Maths challenge No. 3

Page 6 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
Several people (in the last 15 posts or so) have asked for a program to prove this. A program was posted as well as the results of another program.

If you would like, I can post another program that verifys this. I don't think it is necessary, but I would do it if you would like.
 

Moonbeam

Elite Member
Nov 24, 1999
74,468
6,693
126
A program built on false assumptions yields false results. Build one that accounts for the two ways the doors can be eliminated if you pick a car and you'll get 50 50.
 

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
How is this for an algorithm for a program:

1. The computer randomly picks door (integer) 1, 2, or 3 to contain the car

2. the computer randomly picks a door 1, 2, or 3 for the players initial choice

3. the computer randomly picks a door (not the one containing the car) to "reveal"

4. the computer switches the humans choice to the remaining door and checks to see if the new door is the car.

5. record result and repeat for x number of times (does x=10,000 sound reasonable)

Is this what you mean by the right way to switch?
 

Moonbeam

Elite Member
Nov 24, 1999
74,468
6,693
126
Suppose that all three doors have goats. Then no matter which goat you pick, one or the other of the two will be thrown out and you will either keep a goat or switch to a goat. If goat 1 is thrown out, you will wind up with goat 2 or 3 an equal number of times 50 50 and so on if you pick goat 2 or 3. Substituting a car for a goat will do the same.
 

Dexion

Golden Member
Apr 30, 2000
1,591
0
76
Moonbeam: Your just confusing yourself even more! Your becoming way too logical that its illogical and no longer makes any sense. The fact is, theres only 2 goats and 1 car. It doesn't matter which goat you find, cuz the outcome will be the same if the process is repeated after a numerous amounts of time. The first attempt there is 1 car behind the 3 doors, 2 of them are goats. You can win the car on the first try! The puzzle is just one of the situations where a goat was picked on the first chance, doesn't mean that Monty will always get a goat on the first try. Just try to think simple.

Your analogy is right. Suppose goat 1 was picked and thrown out. You are left with goat 2 and 3. You either pick 2 and 3 out of the 3 goats. You picked out 2 goats out of the 3. Which means the same probability. 2/3! You cannot isolate the fact that you took a chance separate from the other. Infact, they have a direct relation no matter what.


heres a formula:

z=number of doors open
y=number of chances used
x=number of chances
n=number of doors left
chance #1 = x+y/n+z = 1+0/3+0 = 1/3 Chance of getting car
chance #2 = x+y/n+z = 1+1/2+1 = 2/3 Chance of getting car
chance #3 = x+y/n+z = 1+2/1+2 = 3/3 Chance of getting car

Get the picture? This is so simple now. The best I can explain it.







 

Moonbeam

Elite Member
Nov 24, 1999
74,468
6,693
126
Dexion, thanks for the advise. Nothing seems simpler that to say that no matter which door you pick one of the remaining two goat doors will be eliminated leaving you with a 50 50 chance of having picked the car. The problem only gets complex when you try to say that switching improves your odds. I don't see it and I see that when those who support switching didn't account in their odds the fact that if you pick the car in the first place there are two options to eliminate a goat, not one. Being able to eliminate one or the other goat means that you will switch to a goat twice as often an the switchers are accounting for. That's what I am trying to say. By the way, while you suggested that I think simple, I didn't understand your clarification at all. I laid out all the possible combination which should be what a correct program spitts out, or so I think.
 

Dexion

Golden Member
Apr 30, 2000
1,591
0
76
I completely understand your point. However, you just left out one essential key: Because you already took a chance on the first try, this adds to the results with the remaining 2 doors. Its not a 50%(1/2 or 50/50) chance after the first try because you already took a 33%(1/3) chance in the beginning, therefore your second chance is 2/3 because your taking a second chance on the remaining 2 doors. If you isolate the second chance ALONE, then your correct, its a 50 50 chance, but as I'm trying to tell you over and over again. You can't isolate it because the results is directly related to the fact that you took 2 chances and opened 2 doors none-the-less.

1/3 chance on the first try
2/3 chance on the second (2/3 chance is far better than a 1/2 chance)




 

Moonbeam

Elite Member
Nov 24, 1999
74,468
6,693
126
What you are saying then is that if you pick a goat monty throws out the other goat leaving the car to switch to and also that you pick a goat 2/3 of the time. If so, than I would have to say that sounds pursuasive. :D
 

Dexion

Golden Member
Apr 30, 2000
1,591
0
76
NO!! LOL Boy your confused bigtime.

OK.. forget the damn goats, the car and the switching!. Thats just making it confusing. Lets say theres nothing behind 2 doors, and 1 door leads to the toilet. That makes a total of 3 doors.

Letting you open 2 doors at the same time, whats your chance of finding the toilet?

Is it 2 out of 3 chances of finding a toilet? Yes or No?



-------------------------------------------------------------------------------------




Now, when you get the answer. Whats the difference between the Monty problem and the toilet problem? None, because in both of the problems you open 2 doors. Just that the separate occassions is confusing you. Open them one at a time doesn't change the probability except if you find it the first time, which is a 1 out of 3 chance.

