Labyrinth is full of riddles and puzzles. One in particular stands out: the two-door riddle. For those of you who don’t remember, our protagonist, Sarah, encounters the two doors while attempting to rescue her kid brother from the clutches of Jareth, a crystal-ball-juggling Goblin King, played by the late David Bowie. The mysterious monarch gave Sarah 13 hours to retrieve the “babe with the power.” She can complete the quest by maneuvering through Jareth’s perplexing brick maze.

The labyrinth is ever-changing and inhabited by a band of creatures so wonderful that only Jim Henson could dream them up. Among the cast are The Four Guards—a pair of two-headed, coat-of-arms bodied puzzle enthusiasts who present Sarah with a stumper, which she must solve in order to move to the next section of the maze.

### Labyrinth‘s Two-Door Riddle Rules

The rules are clear: there are two doors. One leads to the castle, the other, to certain death. You may ask one question to one guard to help you decipher which door is the correct one. Sounds simple enough, but there’s a catch: one guard always lies, and one always tells the truth.

The two-door riddle is an incarnation of the  Knights and Knaves logic puzzle, and while it sounds like a Pinocchio paradox,the problem actually has a simple solution. (If you want to figure the puzzle out for yourself, take a break and come back to us.)

### How to Solve the Labyrinth Two-Door Riddle

To solve the puzzle, you must ask one guard (it doesn’t matter which one) which door the other guard would say leads out. Both guards will indicate the same door, which will be the door that doesn’t lead out. For purposes of this explainer, we’ll call the doors A (the safe door), and B (the knock, knock, knocking on heaven’s door). Let’s discuss:

Scenario one: The guard you ask is the one who lies.
If the guard you asked is the one who lies, then he will lead you astray by telling you (falsely) that the other guard—the truthful guard—will point you towards door B. This makes door A the safe bet.

Scenario two: The guard you asked is the one who tells the truth.
If the guard you ask is the one who tells the truth, he will tell you (honestly) that the other guard—the lying guard—will point you towards door B. This makes door A the safe bet.

In both cases, the outcome is the same. To stay alive, you must walk through the opposite door from what the guards tell you.

This is exactly what Sarah does in the film, but as many of you probably remember, her success is short-lived. Upon entering, she falls through a hole in the floor, which sends her cascading into the nightmarish Shaft of Hands. Many assume she simply chose wrong, but Sarah’s unfortunate mistake was one of Labyrinth law, not of logic.

The key to this plot twist lies in the script. Just before the trap door opens, Sarah says, “It’s a piece of cake.” The seemingly innocent sentence spells trouble in the Labyrinth world. It’s said three times throughout the film (and countless others in the novel), and each time, something goes horribly wrong. Sarah says it again when Jareth asks her how she’s enjoying the maze. “It’s a piece of cake,” she says, prompting him to speed up the clock and send in the murderous cleaner. Hoggle says it when the crew finally makes it to Goblin City, and in comes a squad of goblin soldiers.

And so, the rules of our puzzle and the validity of the solution remain intact. Sarah ignored the guards’ advice, and, despite making a downward detour, she certainly didn’t die. You’re now fit to face your own two-door fate. Let’s just hope XKCD’s snarky third guard stays out of the equation.

Originally published on January 16, 2016.