When Everyone Corrected the World's Smartest Woman

Written by leinad520 | Published 2020/05/04
Tech Story Tags: python | learning-to-code | problem-solving | programming | coding | python-basics | the-monty-hall-problem | hackernoon-top-story

TLDR When Marilyn Von Savant answered the Monty Hall Problem correctly in 1991, she was inundated with over 10,000 letters from academics and Ph.Ds criticizing her “error” The answer is that you will win 2/3 of the time by switching. I wanted to try writing the game in Python to see if I really win around 6,667 times (2/3) by switching, by switching the answer. The results were 6547, 6603, 6714, 6738, and 6738. All within 1% from the expected 6,000 wins. The Intuitive Solution is the Intuitive solution.via the TL;DR App

I find the Monty Hall Problem one of the most fascinating brain teasers, because it seems deceivingly simple. When Marilyn Von Savant, the woman with the highest IQ, answered this brainteaser correctly in 1991, she was inundated with over 10,000 letters from academics and Ph.Ds criticizing her “error”, only to be proven later that she was correct.

The problem goes like this:

The Monty Hall Problem

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.

Code

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 Intuitive Solution

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. 

Written by leinad520 | nestwallet.xyz | Prev. @ Draper Associates, Point72 | ksydaniel.com
Published by HackerNoon on 2020/05/04