Does that solve your logic? IF at this point you don't get it, go get some sleep, it'll eventually make sense.




Mark R, I demand you to state the answer!!!! People will not give this thread a rest without the official answer from the author. :p
 

Shalmanese

Platinum Member
Sep 29, 2000
2,157
0
0
hmmm havent read all 100+ of the threads and this has probably been mentioned before but since we just did probability ill try to set it out in a indisputable fasion
Assumptions:
1.All doors are independent of each other (no assistants playing funny buggers with you)
2. the doors are not "loaded" (all 3 contain goats)
3. you choose door 1 (could be any door, 1 just makes it simpler)
4. door 2 is opened (same reason)
Proof:
there are 6 possibilitys before the door was open and we assume that all the probabilitys are equal ie 1/6
1.g1,g2,c
2.g1,c,g2
3.g2,g1,c
4.g2,c,g1
5.c,g1,g2
6.c,g2,g1
indisputable so far??
by opening the door 2 and having a goat revealed alters the means the probability of 2 and 4 is 0
this HAS to alter the probability of 1,3,5 and 6 since all probabilities add to 1
still indisputable??
therefore the choices remain
1.g1,g2,c 1/4
2.g1,c,g2 0
3.g2,g1,c 1/4
4.g2,c,g1 0
5.c,g1,g2 1/4
6.c,g2,g1 1/4
since the RELATIVE probability of the choices changed due the elimination of choices
therefore the probability of a car is 1/2
Q.E.D.
AIASB (aint I a smart ah heck)
 

br0wn

Senior member
Jun 22, 2000
572
0
0
For those of you looking for program to convince you,

I have written the program and posted in this thread,
but I guess you didn't read it.

Here they are :
1. The executable, you need to rename it to monty.exe (geocities
won't allow me to upload .exe file)
"Executable file, please rename it to monty.exe"
2. The source code, written in C.
"Source code, you need a C compiler to compile this"

The program allows YOU to play the Monty's game for as many time as you like
and record how many times you win (Monty choose the door in RANDOM).

I'm really surprised some of you still argue about this.
 

callspread

Member
Oct 13, 1999
49
0
0
Let's say that there are 2 doors on the stage, one with a car and one with a goat. Some guy walks up and picks one door, so he has a 1/2 chance of choosing the door with the car.

Now, back to the three door scenario. I am on the stage and have chosen my door. Monty eliminates one door, and the guy from before comes back onto the stage. He only has a choice between two doors, my door or the one I could switch to. Since there are only two doors for him to choose from, his choice is the same as in the example above. However, according to the arguement in use by the switchers, he will have a 1/2 chance if he chooses the door that I don't want to switch to, but if I switch to it I will have a 2/3 chance.

This is my final attempt to educate you guys. Unfortunately some people just don't understand simple statistical concepts. Fortunately for you guys you can get through life perfectly well without such understanding. Just don't go to Vegas too often.

Callspread, signing off.
 

kranky

Elite Member
Oct 9, 1999
21,019
156
106
duckers, I understand now what you were trying to say. I was confused because I thought you were trying to answer the original problem, but you were talking about a different situation. :)

Argo, thanks for coming back and posting your results. Another one converted! :)

Moonbeam might have gone back to the dark side, though. ;)

Shalmanese, sorry, you are wrong. You haven't read the rest of the posts, but I'll just say this: your logic says you would have a 50/50 chance of picking the car if there were 100 doors. You would agree that cannot be true.

I should point out that it is an absolute certainty that you benefit by switching - the switching strategy is proven to be correct. You can find any number of programs on the web that simulate this (look for "Monty Hall paradox"). I didn't point this out before because I am greatly enjoying the discussion, primarily because I also used to insist that there was no benefit by switching. Those of you who are unconvinced should try to understand the logic of why switching is better. It is a fact. :)
 

br0wn

Senior member
Jun 22, 2000
572
0
0
Callspread, I guess that's what make you confused.
You have FLAW in your logic and I guess many ppls think the same way.
Why ?

Consider this :
You want to win a car, there are 2 doors.
One has a car, the other has a goat.

