3 Approaches to Monty Hall Problem — Intuition, Simulation, and Theory

Fatih Boyar
6 min readApr 18, 2023

--

People are not so good at grasping probabilities intuitively. Not only do we need that specific education and somewhat concern for rationality, but we also need to understand that our brains are wired to make heuristics. These heuristics helped us to survive on the savanna but now we understand that it causes failure to comprehend what really goes around us. However, after we intuitively understand the probability, it’s harder to look at the problems incorrectly. Well, at least those particular problems. To project our understanding of probability to other issues, we need to make an effort against our heuristics and premature conclusions. The infamous Monty Hall problem is a particular brain teaser, not only to ordinary but well educated also.

The Monty Hall problem comes from a TV Show called “Let's Make a Deal”, and Monty Hall is the host. Here is how it goes: There are three doors, and behind one of those, there is a car, which is the grand prize. The other two have goats, which means missing the prize. You pick a door from these three, wishing for the car. After then the host Monty Hall opens one of the doors you didn’t choose and there is a goat behind it. Now note that the host knows which door has the prize and he can’t open the prize door or your pick. There are two doors left and he asks: “Would you like to switch or stick to your first choice?” Everything was okay and you were one step closer to your dream car but the host creates a choice! We mostly don’t like more choices, and we tend to stick to the status quo. And there are two doors left anyway, so you have a 50% chance don’t you? Wrong.

How this problem got famous is noteworthy. The problem was originally posed (and solved) by Steve Selvin to the American Statistician in 1975. It became famous as a question from a reader’s letter quoted in Marilyn vos Savant’s “Ask Marilyn” column in Parade magazine in 1990. She was the highest IQ at her time and her column was basically about asking anything the smartest person in the world. She answered that you should switch. When you switch you double your chances. She had terrible reactions from lots of people and some of these people were math professors. They thought she was plain wrong.

The odds are changed after Monty opened a door and you should update your belief. It’s about updating your beliefs after events so Bayes’ Theorem would be on point but using formulas without intuition is would be ineffectual. It’s an event that you should consider because he knew what door he was opening. He didn’t open it randomly. When you select a door in the first place, you had a 1/3 of a chance. You knew nothing and picked it randomly. It might have the prize but most likely, 2/3 of the time it's the goat. So note that you pick a door randomly with odds against you. Thus, the two doors you didn’t choose have a 2/3 chance of obtaining the prize. If you stick with your choice, your chance to get the prize is still 1/3 but if you switch, it’s 2/3.

image source: https://en.wikipedia.org/wiki/Monty_Hall_problem

In the figure above, you picked door 1, the odds are in favor of the other two.

image source: https://en.wikipedia.org/wiki/Monty_Hall_problem

After revealing the goat, the other door still remains with a 2/3 chance.

Intuitive approach: 100 doors

I also did not understand this at first sight but imagining 100 doors instead of 3 helps a lot. Now think about 100 doors and you pick one of them. Again, one of these doors has the car behind it and the other 99 have goats. After your pick, good old Monty opens up 98 of them and they are all goats. Now there is only your pick and the door that Monty did not open. Think about how small were the chances that your door is the prize door out of 100 doors. Now you might feel that the chance of the other door obtaining the prize has risen greatly.

Imagine you selected door number 1, and Monty Hall started to open every door one by one, until your choice and the number 2 left. All the others had goats behind them. Now do you still think that you have a 1/2 chance?

Simulation approach

Let’s see all the possible scenarios with 3 doors selections. Out of 9 instances, you win 6 of the times. This means if you switch, you have a 2/3 chance of winning.

All the possible scenarios

If this is still difficult to convince, let’s make a simulation with many trials. You can try the Python code given below:

import random
import numpy as np

# stick with the choice:
B = 10000 # number of trials
results_stick = []

for i in range(B):
doors = np.array([0, 1, 2]) # creates doors
prize = np.array(random.sample(['car', 'goat', 'goat'], 3)) # puts prizes in random order
prize_door = doors[prize == 'car'][0] # note which door has prize
my_pick = random.sample(doors.tolist(), 1)[0] # note which door is chosen
show = random.sample(doors[(doors != my_pick) & (doors != prize_door)].tolist(), 1) # open door with no prize that isn't chosen
stick = my_pick
results_stick.append(stick == prize_door)

np.mean(results_stick)

# output would be around 0.33 for stick with choice


# switch the choice:
B = 10000 # number of trials
results_switch = []
for i in range(B):
doors = np.array([0, 1, 2]) # creates doors
prize = np.array(random.sample(['car', 'goat', 'goat'], 3)) # puts prizes in random order
prize_door = doors[prize == 'car'][0] # note which door has prize
my_pick = random.sample(doors.tolist(), 1)[0] # note which door is chosen
show = random.sample(doors[(doors != my_pick) & (doors != prize_door)].tolist(), 1) # open door with no prize that isn't chosen
switch = doors[(doors != my_pick) & (doors != show)][0]
results_switch.append(switch == prize_door)

np.mean(results_switch)

# output would be around 0.66 for switch

Theoric approach: Bayes’ Theorem

This is clearly a problem that can be solved with Bayes’ Theorem because it is all about updating beliefs about probabilities. But first, we should be convinced that Monty Hall opening a door with a goat behind is relevant to our goal. It is a piece of new information. Before this event, we had a chance of 1/3 winning the car. After the event, we need to calculate the posterior probability.

Let H: Hypothesis of door 1 has a car behind it

E: The event of Monty revealed a door with a goat behind it

Our goal is to calculate P(H | E), meaning the probability of the Hypothesis being true given the Event.

  • P(H) = 1/3 (Prior probability)
  • P(notH) = 1 — P(H) = 2/3 (Complementary of the prior)
  • P(E|H) = 1 (Monty shows a door with a goat behind it, given that door 1 has a car behind it. This is always true so it is 1)
  • P(E|notH) = 1$ (Monty shows a door with a goat behind it, given that door 1 does not have a car behind it. This is also always true so it is 1)

Given the probabilities:

Given the information, the probability of door 1 winning has unchanged. But, because there are only 2 doors left, the total probability must add up to 1. Therefore, the probability of the unrevealed door has a 2/3 chance of winning. So you should switch to the other door at the end.

--

--

Fatih Boyar

Wondering around probability, data science and philosophy. Aim is to be less wrong. Rationally Curious.