4 ms·
If you want the result where there is a lower conditional probability of your originally selected door having the prize versus the remaining unopened door, then
by Chinjut 3y ago
If you want the result where there is a lower conditional probability of your originally selected door having the prize versus the remaining unopened door, then it completely does matter to have the setup be "Monty always opens a door with a goat" instead of "Monty opens a door at random, and in this particular case, it happened to have a goat behind it".
- kragen 3y agonope, do the math edit: i ran a monty carlo simulation¹ and i was doing the math wrong. it really does matter if monty knows or not. here's the simulation where he knows: In [15]: non_censored_trials = got_car_trials = 0 In [16]: for trial in range(100_000): ...: car_door = random.randrange(3) # the other two doors have goats ...: your_door = random.randrange(3) ...: monty_door = random.choice(list({0, 1, 2} - {your_door, car_door})) ...: if monty_door == car_door: ...: print("Monty showed the car, never mind") ...: continue ...: non_censored_trials += 1 ...: your_new_choice = next(iter({0, 1, 2} - {your_door, monty_door})) # you change your choice ...: if your_new_choice == car_door: ...: print(f"You got the car because you changed from {your_door} to {your_new_choice}") ...: got_car_trials += 1 ...: else: ...: print(f"Too bad you changed; you should have stuck with {your_door}") (...output omitted...) In [17]: got_car_trials / non_censored_trials Out[17]: 0.66921 so in ⅔ of the cases, switching doors gets you the car. by contrast, if monty didn't know which door would reveal a car, it's only ½ of the cases: In [21]: non_censored_trials = got_car_trials = 0 In [22]: for trial in range(100_000): ...: car_door = random.randrange(3) # the other two doors have goats ...: your_door = random.randrange(3) ...: monty_door = random.choice(list({0, 1, 2} - {your_door})) ...: if monty_door == car_door: ...: print("Monty showed the car, never mind") ...: continue ...: non_censored_trials += 1 ...: your_new_choice = next(iter({0, 1, 2} - {your_door, monty_door})) # you change your choice ...: if your_new_choice == car_door: ...: print(f"You got the car because you changed from {your_door} to {your_new_choice}") ...: got_car_trials += 1 ...: else: ...: print(f"Too bad you changed; you should have stuck with {your_door}") (...output omitted...) In [23]: got_car_trials / non_censored_trials Out[23]: 0.49987257709086 so if monty picked the goat door on purpose, you do gain by switching. but if he just got lucky, you don't ______ ¹ thank you, manoj
- dekhn 3y agoI dunno about anybody else, but to me teaching people how to convert word problems into code/simulations and how to interpret the results is one of the most important things a country that wants to be wealthy and powerful in the future should be doing. I've always admired folks who can do these sorts of things in their head, while it takes me a bunch of time to inspect the code and convince myself it's an accurate representation of the word problem.
- kragen 3y agoin this case I couldn't verify it against an actual experiment, which i think is good practice for newly programmed simulations, but when I saw that removing car_door from monty's choices made the probability go from 50% to 67%, i was reasonably sure that i hadn't fucked up the code, just the stuff i did in my head
- rspeele 3y agoOne way to think about is, suppose you switch -- why not switch back? In the random-open case, you really know nothing new about either of the closed doors. If you can talk yourself into switching, you could make an equally good argument for switching back. In the Monty-knows-and-always-shows-goat case, you have gained information about one of the closed doors. You haven't gained any information about your initial pick door. But the other remaining door, you know there's a 2/3rds chance that Monty was forced to avoid it so as not to reveal the car. Only in the 1/3rd case where you were already on the car does Monty have freedom to open either door willy nilly.
- kragen 3y agothat's all true, but i had concocted explanations that sounded equally convincing to me of why it was wrong
- topaz0 3y agoYou can tell because only trials where you chose a goat in the first round can be "censored". Your first pick is still twice as likely to be a goat as a car, but half of the times you do choose a goat on round 1 you won't get a chance to switch. Whereas if your first pick was a car, the game is guaranteed to complete (and switching is guaranteed to lose).