Monty Hall

In this exercise you will practice

Problem Description

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

  1. to stay with your initial choice, or
  2. switch to the other unopened door.

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.

Solution Description

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.

Tips and Considerations


  1. My Erdös Number is 5 (Charles Isbell -> David Roberts -> Fred Roberts -> multiple -> Paul Erdös) ↩︎