dear math knowers, pls double-check my understanding on this:
in the monty hall problem, if you remove monty hall and replace him with an actual random number generator, that actually has a chance to open a door with a car, and it happens not to, now it's actually 50/50 between the two remaining doors right? it's specifically monty hall, his knowledge of where the car is, and his methodology for opening a door that creates the unintuitive effect? or is that still there in this case...
ok i did not explain this very well, but if you're curious, i wrote a little python script showing that the thing i am poorly trying to explain was correct, i think?:
as @belarius helpfully put it in the comments, the situation i'm explaining is that rng monty hall could have opened the door with the car, and could have opened your own door, but didn't. the situation where he didn't has already occurred. it's like how the odds of flipping two heads is 1/4 but the odds of flipping a second heads given that the first has already occurred is 1/2.
here's a python script that rerolls car locations and opened door locations until the "keep or switch" scenario from the original monty hall problem occurs (a door has been opened, it's not your door, the door did not have the car) 3000 times. if i've coded that correctly, it shows that keeping your door #1 under these conditions results in winning the car ~1500 times out of every 3000, or 1/2.
import random
# the number of times our door, door 1, contained the car, given that the scenario has occurred
successes = 0
# the number of times the specific scenario has occurred, where a door that isn't yours has been opened, and that door did not contain the car
montyhallscenarios = 0
while(montyhallscenarios < 3000):
#car and opened door can be in doors 1 through 3
car = random.randrange(1,4)
door = random.randrange(1,4)
#if the opened door has the car, then this isn't the "stay or switch" scenario
if door == car:
continue
#if the opened door was our door #1, then this isn't the "stay or switch" scenario
if door == 1:
continue
#if this *is* the "stay or switch" scenario, then we get a point if the car is in door 1!
else:
montyhallscenarios += 1
if car == 1:
successes += 1
print(successes)
