In this exercise you will practice
The Monty Hall Problem, based on a famous American TV game show, is a famous exercise in probabilistic thinking. You are shown three doors, behind one of which is a prize. You choose one of the three doors, and the host opens one of the other two doors after checking that it does not contain the prize. You may then choose
The question: which strategy has the highest probability of winning? The answer is so counter-intuitive that even the famous mathematician Paul Erdös1 had to be shown a Monte Carlo computer simulation before he would believe it.
Write a program, monty_hall.py
, that simulates 100 trials of the game described above where the player chooses stay, then 100 trials where the player chooses switch. Report the sum of the wins with each strategy, stay versus switch.
My Erdös Number is 5 (Charles Isbell -> David Roberts -> Fred Roberts -> multiple -> Paul Erdös) ↩︎