Updated
In this lesson
Wide tables, equations, and code scroll sideways. Swipe, or Tab to focus them and use the left and right arrow keys.
Monty Hall
You will learn: Compare host protocols before calculating the value of switching doors.
Start with: Conditioning and independence
Three doors hide one car and two goats. You pick a door. The host opens another door, and you see a goat. Should you stay or switch? Before calculating, ask how the host chose the door.
Try a round, make your choice, then open the strategy comparison. You can change the number of doors and the host’s rule.
Play a round
The host opens 1 unchosen door and leaves one alternative closed. They always reveal only goats and offer a switch; when free to choose, they choose uniformly.
Pick a door before seeing what the host reveals.
Compare the strategies over many rounds
2000 attempted rounds: 2000 goat-only reveals, 0 prize reveals excluded. Each eligible round evaluates both strategies against the same prize.
| Strategy | Exact model | Simulation |
|---|---|---|
| Stay (solid) | 33.33% | 35.65% |
| Switch (dashed) | 66.67% | 64.35% |
The model predicts 100.00% of attempted rounds are eligible.
State the rules before solving the puzzle
In the classic model, the prize is uniform across the doors. The host knows its location, always opens an unchosen goat door, and always offers a switch. If several reveals are possible, the host chooses uniformly. Your initial choice does not depend on the prize.
With these rules, switching wins with probability 2/3. A single game cannot demonstrate that advantage; the simulation compares both strategies across the same repeated games.
Enumerate the three prize locations
Fix your first pick at door 1. The three rows below are equally likely before the host acts.
| Prize | What the informed host opens | Staying | Switching |
|---|---|---|---|
| Door 1 | Door 2 or 3, equally likely | Wins | Loses |
| Door 2 | Door 3 | Loses | Wins |
| Door 3 | Door 2 | Loses | Wins |
Your first choice is right in one row and wrong in two. Switching wins exactly when that first choice was wrong: the informed host removes every other wrong alternative.
Make a prediction
With 10 doors, the informed host opens 8 goats. What is the chance that switching wins?
Explore the answer
9/10. The initial pick was wrong with probability 9/10, and the remaining alternative is then the prize. Set Doors to 10 to compare this with the simulation.
For n doors and an informed host who opens n − 2 goats, staying wins with probability 1/n; switching wins with probability (n − 1)/n. Keeping two doors closed does not make them symmetric.
Change the host, change the conditioning
An uninformed host opens one of the two unchosen doors uniformly, without checking. Sometimes they reveal the car. We compare stay and switch only among rounds with a goat reveal, and show the excluded rounds separately.
| Initial pick | Probability before reveal | Chance host reveals a goat | Joint probability |
|---|---|---|---|
| Correct | 1/3 | 1 | 1/3 |
| Wrong | 2/3 | 1/2 | 1/3 |
The retained groups have equal probability. Each strategy wins half of these retained rounds. The goat reveal has filtered out half of the initially wrong picks and none of the initially correct ones.
With n doors, the random host leaves one uniformly chosen alternative closed. A wrong initial pick survives only if that alternative is the car, with probability 1/(n − 1). Thus each retained group has probability 1/n, only 2/n of attempts are retained, and conditional win rates remain 1/2 each. With 100 doors, expect only 2% of attempts to reach the decision.
Make a prediction
A random host reveals goats in 40 out of 2,000 attempts. Should the switching win rate divide by 40 or by 2,000?
Explore the answer
Use 40 for the conditional win rate shown here. Dividing by 2,000 answers a different question: the chance that an attempted round both reaches the decision and wins by switching. Under the random-host model, that joint probability is 1/n.
Transfer the idea
The information is in the selection process. A test result, a survey response, or a published success story can change what you know because some cases were more likely to appear than others. Before treating remaining outcomes as equally likely, identify what could have been revealed and what was excluded.
Continue with conditioning, Bayes’ theorem, or the surprising probability path.
Reference
Richard Gill’s analysis of Monty Hall as a modelling problem discusses why the host’s rules belong in the mathematical model. The tables above derive the two specific protocols used by this experiment.