Statistics
Monty Hall problem calculator
Should you stick with your door or switch? Enter the number of doors and how many the host opens to get the exact chance of winning each way, and simulate the game to see it happen.
Empty doors, other than yours. At most doors − 2.
Show the working, step by step
Your first pick is right with probability 1/3, and nothing the host does changes that, because he can always open 1 empty door whatever you picked.
P(win by staying) = 1/3 = 0.333333
So the car is behind one of the other 2 doors with probability 2/3. The host has removed 1 of those, leaving 1 closed door you can switch to, and the 2/3 is now shared among that one door.
P(win by switching) = (2/3) × (1/1) = 2/3
Switching is 2 times as likely to win.
2/3 ÷ 1/3 = 2
This relies on the standard rules: the host knows where the car is, always opens empty doors other than yours, and always offers the switch. If he opened a door at random and happened to show a goat, switching and staying would be equally good.
The formula
There are n doors with a car behind one. You pick a door. The host, who knows where the car is, opens k of the other doors, all empty, and offers you the chance to switch to one of the n − 1 − k doors still closed.
P(win by staying) = 1 ÷ n P(win by switching) = (n − 1) ÷ n × 1 ÷ (n − 1 − k)
Your first pick is right with probability 1/n, and nothing the host does changes that. The car is behind one of the other doors with probability (n − 1)/n, and after the host opens k of them that probability is shared equally among the n − 1 − k that remain.
A worked example
The default is the classic game: 3 doors, and the host opens 1.
P(stay) = 1/3 = 33.33% P(switch) = (2/3) × (1/1) = 2/3 = 66.67%
Switching is twice as likely to win. A table of the three equally likely places the car can be makes this concrete. Say you pick door 1. If the car is behind door 1, the host opens 2 or 3 and switching loses. If it is behind door 2, the host must open door 3 and switching wins. If it is behind door 3, the host must open door 2 and switching wins. Switching wins in two of the three cases.
With 4 doors and the host opening 1, switching still helps, but less: (3/4) × (1/2) = 3/8 = 37.5% against 25% for staying. If the host opens 2 of the 4, switching wins 3/4.
Checking it by simulation
Choose “Also simulate games” and press Calculate. The calculator plays the game as many times as you ask: it hides the car at random, makes a random first pick, has the host open empty doors at random from those allowed, and records whether staying or switching would have won. The bar chart puts the simulated rates beside the exact ones. Run it a few times; with 10,000 games the rates settle within about a percentage point of 1/3 and 2/3.
How much switching helps as doors are added
The gain from switching depends on how many doors the host opens. If he opens all but one of the other doors (k = n − 2), switching wins (n − 1)/n, so the advantage grows with the number of doors. If he opens only one, switching wins (n − 1)/(n(n − 2)), which is only slightly more than 1/n when n is large. The ratio shown in the result is how many times more likely switching is to win than staying.
Common mistakes
- Treating the last two doors as equally likely. That would be true only if the host picked a door to open at random, without knowing where the car was.
- Thinking the host's reveal “resets” the game. It gives information about the other doors, not about yours.
- Forgetting the rules matter. If the host only offers a switch when you picked the car, switching always loses. The calculation assumes he always opens empty doors and always offers the switch.
Common questions
Should you switch doors in the Monty Hall problem?
Yes. With three doors, switching wins the car 2/3 of the time and staying wins 1/3. Switching doubles your chance.
Why is it not 50–50 once two doors are left?
Because the host's choice is not random. He knows where the car is and always opens an empty door you did not pick. Your first pick was right 1 time in 3, and opening a door cannot change that. The other 2/3 had to go somewhere, and the only place left is the other closed door.
What if there are 100 doors?
If the host opens 98 empty doors, leaving yours and one other, switching wins 99/100. Your first pick had a 1 in 100 chance and still does. This version makes the logic easier to see: the host has done almost all of the searching for you.
What if the host opens a door at random?
Then the answer changes. If the host does not know where the car is and happens to open an empty door, staying and switching each win with probability 1/2. The advantage of switching comes entirely from the host's knowledge and his rule of always revealing a goat.
How many games does the simulation need?
A few thousand games is enough to see the pattern clearly. With 10,000 games of the three-door version, the switch win rate lands within about one percentage point of 66.7% almost every time.
Related calculators
-
Conditional probability
P(A|B), the idea at the heart of the puzzle.
-
Bayes' theorem
Update a probability after new evidence.
-
Birthday paradox calculator
Another probability result that surprises most people.