The Monty Hall Problem: Play it Yourself

If you're not convinced that switching is the best strategy for the Monty Hall problem, why not try it yourself?

Here's a Java applet that lets you play the game repeatedly. It keeps track of wins and losses for both the stay and switch strategies. It's an honest applet that doesn't try anything underhanded. As a matter of fact, it's so honest that it tells you where the prize is. Try it. You'll see.

[You should be seeing an applet now.
Turn on Java if you can.]

It's easy to use. Just click on one of the question marks. The door you select is marked with a circle. Also, all remaining doors but one are revealed to be a booby prize (denoted by a red X). You can then click on either door that has a question mark. The result is then added to the running win/loss totals. If you want to reset these totals, just click the Reset button.

This also has an autoplay feature which lets the machine choose doors randomly. It's a quick way to let numbers add up. It plays 200 games. Scores will reset automatically when 10000 games have been played.

Remember that we're dealing with probability. Win/lose ratios won't be exactly 2 to 1 or 1 to 2. It might take a large number of games before the win/lose ratios approach the predicted values. Play more than just a few games. Try a few hundred.

Now, see how it works when there are more than three doors.

[Same applet, but with six doors.]

See how the stay and switch win/lose rations are the inverse of each other? In this case, they should run 5 to 1 and 1 to 5. In general, with n doors, the win/lose ratio for switching should be n-1 to 1.

A true scientist wouldn't trust the results without knowing how this applet works. For all you skeptics out there, here's the Java source.

Last updated 7 August 2003
All contents ©1998-2003 Mark L. Irons