# Monty Hall - A bayesian approach

I remember watching the movie 21 growing up and being completely stunned by one of the opening scenes. The protagonist, Ben, is given a problem - the gameshow problem as they call it in the movie. Here’s how the game works, Ben plays the role of a game show contestant, presented in front of him are three doors A, B, and C. He is told that behind two of the doors are goats, but behind one of the doors is a fancy sports car, and if he guesses the door with the car he gets to keep it! Ben chooses door A, but now comes the twist, before it is revealed what is behind Ben’s door, the gameshow host reveals that behind door B is a goat. Now the host asks Ben if he wants to switch to door C. What would you do in this situation?

In the movie, the Ben, instantly accepts the option to switch, claiming he now gets better odds from switching. But why? There was seemingly a one in three chance of picking the car in the beggining - what changed? To quote Ben, everything.

In the movie this was called the game show problem, but it is perhaps better known as the Monty Hall problem, and it actually has quite an interesting history. It gained notoriety after a newspaper columnist Marilyn Vos Savant posed the question in her column, “Ask Marilyn”. Vos Savant claimed that switching would give a \(\frac{2}{3}\) chance of getting the car, whereas staying with the same choice yielded only \(\frac{1}{3}\) chance.

This was very controversial at the time, many readers refused to believe that switching changed the odds. Nearly 1,000 people with PhDs wrote in claiming that vos Savant was wrong. Even my favorite mathematician, Paul Erdős, one of the most prolific mathematicians in history, remained unconvinced until he was shown a computer simulation. Suffice it to say, this is an unintuitive result, so don’t despair if you thought that there was no difference - you’re in good company. I think one of the easiest ways to understand why the odds change is through using Bayes’ theorem

Let’s start by breaking this problem down to it’s basics. To steal some terminology from Richard McElreath, we’re going look at the garden of forking data, which is to say - all the possible outcomes.

Suppose we chose door A. The game show host knows what’s behind each door, so he’s not going to reveal the door with the car behind it. Therefore, we know the following: \[ \small \begin{array}{l} Pr(\text{open door B | car is behind B}) = 0 \\ Pr(\text{open door C | car is behind C}) = 0 \end{array} \]

We also know that if there’s a goat behind our door, door A, then the gameshow host only has one option to pick the other door with a goat. This is because he can’t choose our door, and he’s not going to open the door with the car in it. \[ \small \begin{array}{l} Pr(\text{open door B | car is behind C}) = 1 \\ Pr(\text{open door C | car is behind B}) = 1 \end{array} \]

Lastly, if the car is behind door A, then it doesn’t matter which door the host chooses, so we can say that: \[ \small \begin{array}{l} Pr(\text{open door B | car is behind A}) = \frac{1}{2} \\ Pr(\text{open door C | car is behind A}) = \frac{1}{2} \end{array} \]

Now we have all the information that we need to solve this problem, I’m going to put everything we worked on down below in a slightly different order. Hopefully this will make it easier to visualize that we’ve covered all the possible outcomes. \[ \small \begin{array}{l} Pr(\text{open door B | car is behind A}) = \frac{1}{2} \\ Pr(\text{open door B | car is behind B}) = 0 \\ Pr(\text{open door B | car is behind C}) = 1 \\ Pr(\text{open door C | car is behind A}) = \frac{1}{2} \\ Pr(\text{open door C | car is behind B}) = 1 \\ Pr(\text{open door C | car is behind C}) = 0 \\ \end{array} \]

With that, we can now move on to using Bayes theorem to see whether or not we should switch doors. Recall that the general form of Bayes theorem states: \[ \small Pr(A|B) = \frac{Pr(B|A)Pr(A)}{Pr(B)} \]

Repurposing it for our problem here we have: \[ \small Pr(\text{car is behind A | open B}) = \frac{Pr(\text{open door B | car is behind A})Pr(\text{car is behind A})}{Pr(\text{open door B})} \]

Let’s start with numerator first. Well we’ve alread established above that \[ \small \begin{array}{c} Pr(\text{open door B | car is behind A}) = \frac{1}{2} \\ \text{and} \\ Pr(\text{car is behind A}) = \frac{1}{3} \end{array} \]

So now we have,

\[ \small Pr(\text{car is behind A | open door B}) = \frac{\frac{1}{2}*\frac{1}{3}}{Pr(\text{open door B})} \]

Now onto the denumerator, \(Pr(\text{open door B})\), is equal to the sum of all the possible ways that our gameshow host opens up door B, let’s take a look.

\[ \small \begin{array}{r} Pr(\text{open door B}) = Pr(\text{open door B | car is behind A})Pr(\text{car is behind A}) \\ + Pr(\text{open door B | car is behind B})Pr(\text{car is behind B}) \\ + Pr(\text{open door B | car is behind C})Pr(\text{car is behind C}) \\ \text{___________________________________________________} \\ = (\frac{1}{2} * \frac{1}{3}) + (0 * \frac{1}{3}) + (1 * \frac{1}{3}) \\ = \frac{1}{2} \end{array} \]

Now we can return to our initial equation and see that. \[ \small Pr(\text{car is behind A | open door B}) = \frac{\frac{1}{6}}{\frac{1}{2}} = \frac{1}{3} \]

So staying with door A only yields a 33.33% chance of having a car behind it. This means that there’s a 66.66% chance that the car is behind door C. Don’t take my word for it though, let’s calculate it out. We’ll use the same framework as before, only this time we’ll be calculating:

\[ \small Pr(\text{car is behind C | open door B}) = \frac{Pr(\text{open door B | car is behind C})Pr(\text{car is behind C})}{Pr(\text{open door B})} \] As we can see the denominator is the same as before, so that will be \(\frac{1}{2}\). However, the numerator is now equal to \(1 * \frac{1}{3} = \frac{1}{3}\). Therefore we have \[ \small Pr(\text{car is behind C | open door B}) = \frac{\frac{1}{3}}{\frac{1}{2}} = \frac{2}{3} \]

There you have it, switching doors doubles your chances of getting a car! I think this is a very fun way of understanding a problem that stumped many a mathematicians for quite some time. I hope you enjoyed!