Monday, January 15, 2018

The Monty Hall Problem, Bayes Theorem, and a fault in Numberphile

I watch a lot of educational videos on YouTube, in particular the awesome channel Numberphile.  I recently saw their video on the Monty Hall Problem, and was kind of disappointed at what seemed to be a rather pointless calculation that didn't really show the result, and instead showed something that was already kind of obvious.

The video can be found here and explains everything, but let me explain it again for completeness.



The Monty Hall Problem is a classic apparent paradox in probability, named after gameshow host Monty Hall from Let's Make a Deal.  In the show, the contestants are shown three doors and told behind one of the doors is a brand new car.  Behind the other two doors are "worthless" prizes; anything works, but traditionally the problem says the other two doors hold goats.  The player gets to pick any of the three doors, and whatever is behind the door is what they win.  If they pick right they get a car, otherwise they get a goat.

To add tension, after the contestant picks, Monty Hall would walk to another door, a door that the player did not pick, and show them what was behind it.  And look!  It's a goat!  The car is still out there!

In the Monty Hall Problem (not necessarily the show), Monty then asks if the contestant would like to change their mind.

The question is, what is the probability of the player guessing correctly if they swap their pick?

The answer is quite obviously $\tfrac{1}{2}$, or 50%.  Except that isn't the correct answer, and the probability of winning if you switch is actually much higher.  It's actually $\tfrac{2}{3}$ probability, or 67%, if you switch.  But why?



The common explanation on the web goes like this:

When you first picked a door, each of the doors had a $\tfrac{1}{3}$ chance of being the door with the car.  Let's say you pick Door #1.  Then Door #1 has a $\tfrac{1}{3}$ chance of being right; the two doors you didn't pick, #2 and #3, have a combined probability of $\tfrac{2}{3}$ of holding the car.  What is very important is that Monty will always show you a goat; he will never, ever open a door with a car mid-game.  When he then opens, say, Door #2 to show a goat, the probability of the goat being behind Doors #2 or #3 still have a combined probability of $\tfrac{2}{3}$, except now the option of #2 has been eliminated, so  all that probability gets concentrated into Door #3.  Thus Door #3 has a 2/3rds probabiltiy of being right.

It makes sense, and the Numberphile video illustrates it clearly.

But I've never really liked that explanation.  I never liked it because it isn't math.  There's no probability.  Prove it to me with equations..

I was initially very excited for the Numberphile video, as the title said it had extended math.  However, the extended math in the video only goes to prove that the door you picked, Door #1, still has a $\tfrac{1}{3}$rd chance of being right after Door #2 is opened, and then alludes to the above argument about probabilities condensing for the rest of its point.

However, the mathematical idea shown in the video actually lends to better solution, and that's what I'm going to show you now.

First, a note on Conditional Probabilities.

A conditional probability, in words, is the probability of one thing given that another thing is already known.  It explains how chances change based on additional information.

For instance: the probability of a dying from a heart attack may be 50%; this is for any random person in the population.  But, if you tell me your race, then I can give you an even better estimate; for certain races the chances may be as low as 20%, or for other races as high as 70%.

Another instance: the probability of rolling 12 on two cubic dice is 1/36; but if I know that the first die was a 6, then the probability of a 12 given that information is only 1/6; and if the first die was a 3, then the probability of a 12 given that information is 0.

We express conditional probabilities as follows
$$\Pr(A | B),$$
which we read "probability of $A$ given $B$", where $A$ is one event and $B$ is another event.  An "event" in probability might be having a heart attack, being a specific race, or rolling a 3.

Consider two events, $A$ and $B$.  What is the probability of both $A$ and $B$ happening?  We write this as
$$\Pr(A \& B).$$
Consider an example: what is the probability that you will ($A$) have red hair and ($B$) have freckles?

In order to have red hair and freckles, first you have to have red hair.  So we start with $\Pr($A$),$ the probability you have red hair.

Then we need to include something about freckles.  But we can't just include $\Pr(B)$, the overall probability of having freckles.  We're limiting our scope to just redheads, and the probability of a redhead having freckles is much higher than the probability of someone in the general population having freckles.  Considering everyone in the globe, the probability of freckles $\Pr(B)$ is way less than 10%; but amongst redheads, the probability of freckles is 50%, or higher.   The last probability is what we really want to consider; the probability of having freckles given that you have red hair, $\Pr(B|A)$.



So we start by limiting our sample space down to just redheads, then we further refine that sample space down to the redheads who also have freckles: that is
$$\Pr(A\& B) = \Pr(A) \cdot \Pr(B|A).$$
Well, with a little thought, we could have considered this a different way, starting with people with freckles and then narrowing down just to redheads with freckles and we should have gotten the same number.  So
$$\Pr(A \& B) = \Pr(B) \cdot \Pr(A|B).$$
And equating these two,
$$\Pr(A) \cdot \Pr(B|A) = \Pr(B) \cdot \Pr(A|B).$$
With some rearrangement we get the infamous Bayes Theorem,
$$\Pr(A |B) = \frac{\Pr(B|A)\cdot\Pr(A)}{\Pr(B)}.$$
This simple rule helps you find conditional probabilities.  It also allows you to reconsider options when presented with new information.  If you are trying to guess about $A$, then at first you assume $\Pr(A)$.  But, as you learn about $B$, you can use knowledge of $B$ to now refine your initial guess to $\Pr(A|B)$.

