Monty Hall Problem Calculator - Stay vs Switch Win Rates

Use this monty hall problem calculator to compare stay and switch win rates for 3 doors or more. Closed-form theory and a Monte Carlo simulation both shown.

Monty Hall Problem Calculator

Total number of doors. The host opens n minus 2 non-prize doors after your first pick.

Number of simulated games used for the empirical win rate. Set to 0 to skip the simulation and show only the closed-form probabilities.

Results

P(Win | Stay)
0%
P(Win | Switch) 0%
Empirical Stay Win Rate -
Empirical Switch Win Rate -
Switch Advantage +0.00 pp

What the Calculator Does

A monty hall problem calculator works out the chance of winning a prize behind closed doors when the host opens non-prize doors after your first pick. The form takes the number of doors and the number of simulation trials, then returns the closed-form stay and switch win rates plus a Monte Carlo empirical rate for the same setup, so the classic 2/3 result and the N-door generalization are both visible in one view.

  • Homework and classroom check: Confirm that switching wins 2/3 of the time in the 3-door game without setting up 100 chalkboard trials by hand.
  • Sanity-check intuition: Run a quick simulation when the 2/3 switch result still feels wrong; the empirical row converges to the theory row as trials grow.
  • Explore the N-door generalization: See how the advantage of switching grows as more doors are added and the host's reveal concentrates the full 'first pick was wrong' mass on a single unopened alternative.
  • Decision-making framing: Compare the two strategies as a two-outcome decision under uncertainty, with both probability and empirical frequency on the same page.

The game is the standard one: the prize sits behind one of n doors at random, the contestant picks a door, the host opens every other non-prize door, and the contestant chooses between staying with the original pick and switching to the only remaining unopened door. The calculator uses exactly this rule for the closed-form math and the simulation.

For a single-event or conditional-probability version of the same setup, the Probability Calculator handles the simpler fractions and complements in a related form.

How the Calculator Works

The calculator combines a closed-form probability for the stay and switch strategies with a Monte Carlo simulation that draws random prize placements and random first picks for the requested trial count. The empirical win rate converges to the closed-form value as trials grow, which is why both rows are shown side by side.

P(win | stay, n) = 1/n P(win | switch, n) = (n - 1) / n for n > 2
  • n: Total number of doors, from 3 to 100. For n = 3 the switch formula reduces to 2/3; for large n it approaches 1.
  • trials: Number of simulated games. 0 hides the empirical row and shows only the closed-form values.
  • Strategy: Stay with the first pick or switch to the only other unopened door; the calculator returns both rates.
  • Host rule: The host opens every door that is neither the contestant's pick nor the prize, so the unopened alternative inherits the full 'first pick was wrong' mass.

The switch formula comes directly from the host's reveal. The first pick is wrong with probability (n - 1)/n, and when it is wrong, switching always wins because the host leaves the prize behind the only unopened alternative. So P(switch) = (n - 1)/n, and stay plus switch sum to 1 for every n.

The simulation draws a prize door and a first pick uniformly at random each trial. The empirical stay win rate is the fraction of trials where the first pick equals the prize, and the empirical switch win rate is its complement, since switching wins exactly when the first pick was wrong.

Worked example: classic 3-door game, switching

n = 3 doors, trials = 10000

P(stay) = 1/3 ≈ 33.33%. P(switch) = (3 - 1) / 3 = 2/3 ≈ 66.67%. The simulation draws 10000 random placements and first picks, then counts wins per strategy.

Closed-form stay ≈ 33.33%, switch ≈ 66.67%. Empirical rates land within about 1 percentage point of those values at 10000 trials.

Switching roughly doubles the win rate; the empirical row catches up as trials grow, illustrating the law of large numbers.

According to Britannica, Monty Hall problem, the host always avoids the prize door and the contestant's first pick, so the remaining unopened door inherits the full 'first pick was wrong' mass.