1. Now you picked a door with a goat (but you don't know this),
Monty asked you whether you want to switch or not ?

SWITCHING at this moment will give you 100% of winning a car,
NOT SWITCHING will give you 0% of winning a car.

2. You picked a door with a car (but you don't know this),
Monty asked you whether you want to switch or not.

SWITCHING at this moment will give you 0% of winning a car,
NOT SWITCHING will give you 100% of winning a car.


Looks fair so far.....kinda like 50-50......but IT IS NOT !!!

Why ?
Because we have 3 doors, 2 doors with goats and 1 door with car.

You will picked doors with goats 2 out of 3 (no 1 situation)
and 1 out of 3 you will pick door with car (no 2 situation).

So if you switch : you will get 200% out of total 300% of winning a car.
Total = 2/3 of winning a car.

If you don't switch : you will get 100% out of total 300% of winning a car.
Total = 1/3 of winning a car.
 

kranky

Elite Member
Oct 9, 1999
21,019
156
106
OK, just read another variation on the same problem which may help. Imagine a gambler, call him Fast Eddie, who presents you with an array of three walnut shells, beneath one of which there is a pea. You pick one of the shells. The gambler (or swindler) offers you an even-money bet - if you've picked the shell with the pea, you win, say, $10, and if you haven't you lose $10. You protest that that is not a fair bet because your chance of having picked the right shell is only one in three. Fast Eddie says, "Now I tell you what I'm going to do, I'll even the odds." He proceeds to turn over one of the other shells, which has no pea, saying, "Now it is 50/50, so the bet is fair!" But you can see that the bet is not fair, for your one in three chance has not changed.
 

br0wn

Senior member
Jun 22, 2000
572
0
0
kranky, I guess you make them more confused.

If Fast Eddie open one of the shell first, THEN it is
50/50.

It will not be 50/50 if he asks you to PICK one first,
then he will open one without peas, and ASK you whether
you want to change or not.
(in fact it is 2/3 for you to win, Fast Eddie is pretty
stupid then :))
 

kranky

Elite Member
Oct 9, 1999
21,019
156
106
It does say at the beginning "You pick one of the shells". It's the same problem - except it's a swindle. The point I was trying to make is that if someone can see that the bet is not fair, they should also realize that it's better to switch doors in the original problem.

In the street version of the "shell game", you don't get a chance to switch.
 

Duckers

Platinum Member
Mar 30, 2000
2,089
1
0
could someone please come up with Math Challenge #3?

or maybe even Math Challenge #3.1, which should be exactly the same as Math Challenge #3, but this time we would be dealing with 4 doors instead of three, it would be fun, don't you think ? ;)
 

piku

Diamond Member
May 30, 2000
4,049
1
0
CJM - thanks for that 1000 doors post. You converted me :p

But even if _mathematically_ you have a better chance switching, in actual use does it work better?



(edit: thats converted, not coverted :p )
 

Gustavus

Golden Member
Oct 9, 1999
1,840
0
0
Duckers,
The four door version is as trivial as the three door version. A car is behind one of the doors, goats are behind three etc. just as before. The probability you have chosen a door with a goat is 3/4. The probability you have chosen the door with the car behind it is 1/4. If your door conceals a goat, Monty has two doors he could open to reveal a goat so the odds of your then selecting a door concealing a car are 1/2 if you switch. On the other hand if the door you originally chose concealed the car switching will lose you the car with certainty. The simple conditional probabilty you will get the car by switching is 3/4x1/2 + 1/4x0 or 3/8. That is better than your original odds of 1/4 so switching is till the best strategy.
Computations of this sort are trivial conditional probability calculations. I do not understand why so much confusion.
 

Moonbeam

Elite Member
Nov 24, 1999
74,468
6,693
126
kranky, I'm back with you again. The fact that there are two goats to choose from if you choose the car door does not alter the fact that the two times you choose a goat you win by switching, because you only get to loose once.

Dexion, if you open two doors the chance of me finding the bathroom is 100% :D


Edit, this is how I convinced myself and why I don't think you need a program to see this:

If you pick a goat door and switch, you win because the only other goat door has been eliminated. There is no escape. You will pick a goat door 2/3 of the time. There is no escape.
 

Gustavus

Golden Member
Oct 9, 1999
1,840
0
0
As I have already remarked, this puzzle is a trivial example of calculating a conditional probability no matter how many doors are involved. One final comment is that the optimal strategy is to switch doors after Monty opens a door to reveal a goat -- irrespective of the number of doors involved in the puzzle. The percentage improvement in your odds of getting the car by switching is 100/(n-2) where n is the number of doors; 3 doors, 100% improvement in your odds, 4 doors a 50% improvement, 5 doors 33 1/3% improvment etc.
 

konichiwa

Lifer
Oct 9, 1999
15,077
2
0
I don't want to sound condescending, but Gustavus, are you a math professor or something? People seem to revere your great wisdom. Personally I agree with you, I think your analogies are easier to understand than anyone else's (except the 1:1,000,000 one was quite obvious :)) but I'm just curious...Kranky mentioned that if you said switching was right it must be. Are you some sort of Math God? ;)
 

Gustavus

Golden Member
Oct 9, 1999
1,840
0
0
konichiwa

I am a mathematician as a matter of fact. I usually say I am a cryptographer since that is the area where I did much of my work for the last twenty years or so of my career and the field in which I am best known. I was Rothschild Professor of Mathematics at the Newton Institute of Mathematics at the University of Cambridge in Cambridge, England for a time as well.

My daughter teaches English to Japanese speaking people -- she speaks Japanese of course -- and I have been meaning to ask her what konichiwa means but always forget to ask. What does it mean?

Note:
I think everyone has lost interest in this puzzle by now, but the probability of getting the car if you switch after Monty shows the goat is easily shown to be (n-1)/(n(n-2)) versus just 1/n if you don't switch -- where n is the number of doors.