You are here

The Probability/Statistics Object Library - The Dice Experiment

Kyle Siegrist

Figure 1 shows a screen shot of the Dice Experiment, a typical applet in the library. 

  • If your browser supports Java (version 1.4 or later), you can click on Figure 1 to open a new web page with the live applet. (Note: The author has converted the applets to HTML5 with JavaScript. The images seen here are no longer what you will see with the applet. Ed, 2014.)
  • If you need to install the Java plug-in for your browser, visit

Click to launch the applet

Figure 1. A typical view of the Dice Experiment

The Dice Experiment applet is a virtual random experiment that rolls dice, collects data, and displays the data in tables and a graph. Specifically, the basic experiment is to roll n dice and record the values of the following random variables:

  • Y: the sum of the n dice scores
  • M: the average of the n dice scores
  • U: the minimum of the n dice scores
  • V: the maximum of the n dice scores
  • Z: the number of aces (1's) among the n dice scores

The simulation is controlled by the buttons and selection boxes in the main toolbar (Figure 2) at the top.

Figure 2. The main toolbar

  • The first button   runs the experiment one time -- the dice are rolled one at a time, with audible feedback, and then the tables and graphs are updated.
  • The second button   runs the experiment repeatedly. In this mode,
    • the dice are rolled all at once on each run of the experiment,
    • the tables and graphs are updated periodically, according to the number in the Update setting, and
    • the simulation stops after the number of runs specified in the Stop setting.
  • The third button   in the main toolbar can be used to stop the simulation at any time -- the data in the tables and graphs are preserved.
  • The fourth button   in the main toolbar clears the data in the tables and graphs and restores the applet to its initial state.

The table on the left records the values of the five random variables on each update. The table on the right gives the probability mass function, mean, and standard deviation of a selected random variable in the distribution column, and the relative frequency function, empirical mean, and empirical standard deviation in the data column. The graph on the right gives exactly the same information as the table on the right, but in graphical form rather than numerical form. Information about the theoretical distribution is displayed in blue, and information about the empirical data is displayed in red. The choice of the random variable to display in the table and graph is made with the drop-down box in the second toolbar (Figure 3).

Figure 3. Selection of random variable

The number of dice can be varied from 1 to 30 with the scroll bar. Clicking on the die icon brings up a dialog box (Figure 4) for specifying the probabilities that govern each die:

Figure 4. The die probabilities dialog box

The buttons along the top of this dialog box specify six "pre-packaged" die distributions. The first gives uniform probabilities (corresponding to a fair die), and the others give various non-uniform distributions for a crooked die. Additionally, the student can specify the probabilities directly in the text boxes.

Information about each component in the applet is given in a tool tip that appears when the student rests the cursor on the component. Basic information about the applet is also given in a help box that pops up when the student clicks on the information button in the main toolbar.

In the next section I will cover the nuts and bolts of how you could include this applet in your own Web-based course materials. Then I will return to the more interesting discussion of pedagogical issues.

Kyle Siegrist, "The Probability/Statistics Object Library - The Dice Experiment," Loci (October 2004)


Journal of Online Mathematics and its Applications