Math paradoxes

The Monty Hall problem Three doors. One car. Should you switch?

You pick a door. The host, who knows where the prize is, opens another door to show a goat and offers you a switch. Should you take it? Lock in your answer, then check it in a game, a simulation, six explanations, and with 20 doors.

You pick a door. The host, who knows where the prize is, opens another door to show a goat and offers you a switch. It feels like 50/50 now. It isn't. Check it yourself: on video, in a game, in a simulation, through six explanations, and with 20 doors.

Play
1/3if you stay
2/3if you switch
The puzzle

Picture this: you're on a game show

The Monty Hall problem, also called the Monty Hall paradox, is named after Monty Hall, host of the American show Let's Make a Deal, which first aired in 1963. The show never ran this exact game, but the setting is the same: a host, doors, prizes, and the temptation to change your mind.

  1. 1

    The stage

    You're the finalist. In front of you are three closed doors. Behind one is a brand-new car, behind the other two are goats. The prizes were placed in advance, at random. Only the host knows what is where.

    1
    2
    3
  2. 2

    Your pick

    You point at one door, say door 1. It stays closed for now.

    1
    2
    3
  3. 3

    The host opens another door

    The host opens one of the two doors you didn't pick, say door 3. It's a goat. He never touches your door and never reveals the car. If both unpicked doors hide goats, he opens either one at random.

    1
    2
  4. 4

    The offer

    "Do you want to stay with door 1, or switch to door 2?" Two doors are closed, and one of them hides the car.

    1
    2
  5. 5

    The reveal

    They open the door you settled on. If it's the car, you drive it home. If it's a goat, the goat is yours.

The question

Should you switch? Or does it make no difference?

Make up your mind before you scroll on. Then check your answer in the game in round 2.

Most people say it makes no difference: it's 50/50 now. In 1990 Marilyn vos Savant wrote in Parade magazine that you should switch. She got around 10,000 letters saying she was wrong, nearly a thousand of them from people with PhDs. She was right.

The rules the answer depends on

  • The host knows where the car is.
  • He always opens a door with a goat, never the car.
  • He never opens your door.
  • He always offers the switch, whether or not you picked right.
  • If both unpicked doors hide goats, he picks one of them at random.

Change one of these rules and the answer can change. Round 4 shows how.

Round 1 · Watch

The scene from the film 21

In the 2008 film 21, maths professor Micky Rosa (Kevin Spacey) puts a game-show puzzle to his student Ben Campbell (Jim Sturgess). Ben answers right away and explains his reasoning.

In the 2008 film 21, maths professor Micky Rosa (Kevin Spacey) puts a game-show puzzle to his student Ben Campbell (Jim Sturgess). Ben says he would switch doors and explains why.

The scene gives the answer away

Play at least one round in round 2 first. The video and a breakdown of the scene will then appear here.

Play

21 (2008), dir. Robert Luketic · English · open on YouTube

What happens in the scene

  • PuzzleThe professor: behind one of three doors is a car, behind the other two are goats. You pick door 1.
  • HintThe host opens door 3 and shows a goat. Do you want to switch to door 2?
  • AnswerBen says yes: his chance was 33.3% at first and becomes 66.7% if he switches.
  • IdeaBen calls it "variable change": new information changes the calculation, and emotion gets in the way of seeing it.

What the film leaves out. The 2/3 answer holds only if the host always opens a goat door and always offers the switch. If he opened doors at random, or only offered a switch to players who had already picked the car, the answer would change. More on that in round 4.

Round 2 · Play it yourself

Pick a door

Play 15 to 20 rounds and try both strategies. The panel on the right shows how often each one wins in your session.

Your session

The tick on each bar marks the theoretical result. With only a few games the results swing a lot, so look at round 3 too.

Next: the solution

Next comes the explanation, with spoilers

The next rounds show whether you should switch: 10,000 games, six explanations and 20 doors. Play round 2 first, or go on?

You chose to always show all rounds.

Round 3 · Simulation

10,000 games in a second

The computer plays for you: it picks a door at random, the host opens goat doors, then the player either stays or switches. The chart shows the win rate settling on the theoretical value.

Strategy
Stay Switch dashed: theory
–
–
The first 300 games. Each square shows which strategy would have won that game.

What if you switch only sometimes?

Wins, 10,000 games
–

Once you answer, the simulation code appears here so you can run it yourself.

Check it yourself in code

