Timothy once visited a land of knights and liars,and met two inhabitants,A and B.
He had the following conversation.
Timothy:A,is B a liar?
Timothy hears A's answer,but he will not tell you what it was.
Timothy:B,are you both liars?
Timothy hears B's answer,but he will not tell you what it was.
At this point,I will not tell you whether or not he knew what they were.
He once told his friend what questions he asked,but not what answers he got.
The friend did not have enough information,so the following dialogue occurred.
Friend:Were your answers the same?
Timothy's friend hears his answer,and finally the friend has enough information to solve what A and B are.
What are they?
(In reply to
Solution by Ravi Raja)
You say "So now, suppose that when Tim asked B if both of them were Liars, B answered No.Then either both A and B are Knights or A is a Liar and B is a Knight." But actually, if both are liars, B will also answer No, as he is a liar. So if both answers are No, then they are either both knights or both liars. You say correctly that If both answers are Yes then A is a knight and B a liar.
Your final answer of A is a knight and B is a liar depends on that having different answers to the questions, yet you had (correctly) said that the answers in that instance are both Yes.
The unique nonsame answer would be for A is Liar, B is Knight, where the answers are Y and N.

Posted by Charlie
on 20030513 04:30:43 