You are on the game show. Three doors hide a car and two goats, and you do not know which door hides what. You pick a door. The host, who knows what is behind every door, opens one of the other two on a goat and offers to let you switch to the remaining door. He always opens a goat door, never the one you picked, and when he has a free choice he opens either goat with equal chance.
Should you switch, and what is your probability of winning the car if you switch?
Reveal solutionHide solution
Say I pick door 1 and the host opens door 3 on a goat, offering me door 2. Nothing below depends on those labels.
#The decisive observation
Switching inverts my first guess. If door 1 already hid the car, switching loses. If door 1 hid a goat, the host is forced to expose the other goat, so the door I move to must hide the car. Switching therefore wins on exactly the plays where my first pick was a goat, which is two in three.
Staying wins the remaining third. Nothing here used how the host breaks a tie, because a tie only arises when I already hold the car, and then switching loses whichever goat he shows.
#Conditioning on the open door
The strategy rate above is the number that decides the game. The probability for a named door is finer and does lean on the host's symmetry. Write for the car behind door , each with prior , and for the host opening door 3. His rule fixes the likelihoods.
With the car behind my door he chooses between two goats and the uniform rule gives . With the car behind door 2 he is forced onto door 3. He can never open door 3 onto the car. Marginalising gives , and Bayes returns
A host who instead opened door 3 with probability when free would leave . The uniform is what pulls this back to the same as the strategy rate.
#Why the even split is wrong
The tempting picture calls the two closed doors symmetric once a goat is shown. A random opener would make them so. This host is not random. He avoids the car and avoids my door, so opening door 3 is a measurement, and that measurement moves door 3's prior mass onto door 2 while leaving my door 1 fixed at .
#A one-line simulation
The decisive observation collapses the experiment. Switching wins exactly when the car and my first pick differ, so each game is one comparison of two independent uniform draws.
import random
def switch_wins(doors: int = 3) -> bool:
# Switching wins exactly when the first guess missed the car.
return random.randrange(doors) != random.randrange(doors)Averaging this over a growing number of games drives the running estimate onto .
The same identity returns when the host clears every other goat from doors.