Assignment 3:

The Monty Hall Problem:

The Monty Hall problem comes from a TV game show, “Lets’ Make A Deal,” hosted by Monty Hall. A contestant is shown three doors. Behind one door is a car, behind the other two doors are goats. The contestant chooses a door. Monty Hall then opens another door, which he knows is hiding a goat. The contestant then has the option of staying with his original choice, or switch to the one remaining unopen door. Should the contestant switch? Our assignment is to create a simulator for the Monty Hall problem. We’ll need an array of size three.

The program should:

* Repeat 1000 times:

  • Randomly place the prize in the array and randomly choose a door for the contestant.
  • Eliminate a door that was not chosen, and does not have the prize.
  • Do not have the contestant switch to the remaining door, and record as a win/loss as appropriate.

*Repeat the above 1000 times again, but this time switch to the remaining door.

* Present results

Note: The answer is counterintuitive. For an explanation and analysis, you can check here: http://montyhallproblem.com/

courses/cs203-200803/assignments/monty_hall_problem.txt · Last modified: 2009/02/10 11:52 by jones
VCCS Top Events Extended Site Search Login Vassar Science Web Vassar Home Driven by DokuWiki Valid XHTML 1.0