The Monty Hall Problem

One car and some goats behind closed doors. Pick a door, let the host open others, and decide whether to switch. The page works out the chance behind every door from the host's rule and what he did, plays thousands of games to check it, or lets you play yourself. The table below shows the arithmetic.

Loading interactive simulation...

Lesson

The theory โ€” The Monty Hall Problem

The chance that the car is behind a given door, after the host has acted, follows from Bayes' rule: the prior for that door, 1 รท n, times the likelihood that the host would do exactly what he did if the car were there, divided by the total chance of what he did. The host's rule decides the likelihoods, so the same opened doors can give different answers under different rules. With the standard host, who knows where the car is and always opens k goat doors chosen at random among them, staying wins with probability 1 รท n whichever doors he opens.

What each symbol means

n
the number of doors
k
the number of doors the host opens
P(H | C_i)
the likelihood: the chance the host does what he did if the car is behind door i
P(C_i | H)
the posterior: the chance the car is behind door i after seeing what the host did

Switching wins two times in three 🖖

Press Three doors. You pick door 1, and it has a one-in-three chance of the car. Nothing this host does can change that: he would open door 3 half the time with the car behind your door, and when he has a choice he chooses at random, so his move carries no news about door 1. He opens door 3 and shows a goat. The two-in-three chance that the car was behind door 2 or door 3 now sits entirely on door 2, so switching wins 2 times in 3. Press 100 doors and it is plain: you picked one door in a hundred, the host opens 98 of the rest with goats behind them, and the single door he leaves shut is the one to take, 99 times in 100. In 1990 Marilyn vos Savant gave the three-door answer in her Parade column and received thousands of letters telling her she was wrong, many signed by people with doctorates.

The same view gives a different answer if the host did not know 🖖

Press Host who does not know. You see exactly what you saw before: door 1 picked, door 3 open, a goat. But this host opened a door at random and happened to miss the car, and now staying and switching both win 1 time in 2. The chance depends on the rule that produced what you see, not only on what you see. A host who knows, must show a goat, and picks at random when he can tells you nothing about your own door; all the chance he removes from door 3 moves to door 2. A host who opened door 3 at random would have shown a goat there just as often with the car behind door 1 as behind door 2, so the goat favours neither.

Which door he opens can be the whole answer 🖖

Press Biased host opens 2. This host always opens the lowest-numbered goat door he can. Door 2 is what he would open whether the car is behind door 1 or door 3, so seeing it does not favour one over the other, and staying and switching are 1 in 2. Press Biased host opens 3: he passed over door 2, which he would only do if the car were behind it, so switching wins every time. Averaged over the games, a half two thirds of the time and a certainty one third of the time, switching still wins 2 times in 3. Monty Hell is the host who offers a switch only when you have already found the car, and given an offer, switching always loses.

Problem solved in full

  1. The three doors, by Bayes' rule 4 steps

    You pick door 1. The host, who knows where the car is and always opens a goat door, choosing at random when he has a choice, opens door 3. Find the chance that the car is behind door 1 and behind door 2. Press Three doors to check.

    Open this problem in the tool

    1. Before he acts, each door is equally likely:

    2. How likely is it that he opens door 3, for each place the car could be?

    3. The total chance that he opens door 3:

    4. Divide each door's prior times likelihood by that total:

    Answer

    The car is behind door 1 with probability 1/3 and behind door 2 with probability 2/3. The whole answer sits in the second step: if the car is behind door 2 he is forced to open door 3, and if it is behind door 1 he opens door 3 only half the time, so his opening door 3 is twice as likely if the car is behind door 2.