The Two Doors and Two Guards Puzzle
One door leads to freedom, one to doom. One guard always lies, one always tells the truth, and you get one question. What do you ask? A logic classic, fully explained.
The puzzle
You're standing in front of two doors. One leads to freedom. The other leads to a dead end you can't come back from. Each door has a guard. One guard always tells the truth and the other always lies, but you don't know which is which. Both guards know everything, including which door is which and what the other guard would say. You get to ask one guard one question. What do you ask so you're sure to pick freedom?
This puzzle belongs to a family that logicians call "knights and knaves" problems. Knights always tell the truth. Knaves always lie. The mathematician and puzzle writer Raymond Smullyan made the genre famous, and this two-door version is one of the best-known.
The hard part? You get one question and you have no idea who you're talking to. Ask "Which door leads to freedom?" and you'll get an answer. You just won't know whether to believe it.
What makes it tricky
Your question has to work in both possible situations:
- Situation A: you're talking to the truth-teller.
- Situation B: you're talking to the liar.
If your question gets different useful answers in those two situations, it's no help, because you can't tell which one you're in. You need a question whose answer points the same way no matter who replies.
Hint
You can't know which guard you're talking to, so design a question whose answer comes out the same either way. What if both guards had to be involved in the answer?
The answer
Ask either guard: "Which door would the other guard say leads to freedom?" Then go through the opposite door.
The question to ask
Pick either guard and ask:
"If I asked the other guard which door leads to freedom, which door would they point to?"
Then walk through the other door, the one they didn't point to.
Why it works: check both cases
Let's say the left door leads to freedom.
Case 1: you asked the truth-teller. If you asked the liar, the liar would point to the right door (the wrong one). The truth-teller honestly tells you that: "They'd say the right door." You pick the opposite. Left. Freedom.
Case 2: you asked the liar. If you asked the truth-teller, they'd point to the left door. But the liar lies about that and says: "They'd say the right door." You pick the opposite. Left. Freedom.
| You asked… | What the other guard would really say | What you're told | Door you choose |
|---|---|---|---|
| The truth-teller | The wrong door (the liar's answer) | The wrong door | The opposite one, freedom |
| The liar | The right door (the truth-teller's answer) | The wrong door, after a lie | The opposite one, freedom |
Either way, the answer you hear always points to the wrong door. So you always take the other one.
The logic behind it
Running the question through both guards guarantees exactly one lie in the chain. A truth passed along by the liar turns into a lie. A lie passed along by the truth-teller stays a lie. One lie flips the answer once, and you undo the flip by picking the opposite door.
Another question that also works
You can also ask a guard about themselves: "If I asked you which door leads to freedom, what would you say?" The truth-teller just answers honestly. The liar would lie about the door, but then also lies about what they'd say, so the two lies cancel out. Either guard points to freedom, and this time you go through the door they point to.
The thinking skill behind it
The trick is planning around what you don't know. Instead of trying to figure out which guard is which, you build a question that makes it not matter. That's a handy habit outside puzzles too. When you can't get rid of an unknown, look for a move that works either way.
Sources
Fact-checked and editorially reviewed on .
Spotted an error? Tell our editors.