A farmer has three daughters. The oldest sister always tells truth, the youngest always lies, the middle is evil, she tells truths or lies as she pleased. Unfortunately, all three sisters look the same. You are a knight, who is allowed to ask 3 yes/no questions to any of the sisters. Your goal is to identify the oldest sister and marry her.
Solution:
First task is to find the evil sister. This solution only works if evil sister knows whether she is going to lie or tell truth, compared to randomly answering yes or no without even listening to the question. The question we need to ask is: "If I ask you to use the opposite value when you are about to tell truth at the moment of answering my question, what will be your answer to: are you the evil daughter?".
For older sister, the true answer to the hypothetical question is no, but since she is about to tell truth, she should give us the opposite value and answer yes.
For the younger sister the true answer to the hypothetical question is also no. Since she is going to lie, she should not use the opposite value, but she will lie and her answer will also be yes.
For the middle sister, the true answer to the hypothetical question is yes. If she decides to tell the truth, the opposite value and hence her answer will be no. If she decides to lie, she should not use the opposite value but since she is lying, her answer will be again no.
This question must be asked at least 2 sisters. If you hear no, it is the evil one. If both answers are yes, than the evil is the other sister.
Then we need to ask something that we can verify. Since we already know who is the evil sister, we can ask any of the other two pointing to the right direction: "Is she an evil sister?". Oldest will say yes, youngest - no.
Wednesday, May 31, 2017
Subscribe to:
Posts (Atom)
