2

How can I solve this question mathematically?

There are two paths $A$ and $B$, in each path there is a person, one of them is a liar and the other is a truth teller. I want to know the right path, so what is the question that I should ask only one of them. and be sure about the right path?

Austin Mohr
  • 25,662
mohamez
  • 1,521

1 Answers1

2

This is often called the "Gateway to Heaven" puzzle, and is written in terms of an angel (truthteller) and a demon (liar) guarding the doors to Heaven and Hell. The demon is so deceptive that he and his door appear identical to the angel and his door.

Hint: Since you cannot be sure who you are talking to, somehow you need to create a question that involves both parties.

Solution (mouseover to read):

Ask either person "What path would the other person say is the wrong one?" If you are speaking to the truthteller, then he will answer faithfully on behalf of the liar. The liar would indicate the correct path (since you asked for the wrong one), and the truthteller will faithfully relay that to you. If you are speaking to the liar, then he will lie on behalf of the truthteller. That is, the truthteller would correctly tell you which path is wrong, but the liar will then reverse this and indicate the correct path to you. Thus, no matter who you are speaking to, the path they give as the answer will be the correct path.

Austin Mohr
  • 25,662
  • 3
    Or a question that involves one party twice... – Abel Apr 17 '13 at 02:07
  • Yes, I always preferred the "if I asked you which path to take, which would you say?" – Ben Millwood Apr 17 '13 at 02:19
  • 2
    One way to think about it is to see you need one bit to select a path and only get to ask one yes/no question. You can't afford to know whether the responder is the truth-teller or liar-that would spend your bit on the wrong thing. – Ross Millikan Apr 17 '13 at 02:19
  • @Abel That is a very nice solution (nicer than the one I gave, I think). – Austin Mohr Apr 17 '13 at 02:36