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

 Who Said What? (Posted on 2007-05-17)
You are in a popular tourist town in the land of Liars and Knights. You happen to overhear a conversation another tourist is having with three of the locals: Alex, Bert and Carl. Each of the three could be a knight, a knave or a liar. You know that for each question the tourist asks, Alex, Bert and Carl each give one response, but you don't know who said what. The conversation is as follows:

1. What type are each of you?
• I am a knight.
• I am a knave.
• I am a liar.
2. How many of you are the same type?
• We are all the same type.
• We are all different types.
• Exactly two of us are the same type.
3. What type is Alex?
• A knave.
• A liar.
• Different from Bert.

Can you determine which type Alex, Bert and Carl are?

 See The Solution Submitted by Brian Smith Rating: 4.5000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: solution -- the computer way | Comment 3 of 7 |
(In reply to solution by Charlie)

'1=kt:2=L:3=kv,start w/lie;4=kv,start w/truth

CLS

FOR a = 1 TO 4
FOR b = 1 TO 4
FOR c = 1 TO 4
REDIM tct(4)
tct(a) = tct(a) + 1
tct(b) = tct(b) + 1
tct(c) = tct(c) + 1
good = 0
IF tct(1) = 1 AND tct(3) = 1 AND (tct(2) = 1 OR tct(4) = 1) THEN good = 1
IF tct(2) = 2 AND tct(3) = 1 THEN good = 1
IF tct(2) = 1 AND tct(3) = 1 AND tct(4) = 1 THEN good = 1
IF tct(3) = 2 AND (tct(2) = 1 OR tct(4) = 1) THEN good = 1
IF good THEN
PRINT a; b; c;
trct = 0
IF a = 1 OR a = 3 THEN trct = trct + 1
IF b = 1 OR b = 3 THEN trct = trct + 1
IF c = 1 OR c = 3 THEN trct = trct + 1
IF trct = 1 THEN
PRINT " *"
trct1 = 0
IF a = 1 OR a = 4 THEN trct1 = trct1 + 1
IF b = 1 OR b = 4 THEN trct1 = trct1 + 1
IF c = 1 OR c = 4 THEN trct1 = trct1 + 1
trct2 = 0
IF a >= 3 THEN trct2 = trct2 + 1
IF a = 2 THEN trct2 = trct2 + 1
IF a = 1 AND b <> 1 OR a = 2 AND b <> 2 OR (a = 3 OR a = 4) AND b <> 3 AND b <> 4 THEN trct2 = trct2 + 1
IF trct1 = trct2 THEN
PRINT a; b; c; "*****"
END IF
ELSE
PRINT
END IF
END IF
NEXT
NEXT
NEXT

`1  2  31  3  21  3  41  4  32  1  32  2  3  *2  3  12  3  2  *2  3  32  3  4  *2  4  3  *3  1  23  1  43  2  13  2  2  *3  2  33  2  4  *3  3  23  3  43  4  13  4  2  *3  4  2 *****3  4  34  1  34  2  3  *4  3  14  3  2  *4  3  2 *****4  3  3`

 Posted by Charlie on 2007-05-17 15:39:39

 Search: Search body:
Forums (0)