Login | Register

Roger's Equations

This blog features weekly an equation, formula, or constant that occurs frequently in Engineering or Science. I will try to present the subject matter in a nonformal, conversational style that can be easily followed. Criticism and corrections are encouraged, as are suggestions for future discussions.

Previous in Blog: Multipole Expansion   Next in Blog: Phi - The Golden Ratio Part I
Close

Comments Format:






Close

Subscribe to Discussion:

CR4 allows you to "subscribe" to a discussion
so that you can be notified of new comments to
the discussion via email.

Close

Rating Vote:







22 comments

The Three Doors Problem

Posted October 23, 2007 12:00 AM by Roger Pink

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


Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 10330
Good Answers: 207
#1

Re: The Three Doors Problem

10/23/2007 4:52 AM

This is an old chestnut...it's even been on CR4 B4.

I just don't buy it... If you say that all the messing about with eliminating one door was done with you even knowing, the problem then becomes a straight 50-50 chance.

e.g Say the first part is done with Fred who is then sent off... Jim comes in and the presenter says... '2 doors one car Fred chose that one...which do you want?'

Freds choice is completely irrelevant to the question (doubly so if Jim was completely unaware of the 3rd door and all the messing about).

I think it is straight 50-50..... It's about time someone did a big enough 'real trial' or simulation to prove it one way or another... It must be simple enough.

(If you don't like my analysis I'll arm wrestle you for it! )

Del

__________________
health warning: These posts may contain traces of nut.
Guru

Join Date: Mar 2007
Location: Etherville , U.K.
Posts: 9863
Good Answers: 47
#2
In reply to #1

Re: The Three Doors Problem

10/23/2007 6:37 AM

If you don't mind pigs, look here.

Let's say you're always going to swith doors. You have a 1/3 chance of initially selecting the prize, and so ending up a loser when you switch. Thus you have a 2/3 chance of not being a loser. Still, I can't argue with Rogers elegant statistical analysis.

__________________
...be afraid, be very afraid!
Guru

Join Date: Mar 2007
Location: Etherville , U.K.
Posts: 9863
Good Answers: 47
#9
In reply to #1

Re: The Three Doors Problem

10/24/2007 4:22 AM

Monty's chestnuts !

__________________
...be afraid, be very afraid!
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 10330
Good Answers: 207
#3

Re: The Three Doors Problem

10/23/2007 6:58 AM

I s'pose pragmatically the answer is to swap...'cos if it's 50/50 it doesn't mater.. but if its 2/3 1/3 then it is worth doing... so swapping is a no lose.

