Hacker News new | past | comments | ask | show | jobs | submit login

Tbh I still can barely get my head round it even after coding a working solution.



The best way to understand it:

Think of a version with 100 doors, 99 with goats and 1 with a car.

You choose a door, and the host opens 98 doors that have goats. Do you keep your randomly chosen door or switch to the single door that the host didn’t open?


The big insight is that at each attempt, the remaining door could have been chosen if it had a goat, but wasn't

It would be extremely lucky for that door to have not been selected 98 times in a row and still have a goat


I played role of Monty with another person. They chose a door, I revealed a different door, and they switched (or not).

That got my head around it. Most of the time the door I "chose" to reveal was no choice at all. There was only one door I could open.


I had it explained to me like this:

You pick one of three options, giving you a 1/3 chance of being correct, 2/3 odds you picked incorrectly. The host removes an option and give you the option to switch.

Your options then are -

Keep the same door: you win 1/3 of the time (your first guess was right)

Switch doors: you win 2/3 of the time (your first guess was wrong)

It really just comes down to, do I think I was right the first time, which was 1/3 odds, or wrong the first time, 2/3 odds.


Here's how I've explained it: Choose randomly between 3 doors. 1/3 of the time you end up with the door with the car, and switching loses. The other 2/3, you pick a door with a goat, the other door with the goat is eliminated, and switching wins.

Basically, P(lose when switching) = P(choosing correct door at first), and P(win when switching) = P(choosing any incorrect door at first).


Another way to verify the solution is to code a Monte Carlo simulation of Monty Hall

This can be done with ChatGPT. No code corrections needed.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: