counterintuitively, it doesn't actually matter whether monty knew there was a goat before he opened the door; what matters is that you observed the goat, so you know you're not in one of the possible worlds where he opened the car door
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".
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
I 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.
in 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
You 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).
One 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.
But if the car door is picked, there's no further game to play. Surely the only interesting thing to ask is, conditioned on seeing a goat, what's the probability the third door contains a car. The cases of observing a car are irrelevant since that's not the scenario. I'm still not convinced it's any different whether Monty Hall knows or not so long as the goat door is opened.
Edit: having written this, thinking about the 100 door case. If 98 random doors open (that aren't the one I picked) then the fact they all contain goats is pretty suggestive that I have the car, or at least 50/50. I'm not convinced by the code example though.
> the fact they all contain goats is pretty suggestive that I have the car, or at least 50/50
That's exactly the point. If he doesn't know, then it's exactly 50/50 and there is no reason to switch. If he does know, then it's 1/NUM_DOORS versus NUM_DOORS-1/NUM_DOORS, so you'd be crazy not to switch.
The point is, if he picks at random, in the 100 door case, the vast majority of the time he will open the car door while opening those 98 doors. The case where you get to pick again would be exceedingly rare. Conversely, if he only opens goat doors, you will get your second pick 100% of the time.
I believe the confusion with "ignoring the car picked cases" comes due to thinking that they are additional games to the original ones, instead of being part of those that constitute the 2/3 in which the player starts picking wrong.
So you thought that eliminating them you were left with the original 1/3 vs 2/3, when you actually removed half of the 2/3.
Yes, it's exactly 50/50. It's not hard to work out the details, as I did in another thread elsewhere on this article. Here goes:
-There's a 1/100 chance my door is a car, in which case it doesn't matter which of the others stays closed, it will always be a goat. The game will proceed, and switching will lose.
-There's a 99/100 chance my door is a goat, in which case the car is behind some other door. Choosing 98 out of 99 doors to open at random is the same as choosing 1 out of 99 doors to leave closed at random. So the chance that the car stays hidden in this case (so that switching will win) is 1/99, and 98/99 that the game ends early because the car is revealed.
-Adding it up, the game ends without the chance to make a choice 99/100 * 98/99 = 98/100 of the time. Of the remaining 2%, 1/100 comes from the first case (switching loses) and 99/100 * 1/99 = 1/100 comes from the second case (switching wins). The strategies are equally effective.
your first paragraph is what i thought before running the simulation, but it turned out to be wrong. if my simulation isn't convincing to you, try writing one that is
edit: this is wrong, dekhn was right, see below