# The Monty Hall Problem

For a thorough explanation of the Monty Hall Problem: Monty Hall Wikipedia

## What is the Monty Hall Problem?

The Monty Hall Problem is based on the game played on the *Let’s Make a Deal* game show named after the host of the show, Monty Hall. The game goes something like this:

```
You are on a game show and are given the choice of three doors. Behind one door is a
Brand New Car but behind the other two doors are goats. You pick one of the three
doors. The host opens a different door than the one you picked and reveals a goat.
The host asks you, 'Do you want to switch your pick to the other door or do you want
to stay with your original pick?'
Is it in your interest to switch your choice?
```

## The Solution

Thinking through the problem, the goal is to end up with the door that holds the prize, the Brand New Car. Initally, you are given a choice between three doors which gives you a 33.3% chance of choosing the door with the car. If the game ended there, your chances would remain at 33.3% or 1/3. But this game doesn’t end there. The game show host opens one of the two doors you did not select and reveals a goat behind it. The host then asks if you would like to switch your choice to the remaining door or to stay with your original selection? At this point, many people think your odds of staying improve to 50% because there are only two doors remaining. Most will stay with their original door. However, 50% odds is not correct. If you stay with your orginal pick you will still have a 33.3% chance of winning while if you switch to the remaining car you will have a 66.6% chance of winning the car. This is because the host ALWAYS opens one of the other two doors and the door that is opened is always a goat.

Lets walk through the three possible scenarios:

##### Scenario 1

You choose Door 1. The host can reveal either Door 2 or Door 3 since they are both goats. If you stay you win. If you switch you lose.

```
Choice = Door 1
Door 1 Door 2 Door 3
Car Goat Goat
```

##### Scenario 2

You choose Door 1. The host reveals Door 3 as the goat. If you stay you lose. If you switch you win.

```
Choice = Door 1
Door 1 Door 2 Door 3
Goat Car Goat
```

##### Scenario 3

You choose Door 1. The host reveals Door 2 as the goat. If you stay you lose. If you switch you win.

```
Choice = Door 1
Door 1 Door 2 Door 3
Goat Goat Car
```

In two of the three scenarios you win the game by switching. In one of the three scenarios you win the game by staying.

## Controversy

There was much disagreement when the problem was first published in Marilyn vos Savant’s column of Parade Magazine in 1990. According to wikipedia, she received thousands of letters from her readers disagreeing with her solution. Some confusion was due to a misunderstanding of the problem where people did not understand that the host will always reveal a goat. Most, though, understood the problem but could not overcome their internal biases. The wikipedia page also notes that “Pigeons repeatedly exposed to the problem show that they rapidly learn to always switch, unlike humans.” Pigeon Study.

## Why are People More Likely to Choose to Stay?

There are a few psychological reasons why people tend to believe that staying with their original pick is the best choice. One reason is the endowment effect. The endowment effect is when people tend to overvalue the winning probability of what they already own, or in this case what they have already chosen. They believe that the odds are 50/50 between the two remaining doors and that it is better to go with the door they have already chosen. Another reason for staying is the staus quo bias which means people prefer to stick with the choice they have already made. It is a bias towards the existing situation even when better alternatives are available. And a final reason for explaing the tendency to stay is **errors of omission vs errors of commission** where people would prefer to be wrong through inaction rather than wrong through action.

## My Python Implementation from when I was in College

There was a movie called **21** that I saw during my college years. It was about a professor and some of his students counting cards in Vegas. In one scene, the professor poses the Monty Hall Problem to his class (although he called it the ‘game show host’ problem). One student verbalizes the correct probabilities of each choice and ends up being one of the students that helps the professor win big money in Vegas. After watching this movie, I found the problem intriging and decided to implement it in a small python program. The program allows the user to play the game as many times as they wish and it keeps track of their results. The best way to visualize the results for the best selection is to either stay every time or switch every time.

The game requires two inputs for one round to be played. You must first pick a door, then you must decide to stay with your original door or to switch to the other remaining door. I played the game 100 times with the following results:

My implementation in my python script uses a while loop until the user decides to exit by entering invalid input. The correct door is randomized each time using the random module. The door that is revealed is also randomized if there are two doors for the host to choose from. My program is slightly unkempt but it works. I use a lot of if, elif, else statements for the logic of the program. I also keep track of important stats like number of stays, number of switches, number of wins, and number of losses. I use print() quite a bit as well as a few display functions for printing the door images to the screen.

My python script can be found on GitHUb.

## Conclusion

Given the constraints of the problem, you should **always** switch.

If the problem changes like it does it other variations, your strategy might also change. Some variations include Monty flipping a coin to determine which door to open. Another variation is Monty always opening the door on the right when given the opportunity to pick between two losing doors. Stil other variations increase the total number of doors and each variation of that changes how many doors are opened by the host before the contestant switches.

Here is a fun article regarding increasing the number of doors, *d*, that our host offers the guest. Link to Article