All Articles

Monty Hall Problem

The game

The Monty Hall Problem is a brain teaser that is (was?) often used in investment banking interviews. If you’ve never heard of it, here’s a summary:

You’re on a TV game show. There are three closed doors:

  • One door has a car, which will be your prize if you choose that door
  • The other two doors each have a donkey

The aim of the game is to choose the door with the car. The game mechanics are thus:

  1. You choose a door
  2. Monty (the host) opens one of the other two doors, revealing a donkey.
  3. Now there are two unopened doors. You choose whether to stick with your original choice, or switch to the other unopened door.
  4. All is revealed.

The question is: at step 3, should you switch?

The mistake

Most people, when encountering this problem for the first time, think there’s no benefit to switching. But, oddly, this isn’t right.

Another way to think about it

Assuming you understand the rule (that Monty will always open a door you didn’t choose, and that door always has a donkey behind it), then one way to understand the game is:

You can choose to have:

  • The most valuable prize that’s behind door A, or
  • The most valuable prize that’s behind doors B or C

When you look at it this way, it’s obvious that you would rather have the most valuable prize from the ‘other’ doors, and the way to do that is to switch.

The intuition above is easier than trying to compute probabilities, and thinking about whether the probabilities change once Monty opens the door with the donkey.

If you need convincing, here’s a simple python script based on the above:

import random

donkey = 0
car = 10  # car is worth more than a donkey
prizes = [car, donkey, donkey]  # there's always exactly one car
N = 1000000

def pick_a_door(prizes):
    random.shuffle(prizes)
    my_pick, *other_doors = prizes
    return [my_pick, other_doors]

def keep_or_swap(my_picks, keep=False):
    if keep:
        return my_picks[0]
    else:
        # if you switch, and one of the other doors had the car, you
        # will definitely get it, so you get the max() of those two doors
        return max(my_picks[1])

print(sum([keep_or_swap(pick_a_door(prizes)) for i in range(N)]) / N)

print(sum([keep_or_swap(pick_a_door(prizes), keep=True) for i in range(N)]) / N)

If you’re still thinking about whether the probabilities change, consider whether ‘Monty opens a door with a donkey behind it’ is new information. It’s not because he always does that. And the two doors you picked are fungible/identical except for physical position, as both are in the set of doors you didn’t pick. So which one he opens is irrelevant.