7 ms·
How would the answer be any different? As long as the doors are bad doors, it doesn't matter if they're opened by chance or not
by selestify 7y ago
How would the answer be any different? As long as the doors are bad doors, it doesn't matter if they're opened by chance or not
- mdonahoe 7y agoWeirdly, it matters. You can simulate it. I didn't believe it until I simulated it myself.
- tiziano88 7y agoHow did you count the runs in which the good door was accidentally opened?
- grraaaaahhh 7y agoThose runs get ignored since that isn't the scenario. Specifically we're looking at the case where Monty opens a goat by chance (ie. he could have opened the car, but did not). It also helps that that result doesn't matter to the overall question, is it better to switch or to stay, since both options are irrelevant when Monty opens the car door.
- semiotagonal 7y agoRESCINDED: Error in my simulation! Apologies.
- sparky_z 7y agoYou're accidentally including the cases where montysPick == myPick. You have to discard those cases. Monte has to show you what's behind a different door than the one you initially picked. The game doesn't make sense otherwise.
- semiotagonal 7y agoYes you are correct. Corrected simulation gives 50/50 when Monty picks at random among 3 doors. switchWins=33044 switchLoses=33581 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #define NUM_RUNS 100000 #define NUM_DOORS 3 int main(int argc, const char* argv[]) { srand(time(NULL)); char doors[NUM_DOORS]; int switchLoses = 0; int switchWins = 0; for(int i = 0; i < NUM_RUNS; i++) { memset(&doors, 0, sizeof(doors)); doors[rand() % NUM_DOORS] = 1; int myPick = rand() % NUM_DOORS; int montysPick = rand() % (NUM_DOORS - 1); if(montysPick >= myPick) montysPick++; if(doors[montysPick]) continue; if(doors[myPick]) switchLoses++; else switchWins++; } printf("switchWins=%d switchLoses=%d\n", switchWins, switchLoses); return 0; } EDITED TO ADD: Just for further info: 3 doors: switchWins=33111 switchLoses=33470 4 doors: switchWins=50182 switchLoses=24698 8 doors: switchWins=74876 switchLoses=12687 100000 doors: switchWins=99998 switchLoses=2
- reidjs 7y agoHah, I wrote one as well to prove it to myself in the chrome dev tools console const pickCar = (switchChoice) => { const doors = [0, 0, 0]; doors[(Math.random() * doors.length - 1) | 0] = 1 let pick = (Math.random() * doors.length - 1) | 0 let goat for(let i = 0; i < doors.length; i++) { if (doors[i] == 0 && i != pick) goat = i } let result = pick if (switchChoice) for(let i = 0; i < doors.length; i++) { if (i != pick && i != goat) result = i } return result } let switchWins = 0; let switchLosses = 0; for(let i = 0; i < 100000; i++) { pickCar(true) == 1 ? switchWins++ : switchLosses++ } console.log('wins:', switchWins, ', losses: ',switchLosses)
- Dylan16807 7y agoBy deleting the universe 1/3 of the time, you change the nature of the problem. It starts to resemble a quantum immortality argument. And if I can delete universes where certain events happen then screw probability, I can guarantee a win despite picking randomly. "Picks a random door out of all closed doors, but that door is never the winner" is a contradiction. It doesn't give you a different chance of winning because it's not a coherent scenario in the first place.
- OscarCunningham 7y agoConditional probability is a coherent concept with no need to talk about deleting universes. You can ask "If it's raining in the morning how likely is it to still be raining in the afternoon?" even though it's sometimes not raining in the morning.
- Dylan16807 7y agoConditional probability is fine. But you have to make the condition part of the question. You can't subtly omit certain results because it screws up the narrative. This is a game where you start off with a certain layout, and then proceed forward. If you want conditions, they have to be conditions that you can apply before the game starts. You can't retroactively remove a significant chunk of samples. If you added an actual outcome to him picking the winner, you could make a valid filter where the answer actually is 50:50. Perhaps they restart the game. Perhaps they never air the episode. And if you calculate only for finished/aired games then it's very clear then that you're solving a different math problem. You can't apply that answer to the original problem.
- deleted 7y ago[deleted]
- deleted 7y ago[deleted]
- baddox 7y agoIt doesn't seem that weird. That just means your code is choosing to not count half of the scenarios where you would have won in the original simulation.
- Smaug123 7y agoYes, it does! The whole problem revolves around whether Monty Hall was giving you more information by his choice of which doors to open, or whether he was just opening doors randomly. If he was opening doors randomly then you're left with a one-in-two chance. But if he was giving you information by opening doors he knew were bad, you're left with two possibilities: the door you started with just happened to be the right door (a tiny chance), or (much more likely) the door you started with was not the right door - in which case Monty was forced to open every other door so as to avoid showing you the car, and he has eliminated all the non-car options.
- mcphage 7y agoWhat would happen if he opened the right door?
- rohit2412 7y agoThe assumption is that this didn't happen. Hence you must remove these cases from your sample set while calculating probability
- baddox 7y agoBut that means that something knows which door was the winning one. Either Monty knew which one it was, or whatever mysterious Agent is sampling from all the possible outcomes knew (because the Agent only sampled the ones where Monty happened to open a non-winning door). Either way, you're given the choice between having the 1 door you initially chose, or both of the other doors.
- leeoniya 7y ago> Either way, you're given the choice between having the 1 door you initially chose, or both of the other doors. i initially thought this too, but in both cases you're gonna see 2/3 doors. the thing that makes the difference is when he has the car (2/3 of the time), he has to tell you where it is. so the choice becomes between your unknown door and his 2/3 selectively chosen car door.
- dboreham 7y agoThe key insight is that which door is picked actually communicates information to you about the other doors because you know those other doors were not picked. You now know more about the probabilities of various outcomes which means you need to change your choice. Also note the question is about "do you change your choice?" not about the chances of success with any specific door.