Four men (Andy, Ben, Cal, and Dan) eat dinner together at a square table in a restaurant. Suddenly, Andy cries out "I've been poisoned" and falls over dead. Andy's companions were questioned by the police and each made three statements, exactly one of which is false for each man, which are as follows:
Ben
1. I didn't do it.
2. I was sitting next to Dan.
3. We had our usual waiter today.
Cal
1. I was sitting across from Andy.
2. We had a new waiter today.
3. The waiter didn't do it.
Dan
1. Cal didn't do it.
2. The waiter poisoned Andy.
3. We had a new waiter today.
Assuming that only Andy's companions and the waiter are implicated, who is the murderer?
FOR killer = 1 TO 4 ' 1 is waiter
FOR waitnew = 0 TO 1
FOR aOppc = 0 TO 1
b1 = (killer <> 2)
b2 = (aOppc = 0)
b3 = (waitnew = 0)
bt = ABS(b1 + b2 + b3)
IF bt = 2 THEN
c1 = (aOppc = 1)
c2 = (waitnew = 1)
c3 = (killer <> 1)
ct = ABS(c1 + c2 + c3)
IF ct = 2 THEN
d1 = (killer <> 3)
d2 = (killer = 1)
d3 = (waitnew = 1)
dt = ABS(d1 + d2 + d3)
IF dt = 2 THEN
PRINT killer, waitnew, aOppc
PRINT ABS(b1); ABS(b2); ABS(b3), ABS(c1); ABS(c2); ABS(c3), ABS(d1); ABS(d2); ABS(d3)
END IF
END IF
END IF
NEXT
NEXT
NEXT killer
reports
4 1 0
1 1 0 0 1 1 1 0 1
Indicating the killer was Dan, the waiter was new and Andy was not seated opposite Cal, and therefore Ben was seated next to Dan.
The false statements were Ben's 3rd, Cal's 1st and Dan's 2nd.
Actually, Andy could have committed suicide, poisoning himself. Allowing 0 to represent Andy (since 1 was already taken by representing the waiter), that comes out to
0 1 0
1 1 0 0 1 1 1 0 1
in the chosen code. Only the poisoner's identity has changed from Dan to Andy. Of course, the rules say "Andy's companions", but strange twists exist at the end of mystery stories.

Posted by Charlie
on 20140123 11:15:40 