Beta. Content is under active construction and has not been peer-reviewed. Report errors on GitHub.Disclaimer

Foundations

Monty Hall Problem

Three doors, one car, two goats. You pick a door, the host reveals a goat behind another. Switching wins 2/3 of the time. Bayes theorem makes this precise.

CoreTier 2Stable~30 min
0

Why This Matters

The Monty Hall problem is a precise test of whether you understand conditional probability. Most people get it wrong on first encounter, including professional mathematicians. The error is always the same: confusing unconditional probability P(car behind door)P(\text{car behind door}) with conditional probability P(car behind doorhost opened another door)P(\text{car behind door} \mid \text{host opened another door}).

This confusion reappears throughout ML. Confusing priors with posteriors, ignoring conditioning information, treating marginal and conditional distributions as interchangeable. The Monty Hall problem is the simplest setting where this mistake is visible.

Setup

You face three doors. Behind one door is a car. Behind each of the other two doors is a goat. You pick a door (say door 1). The host, who knows what is behind every door, opens one of the remaining doors to reveal a goat (say door 3). The host then asks: do you want to switch to door 2?

Assumptions: the car is placed uniformly at random. The host always opens a door with a goat. The host never opens the door you picked. If the host has a choice of two goat doors, the host picks uniformly at random.

Formal Setup

Let C{1,2,3}C \in \{1, 2, 3\} denote the door hiding the car, and H{1,2,3}H \in \{1, 2, 3\} the door the host opens. You pick door 1. The host opens door 3.

We want P(C=2H=3)P(C = 2 \mid H = 3): the probability the car is behind door 2 given that the host opened door 3.

Definition

Monty Hall Conditional Probability

The posterior probability that the car is behind door ii, given the player chose door 1 and the host opened door 3. Computed via Bayes theorem from the prior P(C=i)=1/3P(C = i) = 1/3 and the host's strategy P(H=3C=i)P(H = 3 \mid C = i).

Main Theorems

Theorem

Monty Hall Switching Advantage

Statement

Let the player choose door 1 and the host open door 3. Then:

P(C=1H=3)=13,P(C=2H=3)=23P(C = 1 \mid H = 3) = \frac{1}{3}, \qquad P(C = 2 \mid H = 3) = \frac{2}{3}

Switching to door 2 wins with probability 2/32/3. Staying with door 1 wins with probability 1/31/3.

Intuition

When you first pick, you have a 1/31/3 chance of being right. That means there is a 2/32/3 chance the car is behind one of the other two doors. The host then eliminates one of those two doors (always a goat). The entire 2/32/3 probability concentrates on the remaining door.

Proof Sketch

Apply Bayes theorem. The prior is P(C=i)=1/3P(C = i) = 1/3 for i=1,2,3i = 1, 2, 3. The likelihoods are:

  • P(H=3C=1)=1/2P(H = 3 \mid C = 1) = 1/2 (host can open door 2 or 3, picks uniformly)
  • P(H=3C=2)=1P(H = 3 \mid C = 2) = 1 (host must open door 3, since door 2 has the car and door 1 is chosen)
  • P(H=3C=3)=0P(H = 3 \mid C = 3) = 0 (host cannot open door 3 if the car is there)

The marginal is P(H=3)=(1/3)(1/2)+(1/3)(1)+(1/3)(0)=1/2P(H = 3) = (1/3)(1/2) + (1/3)(1) + (1/3)(0) = 1/2.

By Bayes theorem:

P(C=2H=3)=P(H=3C=2)P(C=2)P(H=3)=11/31/2=23P(C = 2 \mid H = 3) = \frac{P(H = 3 \mid C = 2) \cdot P(C = 2)}{P(H = 3)} = \frac{1 \cdot 1/3}{1/2} = \frac{2}{3}

P(C=1H=3)=(1/2)(1/3)1/2=13P(C = 1 \mid H = 3) = \frac{(1/2)(1/3)}{1/2} = \frac{1}{3}

Why It Matters

This is the clearest demonstration that conditioning on new information changes probabilities. The host's action is not random noise. It carries information because the host is constrained to never reveal the car.

Failure Mode

If the host opens a door at random (possibly revealing the car) and happens to reveal a goat, then switching and staying both give 1/21/2. The result depends on the host's strategy, not just the observed outcome. This is the same distinction that separates observational data from experimental data in causal inference.

Connection to Information Theory

The host's action reduces your uncertainty. Before the host acts, the car is equally likely behind any of three doors: entropy is log231.585\log_2 3 \approx 1.585 bits. After the host reveals a goat, you are choosing between two doors with probabilities 1/31/3 and 2/32/3: entropy is H(1/3,2/3)0.918H(1/3, 2/3) \approx 0.918 bits. The host provided about 0.6670.667 bits of information.

Common Confusions

Watch Out

The car is behind one of two doors so it must be 50-50

This is the most common error. There are two doors left, but they are not equally likely. The host's choice was constrained: the host could not open the car door. This constraint makes the problem asymmetric. The host's action is evidence about where the car is.

Watch Out

Unconditional vs conditional probability

Before the host acts, P(C=2)=1/3P(C = 2) = 1/3. After the host opens door 3, P(C=2H=3)=2/3P(C = 2 \mid H = 3) = 2/3. The probability of the same event changed because you conditioned on new information. People who insist the probability "doesn't change" are confusing the prior with the posterior.

Canonical Examples

Example

Simulation verification

Run 10,000 trials of the Monty Hall game. In each trial, place the car uniformly, pick door 1, have the host reveal a goat, and record whether switching wins. The fraction of switching wins converges to 2/30.66672/3 \approx 0.6667. This is a good exercise to convince yourself the math is correct when your intuition resists.

Exercises

ExerciseCore

Problem

Suppose the host always opens the highest-numbered available goat door (instead of choosing uniformly). You pick door 1 and the host opens door 3. What is P(C=2H=3)P(C = 2 \mid H = 3) now?

ExerciseAdvanced

Problem

Generalize to nn doors, one car, n1n - 1 goats. You pick a door. The host opens n2n - 2 goat doors, leaving your door and one other. What is the probability that switching wins?

References

Canonical:

  • Selvin, "A Problem in Probability" (letter), The American Statistician, 1975
  • vos Savant, "Ask Marilyn" column, Parade Magazine, 1990

Current:

  • Rosenhouse, The Monty Hall Problem, Oxford University Press (2009), Chapters 1-3
  • Gill, "The Monty Hall Problem Is Not Not a Problem", Statistica Neerlandica (2011)

Next Topics

  • Base-rate fallacy: another case where ignoring conditional probability leads to wrong conclusions
  • Birthday paradox: combinatorial probability that defies intuition

Last reviewed: April 2026

Prerequisites

Foundations this topic depends on.

Next Topics