page_title: Monty Hall problem
section_title: Solutions by simulation
hierarchical_section_title: Monty Hall problem / Solutions using conditional probability and other solutions / Solutions by simulation
context_page_description: The Monty Hall problem is a brain teaser, in the form of a probability puzzle, loosely based on the American television game show Let's Make a Deal and named after its original host, Monty Hall. The problem was originally posed in a letter by Steve Selvin to the American Statistician in 1975. It became famous as a question from a reader's letter quoted in Marilyn vos Savant's "Ask Marilyn" column in Parade magazine in 1990:
  Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
  Vos Savant's response was that the contestant should switch to the other door. Under the standard assumptions, contestants who switch have a chance of winning the car, while contestants who stick to their initial choice have only a chance.
  The given probabilities depend on specific assumptions about how the host and contestant choose their doors.
context_section_description: A simple way to demonstrate that a switching strategy really does win two out of three times with the standard assumptions is to simulate the game with playing cards (Gardner 1959b; vos Savant 1996, p. 8). Three cards from an ordinary deck are used to represent the three doors; one 'special' card represents the door with the car and two other cards represent the goat doors.
  The simulation can be repeated several times to simulate multiple rounds of the game. The player picks one of the three cards, then, looking at the remaining two cards the 'host' discards a goat card. If the card remaining in the host's hand is the car card, this is recorded as a switching win; if the host is holding a goat card, the round is recorded as a staying win. As this experiment is repeated over several rounds, the observed win rate for each strategy is likely to approximate its theoretical win probability, in line with the law of large numbers.
  Repeated plays also make it clearer why switching is the better strategy. After the player picks his card, it is already determined whether switching will win the round for the player. If this is not convincing, the simulation can be done with the entire deck. (Gardner 1959b; Adams 1990). In this variant, the car card goes to the host 51 times out of 52, and stays with the host no matter how many non-car cards are discarded.
caption: Simulation of 29 outcomes of the Monty Hall problem