Simulate The Monty Hall Problem

Made without AI ✔️

The Monty Problem

The Monty Hall problem is a famous problem that has puzzled many people, and still does.

Simply explained, Monty provides you with 3 doors, behind 2 doors is a goat, and behind 1 is a car. If you pick a door, for example 2 and he then revealed that door 3 is a goat you would have a much higher probability of getting the car by switching

Heres why. Imagine you had 1,000,000 doors. We can all agree that if we have absolutly no clue what door the car is behind, it is basically impossible to guess correctly. We would have a 1 in a million chance in getting it correctly. Now, imagine we choose door 103400. If monty then reveals EVERY SINGLE DOOR except door 503930 and your door, it would only make sense to switch, because when you guessed you had a 1 in a million chance of getting the car, but this mysterious other door monty hasen't opened has a 999,999 in a million chance, because most likley, the reason he didn't reveal this door is because it was the car. I haven't explained this very well, but basically, it is much more likley for monty to of not opened door 503930 because it is a car than because you have the car and so he is forced to randomly leave a door, considering you had a 1 in a million chance to guess the car.

If you scale this down, thats basically what the monty door problem is, however instead of 1 in a million, its 1/3 to guess the car at the start, then when he reveals another door is a goat, its a 2/3 chance that switching wins you the car.

At the time of coding in, I didn't actually believe switching increased your chances. I thought that a lot of the online simulations were possibly tinkered with, or only in favour of switching because of how computers run through code, so I decided to code it myself, no AI, in javascript.

The source code is fully available via inspect. You are welcome to use it for your own website, as long as you do not claim it as your own. Please insert the following code if you would like to use the simulation for your own webpage: <footer>I do not claim to own any of the code used for this Monty Hall problem simulation, it was made by Ben - benswebsite.click</footer>