4 ms·
Edit: Sorry, didn't realize that gitlab.com requires you to be logged in to view things (that's dumb). Here it is on github: https://github.com/michaelnew/monty
by mikenew 5y ago
Edit: Sorry, didn't realize that gitlab.com requires you to be logged in to view things (that's dumb). Here it is on github: https://github.com/michaelnew/monty_hall/blob/main/monty_hall.nim https://github.com/michaelnew/monty_hall/blob/main/monty_hal...
That is my premise exactly. If the host chooses at random, then there is indeed a 1/3 chance of choosing the door that contains the prize. In which case the game is discarded (or restarted, if you like). If that is the behavior of the host, then in the event that the host randomly chooses a door without the prize (which should happen 2/3 of the time), then the choice between the original door and the remaining door is 50/50. If the host never chooses the door that contains the prize (and therefore the game never has to be restarted), then the host is not choosing randomly.
It's stated pretty clearly in the wikipedia article. The 2/3 probability is only true when these three conditions are met:
1. The host must always open a door that was not picked by the contestant.
2. The host must always open a door to reveal a goat and never the car.
3. The host must always offer the chance to switch between the originally chosen door and the remaining closed door.
- amluto 5y agoAh, you’ve invented (and implemented!) a very strange variant indeed. The contestant chooses a door. If they choose right, they win. Otherwise the host effectively flips a coin and, with 50% probability, the game starts over. Otherwise the contestant loses. I’m not convinced this has anything to do with the host’s _knowledge_ per se. For example, consider a different version. The contestant chooses a door. The host then peeks behind a door the door contestant didn’t choose (without showing anyone else what’s there) at random. If the prize isn’t there, the host reveals that there is no prize behind the door. Otherwise the host forgets they peeked and repeats the peek-and-choose step until they randomly get an empty door. Once an empty door has been revealed, the contestant may choose to switch. In this version, the host has no secret knowledge, but the 1/3 vs 2/3 probabilities still happen.
- mikenew 5y ago> The contestant chooses a door. If they choose right, they win. Otherwise the host effectively flips a coin and, with 50% probability, the game starts over. Otherwise the contestant loses. That isn't what happening in the first simulation. The game doesn't end if the contestant chooses the prize door initially. The contestant simply chooses a door. The host randomly chooses between the remaining doors. If they reveal the prize, the game is restarted. If they reveal an empty door, then the game is logged as either "the original door was correct" or "the remaining door was correct". This is the definition of "the host chooses randomly". > The host then peeks behind a door the door contestant didn’t choose (without showing anyone else what’s there) at random. If the prize isn’t there, the host reveals that there is no prize behind the door. Otherwise the host forgets they peeked and repeats the peek-and-choose step until they randomly get an empty door. Picking random doors until an empty one is found absolutely the same thing as randomly choosing amongst the available doors that don't contain a prize. You can implement any function you like here. Either the host always opens a door that does not contain the prize, or the host has a 1/3 chance of revealing the prize and the game is restarted. There is simply no other possibility.
- amluto 5y ago> Picking random doors until an empty one is found absolutely the same thing as randomly choosing amongst the available doors that don't contain a prize. You can implement any function you like here. Either the host always opens a door that does not contain the prize, or the host has a 1/3 chance of revealing the prize and the game is restarted. There is simply no other possibility. Not entirely. The issue is what, exactly, gets restarted. Version A: contestant chooses a door. Then the host picks a door and, if the host finds the prize, restarts the whole game if they picked the door with the prize. There is a 1/3 chance the contestant finds the prize. There is a 1/3 chance the contestant does not find the prize and and host does not find the prize. And there is a 1/3 chance neither one finds the prize. So 1/3 of the time the game restarts and, conditioned on a completer run, the contestant’s first guess was right with 50% probability. Version B: contestant chooses a door. Then the host picks a door and, if the host finds the prize, restarts just this step and picks another door. There is a 1/3 chance the contestant finds the prize. If this happens, the host won’t find the prize. If the contestant’s first guess was wrong, there is a 1/2 chance the host finds the prize on any given try, but the host keeps trying so the host will not find the prize when the loop is done. So, conditioned on a completed run, the contestant’s first guess is correct 1/3 of the time. See the difference?