A more sophisticated version of Bayes Theorem is used often in scientific research and in economic planning and other fields to make complicated predictions using probability.  One example: when the weather station tells you that there is a 67% chance of rain, what they are really telling you is that given the current conditions and given what we have seen in the past, there is a 67% chance of rain.  They rely on Bayes Theorem for this.

Anyway, back to Monty Hall.

Suppose you pick Door #1.  I am going to refer to this event as $Y=1$.  Monty Hall then comes over, and shows you that behind Door #2... it's a goat!  I will call this $G=2$.  (It is important to note that it doesn't matter whether Monty shows you Door #2 or Door #3 -- just swap those numbers below.)  The Numberphile video calculated the probability that the car is behind Door #1 given the goat behind Door #2, but what we really want to know is the probability of the car being behind Door #3, since that's the one that's so confusing for people.

For completeness, let me first show you the probability of the car behind Door #1, as in the video.  I am going to call this $C=1$.

We want to know $\Pr(C=1|G=2,Y=1).$  To find this, from Bayes theorem, we need $\Pr(G=2|C=1,Y=1), \Pr(C=1|Y=1), \Pr(G=2|Y=1).$

For $\Pr(G=2|C=1, Y=1)$, that is, the probability that Monty shows you a goat behind Door #2 given that you guess Door #1 and the car is behind Door #1, this is 50%.  Since Monty has to show you a goat, he could have picked Door #2 or Door #3, and everything been the same.  So $$\Pr(G=2|C=1, Y=1) = \tfrac{1}{2}.$$
For $\Pr(C=1|Y=1)$, the probability that the car is behind Door #1 given that you picked Door #1, your decision doesn't influence where the car.  The car isn't moved based on where you pick or anything so this remains $$\Pr(C=1|Y=1) = \frac{1}{3}.$$
Lastly, $\Pr(G=2|Y=1)$, the probability you are shown a goat behind door #2 given that you picked Door #1.  Without any information about where the car is, we can't say anything about the two doors.  All we do know is that Monty can't show you the door you picked.  So we have to say either door is equally likely, and hence $$\Pr(G=2|Y=1) = \frac{1}{2}.$$
If we put this into Bayes Theorem
$$\Pr(C=1|G=2,Y=1) = \frac{\Pr(G=2|C=1,Y=1)\cdot\Pr(C=1|Y=1)}{\Pr(G=2|Y=1)} = \frac{\tfrac{1}{2} \cdot \tfrac{1}{3}}{\tfrac{1}{2}} = \frac{1}{3}.$$
That's what the Numberphile video shows, and since the only other door is #3, and since the probabilities must sum to 1, then $Pr(C=3|G=2,Y=1)$ must be the remaining 2/3rd.

But let me show you more clearly using Bayes Theorem again.  This time I will calculate the probability of the car being behind Door #3, given that we picked Door #1 and Monty showed us Door #2.

We want to know $Pr(C=3|G=2,Y=1),$ and we need $\Pr(G=2|C=3,Y=1), \Pr(C=3|Y=1), \Pr(G=2|Y=1).$

For $\Pr(C=3|Y=1), \Pr(G=2|Y=1)$, things are just like before.  Your guess doesn't affect where the car is, so $$\Pr(C=3|Y=1) = \frac{1}{3},$$ and just given your guess either other door is equally likely to have a goat, so $$\Pr(G=2|Y=1) = \frac{1}{2}.$$
Lastly consider $\Pr(G=2|C=3,Y=1),$ the probability that Monty showed you a goat behind Door #2 given that you picked Door #1 and the car is behind Door #3.  This is the most important puzzle piece.  Monty's decision of doors actually gives you information.  Remember that Monty he has to show you a door with a goat, and he won't show you the door you picked.  Therefore, given that we picked #1 and #3 has the car, this is the only door Monty can show you.  So $$\Pr(G=2|C=3,Y=1) = 1.$$
Using Bayes theorem,
$$\Pr(C=3|G=2,Y=1) = \frac{\Pr(G=2|C=3,Y=1)\cdot\Pr(C=3|Y=1)}{\Pr(G=2|Y=1)} = \frac{1 \cdot \tfrac{1}{3}}{\tfrac{1}{2}} = \frac{2}{3}.$$
We just proved the solution to Monty Hall Problem using Bayes Theorem.  If you pick Door #1, and Monty shows you the goat behind Door #2, then the probability of the car being behind Door #3 is 2/3.  It is not 1/2, as you might think.

2 comments:

Anonymous said...

I remember when the Monty Hall Problem was first posed to me and I thought there was no difference in the choice, just going on what I thought was common sense. It is somewhat of a meditation to delve into and to realize that at the beginning all three doors do have an equal probability and our minds want to regard that probability as unchanging as if that probability is an almost a frozen attribute of each door. But when more information is given that equality of probability falls apart. And we must recognize that. In all sorts of problems like this. Actually, in all areas of life.

Anonymous said...

I think the reason that this so-called problem or paradox causes so much head-scratching is because there are actually two games and mixing the probabilities together leads you into error:

GAME 1: can the contestant pick the car when there are 3 doors (they have a 1/3 chance). If they do, the 3 door game ends. If they don't, then Monty removes a door and game 2 (a 2 door game) begins.

GAME 2: can the contestant pick the car when there are two doors (they have 1/2 chance, not a 2/3 in chance).

What I find funny is that the "switch is better" argument point to simulators to prove that if you stick with your "first" choice then you can only ever have a 1/3 chance of winning the car, but if you switch you will have a 2/3 chance. The former is correct. The latter is nonsense because you are calculating the 1/3 chance on the basis that there are 3 doors, but at the point you are asked to "switch or stay" there are only two.