# Enigmatic Code

Programming Enigma Puzzles

## Tantalizer 479: Cat and five tales

From New Scientist #1030, 9th December 1976 [link]

Someone let the cat out. Who was it? That is rather hard to decide. Delia says it was one of the twins, meaning Bert or Claud. Alice says it was Bert; and Bert (shame on him!) says it was Claud. Meanwhile Claud says it was Delia; and Emma says it was not Claud.

So it is all a bit of a puzzle and you will be expecting to be told how many of them are right in what they say. But that would make it all much too easy, as you could then deduce who the culprit was. So you will just have to manage with what information you have.

Who let the cat out?

[tantalizer479]

### One response to “Tantalizer 479: Cat and five tales”

1. Jim Randell 14 June 2017 at 9:53 pm

This Python code examines each possible culprit, and uses the filter_unique() function from the enigma.py library to find culprits with a unique number of true statements. It runs in 41ms.

```from enigma import filter_unique, printf

# evaluate the statements
# return the number of true statements
def statements(culprit):

# the statements
ss = (
# D says it was B or C
(culprit == 'B' or culprit == 'C'),
# A says it was B
(culprit == 'B'),
# B says it was C
(culprit == 'C'),
# C says it was D
(culprit == 'D'),
# E says it was not C
(culprit != 'C'),
)

# how many are true?
n = ss.count(True)

printf("culprit = {culprit} {ss}, true = {n}")

return n

# find culprits with a unique statement count
(culprits, _) = filter_unique('ABCDE', statements)
printf("culprits = {culprits}")
```

Solution: Bert let the cat out (shame on him!)

I assumed that one of the named people was the culprit, but we could add an extra symbol to the code to account for the case of an unnamed culprit, although as no-one mentions E in their statements the results for the unnamed culprit will be the same as for E.

This site uses Akismet to reduce spam. Learn how your comment data is processed.