In a remote island there are only two types of people that live on it, Knights and Liars. Knights always tell the truth. Liars always speak falsely.
Five suspects are interrogated in connection with a murder. Their statements are as follows:
Al: "Cal and Dan are lying."
Ben: "Al and Elmer are lying."
Cal: "Ben and Dan are lying."
Dan: "Cal and Elmer are lying."
Elmer: "Al and Ben are lying."
Which suspect do you know for certain to be a liar?
FOR a = 0 TO 1
FOR b = 0 TO 1
FOR c = 0 TO 1
FOR d = 0 TO 1
FOR e = 0 TO 1
IF a = ABS(c = 0 AND d = 0) THEN
IF b = ABS(a = 0 AND e = 0) THEN
IF c = ABS(b = 0 AND d = 0) THEN
IF d = ABS(c = 0 AND e = 0) THEN
IF e = ABS(a = 0 AND b = 0) THEN
IF a = 0 THEN PRINT "A";
IF b = 0 THEN PRINT "B";
IF c = 0 THEN PRINT "C";
IF d = 0 THEN PRINT "D";
IF e = 0 THEN PRINT "E";
PRINT
END IF
END IF
END IF
END IF
END IF
NEXT
NEXT
NEXT
NEXT
NEXT
shows the only possibilities for the set of liars are these two:
ABD
ACE
Al is the only one in both possible sets.

Posted by Charlie
on 20130226 13:34:37 