Probability

Monty Hall Problem

Switch doors and double your chances — the most counterintuitive correct answer in probability

The Monty Hall problem — pick one of three doors. The host opens another to reveal a goat. Should you switch? Yes — switching wins 2/3 of the time, sticking wins 1/3. The intuition that "it's now 50-50" is wrong because the host's choice gives information. The famous result fooled mathematicians, sparked angry letters to a column, and has become the canonical example of conditional-probability counterintuition.

  • Win rate — switch2/3
  • Win rate — stick1/3
  • First posedSelvin (1975) and Whitaker (1990 letter to Marilyn vos Savant)
  • Famously misanalyzedHundreds of PhDs disagreed when vos Savant got it right
  • Key insightThe host's choice is conditional on your pick — provides info
  • Bayesian formulationP(car | reveal) calculated via Bayes' theorem

Interactive visualization

Press play, or step through manually. The visualization is yours to drive — try it before reading on.

Open visualization fullscreen ↗

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The problem

You're on a game show. Three doors. Behind one is a car; behind the other two are goats. You pick a door, say door 1.

The host (who knows what's behind each door) opens one of the other two doors, revealing a goat. Say the host opens door 3.

The host then offers you the option — stick with door 1, or switch to door 2.

Should you switch?

The famous answer — yes. Switching gives you a 2/3 probability of winning the car. Sticking gives 1/3. The intuition that says "two doors left, must be 50/50" is wrong.

Why switching wins

Three reasoning paths to the same conclusion.

Method 1 — enumerate cases

Without loss of generality, suppose you always pick door 1. Then:

Car locationProbabilityHost opensSwitch wins?
Door 1 (your pick)1/3Door 2 or 3 (random)No — switching loses
Door 21/3Door 3 (forced — only goat to reveal)Yes — switch to door 2 wins
Door 31/3Door 2 (forced)Yes — switch to door 3 wins

Switching wins in 2 of 3 equally likely scenarios. P(switch wins) = 2/3.

Method 2 — initial probability is preserved

When you pick door 1, P(car behind door 1) = 1/3 and P(car behind doors 2 or 3) = 2/3. The host's reveal of a goat doesn't change door 1's probability — the host always reveals a goat regardless of where the car is. So door 1 stays at 1/3.

The reveal does, however, collapse the 2/3 probability of "car behind 2 or 3" onto the single remaining unopened door. Switching captures this 2/3.

Method 3 — the 100-door scaling argument

Imagine 100 doors, 1 car, 99 goats. You pick door 1. Probability your pick is the car — 1%. Host opens 98 other doors, all goats. Two doors left — yours and one other. Where's the car likely to be?

Obviously the other door. Your door has 1% probability; the other door collected the remaining 99% from the 99 doors you didn't pick. The reveal of 98 goats was massively informative — switching is essentially guaranteed.

The 3-door version is the same logic with smaller numbers — your door is 1/3 (1%), the other unopened door is 2/3 (99%). Switching captures the bigger pile.

Bayesian formulation

Let:

  • C₁ = car behind door 1; C₂ = car behind door 2; C₃ = car behind door 3.
  • O₃ = host opens door 3.

You picked door 1. The host opens door 3, revealing a goat. What's P(C₁ | O₃) and P(C₂ | O₃)?

By Bayes' theorem:

P(C₁ | O₃) = P(O₃ | C₁) · P(C₁) / P(O₃)
P(C₂ | O₃) = P(O₃ | C₂) · P(C₂) / P(O₃)

Compute the likelihoods:

  • P(O₃ | C₁) = 1/2 (host has two goat doors to choose from; randomly picks).
  • P(O₃ | C₂) = 1 (host must open door 3 — door 1 is your pick, door 2 has the car).
  • P(O₃ | C₃) = 0 (host can't reveal the car).

P(O₃) — by total probability — = (1/2)(1/3) + (1)(1/3) + (0)(1/3) = 1/6 + 1/3 = 1/2.

So:

P(C₁ | O₃) = (1/2)(1/3) / (1/2) = 1/3
P(C₂ | O₃) = (1)(1/3) / (1/2) = 2/3

Confirmed. P(switching wins) = 2/3.

JavaScript — Monte Carlo simulation

function montyHallTrial(switchStrategy) {
  // Place car randomly behind one of 3 doors
  const carDoor = Math.floor(Math.random() * 3);
  // Player picks randomly
  const playerPick = Math.floor(Math.random() * 3);

  // Host opens a door that's not the player's pick AND has a goat
  let hostOpens;
  do {
    hostOpens = Math.floor(Math.random() * 3);
  } while (hostOpens === playerPick || hostOpens === carDoor);

  // Determine final pick based on strategy
  let finalPick;
  if (switchStrategy) {
    finalPick = [0, 1, 2].find(d => d !== playerPick && d !== hostOpens);
  } else {
    finalPick = playerPick;
  }

  return finalPick === carDoor;
}

function simulate(strategy, trials = 100000) {
  let wins = 0;
  for (let i = 0; i < trials; i++) {
    if (montyHallTrial(strategy)) wins++;
  }
  return wins / trials;
}

console.log('Switch strategy:', simulate(true));   // ≈ 0.667
console.log('Stick strategy:', simulate(false));   // ≈ 0.333

// Variant — host opens random door (might reveal car; trial discarded if it does)
function montyHallRandomHost() {
  const carDoor = Math.floor(Math.random() * 3);
  const playerPick = Math.floor(Math.random() * 3);
  let hostOpens;
  do {
    hostOpens = Math.floor(Math.random() * 3);
  } while (hostOpens === playerPick);  // not player's door, but might be car

  if (hostOpens === carDoor) return null;  // discard

  // Switch
  const finalPick = [0, 1, 2].find(d => d !== playerPick && d !== hostOpens);
  return finalPick === carDoor;
}

let valid = 0, wins = 0;
for (let i = 0; i < 100000; i++) {
  const r = montyHallRandomHost();
  if (r !== null) { valid++; if (r) wins++; }
}
console.log('Random host (filtered) — switch:', wins/valid);  // ≈ 0.5

Why this is so counterintuitive

The intuitive but wrong answer — "two doors left, 50/50" — comes from treating the situation as a fresh choice between two doors with no prior information. But there's information in:

  1. You picked first, with 1/3 probability of being right.
  2. The host's choice is constrained — they must open a goat.

The reveal gives information about the OTHER unopened door (it might be the car if the original choice was wrong). It doesn't equally update your original pick (which is just "wrong" with probability 2/3 from the start).

The misintuition is so persistent that the puzzle has caused arguments among PhDs. Paul Erdős famously didn't accept the 2/3 answer until he saw a computer simulation. It's a useful exhibit for the limits of intuition in probability — even people who've taken probability courses often get it wrong on the first encounter.

Variants and pitfalls

VariantSetupBest strategy
StandardHost always opens a goat doorSwitch (2/3 win)
Random hostHost opens random door (might reveal car)Switch — but only when revealed is goat (filtered probability is still 2/3, because of unequal selection rates given C₁)
Random host (alternative)Host might pick player's doorDifferent problem entirely
Two contestantsYou see another contestant make a choice and see their revealSame — switch
n doors, host opens k goatsn > 3 doorsSwitch wins (n−1)/(n(n−1−k)) — increases with k

The key dependency is the host's strategy. Different host strategies → different optimal player strategies. Always specify the host's behavior explicitly.

Where this matters beyond the puzzle

  • Conditional probability fundamentals. The Monty Hall problem is the canonical pedagogical example of how conditioning changes probabilities — and how intuition fails.
  • Trial reveals in clinical / scientific testing. When a test or screen reveals information, the posterior probabilities of competing hypotheses change in ways that depend on the test's protocol — analogous to the host's behavior.
  • Game theory. Information-revealing actions in games (poker tells, options dropped from a menu) condition future expectations the way the host's reveal does. Pricing in information markets uses similar reasoning.
  • Bayesian inference. The puzzle is one of the cleanest demonstrations of why direct intuition fails and Bayes' theorem succeeds.
  • Decision theory under partial information. Whenever you have an opportunity to revise a decision after observing a partial outcome, Monty Hall logic applies.

Common mistakes

  • Treating the post-reveal situation as a "fresh" two-door choice. It's not — your initial pick had 1/3 probability, and that doesn't change. The other unopened door inherits the rest.
  • Forgetting the host's constraint. If you didn't know the host always reveals a goat, the analysis is different. The conditional structure of the host's behavior is what makes switching better.
  • Assuming symmetry. Yes, two doors are unopened. No, they're not symmetric — one was your initial pick (1/3 prior), the other is the residue (2/3).
  • Dismissing simulation as needed. If you don't trust the math, run 10,000 trials. The numerics confirm 2/3 vs 1/3 every time.
  • Confusing this with the "boy or girl" paradox. Different setup, but similar conditional-probability counterintuition. Both involve "what does this information actually tell me?"
  • Generalizing to scenarios where the host's behavior is unknown. Real-world analogs (e.g., regulatory revealing of one option in a tender) require explicit modeling of the revealer's behavior. Don't assume "host always shows the worst" without justification.

Frequently asked questions

Why is the answer 2/3 and not 50/50?

Because the host's choice is conditional on your pick. When you pick door 1, the car is behind your door with probability 1/3 and behind one of the other two with probability 2/3. The host opens a goat — but which one of the two depends on what's there. After the reveal, your door is still 1/3, and the unopened door inherits the 2/3 collective probability. Switching captures the 2/3.

What if I just imagine 100 doors instead?

Pick door 1 of 100. Probability you picked the car — 1%. Host opens 98 other doors, all goats. Now there's your door 1 and one other unopened door. Should you switch? Obviously yes — your initial 1% is unchanged; the other door has the remaining 99%. Same logic with 3 doors — picked car with 1/3, other unopened door has 2/3.

Doesn't the host's reveal change my door's probability too?

No. The reveal gives you information about THE OTHER UNOPENED DOOR (it's NOT the one with the goat the host opened, and it's NOT the open one). It doesn't update the probability of your initially-picked door, because the host's strategy guarantees revealing a goat regardless of where the car is. Your door stays at 1/3.

What if the host opens a door at random (might reveal the car)?

Different problem entirely. If the host's reveal isn't conditioned on having a goat, then 50-50 IS the right answer (after the case where they reveal a car is excluded). The 2/3 answer specifically requires the host to ALWAYS reveal a goat — which is what the problem states. The conditional structure of the host's behavior is what makes 2/3 work.

Did mathematicians really get this wrong?

Many did. Marilyn vos Savant (highest IQ at the time) wrote about it in her column "Ask Marilyn" (1990). She got it right; thousands of letters disagreed, including from PhDs. Paul Erdős, the prolific mathematician, also got it wrong initially and only believed after seeing computer simulations. It's a robust counterexample to "this is so obvious, no need to compute."

How does Bayes' theorem solve it?

P(car behind door 1 | host opens door 3) = P(host opens 3 | car behind 1) · P(car behind 1) / P(host opens 3) = (1/2) · (1/3) / (1/2) = 1/3. So P(car behind door 2 | host opens 3) = 2/3 by complementation. The Bayesian calculation is two lines and gives the right answer; intuition gives the wrong one.

How can I verify by simulation?

Code it up. Pick a door uniformly. Place car uniformly (independent). Host opens a non-picked, non-car door (random tiebreak if your door has the car). Record whether switching wins. Run 10,000 trials. You'll get ≈ 2/3 wins for switching. Same code with random door reveal gives 1/2 — confirming the strategy depends on the host's behavior.