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?
Suppose A and B are both knights. Then, A would say, "No" because B is not a liar. Also, B would say, "No" because they are not both liars. The answers would be the same in this case.
Suppose A is a knight and B is a liar. Then, A would say, "Yes" because B is a liar. B would say, "Yes" because they are not both liars and B would have to lie. The answers would be the same in this case, too.
Suppose A is a liar and B is a knight. Then, A would lie and say, "Yes." However, B would say, "No" because they are not both liars. The answers would not be the same in this case.
Suppose A and B are both liars. Then, A would say, "Yes," and B would say, "Yes." The answers would be the same.
If Timothy said that the answers were the same, then there would be 3 cases. The friend would not know what A and B are. Therefore, Timothy said that the answers were different. Then, the friend knew that A is a liar and B is a knight.
A:liar
B:knight

Posted by Math Man
on 20120509 17:02:55 