(Arrrgh no... I said 'pragmatically'... next thing you know I'll be saying 'mind set' and rubbish like that...)

__________________
health warning: These posts may contain traces of nut.
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 10330
Good Answers: 207
#4

Re: The Three Doors Problem

10/23/2007 7:03 AM

Hmm... yes I've just spent some time re-reading the post... and it does seem to deal with the prior knowledge and any other of my objections. So I believe I believe the maths now..... (as convinced as that eh?)

(I've also seen Roger's pic in the avatar and am withdrawing the offer of an arm wrestle )

Del (maybe I can't do the maths ..but I can appreciate it )

__________________
health warning: These posts may contain traces of nut.
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 1537
Good Answers: 41
#7
In reply to #4

Re: The Three Doors Problem

10/24/2007 4:12 AM

For a quick intuitive reality check: suppose there are 100 doors; you pick one; the host then reveals 98 goats; now: are you better sticking with your original 1/100 chance or switching the the one remaining door.

__________________
The early bird catches the worm, but, look what happens to the early worm: Alfred E. Neuman
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 10330
Good Answers: 207
#8
In reply to #7

Re: The Three Doors Problem

10/24/2007 4:22 AM

I like it... but would counter by asking.

For a quick intuitive reality check: suppose there are 100 doors; you pick one; the host then reveals 1 goats; now: are you better sticking with your original 1/100 chance or switching to one of the remaining doors?

__________________
health warning: These posts may contain traces of nut.
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 1537
Good Answers: 41
#10
In reply to #8

Re: The Three Doors Problem

10/24/2007 4:40 AM

Very slightly better to switch (1/100 versus 99/100 X 1/98). Try 4 doors and one goat revealed: if you "stick" your chances are 1/4 if you switch they improve to 3/8 (3/4 X 1/2).

__________________
The early bird catches the worm, but, look what happens to the early worm: Alfred E. Neuman
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1398
Good Answers: 20
#11
In reply to #10

Re: The Three Doors Problem

10/24/2007 4:48 AM

How about this. Three doors. Someone else chooses the first door. The host opens the a goat door. Now you are brought out and you get the option to choose the picked door or choose the unpicked door. You weren't involved in what happened before you came out, let's say you don't even know what happened. Here's your door, do you want to switch or keep? Is this not a 50/50 chance?

__________________
In the really big picture, we are but brief diversions on the arrow of entropy.
Guru

Join Date: Aug 2005
Location: Hemel Hempstead, UK
Posts: 1537
Good Answers: 41
#12
In reply to #11

Re: The Three Doors Problem

10/24/2007 5:31 AM

Is this not a 50/50 chance?

Not if the host always reveals a goat: it doesn't matter how the original selection was done there was a 1/3 chance of the prize, and, there is a 2/3 chance of the prize behind the remaining 2 doors; the host has eliminated one, leaving one which "keeps" the 2/3 probability of being correct.

Suppose someone else chose a door; you were then given the opportunity of sticking with their choice or choosing both the other two.

let's say you don't even know what happened. Here's your door,

OK: you have to know that "your door" was the one originally chosen by the other guy, and, that the goat was revealed deliberately by the host.

__________________
The early bird catches the worm, but, look what happens to the early worm: Alfred E. Neuman
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1398
Good Answers: 20
#13
In reply to #12

Re: The Three Doors Problem

10/24/2007 6:58 AM

Ok, if I frame it in the negative, like the host ensures I have two chances to not pick the wrong one and the only way I can avail myself of the opportunity his knowledge creates for me to get the prize is to change my second choice, then it makes sense to me. I have to change in order to cooperate with the statistical advantage the host is creating by always eliminating one goat.

Sometimes although, yeah I see the numbers but, I also have to see it in the context of a "word problem" in the manner in which my mind works in order to get full agreement in my mind.

__________________
In the really big picture, we are but brief diversions on the arrow of entropy.
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1398
Good Answers: 20
#5

Re: The Three Doors Problem

10/24/2007 2:27 AM

It seems to me it depends on whether you believe that the two choices couple or not. Aside from what you may be able to configure the math to say, it looks like two independent choices. If you stay with your first choice you are choosing one of two same as if you choose the one of two that you didn't initially pick.

Here's what I would do. I would get tapes of 100 prior shows and study the hosts body language in an attempt to discern any consistent cues that he unconsciously emotes based on the actual outcomes and then use that information to hedge my chances. Sometimes a little social engineering can help you beat the statistical odds.

__________________
In the really big picture, we are but brief diversions on the arrow of entropy.
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1398
Good Answers: 20
#6
In reply to #5

Re: The Three Doors Problem

10/24/2007 3:38 AM

Further thoughts make me think that the apriori knowledge of the host always decouples the first choice and reduces the second choice to a one of two 50/50 choice. If the host didn't know then it wouldn't interfere with the odds but then it would change the nature of the game since one out of three times the host would open the door with the prize.

I realize that the odds are that I am wrong, but I'll play the devil's advocate here. It seems the first choice only serves to build anticipation. The host's choice forces the odds in the final choice.

Has anyone actually tabulated the results on the show to determine what happened over time?

__________________
In the really big picture, we are but brief diversions on the arrow of entropy.
Guest
#14
In reply to #6

Re: The Three Doors Problem

10/24/2007 9:45 AM

Seems logical.

However, could this be applied to the game show Deal or No Deal.

Where if you got down to the last case. Should you take the option to switch your original case for the last one?

Commentator

Join Date: Sep 2007
Location: Scotland
Posts: 97
Good Answers: 2
#19
In reply to #14

Re: The Three Doors Problem

12/06/2007 3:00 AM

I've been thinking about this problem while reading this thread and think that the answer is yes. Not sat down and gone through it yet but pretty sure you should.

__________________
Stress? That's what you get when you do something interesting and worthwhile; if you can't handle it get out of the gene pool.
Power-User

Join Date: Dec 2006
Posts: 294
Good Answers: 21
#15
In reply to #6

Re: The Three Doors Problem

10/24/2007 10:46 AM

rcapper,

This problem fascinates me just because the correct answer is non-intuitive. Here in the US there is a woman named Marilyn vos Savant, who supposedly has the highest recorded IQ, and has a column in a newspaper magazine. When posed this question she answered the same as the original poster, your odds double by switching. You can read about it here:

http://barryispuzzled.com/zmonty

She received a lot of mail including letters from professors saying she was wrong, and how this points out the ignorance of the public etc.

I still had problems with it, so I wrote a little program to simulate it.

Yup, switching doors definitely doubles the odds to 0.67, just as the others have stated.


Tad

Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1398
Good Answers: 20
#18
In reply to #6

Re: The Three Doors Problem

10/24/2007 3:39 PM

It occurs to me that the results would be the same if the knowledge of the door with the prize were kept from the host. If he were only informed of the door that was certain to have a goat, then the same statistical information is communicated to the contestant. Though somewhat interesting probably this isn't relevant because the knowledge of the location of the prize is known by the host's informant but say the host chose randomly then it would create a new situation with a sub-branch in the possible outcome. Just thinking out loud.

But the key is that for the contestant to benefit from the signaling of statistical information he must act subsequent to receiving that signal due to the remaining lesser uncertainty transmitted by the communication, in order to improve his odds.

Thereby the contestant is assured that one of his two choices out of three will be correct. And statistically the second one is biased due to the consistent elimination of one bad choice by the host.

__________________
In the really big picture, we are but brief diversions on the arrow of entropy.
Member
United States - Member - New Member Engineering Fields - Electrical Engineering - New Member Fans of Old Computers - Altair 8800 - Long time Computer Geek

Join Date: Oct 2007
Posts: 6
#16

Re: The Three Doors Problem

10/24/2007 10:55 AM

The key fact in this problem is wether the host ALWAYS opens a door, or if he has the choice. If the host always opens a door, then you do better switching. If the host is given some choice in the matter, then how he make that choice has a big impact in the answer. The problem as stated has him always open. Peoples gut reaction is to think he has the choice and that he is out to trick you into losing.

Guru

Join Date: Aug 2007
Posts: 563
#17

Re: The Three Doors Problem

10/24/2007 3:19 PM

i now know how successfull gamblers make that fortune

Power-User

Join Date: Mar 2008
Posts: 341
Good Answers: 1
#20

Re: The Three Doors Problem

03/14/2008 12:40 PM

With all the elegant mathematical theorem you can throw at it, it's still a coin-toss. Since all the host can do is eliminate a door (eliminate 1 of the 3 chances, making it a one or the other chance), the number of times you get to chose is statistically irrelevant. Add an infinite number of doors, the equation is the same in the given parameters...it all ends up as a coin toss. Only our anticipation makes it any different.

Now, if we added a third degree transcendental L-function into the equation...that might yield different results!...Ok, just heard about that today and have no idea what an L-function is other than it's related to relating different areas of Mathematics.

Power-User

Join Date: Mar 2008
Posts: 341
Good Answers: 1
#21
In reply to #20

Re: The Three Doors Problem

03/14/2008 1:01 PM

And, running 100 simulations with the pig test....Roger is proven right, and it just goes to show I'm not much of a mathematician.

100 staying with the same door, 33/100

100 switching doors, 70/100

Though the statistical sample was small, it proves two things...One, Roger has a much better grasp on this that we gave him credit for, and two, I'm an idiot (though that was never really in doubt, ask either ex)

The Engineer
Engineering Fields - Engineering Physics - Physics... United States - Member - NY Popular Science - Genetics - Organic Chemistry... Popular Science - Cosmology - New Member

Join Date: Feb 2005
Location: Albany, New York
Posts: 3557
Good Answers: 81
#22
In reply to #21

Re: The Three Doors Problem

03/25/2008 3:15 PM

Thanks for the research. I appreciate you posting the results and I understand your reaction.

The first time I heard this I didn't believe it either. It was only after I did the math, and looked at it for a while that I found a way to think about it that made sense to me. It really showed me how valuable Bayes Theorem can be.

__________________
Cause you said the brains I had went to my head
22 comments
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Copy to Clipboard

Users who posted comments:

Del the cat (4), Guest (1), Kris (2), Philo (1), Randall (3), rcapper (5), Richard_Damon (1), Roger Pink (1), Tad (1), tomkaighin (2), vikas (1)

Previous in Blog: Multipole Expansion   Next in Blog: Phi - The Golden Ratio Part I
You might be interested in: Doors, Power Transformers, Video Cameras