Object Library > Applets > Monty Hall Experiment
In the Monty Hall experiment, there are three doors; a car is behind one and goats are behind the other two. The player selects a door and then the host opens one of the other two doors. The player can then stay with her original selection or switch to the remaining unopened door. The door finally selected by the player is opened and she either wins or loses.
Either of two host strategies can be selected with the list box. In the standard strategy, the host always opens a door with a goat); in the blind strategy, the host randomly opens one of the two doors available to him. The player switches doors with probability p, a parameter that can be varied with a scroll bar. Variable G indicates the event that the host opened a door with a goat; variable S indicates the event that the player switched doors; and variable W indicates the event that the player wins the car.
The density of W is shown in blue the distribution graph and is recorded in the distribution table. On each update, the empirical density of W is shown in red in the distribution graph and is recorded in the distribution table.
This applet illustrates the following topics and concepts. Click on the links to learn more about the mathematical theory.
Click on the link below to download the Java archive file:
To add the applet to your web page, insert the following in the html file, at the point where you want the applet to appear:
<applet code="edu.uah.math.experiments.MontyHallExperiment.class"
archive="MontyHallExperiment.jar" width="550" height="350"></applet>
The jar file and the html file must be in the same folder.
This width and height dimensions are simply suggestions and can be varied. Generally, components such as graphs and tables expand and contract proportionally, while components such as buttons, scrollbars, dice, and coins are fixed in size.
Copyright © 2001-2003 Kyle Siegrist, Dawn Duehring
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
If you are interested in the Java source code or the Java documentation and object model for this applet, please visit MontyHallExeriment in the Object section of the Library.