All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic > Liars and Knights
Liar Lock (Posted on 2013-02-26) Difficulty: 3 of 5
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?

No Solution Yet Submitted by K Sengupta    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 3 of 5 |

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 2013-02-26 13:34:37
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (7)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information