|
Imagine you were on a game show where you were presented with 3 doors. Behind one of the doors was a prize and behind the other two were goats (please note, you don't get to keep the goat, its a symbolic way of saying you've picked the wrong door).
You have no idea which door the prize is behind, but the game show host does. You are asked to pick a door and then the host opens one of the two doors that you didn't pick. The host never opens the door with the prize behind it, only a door with a goat behind it.
So now there are two doors left, the one you selected and the one that has not been opened. You are given the option to either open the door you've already selected or switch your choice and open the other door instead. Which door should you open?
A Formalism for Calculating Probabilities
First let's say the probability that A will occur given some prior information can be denoted P(A|I). Let's denote "the probability that A and B will occur given some prior information" by P(A,B|I).
At this point you may be asking what "Prior Information" means. In this context it means things you know, like for instance we all know that a coin has two sides and a fair coin has an equal chance of coming up heads or tails. In our notation we would right the probability of heads as:
P(Heads|Information)=P(H|I)=1/2
Similarly the probability of tails is:
P(Tails|Information)=P(T|I)=1/2
And the probability of flipping a heads and a tails (in succession):
P(H,T|I) = P(H|T,I) x P(T|I) = P(H|I) x P(T|I) = 1/2 x 1/2 = 1/4
Note in that last step we used the product rule of probability. Since the probability of getting heads doesn't depend on whether you got tails the previous throw, P(H|T,I) = P(H|I). Also keep in mind that:
P(H|I) + P(~H|I) = P(H|I) + P(T|I) = 1
Where ~H means "not heads". This is known as the sum rule. From the Product Rule and the Sum Rule we can derive a useful equation, consider:
P(X,Y|I) = P(Y,X|I) (this is true since A and B is the same as B and A)
and noting that:
P(Y,X|I) = P(Y|X,I) x P(X|I)
we get:
P(X,Y|I)=P(Y|X,I) x P(X|I)
we also know from the product rule:
P(X,Y|I) = P(X|Y,I) x P(Y|I)
if we combine the two equations we get:
P(Y|X,I) x P(X|I) = P(X|Y,I) x P(Y|I)
Solving for P(X|Y,I) we get:
P(X|Y,I) = [P(X|I) x P(Y|X,I)]/P(Y|I)
That final result is known as Bayes' Theorem and is a very useful equation for solving probability problems.
Back to the Three Doors Problem
So let's use Bayes' Theorem to calculate something simple first, just so you get a feel for it. We'll calculate the probability that we flip a coin and get heads given that we just flipped the coin a moment before and got tails plus our prior information that its a fair coin and we know how those are supposed to work. Using Bayes' Theorem we get:
P(H|T,I)= [P(H|I) x P(T|H,I)]/P(T|I) = [(1/2) x (1/2)] / (1/2) = 1/2
which makes sense since we should expect P(H|T,I) = P(H|I) = 1/2 since a fair coin's result doesn't depend on its previous result.
So let's apply it to the three doors problem. First define the probabilities of opening door 1, 2, or 3 (the first part of the game where you select a door).
P(Select Door 1|Information)= P(SD1|I)=1/3
P(SD1|I) = P(SD2|I) = P(SD3|I) = 1/3 (basically, you have equal odds for each door)
Now let's figure out the odds of the host opening a door given your selection and the location of the prize. For convenience, and since the problem is symmetric, lets pick door number 1 as our selected door.
Scenario 1, the door with the prize is door 1
P(Opened Door is 1|Selected Door is 1, Prize Door is 1, I) = P(OD1|SD1,PD2, I) = 0 (remember, the host won't open the door you picked or the door with the prize)
P(OD2|SD1,PD1,I) = 1/2 (the host can choose either of the doors you didn't pick)
P(OD3|SD1,PD1,I) = 1/2 (the host can choose either of the doors you didn't pick)
Scenario 2, the door with the prize is door 2
P(OD1|SD1,PD2, I) = 0 (remember, the host won't open the door you picked)
P(OD2|SD1,PD2,I) = 0 (the host won't open the door with the prize behind it)
P(OD3|SD1,PD2,I) = 1 (this is the only door in this scenario the host can open)
Scenario 3, the door with the prize is door 3
P(OD1|SD1,PD3, I) = 0 (remember, the host won't open the door you picked)
P(OD2|SD1,PD3,I) = 1 (this is the only door in this scenario the host can open)
P(OD3|SD1,PD3,I) = 0 (the host won't open the door with the prize behind it)
So let's use Bayes' Theorem to calculate the probability that the prize is behind door number 1 given that you selected door number 1 and the host opened door number 2.
P(PD1|SD1,OD2,I)= [P(PD1|I) x P(SD1,OD2|PD1,I)] / P(SD1,OD2|I)
= [P(PD1|I) x P(OD2,SD1|PD1,I)] / P(OD2,SD1|I)
= [P(PD1|I) x [P(OD2|SD1,PD1,I) x P(SD1|PD1,I)]] / [P(SD1|I) x P(OD2|SD1,I)]
= [ (1/3) x (1/2) x (1/3) ] / (1/3) x (1/2) = 1/3
Now lets calculate the probability that the prize is behind door number 3 given that you selected door number 1 and the host opened door number 2:
P(PD3|SD1,OD2,I)= [P(PD3|I) x P(SD1,OD2|PD3,I)] / P(SD1,OD2|I)
= [P(PD3|I) x P(OD2,SD1|PD3,I)] / P(OD2,SD1|I)
= [P(PD3|I) x [P(OD2|SD1,PD3,I) x P(SD1|PD3,I)]] / [P(SD1|I) x P(OD2|SD1,I)]
= [ (1/3) x (1) x (1/3) ] / (1/3) x (1/2) = 2/3
So there you have it, if you selected Door 1 and the host selected Door 2 then you have a 66% chance of winning if you switch your choice of doors and a 33% chance if you stick with your original choice of door.
I believe it, it makes sense
If that makes sense to you, great, you see how useful Bayes' Theorem is for calculating probabilities.
I'm having a tough time believing it, it doesn't make sense
If you have your doubts, that's understandable. You may mistakenly believe that when the host has eliminated the door that the odds have become 1/2 and 1/2, not 1/3 and 2/3. That's understandable, but it is wrong, the correct answer is 1/3 and 2/3.
Think about it this way, instead of thinking of it as the odds of each door having the prize, think of it as the odds of the door having or not having the prize. If there are three doors, the odds are:
Selecting Prize = 1/3
Not Selecting Prize = 2/3
Just because the host has eliminated one of the doors, those odds haven't changed, because you made the choice when there were three doors. Thus you're better off switching because you're sitting with the door with the 1/3 odds while the other has 2/3 odds.
What if, instead of 3 doors, there were 1000 doors? You select a door at random (1/1000) and then the host opens 998 doors leaving only yours and another door of his choosing not opened. Which door do you want, the one you picked at random, or the one the host left unopened? I'd take the one the host left unopened.
Why Use Bayes' Theorem?
The strength of Bayes' Theorem is you just identify your probabilities and calculate. You don't have to "figure it out". You can calculate and then reconcile yourself with the answer afterwards. It's a very useful tool, especially when the probabilities get complicated and our intuition fails us.
Ok, that's all for now. Special thanks to the following websites:
http://mathforum.org/dr.math/faq/faq.monty.hall.html
http://en.wikipedia.org/wiki/Monty_Hall_problem
http://en.wikipedia.org/wiki/Bayes'_theorem
Until next time.
Technorati Profile
|