The Monty Hall problem

The Monty Hall problem is the most famous puzzle in probability. Its answer is simple, and almost everybody gets it wrong at first.

Three doors on a game-show stage: two goats and a car, with the win rates of staying and switching below
Three doors on a game-show stage: two goats and a car, with the win rates of staying and switching below

The puzzle

You are on a game show and may choose one of three doors. Behind one door is a car; behind the others, goats. You pick a door, say No. 1. The host, who knows what is behind the doors, opens another door, say No. 3, which has a goat. He then asks: do you want to switch to door No. 2? Is it to your advantage to switch?

The rules matter: the host always opens a door, never your door and never the car, and he always offers the switch.

All cases in a table

Suppose you always pick door 1. The car is behind door 1, 2 or 3, each with probability 1/3.

Car behind 1: Monty opens 2 or 3. Staying wins, switching loses. Car behind 2: Monty must open 3. Staying loses, switching wins. Car behind 3: Monty must open 2. Staying loses, switching wins.

Staying wins in one of the three equally likely cases, switching in two. Nothing about door 1 changes when Monty opens a door, so it keeps its 1/3, and the other 2/3 goes to the one door he leaves closed.

Bayes' theorem

Say you picked door 1 and Monty opened door 3. Before he opens it, each door hides the car with probability 1/3. If the car is behind door 1, he opens door 3 with probability 1/2, because he can choose between 2 and 3. If it is behind door 2, he opens door 3 for sure. If it is behind door 3, he never opens it. Bayes' theorem weighs the prior chances by these likelihoods:

P(car 1 | opens 3) = (1/3 · 1/2) / (1/3 · 1/2 + 1/3 · 1 + 1/3 · 0) = 1/3 P(car 2 | opens 3) = (1/3 · 1) / (1/2) = 2/3

The door the host leaves closed hides the car twice as often as yours.

More doors

With n doors you pick one and the host opens n − 2 doors with goats, leaving one other door closed. Staying wins with probability 1/n and switching with (n − 1)/n. With 100 doors, sticking to your first guess means betting on a 1% chance against a host who carefully avoided one particular door among 99. The app goes up to 100 doors.

When the host does not know

If the host opens the other doors at random, the reasoning changes. With three doors he reveals the car a third of the time, and those games do not count. In the remaining games staying and switching each win half the time: seeing a goat behind a randomly opened door is evidence that makes your own door more likely to hide the car, exactly enough to make it 50/50. The answer depends not only on what you see, but on how it came to be shown.

The 1990 controversy

Steve Selvin posed the puzzle in a letter to The American Statistician in 1975 and named it after Monty Hall, host of Let's Make a Deal. It became famous in September 1990, when a reader put it to Marilyn vos Savant in her column in Parade magazine and she answered: switch. Around 10,000 readers wrote in, nearly a thousand of them with a PhD, most of them telling her she was wrong. She was right. Paul Erdős refused to believe the answer until a colleague showed him a computer simulation, which is exactly what this app does.

Explore it in PictorX

Open the Monty Hall problem and three doors are waiting. Click one, watch Monty open a door with a goat, then press Stay or Switch, or click your door or the other closed one. The statistics below count every game, and the chart shows the win rates of staying and switching as the games add up, with dashed lines at the values from theory. Play automatically runs up to 100,000 games at up to 2,000 a second, staying half the time and switching half the time, or always doing one of the two. Choose 10 or 100 doors to feel why switching wins, or let Monty open doors at random and watch the advantage disappear.

Frequently asked questions

What is the answer to the Monty Hall problem?

Switch. You win the car with probability 2/3 by switching and 1/3 by staying.

Why doesn't the opened door make it 50/50?

Because Monty's choice depends on where the car is. He never opens the car, so when your first choice is wrong he is forced to leave the car closed and so points you to it.

Who was Monty Hall?

A Canadian-American television host who presented the game show Let's Make a Deal from 1963. The show had doors and prizes, but not exactly this puzzle; Steve Selvin named the puzzle after him in 1975.

Does the Monty Hall problem work with more doors?

Yes. With n doors, if the host opens all but one of the other doors, switching wins with probability (n − 1)/n: 9/10 with 10 doors and 99/100 with 100.

Is the answer the same if the host opens a door at random?

No. If he does not know where the car is and happens to reveal a goat, staying and switching each win with probability 1/2.

Ready to try it?

Open PictorX in your browser — no install, no credit card required to start.

Try the Monty Hall problem