The same simulation, short and with no libraries. Run the JavaScript in your browser console (F12) or in Node; the Python needs only the standard library.

JavaScript
// Three doors, a car behind one. The host knows where it is and always opens a goat door.
const GAMES = 1000000, P = 0.5;                   // P: the share of games in which the player switches
const rnd = n => Math.floor(Math.random() * n);

let stay = 0, sw = 0, mix = 0, kept = 0, keptStay = 0;
for (let g = 0; g < GAMES; g++) {
  const car = rnd(3), pick = rnd(3);
  let host;
  do host = rnd(3); while (host === pick || host === car);   // a goat, and not your door
  const other = 3 - pick - host;                  // the door you can switch to
  if (pick === car) stay++;
  if (other === car) sw++;
  if ((Math.random() < P ? other : pick) === car) mix++;
  if (pick === 0 && host === 2) { kept++; if (pick === car) keptStay++; }   // only games "picked 1, host opened 3"
}
const pc = x => (100 * x).toFixed(1) + '%';
console.log(`Stay: ${pc(stay / GAMES)} (theory 33.3%)   Switch: ${pc(sw / GAMES)} (theory 66.7%)`);
console.log(`Only "picked 1, host opened 3" (${kept} games): stay ${pc(keptStay / kept)}, switch ${pc(1 - keptStay / kept)}`);
console.log(`Switch in ${pc(P)} of games: ${pc(mix / GAMES)} (theory (1 + P)/3 = ${pc((1 + P) / 3)})`);
Python
# Three doors, a car behind one. The host knows where it is and always opens a goat door.
import random

GAMES, P = 1_000_000, 0.5                 # P: the share of games in which the player switches

stay = sw = mix = kept = kept_stay = 0
for _ in range(GAMES):
    car, pick = random.randrange(3), random.randrange(3)
    host = random.choice([d for d in range(3) if d != pick and d != car])   # a goat, and not your door
    other = 3 - pick - host               # the door you can switch to
    stay += pick == car
    sw += other == car
    mix += (other if random.random() < P else pick) == car
    if pick == 0 and host == 2:           # only games "picked 1, host opened 3"
        kept += 1
        kept_stay += pick == car

print(f"Stay: {stay / GAMES:.1%} (theory 33.3%)   Switch: {sw / GAMES:.1%} (theory 66.7%)")
print(f"Only \"picked 1, host opened 3\" ({kept} games): stay {kept_stay / kept:.1%}, switch {1 - kept_stay / kept:.1%}")
print(f"Switch in {P:.1%} of games: {mix / GAMES:.1%} (theory (1 + P)/3 = {(1 + P) / 3:.1%})")
Round 4 · Six explanations

Why intuition gets it wrong

Two closed doors do not 50/50. You chose your door at random. The other one was left closed by a host who knows where the car is and is not allowed to reveal it. The two doors are not equal. Here are six ways to see it, from the simplest to the deepest.

In plain wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

100 doors

Make the game bigger and the answer becomes obvious

Picture 100 doors and one car. You pick one: a 1 in 100 chance. The host, who knows where the car is, opens 98 of the others, all goats. Your door is left, plus one more that the host somehow skipped. Staying is betting that you found the car first time out of a hundred. Switching wins 99 times in 100. With three doors the idea is the same, just less striking: 2 in 3.

You against the group

The host squeezes two doors into one

1
1/3
2
3
2/3
1
1/3
2
2/3

Imagine the host offered from the start: "Keep your door, or take both of the others." You would take both. Showing a goat changes nothing: at least one of those two doors always hides a goat, and the host just tells you which. The group's 2/3 chance now sits in a single door.

List every case

There are only three scenarios

Say you picked door 1. The car is equally likely to be behind any door.

Car behindHost opensStaySwitch
#1#2 or #3cargoat
#2#3goatcar
#3#2goatcar
Wins1 of 32 of 3
The host's role

It all hinges on what the host knows

Host knows and always shows a goat2/3chance if you switch
Host opens at random and happens to show a goat1/2

When the host knows where the car is, his choice is constrained, and that constraint carries information. When he opens at random, the goat could have turned up by chance, so it tells you less. Check it: the simulation throws out games where the host accidentally revealed the car.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Probability tree

Switching wins whenever your first pick was wrong

Your first pick 1/31/31/3 cargoat Agoat B switchswitchswitch goatcarcar 1/31/3 + 1/3 = 2/3

Switching loses only when your first pick was the car, and that happens in just one case out of three.

