When you originally pick a door - there are three. (We all agree on this). Because you are picking at random, and the prize is only behind one door, there is a 1/3 chance that you have picked the right door. (likewise, We can all agree on that.) Therefore, I
think we can all agree that there is a 2/3 chance that the prize exists behind one of the other two doors.
Let us take your approach, and have Monty flip a coin, revealing ANY door at random.
If he flips your door, and you have the prize - You have a 100% chance of winning.
If he flips your door, and you have the goat, 0% chance of winning. Those two scenarios are easy, and we can ignore them.
Likewise, if he flips the coin, and shows one of the other two doors, and they have the prize - then, once again - easy - 0% chance of winning. We can ignore these scenarios.
I think up to this point, we can agree on all of the above scenarios. (They are win/lose)
Where it gets complex, he flips a coin, selects one of the doors you aren't on, and reveals a goat.
Given that you had a 1/3 chance originally of winning, and a 2/3 chance of not winning, and given that Monty has now revealed that one of the other two doors (By chance) does not have the car, your 2/3 chance of not winning is still the same, but now it applies to only a single door - I.E. You have a 66% chance of winning by selecting that other door - and the fact that Monty selected that door by chance, is irrelevant.
Unfortunately, despite my (flawed) apparently logical argument - I'm completely wrong, and you are correct.
from random import *
def putPrizeInDoor():
doors=[0,0,0]
door_winner=randint(0,2)
doors[door_winner]=1
return doors
trials=100000
testCount=0
win=lose=0
for x in range(trials):
doors=putPrizeInDoor()
userSelects=randint(0,2)
montyReveals=randint(0,2)
if montyReveals==userSelects: # Monty reveals the door user is on
pass
else:
if doors[montyReveals]==1: # Monty Revealed the prize.
pass
else: # this is where it's interesting - Monty reveals, at random, door not winning that user not on.
revealedDoors=set([montyReveals,userSelects])
newUserChoice=list(set([0,1,2])-revealedDoors)[0]
testCount+=1
if doors[newUserChoice]==1:
win+=1
else:
lose+=1
print ("Tested: {} Wins: {} Lost: {} Percentage: {:.2f}".format(testCount,win,lose,win/testCount))
Tested: 44484 Wins: 22220 Lost: 22264 Percentage: 0.50
It's interesting that the deliberate selection by Monty of the goat, increases my chance from 33% to 66% if I switch, but the random selection by Monty of the goat, only increases my chance from 33% to 50% if I switch. I'm not really sure where the argument I made breaks down, but, empirically, it's clearly broken. I'll have to meditate on it a bit to see where I've gone awry.