The Monty Hall problem racked my brain for months. Even after I heard the solution, pretended to understand it, and moved on it still sat there in the back of my mind. While I might not be a super-genius like my little brother, I can now clearly explain the solution to the Monty Hall and why it works.
The Monty Hall problem goes like this:
You are a guest on a gameshow presented with three doors. Behind one of those three doors is a cash prize, but you have no way of telling which door that is. The host lets you pick one door to open. After you have selected a door to open, the host of the gameshow opens one of the other two doors and reveals that the prize is not behind that door. The gameshow host then asks if you would like to stick with the door you have already selected or switch to the other door. Should you switch or stay?
You should switch.
If you’re like most people, you would say that it shouldn’t matter which door you choose. If you have no indication of whether the prize is behind door number 1, 2, or 3 at the start then the hosts’ actions should make no difference to you. Now that the choice is narrowed down to two doors you have a 50/50 shot at winning the prize, right?
Not quite. There is a subtle but crucial hint that the gameshow host gives to you when revealing the empty door. Let’s think about this scenario from the gameshow host’s perspective. Specifically, let’s think about the host’s constraints.
If the gameshow host is trying to keep their job they’re probably not going to open up the door with the prize behind it and ask you if you want to switch. Even though that’s an awesome game for you, this ain’t Oprah. On a similar note, the host also is not likely to pick the door you selected. If the host opened your door and there was no prize behind it, of course you would switch.
This leaves us with two possible scenarios, either
Scenario 1) You picked the door with the prize behind it on your first guess or
Scenario 2) you didn’t.
In the case where you picked the prize on your first guess the host can freely choose to reveal either of the two remaining doors. However if you didn’t select the prize on your first guess (which happens ~67% of the time), the host is forced to choose the empty door. Knowing that the host selected the empty door and assuming that you didn’t pick the door with the prize on your first guess, switching will win you the prize. Therefore, switching doors is always the best decision.
This problem is a case study in un-intuitive probability scenarios so if you’re still not convinced you are not alone. My little brother wasn’t convinced either, so I wrote him a Python script that simulated the scenario. The primary takeaway is shown in the code below.
import random
# This function simulates one round of the Monty Hall problem
# where we choose to switch. Returns True if we won the prize.
def monty_hall():
# door 0 door 1 door 2
door = ['Empty', 'Empty', 'Prize'] # Create doors
random.shuffle(door) # Shuffle their order before the show
first_choice = door[0] # Select an arbitrary first door, door 0
if door[1] == 'Prize': # Host selects an empty door we didn't choose
host_reveals = door[2]
remaining_door = 1 # Explicitly state the remaining door that can be switched to
else:
host_reveals = door[1]
remaining_door = 2
return door[remaining_door] == 'Prize' # Returns True if the remaining door contains the prize
Running this simulation 10, 100, and 1,000 times generates the below win rates and corresponding margins of error:
As the number of simulations increases, we become more and more confident that the true probability of winning if we switch approaches 67% (our odds of randomly selecting an empty door in the first place).
While the figures don't lie, it wasn't as fun as a live demo. I gathered three gift bags and a teddy bear to demonstrate the game tomy brother in real life. I turned around and, without peeking, let my brother pick a bag to hide the teddy bear. Then, I picked my first bag, he offered me my options, and I switched. There was little teddy, just waiting for me. He said
Wait a minute, I had to pick the empty bag otherwise I would show you where the bear is!
Exactly.
There are some pretty funny and interesting variants on the Monty Hall problem that can be found on the Monty Hall Wikipedia page. My personal favorite is the “Monty From Hell” variant, where the host only offers to switch if we initially chose the winning door (that sly devil). Most people say that this problem has few (if any) practical applications and that it is supposed to be an introduction to un-intuitive probability concepts. However, I belong to the school of thought that believes that this problem could be used to save your life.
Let’s say you’re a shopkeeper and Anton Chigurh wanders into your store. He says he will flip a coin to decide whether to end your life or leave you be. You say that while you understand that the odds can’t change, you would at least like to pick a similar game if your life is on the line.
Anton Chigurh from No Country for Old Men (2007)
Anton appears to be listening, which is a good sign. This is where you get to Monty up the problem, so I hope for your sake you have been paying close attention.
You ask Anton to pick a secret number between one and three then write that number down on a piece of paper. To preserve the 50/50 chance of the coin-toss, you say that you can only guess between two numbers. Therefore you say “If I were going to pick between 1 and another number then which number isn’t on that paper, 2 or 3?” If Anton says “2”, then 3 is likely the number on the paper. Assuming he takes the bait (and sticks to his end of the deal) we will have gained a 16.6% higher chance to live another day. Whew! Who said this stuff wasn’t “practical”?