Overview

In the Monty Hall problem, you pick one of three doors, the host opens another door with a goat behind it, and you can switch. Switching wins two-thirds of the time, which surprises almost everyone.

Enter the number of doors, how many the host opens, and 1 to switch or 0 to stay. The host always opens empty doors and never your door.

Worked examples

InputsResult
Number of Doors3Doors Opened by Host1Switch doors?YesWin probability if staying: 33.33%Win probability if switching: 66.67%Current strategy (switch): 66.67%
Show 3 more examples
Number of Doors10Doors Opened by Host8Switch doors?YesWin probability if staying: 10%Win probability if switching: 90%Current strategy (switch): 90%
Number of Doors10Doors Opened by Host1Switch doors?YesWin probability if staying: 10%Win probability if switching: 11.25%Current strategy (switch): 11.25%
Number of Doors3Doors Opened by Host1Switch doors?NoWin probability if staying: 33.33%Win probability if switching: 66.67%Current strategy (stay): 33.33%

How it works

Your first pick wins with probability 1 ÷ n, and staying keeps that chance. If you switch to one of the remaining closed doors at random, you win (n − 1) ÷ (n × (n − k − 1)), where k is the number of doors opened. With 3 doors and 1 opened, that's 2/3.

The formula

P(switch wins) = (n − 1) ÷ (n × (n − k − 1))
nNumber of doors
kDoors the host opens

Practical tips

  • With 3 doors, staying wins 33.33% and switching wins 66.67%.
  • With 10 doors and 8 opened, switching wins 90%, which makes the logic easier to see.
  • With 10 doors and only 1 opened, switching wins just 11.25%, still a little better than staying at 10%.

Frequently asked questions

Why does switching help?

Your first pick was probably wrong, and the host's choice gives you information about the other doors.

Does it still work if the host opens doors randomly?

No. If the host might reveal the car, the advantage disappears.

Is switching ever worse?

No. Under the standard rules, switching is always at least as good.