risingthumb.xyz | Agora Zines | Webring | achtung | github | itch | site map

Explainers



🚪 The Monty Hall problem 🚪 #

🎲 Or how I learned I can't trust my intuition for probability #


What is the Monty Hall problem? #

You're on a game show and the host tells you that you could walk away with a sports car, but you have to make the right choice! The curtains unfurl, and there's 3 doors before you. "Behind two of these doors, there is a goat. But behind one special, lucky door... there is a Ferrari. You could be a rich man Mr... Reader... Now make your choice!"

You then pick a door, and the host pauses. He opens up one of the three doors to reveal... a Goat! "Now Mr Reader, I'm offering you a chance to reconsider your door. Would you like to switch doors?"

So the question the Monty Hall problem asks... is it a good idea to switch doors? And here's a simulation below! Give it a try and see if you can get it right?



Don't scroll too far down because we'll explain things shortly...





.
.
.
.


.















.
.
.
.


.









Ok so what is the probability? #

The probability of winning if you switched is 2/3!

"Wait... huh... hang on, I thought it would have been a 1/2 chance?" is what a lot of people who first see this problem think. And 1/2 is actually the probability if it was just 2 doors on their own, and a goat and a car between them. But it's not a coin toss, we have the additional knowledge from the open door.

The probability is actualy in your favour! You have a 2/3 chance of walking home with a car by switching!

That doesn't sound right? Like it should only be a 1/2 chance of walking home with a car? Don't feel bad, I was equally as unconvinced when I was shown this problem! What ends up happening is the door that has opened... that 1/3 chance of it being a car has "collapsed" into the other door, raising it by 1/3.

Now if it were 4 doors, and only 1 door was revealed to be goats, that 1/4 probability would be split evenly among the two remaining doors, making it a choice between a 3/8th chance of a car, another 3/8th chance of a car and a 1/4 chance of a car(the original choice in 4 doors). Now if it were 4 doors and 2 doors were revealed to be goats, those 2 1/4 probabilities "collapse" onto the remaining door, making it a 3/4 chance and your current door a 1/4 chance.

In fact... lets see that in action for 4 doors and 2 doors being opened! Give it a try below

And for completeness, you can try it out for 4 doors and 1 door being opened

Still not convinced? Lets expand it to a 100 doors, 98 of them being revealed to be goats. Would you switch? With such a large expansion of the problem, it becomes pretty evident you should switch.

In this case it is a 99/100 chance of it being the car...

And if you remain still unconvinced, you can run it a thousand times with the choices you make, and see the win/loss results!


The Maffs #

The reason why is because in the Monty Hall problem, we get a bit of information that doesn't seem like it should affect things but it does. If Monty were to open a door at random, then it could have a door behind it. However we know Monty isn't opening a door at random, he's opening a door with a Goat behind it. Thus the following probability rolls out of it:

P(Monty Opened door B | Car at B) = 0. What this is saying is that the probability that Monty will open the door on B, given there is a car at B is 0. It will never happen.

... Bayes theorem stuff TODO...

Anyways as you read this far, you should now have a better grasp on what the Monty Hall problem is. How it shows our intuitive sense for probability isn't too reliable, and how reasoning with probability is affected massively just by a little bit of information. Anyways, have fun with a little sandbox environment of the Monty Hall problem.