The Monty Hall Problem, Explained

After reading this you will know exactly why switching doors wins two games in three, be able to reproduce the running win rates the simulator plots, and know how to extend the argument to 50 doors.

What the game is

Three closed doors sit in front of you. Behind one is a car; behind the other two are goats. You point at a door, say door 1. The host, who knows where the car is, opens one of the other two doors to reveal a goat. The host will never open the door hiding the car, and never opens the door you picked. Now two doors remain closed: your original pick and one other. You get one choice: keep your door, or switch to the other closed one.

Almost everyone feels that two doors means a 50-50 shot, so switching cannot matter. That feeling is wrong. If you stay you win with probability 1/3. If you switch you win with probability 2/3. Switching is twice as good, and the simulator makes that gap visible by playing thousands of games and plotting how the win rate settles.

The puzzle is named after Monty Hall, host of the game show Let's Make a Deal. It became famous in 1990 when Marilyn vos Savant gave the correct answer in a magazine column and received thousands of letters, many from mathematicians, insisting she was wrong. She was right.

Why staying wins one third and switching wins two thirds

The clean way to see the answer is to track your first pick. When you point at a door, before any door is opened, you have a 1/3 chance of having chosen the car and a 2/3 chance of having chosen a goat. Nothing the host does afterwards changes what was behind your door at the moment you picked it.

Now trace both strategies through those two cases.

  • Your first pick was the car (probability 1/3). Staying wins. Switching loses, because both other doors held goats and the remaining one is a goat.
  • Your first pick was a goat (probability 2/3). Staying loses. Switching wins, because the host was forced to open the other goat, leaving the car as the only closed door to switch to.

So switching wins in exactly the case where your first pick was a goat, and that happens two times in three.

P(\text{switch wins}) = P(\text{first pick is a goat}) = \frac{2}{3}

Here P(\text{switch wins}) is the long-run fraction of games won by always switching. It equals the chance your initial door held a goat, because on every such game the host's forced move steers your switch straight to the car. Staying wins the complement, 1 - 2/3 = 1/3.

Where the information comes from

The result hinges on one fact that is easy to skip over: the host knows where the car is and opens a losing door on purpose. That deliberate choice leaks information. Your door was frozen at 1/3 the moment you touched it, and it stays at 1/3 no matter what happens next. The host then removes a known loser from the other two doors, so the entire 2/3 that was spread across those two doors collapses onto the single door the host left closed.

Contrast this with a host who opens a door at random and happens to reveal a goat. In that version there is no information leak, and the two remaining doors really are 50-50. The 2/3 edge is a property of the knowing host, not of the doors. If you ever change the host's rule, recompute from scratch.

The 2/3 answer requires all of: the host always opens a door, always reveals a goat, and never opens your door. Drop any of these and the number changes. A host who opens a door only when you picked the car, for example, makes switching lose every time.

A worked example that reproduces the demo

The demo button runs the standard three-door game on both strategies at once. Work through what the simulator does over a small batch so the plotted curves are no mystery.

Twelve games by hand

Put the car behind a uniformly random door each game and always pick door 1, then apply each strategy. Over 12 games you expect the car behind door 1 about 12 \times 1/3 = 4 times and behind another door about 8 times.

  1. In the roughly 4 games where the car is behind your door 1, staying wins all 4 and switching wins 0.
  2. In the roughly 8 games where the car is elsewhere, the host opens the one remaining goat door, so switching wins all 8 and staying wins 0.
  3. Stay total: about 4 wins out of 12, a rate of 0.333.
  4. Switch total: about 8 wins out of 12, a rate of 0.667.

Twelve games is far too few for the rates to sit exactly on the true values; you might see 3 and 9, or 5 and 7. That noise is the point of running thousands of games. The law of large numbers pulls the running fractions toward 1/3 and 2/3 as the count grows.

The running fraction of games won by switching. It swings widely for the first hundred games, then tightens onto 0.6667 as the count climbs past a few thousand.

The many-doors version makes it obvious

If the three-door case still feels like a coin flip, scale it up. Suppose there are 100 doors, one car, 99 goats. You pick one door. The host, who knows everything, opens 98 goat doors, leaving your door and one other closed. Would you switch now?

