The Two Doors and Two Guards

Two doors side by side
Photo: Unsplash
You stand in a stone hall with two doors. One leads to freedom; the other leads to a dead end.
Each door has a guard, and both guards know which door is which. One guard always tells the truth. The other always lies. You don’t know which guard is which.
You may ask one question to one guard, and he will answer by pointing to a door.
What question do you ask to be sure of finding the door to freedom?
💡 Hint

Design a question that gets both men’s habits involved, so a liar’s twist and a truth-teller’s honesty combine into the same predictable reply either way. Then think about what that reply tells you.

Reveal answer

Ask either guard: “Which door would the other guard say leads to freedom?” Then take the other door.

Step-by-step solution

  1. There are two possible worlds: the guard you ask is the truth-teller, or he is the liar. Check the question in both.
  2. You ask the truth-teller. He honestly reports what the liar would say. The liar would point to the dead end, so the truth-teller points to the dead end.
  3. You ask the liar. The truth-teller would point to freedom. The liar must misreport that, so he points to the dead end.
  4. In both worlds, the door you’re shown is the dead end. So you walk through the other door.
  5. The question works because the answer always passes through exactly one lie, and one lie always flips the truth. Checking every combination of exit door and guard confirms that it never fails.

Why it fools people

We usually try to work out who is lying, because that’s how we deal with people in real life. This puzzle doesn’t let you, and it doesn’t need you to. The trick is to stop asking who and instead design a question in which the liar’s effect is guaranteed to appear exactly once. It fools people because the solution is indirect: you trust neither guard, only the structure of the question.

About This Puzzle

This is one of the most famous logic puzzles ever written, and it still defeats most people on the first try. It belongs to the world of truth-tellers and liars, where every statement is either perfectly honest or perfectly false. That sounds like it should make things easy, since a liar is just a truth-teller turned inside out. The difficulty is that you don’t know which guard is which, and you get exactly one question. A question that works must give you a reliable answer no matter who hears it. Finding one is a genuine exercise in logic, and the solution is elegant once you see it.

How to Think About It

A direct question like “Which door leads to freedom?” fails, because you can’t tell whether the reply is honest. So aim for a question whose answer comes out the same whichever guard you ask. Think of a lie as a switch that flips an answer. If a question passes through the truth-teller only, the answer is unflipped; through the liar only, it’s flipped. You can’t control which guard you’re talking to, but you can control how many flips the answer goes through. Design the question so that it always involves both guards, then work out what that does to the reply.

Common Traps

The first trap is to ask a question with an obvious answer, such as “Is the sky blue?”, to identify the liar. That works, but it uses up your only question. The second trap is to ask “Are you the liar?”, which gets the same reply from both guards and tells you nothing. A third is to build a question so tangled that you can’t work out what either guard would say. A good question is one you can evaluate quickly in each of the two possible worlds.

Where This Puzzle Comes From

Puzzles about truth-tellers and liars were popularized by the American logician and mathematician Raymond Smullyan, whose books turned them into a whole genre, often set on an island of knights and knaves. The two-door version is widely told in puzzle collections and has appeared in films, television and job interviews. The idea underneath comes straight from logic: negating a statement an even or odd number of times decides whether the result is true or false.

Try This Variation

Same hall, but the guards may now answer only yes or no. Can one question still find freedom? Try this one, asked of either guard: “If I asked you whether the left door leads to freedom, would you say yes?” What does each answer tell you?

Show the answer to the variation

“Yes” means the left door leads to freedom; “no” means the right door does. The truth-teller answers honestly. The liar would lie about the left door, then lie again about what he would say, and two lies cancel out. So both guards give the true answer to the inner question.

Up nextThe Fourth of July 5K→

Try Another Format

Scroll to Top