Should you switch doors in the Monty Hall problem?

Probability
Medium
A conditional probability puzzle where the host’s rule determines the answer.
Published

November 16, 2026

NoteQuestion

A car is behind one of three closed doors, and the other two doors are empty. Each door is equally likely to hide the car. You pick door 1. The host knows where the car is. He always opens one of the two other doors, never the one with the car, and then offers you a switch. When both of them are empty, he picks one by tossing a fair coin. He opens door 3. Should you switch to door 2, and what is the chance that switching wins the car?

Try it first, then open the solution.

Switch. Switching wins the car with probability 2/3, and staying wins with probability 1/3.

Staying wins if your first pick was right, and each door hides the car with probability 1/3. The question is whether switching does better, now that you know the host opened door 3. With \(C_i\) for “the car is behind door \(i\)” and \(H_3\) for “the host opens door 3”, compare

\[\begin{aligned} P(\text{switching wins}) &= P(C_2 \mid H_3), \\ P(\text{staying wins}) &= P(C_1 \mid H_3). \end{aligned} \tag{1}\]

By the definition of a conditional probability,

\[P(C_2 \mid H_3) = \frac{P(C_2 \cap H_3)}{P(H_3)}. \tag{2}\]

The host’s rule gives the inputs:

Symbol Meaning Value
\(P(C_i)\) car behind door \(i\), for each door 1/3
\(P(H_3 \mid C_1)\) host opens door 3 when the car is behind your door, by the coin 1/2
\(P(H_3 \mid C_2)\) host opens door 3 when the car is behind door 2, the only door he can open 1
\(P(H_3 \mid C_3)\) host opens door 3 when the car is behind it, which he never does 0

The numerator multiplies along one path, and the denominator adds the three ways the host can open door 3:

\[\begin{aligned} P(C_2 \cap H_3) &= P(H_3 \mid C_2)\, P(C_2) \\ &= 1 \times \frac{1}{3} = \frac{1}{3}, \end{aligned} \tag{3}\]

\[\begin{aligned} P(H_3) &= \sum_{j=1}^{3} P(H_3 \mid C_j)\, P(C_j) \\ &= \frac{1}{2} \times \frac{1}{3} + 1 \times \frac{1}{3} + 0 \times \frac{1}{3} = \frac{1}{2}. \end{aligned} \tag{4}\]

So (2) gives

\[\begin{aligned} P(C_2 \mid H_3) &= \frac{P(C_2 \cap H_3)}{P(H_3)} \\ &= \frac{1/3}{1/2} = \frac{2}{3}. \end{aligned} \tag{5}\]

The same steps give \(P(C_1 \mid H_3) = (1/6)/(1/2) = 1/3\), the chance of your first pick, so switching wins twice as often as staying. If the host opened door 2 or door 3 at random, and door 3 happened to be empty, each closed door would hide the car with probability 1/2, so the answer depends on the host’s rule.

The animation draws the steps for 300 games.

Why switching wins 2/3 in the Monty Hall problem: a tree of 300 games, in which the host opens door 3 in 150 games and the car is behind door 2 in 100 of them

The common wrong answers each skip the host’s rule:

Answer The slip
1/2 for each closed door treats the two closed doors as equally likely, which ignores that the host never opens the car’s door
stay, because door 1 keeps its chance is right that door 1 keeps 1/3, but forgets that door 2 now holds the other 2/3
import numpy as np

rng = np.random.default_rng(0)
car = rng.integers(1, 4, 100_000)
coin = rng.integers(0, 2, 100_000)

knowing_host = np.where(car == 1, np.where(coin == 0, 2, 3), np.where(car == 2, 3, 2))
random_host = np.where(coin == 0, 2, 3)

print(round(np.mean(car[knowing_host == 3] == 2), 2))
print(round(np.mean(car[(random_host == 3) & (car != 3)] == 2), 2))
0.67
0.5