For formula lovers · Bayes' theorem

The exact numbers: you picked #1, the host opened #3

The chance the host opens #3. Each door hides the car with the same chance, ⅓:

  • if the car is behind #1, the host chooses between #2 and #3, so he opens #3 with probability ½;
  • if the car is behind #2, he always opens #3 (probability 1);
  • if the car is behind #3, he never opens #3 (probability 0).
P(host opens #3)=12·13+1·13+0·13=12

: the chance the car is behind your door #1 after the host opened #3.

P(car at #1|opened #3) =P(opened #3|car at #1)·P(car at #1)P(opened #3) =½·⅓½=13

The same for door #2: here the host had to open #3, so P(opened #3 | car at #2) = 1.

P(car at #2|opened #3) =P(opened #3|car at #2)·P(car at #2)P(opened #3) =1·⅓½=23

The whole difference is in the factor P(opened #3 | car at …): ½ for your door #1 and 1 for door #2. If the car is behind your door, the host picks #2 or #3 at even odds. If the car is behind #2, the host has no choice: he must open #3. So seeing #3 opened fits "car behind #2" twice as well.

Round 5 · Scaling up

What happens with more doors

If three doors didn't convince you, scale it up. At twenty doors, intuition usually gives in.

Your session

Chance of winning by number of doors

The host opens one door at a time and offers a switch every time

Which strategy is best?

20,000 simulated games with 6 doors.

How the probability flows

While you hold your first door, its chance is frozen at 1/n: the host may not open it, so each goat he shows says nothing about it. The chance of every opened door flows into the other closed doors. When two doors are left, the whole (n−1)/n sits in one of them, and that is the moment to switch. Switch earlier and your new door freezes at a lower level, so you give part of the win away.

Real data

How people, pigeons and you play

Psychologists have given people this game for decades. Most don't switch even after explanations, while pigeons, who get no explanations, learned within a month to switch almost every time.

Try it on yourself

20 games with three playing cards

The ace is the car, the other two cards are goats. A friend shuffles them face down and knows where the ace is. You point at a card, your friend turns over one of the other two, never the ace. Then you stay or switch. Play 10 games each way and log every game.

Wins / gamesYour rateTheory

Studies

Who switches how often, and what it wins

The win rate uses the formula from round 3: switching in a share p of games wins (1 + p)/3.

Sources: Granberg & Brown (1995), Personality and Social Psychology Bulletin 21(7); Granberg (1999), Social Behavior and Personality 27(4); figures for both as summarised in IJ-SoTL, 2018. Herbranson & Schroeder (2010), Journal of Comparative Psychology 124(1).

Bonus · Fun facts

Things to tell your friends

10 000

10,000 letters of protest

After Marilyn vos Savant's 1990 column in Parade, the magazine received about 10,000 letters, nearly a thousand of them from people with PhDs explaining that she was wrong. Until 1989 the Guinness Book of Records had listed her as the person with the highest IQ; in 1990 it dropped the category, judging IQ tests too unreliable for a record.

1 500+

Even Erdős didn't buy it

Paul Erdős, author of more than 1,500 papers and one of the most prolific mathematicians ever, refused to accept the 2/3 answer. Only a computer simulation, shown to him by his colleague Andrew Vázsonyi, changed his mind. Round 3 on this page does the same.

1991

Monty Hall himself warned

In a 1991 interview with The New York Times, Monty Hall showed the reporter that on the real show he never had to offer a switch. He could offer it to players who had already picked the car, and then switching would be a mistake. That's why the rule "the host always offers the switch" matters.

1889

Older than the show

The same logic appears in Joseph Bertrand's box paradox (1889) and in the three prisoners problem that Martin Gardner published in 1959. The game show just gave an old idea doors and goats.

21

A film about blackjack

The film 21 is based on Ben Mezrich's book about MIT students who counted cards to beat Las Vegas casinos. The Monty Hall scene is a test of whether the hero can put calculation above gut feeling.

The Monty Hall Problem

Jason Rosenhouse

2009 · the whole book

The Book of Why

Judea Pearl, Dana Mackenzie

2018 · chapter 6

The Drunkard's Walk

Leonard Mlodinow

2008 · chapter 3

All books →
Discussion

What do you think?

Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

Is “School maths” the right level for this puzzle?

Thank you! This helps set the levels right.

Newsletter

New puzzles, explanations and discussions

I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

The sign-up form will appear here soon.