Your first pick had a 1/100 chance of being the car. That has not changed. So the single door the host left closed carries the whole remaining 99/100. Switching wins 99 games in 100. The general rule for n doors, with the host opening all but one of the rest, is:

P(\text{switch wins}) = \frac{n-1}{n}

Here n is the number of doors and n-1 is the number of goats. Your original door holds the car with probability 1/n, so switching wins the complement, (n-1)/n. Set n=3 and you recover 2/3. Set n=50 and switching wins 49/50 = 0.98.

As doors are added the stay probability 1/n shrinks toward zero and the switch probability (n-1)/n climbs toward one. At 50 doors switching wins 49 times in 50.

With n doors and a host who opens all but one of the rest, staying wins with probability 1/n and switching wins with probability (n-1)/n. At n=3 that is 0.333 versus 0.667; at n=10 it is 0.1 versus 0.9; at n=50 it is 0.02 versus 0.98.

Reading the running win rate

The two curves the simulator plots are running averages: after k games, each one shows total wins divided by k for that strategy. Early on the curves are jagged because a single win or loss moves the fraction a lot. After 20 games one extra win shifts the rate by 1/20 = 0.05. After 2000 games one extra win shifts it by only 1/2000 = 0.0005. That shrinking step size is why the curves flatten.

You can put a rough band on the wobble. For a win probability p over k games, the standard deviation of the running fraction is \sqrt{p(1-p)/k}. For switching, p = 2/3, so at k = 1000 the spread is \sqrt{(0.667)(0.333)/1000} \approx 0.0149. Expect the switch curve to sit within about 0.667 \pm 0.03 most of the time at 1000 games. At k = 10000 the spread drops to about 0.0047, so the curve should hug 0.667 to within a hundredth.

Common mistakes

The errors here are consistent, which is what makes the puzzle a good teacher.

Collapsing to 50-50
Believing that two closed doors must each carry probability 1/2. This ignores that your door's probability was fixed at 1/n before any door opened and cannot rise just because a goat was revealed elsewhere.
Forgetting the host knows
Treating the opened goat door as a random reveal. A knowing host and a random host give different answers (2/3 versus 1/2 for the switch). Always state the host's rule.
Trusting a tiny sample
Running 20 games, seeing switch win 11 (a rate of 0.55), and concluding the theory is off. The band above says 0.55 is well within normal scatter at 20 games. Run more.
Confusing your pick with the winner
Thinking switching means you win 2/3 of games no matter what. It means the switch strategy wins 2/3 over many games; any single game you still might lose.

Related tools

The Monty Hall result is a convergence story, and several other simulators tell the same kind of story from different angles. The Law of Large Numbers demo shows a running average settling onto its expected value, exactly what the win-rate curves do here. The Monte Carlo Playground uses the same random-sampling idea to estimate quantities you cannot compute directly. For more probability puzzles that break intuition, try the Nontransitive Dice, the Secretary Problem, and the St. Petersburg Paradox. To watch a bell curve build itself from independent trials, the Galton Board and the Central Limit Theorem Demo pair well with the standard-deviation band described above.

Frequently asked questions

Does switching guarantee a win?

No. Switching wins 2/3 of games in the standard three-door version, not all of them. In the one game out of three where your first pick was the car, switching loses. The advantage is a long-run rate, not a promise about any single game.

Why is it not simply 50-50 with two doors left?

Because the two remaining doors are not equally likely. Your door was locked in at 1/3 before the host acted, and the host's deliberate reveal of a goat pushes the full 2/3 onto the other closed door. Equal counts do not mean equal probabilities.

What changes if the host opens a door at random?

If the host opens a non-picked door blindly and it happens to show a goat, no information leaks about your door, and the two remaining doors become genuine 50-50. The famous 2/3 answer depends entirely on the host knowing where the car is and choosing a goat on purpose.

How many games until the curve looks flat?

The wobble shrinks like 1/\sqrt{k}. At 100 games the switch rate typically sits within about \pm 0.047 of 0.667; at 10000 games within about \pm 0.0047. A few thousand games is enough to see both curves clearly separated and nearly level.

Does it matter which door I pick first?

No. By symmetry the analysis is identical whether you start on door 1, 2, or 3. The car is placed uniformly at random, so every starting door has the same 1/3 chance of hiding it.