According to Wikipedia, Monty Hall problem, switching in the classic 3-door game wins with probability 2/3, while staying wins with probability 1/3.

When the same per-trial outcome is better studied as a binomial model, the Coin Flip Probability Calculator computes the matching probability and distribution summary.

Key Concepts Explained

Four ideas carry the meaning behind every result the calculator returns. Understanding them turns the 2/3 number into a usable stay-vs-switch decision.

Uniform prior over doors

Before any reveal, the prize is equally likely to be behind any of the n doors. That uniform prior is what makes the first pick a 1/n guess and is the starting point for every later calculation.

Conditional probability after a reveal

Once the host opens every non-prize non-pick door, the prior is updated. The 1 - 1/n probability mass that 'was' on the unpicked doors is concentrated on the single unopened door, which is the entire reason switching helps.

Stay vs switch as complementary events

In the 3-door game, stay and switch are complementary when the host always reveals n - 2 goat doors. That is why the empirical stay and switch rates sum to 1 in the simulation results and the closed-form rates sum to 1 as well.

Law of large numbers

The empirical win rate converges to the closed-form probability as the trial count grows. Watching the empirical row approach the closed-form row as you raise the trial count is a direct demonstration of that law.

These four ideas connect directly to the form. The uniform prior sets the 1/n stay probability. The host's reveal concentrates the rest onto the unopened alternative. The complementarity gives the closed-form switch rate in one multiplication. The law of large numbers is what makes the Monte Carlo row meaningful as a check on the theory.

To see the empirical simulation row connected to its underlying distribution, the Binomial Distribution Calculator reports the same probability for a range of trial counts.

How to Use the Calculator

Set the two inputs to match the game you want to study, then read the closed-form rows and the simulation rows from the results panel. The defaults reproduce the classic 3-door case used in most textbook examples.

  1. 1 Enter the number of doors: Type the integer number of doors n. The default 3 is the classic case; values from 3 to 100 are accepted, with 3 as the minimum for the standard game.
  2. 2 Choose a trial count for the simulation: Set the trials to the number of random games. The default 10000 gives a stable empirical rate. Set trials to 0 to skip the simulation.
  3. 3 Read the closed-form stay and switch rates: The P(Win | Stay) and P(Win | Switch) rows are the theoretical probabilities. The switch advantage row shows the gap in percentage points.
  4. 4 Compare the empirical simulation row: When trials is greater than 0, the empirical stay and switch rates appear below the closed-form rows and approach them as the trial count grows.
  5. 5 Try the N-door generalization: Increase n to 5, 10, or 100 to see how the switch advantage grows. The closed-form switch formula (n-1)/n approaches 1 as n grows, while staying stays at 1/n.

To verify the 2/3 textbook result, set n = 3 and trials = 10000. Stay lands at 33.33% and switch at 66.67%, and the empirical rows fall within about 1 percentage point of those values. Increase trials to 50000 to tighten the empirical spread further.

For the long-run average gain from choosing one strategy over the other, the Confidence Interval Calculator gives the matching range around the empirical win rate at common confidence levels.

Benefits of Using This Calculator

The calculator pairs closed-form theory with a working Monte Carlo simulation, so a single form answers both the analytic question and the empirical one for the classic game and the N-door version.

  • Theory and simulation in one view: Shows the closed-form probability next to the empirical simulation rate, so the law of large numbers is observable on the same page as the formula.
  • Covers the N-door generalization: Uses the (n-1)/n switch formula, so you can study the 3-door case and the 5-, 10-, or 100-door variant without re-deriving anything.
  • Adjustable trial count: Lets you trade speed for precision. 1000 trials is enough to see the shape of the result, 50000 brings the empirical rate within a few tenths of a percent of the theory.
  • Clear switch-vs-stay comparison: Reports both strategies on the same panel and adds a switch-advantage row in percentage points, so the size of the switch edge is obvious.
  • Real-time results: Updates on every input change, so changing the number of doors or trials refreshes the closed-form and empirical rows without a calculate button.

