The problem goes like this:
You’re on a game show. There are three doors. Behind one of them is a car. Behind the other two are donkeys. You get to open one door, in hopes of getting the car!
But then, this happens:
(I reposted the Monty Hall problem from Adam Zerner’s post, https://medium.com/@adamzerner/monty-hall-problem-346bc6392b0a)
Take a pause and think of what you would do and why before going on to the next line.
.
.
.
At this point, most people see it as a 50 / 50 decision. The answer, however, is that you will win 2/3 of the time by switching.
I wanted to try writing the Monty Hall game in Python and have it run 10,000 times to see if I really win 2/3, or around 6,667 times out of 10,000 plays, by switching.
You can see the code here.
Here are the results:
After running it four times, the results were 6547, 6603, 6714, and 6738. All within 1% from the expected 6,667 wins (2/3 * 10,000 tries).
The easiest way to understand why that is, is to imagine that there is a car behind door 1, and goats behind door 2 and 3. When you pick door 1 initially, you will lose by switching.
In the same scenario, had you picked door 2, the host would have shown door 3 with the goat, you would win by switching to door 1. Same if you had picked door 3. So 2/3 times, you win by switching.