Two Guards, One Question

Brain Teaser · Easy · Free problem

You are at a fork in the road. One path leads to your destination; the other leads the wrong way. Two guards stand at the fork -- one always tells the truth, one always lies. You do not know which is which.

You may ask exactly one yes/no question to exactly one of the guards.

Can you determine the correct path? If yes, state the question. If no, explain why not.

Hints

  1. A direct question ('Is this the right path?') gives the same answer from both guards in each scenario -- try to think of a question that exploits the existence of the other guard.
  2. Consider a self-referential question: what would the OTHER guard say? A truth-teller reports the liar's lie; a liar inverts the truth-teller's truth -- both distortions point the same direction.
  3. Ask: 'Which path would the other guard say leads to my destination?' Both guards will point to the wrong path. Take the opposite.

Worked Solution

How to Think About It: A direct question ('Is this the right path?') fails immediately: in one scenario both guards say 'yes,' in the other both say 'no,' so the answer tells you nothing about which guard you are talking to. The trick is to construct a question whose answer is the same regardless of which guard you ask -- a question that uses the existence of the other guard to cancel out the liar's distortion.

Key Insight: If you ask a guard what the OTHER guard would say, a truth-teller reports the liar's false answer, and a liar lies about the truth-teller's true answer. Both distortions point in the same wrong direction, so both guards give you the same (incorrect) answer. Knowing the answer is wrong, you choose the opposite.

The Method:

Ask either guard: 'If I asked the other guard which path leads to my destination, what would they say?'

Analyze the four cases:

1. You ask the truth-teller; the correct path is on the left. - The liar would say 'right' (lie). - The truth-teller truthfully reports what the liar would say: 'right.' - Answer: right. Choose left (opposite).

2. You ask the liar; the correct path is on the left. - The truth-teller would say 'left' (truth). - The liar lies about this: 'right.' - Answer: right. Choose left (opposite).

3. You ask the truth-teller; the correct path is on the right. - The liar would say 'left.' - The truth-teller reports: 'left.' - Answer: left. Choose right (opposite).

4. You ask the liar; the correct path is on the right. - The truth-teller would say 'right.' - The liar lies: 'left.' - Answer: left. Choose right (opposite).

In all four cases: the guard's answer points to the WRONG path. Always choose the opposite of what you are told.

Practical Considerations: A common wrong answer is to try to identify which guard is the truth-teller first. That requires at least two questions. The self-referential structure -- asking what the other would say -- is the only way to extract reliable information from a single question to an unknown source.

Answer: Yes. Ask either guard: 'Which path would the other guard tell me leads to my destination?' Then take the opposite path. The double-negation (truth-teller reports a lie; liar lies about the truth) always points you in the wrong direction, so inverting the answer gives you the right one.

Intuition

This is a classic logic puzzle testing whether you understand how to use composition of transformations. One guard applies a 'flip' to the truth (the liar); one does not (the truth-teller). If you ask a guard to report what the other guard would say, you are composing the two functions: truth-teller(liar(x)) = truth-teller(not x) = not x, and liar(truth-teller(x)) = not(x). Both compositions produce the same result -- not x -- regardless of which guard you ask. So the answer is always 'wrong,' and you always invert.

In quant work, this kind of double-negation reasoning appears in adversarial settings -- designing a signal that is robust to strategic manipulation, or a test that detects a biased source by asking it to predict what an unbiased source would say. More directly, it connects to mechanism design: how do you elicit truthful behavior from agents with opposing incentives? The answer here is elegant because it requires no information about the agents' types -- it works unconditionally.

Open the full interactive solver →