The switch advantage row is the cleanest read on 'should I switch': it is the gap between switching and staying in percentage points. The empirical row shows what a finite run of trials would produce.

When the empirical row needs a quick check on its expected spread around the closed-form value, the Empirical Rule Calculator gives the 68-95-99.7 envelope for a single proportion.

Factors That Affect Results

The numbers depend on host behavior and trial independence. Real-world variations of the game change the result, and the simulation is only as stable as the trial count allows.

Number of doors

The switch advantage grows as n grows. The closed-form switch formula (n-1)/n approaches 1 for large n, while the stay rate stays at 1/n, so switching becomes nearly certain in the limit.

Host behavior

The standard host always opens every non-prize non-pick door. A host who reveals at random or who sometimes opens the prize door breaks the assumption, and the closed-form switch formula no longer applies.

Independence of trials

Each simulated game is independent, with a fresh random prize door and a fresh random first pick. Drawing without replacement or stopping after a streak breaks independence and shifts the empirical rate.

Trial count

The empirical rate is a finite-sample estimate. With 1000 trials the standard error is about 1 percentage point near p = 0.5; with 10000 trials it shrinks to about 0.3 percentage points.

  • The closed-form switch formula assumes the standard host rule. A randomized reveal host would produce different probabilities.
  • The empirical rate is a Monte Carlo estimate, not an exact answer. A short run can differ from the closed-form value by more than one percentage point.

The empirical rate converges to the closed-form value as trials grow, but convergence is not monotonic. A 1000-trial run can show 32% to 34% while the theory says 33.33%; that spread shrinks with the square root of trials.

According to Wikipedia, Monty Hall problem, in the N-door generalization where the host opens every losing door but one (p = N - 2), switching wins with probability (N - 1)/N, which approaches 1 as N grows.

To standardize the empirical stay rate against its expected value, the Z-Score Calculator converts the gap to a z-score.

Monty hall problem calculator showing stay and switch win rates for the 3-door game and an N-door generalization, with theory and Monte Carlo simulation rows
Monty hall problem calculator showing stay and switch win rates for the 3-door game and an N-door generalization, with theory and Monte Carlo simulation rows

Frequently Asked Questions

Q: What is the monty hall problem?

A: The monty hall problem is a probability puzzle in which a prize is placed behind one of n closed doors, you pick one door, the host opens every door that is neither your pick nor the prize door, and you are offered the choice to stay or switch. The closed-form answer is 1/n to win by staying and (n-1)/n to win by switching for n greater than 2.

Q: Should you switch doors in the monty hall problem?

A: Yes, for the standard 3-door game switching wins about 2/3 of the time while staying wins about 1/3. Under the standard host rule the advantage of switching grows with n, and for n = 3 it is the larger of the two strategies.

Q: What is the probability of winning if you switch?

A: In the classic 3-door monty hall problem the probability of winning by switching is exactly 2/3, or about 66.67%. For n doors in general the closed-form switch probability is (n-1)/n, which reduces to 2/3 when n equals 3 and approaches 1 as n grows.

Q: What is the probability of winning if you stay?

A: In the classic 3-door monty hall problem the probability of winning by staying is 1/3, or about 33.33%. For n doors in general the closed-form stay probability is 1/n, which is the share of doors you chose correctly on the first pick.

Q: What happens with more than 3 doors in the monty hall problem?

A: In the N-door generalization the host opens n-2 non-prize non-pick doors and the probability of winning by switching is (n-1)/n. For large n this approaches 1, so the advantage of switching grows as more doors are added under the standard host rule.

Q: Why does switching double your chances in the monty hall problem?

A: Switching roughly doubles your chances in the 3-door game because the host's reveal concentrates the full 2/3 chance of 'first pick was wrong' on the single remaining unopened door, while the original 1/3 stays on your first pick. The two probabilities sum to 1, so switching captures the larger share.