Misplaced Pages

Talk:Monty Hall problem/Arguments: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
< Talk:Monty Hall problem Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 07:04, 10 February 2017 editJim1138 (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers297,704 edits Undid revision 764670573 by Electroninja (talk) rv this should be archived, not removed← Previous edit Revision as of 07:06, 10 February 2017 edit undoSPACKlick (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers4,193 edits Restoring the conversation without deleting the conclusion.Next edit →
Line 222: Line 222:
</nowiki> </nowiki>
:: You're switching from door 2 to door 1 if door 1 is open. I've run your code with the correction and it doesn't produce 50/50 any more. It produces a clear 2/3. :: You're switching from door 2 to door 1 if door 1 is open. I've run your code with the correction and it doesn't produce 50/50 any more. It produces a clear 2/3.

:::Thank you so much for helping me find this dude. Finally, the universe makes sense again. I am gonna make the edits and publish this a Monty hall simulation. Link is posted here in C++ to help those coding simulate this problem. This is what peer review is for, finding code errors that occurred when writing code at 3:00am, and restoring balance to the universe.

:::https://github.com/McClainJ/Monty_Hall_Simulation/blob/master/main.cpp {{Unsigned|Electroninja|06:55, 10 February 2017}}

Revision as of 07:06, 10 February 2017

This page is for mathematical arguments concerning the Monty Hall problem. Previous discussions have been archived from the main talk page, which is now reserved for editorial discussions.
Peace dove with olive branch in its beakPlease stay calm and civil while commenting or presenting evidence, and do not make personal attacks. Be patient when approaching solutions to any issues. If consensus is not reached, other solutions exist to draw attention and ensure that more editors mediate or comment on the dispute.
Archiving icon
Archives
Archive 1Archive 2Archive 3
Archive 4Archive 5Archive 6
Archive 7Archive 8Archive 9
Archive 10Archive 11Archive 12
Archive 13Archive 14Archive 15


This page has archives. Sections older than 20 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present.


Example door numbers should be removed from the quoted letter at the beginning of the page as they just confuse you

Example door numbers should be removed from the quoted letter at the beginning of the page as they just confuse you. If we are specifying that the player choose door 1 and the host opened 3 and it contained a goat, there is no advantage in switching. both switching and stay give a 50% chance of winning (because if the host opened door n3, it means the car could not have been there in the first place, in this case, so only two possibilities are left). You should just explain that the player picks a door and the host opens another one with a goat and he ask the player if he wants to switch to the remaining door. It is the sum of all the cases together that gives you an advantage by switching. — Preceding unsigned comment added by 2001:B07:644C:A33:1188:5791:7107:1D12 (talk) 10:28, 28 August 2016 (UTC)

That's not true, Given that you picked door 1 and the host opened door 3 it is still twice as likely the car is behind Door 2 as Door 1. SPACKlick (talk) 11:43, 28 August 2016 (UTC)

Comment from original author of the talk: Yes the probability of winning is still twice as likely if you switch, but this is only true if you assume their choices happened naturally and before. What i'm saying is that it is hard for a reader to understand this immediately; the reader could unwittingly not think that door 1 and 3 had been voluntarily chosen, therefore starting to think about possibilities from there on, ignoring that the current situation is just one of the outcomes caused by different choices. That is the whole point of the Monty Hall problem, that is why people do not think that changing door increases the probability of winning, but this page should be about understanding the problem. — Preceding unsigned comment added by 2001:B07:644C:A33:2002:B345:7843:2FE6 (talk) 22:48, 30 August 2016 (UTC)

What do you mean by "this is only true if you assume their choices happened naturally and before"? And, to your original point, removing the door numbers from the problem statement would be changing a quote. The whole point of the Monty Hall problem is to force the reader to imagine standing in front of two unopened doors and at that point deciding whether to switch or not - and how we got there does indeed matter. Without this, the problem might as well be "what is your chance of picking which of 3 doors is hiding the car"? The point of interest is after the host opens a losing door, precisely because there are then only two unopened doors. -- Rick Block (talk) 16:10, 31 August 2016 (UTC)

it means that a readers could initially not think that the answer to the problem lies in the fact that the current outcome is a result of a series of different determined choices, he might instead just think that the car could be in his door (1) and the other available one (2), so the probability for the car to be in both doors is 50%. Without explicitly specifying door n1 and n3, you underline that choices can be made and the answer lies there; in this way, the reader might start reasoning directly from there and get to the solution quickly. If removing words from the quote is not allowed, why don't just explain the problem directly? Also, i'd like to specify that in some other languages the problem is stated like i'm suggesting. — Preceding unsigned comment added by 2001:B07:644C:A33:3C12:5330:1BE0:504C (talk) 20:14, 31 August 2016 (UTC)

"The host, who knows what's behind the doors, opens another door" seems perfectly clear about the sequence of events and the intentionality of host's action. It is not made less clear by labeling the door as "say No. 3". Labeling the doors makes it easier to discuss them. ~ Ningauble (talk) 16:53, 3 September 2016 (UTC)

It does make it less clear simply because you don't chooce yourself, thus it is less likely that your thoughts are going to go in the right direction, which is that the solution lies in analysis all the possible choiches. I'm the original author of this talk and i'm going to stop it here as i'm battling alone against everybody. — Preceding unsigned comment added by 78.13.147.90 (talk) 20:35, 3 September 2016 (UTC)

Wrong assumptions: 2/3 win probaility only works if change decision is taken A PRIORI of opening door 3

For the 2/3 win probability to work it is necessary to state a 4th hypothesis, which sorry, NEVER happens in this kind of TV shows:

4) The contester must decide if switch or keep the same door BEFORE Monty opens the door 3.

Of course, in this case he has 2/3 probability of winning if he CHANGES because there are 2/3 probability that the car is behing either door 2 or 3. Then, if he decides A PRIORI that he will change to EITHER door 2 or 3 DEPENDING on what door Monty opens (that will be either door 2 if the car is behind 3 or viceversa if the car is behind door 2) THEN by just saying "I WANT TO CHANGE" he/she is choosing the BEST OF TWO OPTIONS OUT OF TOTAL THREE, and he gets a a 2/3 win probability.

BUT....

IF Monty ALREADY OPENED DOOR 3 and THERE IS A GOAT THERE, THEN, with the GIVEN set of information, he KNOWS that the car is EITHER behind door 1 or 2. And his probability will be 50%. The conditional tree is WRONG because it is valid for the moment BEFORE THE DOOR 3 IS OPENED AND THERE IS A GOAT THERE. When the door 3 is opened AND there is a goat there, then the conditional tree changes completely and all assumptions with door 2 being opened must be set to PROBABILITY ZERO. — Preceding unsigned comment added by 186.23.133.28 (talkcontribs)

You had it right up to the point where you say "And his probability will be 50%". That is a non sequitur to everything said before. The door not chosen at the beginning of the game has double the probability of the chosen door, because it accumulates the probabilities from the two non-chosen doors (since the door opened by Monty can no longer have a car behing it). When the door is opened, it doesn't change the fact that the non-chosen door is the best of two options out of tree - the only difference is that now we know which those two options the user is getting. Diego (talk) 15:59, 14 November 2016 (UTC)
Exactly - everything you say is correct, except for the last couple of sentences. If you throw all the information you know away, and restart knowing only that the car is behind one of door 1 or door 2, you do end with with probabilities of 50%. But that is NOT what happens. You know the original probabilities were 1/3 for each door. You know the host MUST open door 3 if you've picked door 1 and the car is behind door 2. You can assume the host picks evenly between door 2 and door 3 if the car is behind the door you've picked (door 1). You can and should use this information. Let me fix your last paragraph for you:
If Monty already opened door 3 (deliberately showing a goat there), then with the given set of information, the player knows the car is either behind door 1 or door 2. What we need to determine are the conditional probabilities given the host has opened door 3. For each door, this is the starting probability (1/3 for each door) times the probability the host opens door 3 if the car is behind that door divided by the total probability the host opens door 3. Door 3 is easy. We know the conditional probability the car is behind door 3 is 0 (because we can see a goat there). But working through the computation is pretty easy, too. If the car is behind door 3, the probability the host opens door 3 is 0, so we get a conditional probability of 1/3 * 0 divided by something - so this is going to end up 0. Door 2 and door 1 are a littler harder, but not much. If the car is behind door 2, the host must open door 3 (cannot open door 1), so the composite probability of the car being behind door 2 AND the host opens door 3 is 1/3 * 1 and the conditional probability is this answer divided by something. If the car is behind door 1, the host can open either door 2 or door 3. Assuming the host is indifferent, then the composite probability of the car being behind door 1 AND the host opens door 3 is 1/3 * 1/2 (and the conditional probability is this answer divided by something). The total probability the host opens door 3 is the sum of the composite probabilities, i.e. 1/3 + 1/6 which is 1/2. Now, we can compute the conditional probabilities. For door 1 we get (1/3 * 1/2) / 1/2 which is 1/3. For door 2 we get (1/3 * 1) / 1/2 which is 2/3.
The key here is that if the car is behind door 2 the host MUST open door 3, while if the car is behind door 1 the host can open either door 2 or door 3. This means the chance the car is behind door 1 AND the host opens door 3 is exactly half the chance the car is behind door 2 AND the host opens door 3. These are the only possibilities, so call them X and 2X. We know X+2X must be 1, so X must be 1/3 and 2X is therefore 2/3. -- Rick Block (talk) 16:55, 14 November 2016 (UTC)

flawed logic?

Surely there are 4 possibilities and not 3

if any door is selected by contestant, the host has 4 possible selections(door to open)

1. if contestant selects correct door(say door1), host could select door2

2. if contestant selects correct door(say door1), host could select door3

3. if contestant selects incorrect door(say door1, car behind door2), host must select door 3

4. if contestant selects incorrect door(say door1, car behind door3), host must select door 2

hence in case 1,2 switching will lose, case 3,4 switching will win, hence 50% not 67% as common logic would suggest.

By always opening a goat door(and never the contestants or car door), this new information does not favour either of the remaining doors, both remaining doors probability would increase from 33% to 50% — Preceding unsigned comment added by 211.27.69.72 (talk) 03:35, 27 November 2016 (UTC) g.bardwell

The issue with the logic you've proposed is that those 4 options aren't all equally likely. The contestant is twice as likely to pick a wrong door first as a right door so the 3rd and 4th options are twice as likely as the 1st and second.
To break it down you have (A) the scenario where car is behind door 1 (1/3), (B) where it is behind door 2 (1/3) and (C) where it is behind door 3 (1/3). If the contestant in (A) picks door 1 50% of the time the host opens door 2 (1/6 overall) and 50% they open door 3 (1/6). In (B) if the contestant picks door 1, 100% of the time the host opens door 3 (1/3). In (C) if the contestant picks door 1 then 100% of the time the host opens door 2 (1/3).
In those scenarios you can see that if you've picked door one and door 3 was opened it's twice as likely you're in C as in A. Hence you should switch SPACKlick (talk) 05:24, 27 November 2016 (UTC)


Proposed Solution and Computer Simulation to show evidence

After having an epiphany at 2:00AM and writing computer models and flow charts all night, I have determined that the page https://en.wikipedia.org/Monty_Hall_problem has several flaws. Mainly that according to the page you should have a 2/3rd chance of winning if you switch, and a 1/3 chance of winning if you don't. I using deductive reasoning and computer models have come to the conclusion that if you don't switch you have a 1/3 chance of winning, and if you do switch you have a 1/2 chance of winning.

https://github.com/McClainJ/Monty_Hall_Simulation http://i.imgur.com/PoJzAoG.jpg <- Yes, I know the flow chart is not the prettiest thing, but the simulation doesn't seem to have any errors so I am forming this as my theory. This simulation does the exact process described by the problem, it does not perform a mathematical simulation but does perform a procedural one. Therefor the results are provably accurate. I ran each simulation 5 times for a total of 50,000 cycles for both switch only and never switch.— Preceding unsigned comment added by Electroninja (talkcontribs) 02:06, 9 February 2017 (UTC)


I haven't reviewed your code, but you're clearly doing something wrong. If you have 1/3 chance of winning if you don't switch and 1/2 chance of winning if you do switch where is the other 1/6? It is perhaps not entirely coincidental that 1/2 + 1/6 = 2/3.
Looking at your flowchart, in the "switch" case you show two doors left where the car might be. Didn't the host open one of these doors? In particular, if you have initially picked a goat (with probability 2/3), isn't the only option available when you switch the car? The flowchart needs to be a little more complicated, perhaps somewhat more like the tree diagram in this section of the article. -- Rick Block (talk) 08:09, 9 February 2017 (UTC)


In regards to the flow chart, I agree it is not the best way to organize it, the top two on the right are not a representation of the top two in the middle, they are meant to represent the 2 unopened remaining doors.
Wait, you didn't review the code, but assumed I did something wrong, do you see the problem with that?

Just check the code, it is not even 130 lines of code, and I guarantee that it plays the game perfectly.

(just change the to_switch value when you run the code to true or false for the various simulations.)

And I think the main difference between your analysis and mine, is that you see the choice as a single linear chain, where it is realistically 2 separate decisions, not from which door to pick. but whether to enter into a separate decision. If you don't switch , then you never entered into the second decision, which explains the 1/3rd win rate, but if you do switch then you are entering into a scenario when you have chosen 1 of 2 results, which gives you the 1/2 chance of winning. Both of our lines of logic seem to follow deductive reasoning, and since there are separate results, something is going on.

I've had a quick shufti at the code, and admittedly, I'm a beginner with C languages. in enact_Switch When the car is behind Door 2 and the choice door is 2 you have the code Doors.goat_Revealed = true; Which opens the door 1 or 2, it should be Doors.goat_Revealed = true; to open 1 or 0. I think this will account for most of the discrepancy in your switching data.
I've included a VB coding of the game and the results from a hundred million runs that I just ran.
Option Explicit
 'SwitchWin(33,334,712) SwitchLose(16,678,126) WinIfSwitch(0.666523104)
 'StayWin  (16,658,911) StayLose  (33,328,252) WinIfStay  (0.333263782)
 Sub MontyHall()
 'run counter
 Dim run As Long
 'car and choice and revealed placement
 Dim car As Byte
 Dim choice As Byte
 Dim revealed As Byte
 'totals
 Dim switchwin As Long
 Dim switchlose As Long
 Dim staywin As Long
 Dim staylose As Long
 For run = 0 To 1000000
 'Choose a door for the car
     car = Int(Rnd * 3)
 'Contestant chooses a door
     choice = Int(Rnd * 3) 
 'Host opens door
     Select Case car
 'Where car is 0
         Case 0
         Select Case choice
             Case 0
             revealed = Int(Rnd * 2) + 1
             Case 1
             revealed = 2
             Case 2
             revealed = 1
             End Select
 'Where car is 1
         Case 1
         Select Case choice
             Case 0
             revealed = 2
             Case 1
             If Int(Rnd * 2) = 1 Then
                 revealed = 0
                 Else
                 revealed = 2
                 End If
             Case 2
                 revealed = 0
             End Select
 'Where car is 2
         Case 2
         Select Case choice
             Case 0
                 revealed = 1
             Case 1
                 revealed = 0
             Case 2
                 revealed = Int(Rnd * 2)
             End Select
         End Select
 'Randomise switch; 0 stay 1 switch
     If Int(Rnd * 2) = 0 Then
 'If you stay then you win if you're on the car
         If car = choice Then
             staywin = staywin + 1
             Else
             staylose = staylose + 1
             End If
         Else
 'switching is going to the door which is neither the choice nor the revealed
 'all sum to 3 so that door is 3-choice-revealed
         choice = 3 - choice - revealed
         If choice = car Then
             switchwin = switchwin + 1
             Else
             switchlose = switchlose + 1
             End If
         End If
     Next run
 Cells(1, 1) = switchwin
 Cells(1, 2) = switchlose
 Cells(1, 3) = switchwin / (switchwin + switchlose)
 Cells(2, 1) = staywin
 Cells(2, 2) = staylose
 Cells(2, 3) = staywin / (staywin + staylose)
 End Sub

^thank you so much for helping me fix that small typo, I ran the simulation again 5 times after the fix, and the results are the same still 50/50 if you switch, 1/3 if you don't. I have updated github with the more accurate code. I fear I do not know enough about VB to analyze your code, most of it seems to not make sense. I will have to look up operators for VB and see what I am missing. is * your modulus operator? Your code may not have copied correctly. — Preceding unsigned comment added by Electroninja (talkcontribs) 05:22, 10 February 2017 (UTC)

* is the multiplication operator. To roughly explain the code in English:
Define Variables, start a for loop for 100,000,000 runs of the game
Rnd is a random number between 0 and 1. Int is the integer part of it. So Int(rnd * 3) is a random number between 0 and 2
This is used to pick a random car and choice
Select Case picks based on the chosen variable. So it's like your reveal goat function. Where both choice and car are the same it randomly selects one of the other two doors otherwise it picks the only available door and so sets revealed to that door.
It then randomly selects whether to switch or stay. If it switches then it uses the property that the sum of all three doors is 3, the door you can switch to is the one that isn't the chosen door or the revealed door so 3-choice-revealed = remaining door. (say choice was 1, and revealed was 0, 3-1-0 = the door you switch to.
It then checks if the final chosen door is the same as the car. If it is, it adds one to the win, if not it adds one to the loss
The final section of code just prints the results to an excel spreadsheet.
Also, I've spotted a second flaw with your code Where you have

if(Doors.goat_Revealed ){ if(Choice == 2){ Choice = 1; }else { Choice = 0;

you should have

if(Doors.goat_Revealed ){ if(Choice == 2){ Choice = 0; }else { Choice = 2;

You're switching from door 2 to door 1 if door 1 is open. I've run your code with the correction and it doesn't produce 50/50 any more. It produces a clear 2/3.
Thank you so much for helping me find this dude. Finally, the universe makes sense again. I am gonna make the edits and publish this a Monty hall simulation. Link is posted here in C++ to help those coding simulate this problem. This is what peer review is for, finding code errors that occurred when writing code at 3:00am, and restoring balance to the universe.
https://github.com/McClainJ/Monty_Hall_Simulation/blob/master/main.cpp — Preceding unsigned comment added by Electroninja (talkcontribs) 06:55, 10 February 2017 (UTC)