Thursday, November 29, 2007

Monty Hall Problem

Wow. I teach Bayes' Rule today in class, and specifically use the example of Monty Hall gameshow, and what shows up on Digg.com but a 5-minute video explaining it.



You can formally show this using Bayes' Rule, which is somewhat more satisfying to me personally than the above video. There are three doors: Door 1 (D1), Door 2 (D2) and Door 3 (D3). The probability that a car is behind one of those doors is Pr(D1)=Pr(D2)=Pr(D3)=1/3. Monty Hall, the gameshow host, asks you to pick a door and you pick D1. Monty Hall knows which door has the car and which does not, and he then immediately opens D3, which does not have a car. He has to open the door without a car, by the way. Had a car been behind D3, he would've opened D2. If neither door has a car, then he can open either one. He has then eliminated D3, and now it's just down to D1 and D2. He says to you that he is willing to let you switch doors, if you so desire. But should you? Intuitively, at first glance, it seems like you shouldn't. After all, 2 doors, 1 prize, aren't my chances 50/50 either way? So I can switch if I want, but I have no compelling reason to, right?

Wrong. You should switch doors. Always. Bayes' Rule shows you this formally. The probability that D1 (the door you picked) is the correct door in light of B (ie, Monty opening the door) is based on the definition of conditional probabilities and independent events. It is written as:
Pr(D1|B)=Pr(B|D1)Pr(D1)/Pr(B)
We can fill in all the values and find the answer. Pr(B)=.5, because he either had to open Door 2 or Door 3. Pr(B|D1) needs a little unpacking. What is the chances that he would open door 3 if my door, door 1, held the car? Well, that also is 1/2, because if I'm holding the right door, then he's got two empty doors, and can choose either one. So Pr(B|D1)=.5 as well. That leaves just Pr(D1), and we said earlier that Pr(D1)=Pr(D2)=Pr(D3)=1/3. So inserting those values, you get:
Pr(D1|B)=(.5x.33)/.5=.33
Or 33%. There's a 33% chance, after seeing door 3 open and finding nothing, that you're holding the right door. But there's only one door left, because we now know with certainty that the car was not behind door 3. Therefore you might already see that door 2 is going to have to take up the slack in the sum of the probabilities by taking on a value of 2/3. But let's see it using Bayes' Rule.
Pr(D2|B)=Pr(B|D2)Pr(D2)/Pr(B)
. Again, we know that Pr(D2)=1/3 and Pr(B)=1/2 for the same reasons as before. What about that strange conditional probability, though, Pr(B|D2)? To put that into words, what's the likelihood that he opened door 3 if door 2 had the car? Think about it. He opens door 3 because he cannot open the door with the car, and he had to choose between door 2 and door 3 because you had already taken door 1. The answer is 1 - he had to choose door 3, if the second door has the car. He had no choice. Therefore the Pr(B|D2) conditional probability is equal to 1. Substituting that into Bayes' theorem and you get
Pr(D2|B)=(1x1/3)/.5=2/3
So should you or should you not switch doors? The answer, as the video showed, is that you should always, always, always switch. The chances are much better for you to be picking the right door if you switch.

It's not obvious to most people, not even to most statisticians, when they first hear this problem explained. But it's true. And you can see it if you run Monte Carlo simulations, too. 2/3 of the time, the other door is the right door.

2 comments:

Matthew Pearson said...

Man, I've had a ball trying to convince people of this. The most convincing way I have found is to consider this situation where there are 1000 doors. There's one car and 999 goats. You pick door #37. Monty then opens all of the doors except #492 and #37, the one you picked. Now do you still have a 50/50 chance, or do you want to switch? It's all about Monty having info you don't. It's obvious in the 1000 door case, not so much in the 3 door case.

scott cunningham said...

We ended up talking about Deal or No Deal a lot today in class. It seems like, at the very least, that if you get down to 3 suitcases, where 1 has a million and the other two have the low amount, and you pick a suitcase and still have your suitcase, then you should definitely switch suitcases. That's the only time I've thought that there's something other than a reservation utility driving your picking of suitcases in DOND.