﻿ Monty Hall Problem | JavaScript | Computing ﻿

# The Monty Hall Problem

You are a contestant in a game show. There are three doors, behind one of which is a prize. You are given the opportunity to select a door to open. Before you are allowed to open the door, the host opens another door to reveal that there is no prize behind it, and offers you the opportunity to change your mind. What should you do? This is also known as the Monty Hall problem.

Probability of winning after changing selection:

Probability of winning with original selection:

Sample size:

## Instructions

• First, select a door by clicking on it. A question mark will appear to indicate that that is the door you have chosen. You may change your mind as many times as you like at this point.
• Click the "Play" button. The host will open one of the doors behind which there is no prize; this is indicated by the red cross.
• You can now change your mind. Select one of the remaining doors.
• Click the "Play" button again. A green tick will appear in place of the door that conceals the prize. The status field will describe the outcome and the probabilities will be updated.
• To play again and calculate the probabilities over a larger sample size, click "Reset".