Roll 2 to 8 Dice

Copying dice

dice is a program that allows you to roll 2 to 8 dice at the same time to see what the total score is. It is used in the datagen package to illustrate the chi-square test.

dice has two parameters:

Example of how to run the program.

      dice 10000 5

In this example, the program rolls 5 dice 10 thousand times and then prints the probability distribution, the observations, the standard deviation, and the chi-square test.

The Chi-square number should fit within the Range 95 percent of the time.


References

The calculation of probabilities for the score of the dice is based on the following book:

Lincoln L. Chao
Statistics for Management
2nd Edition
Palo Alto: The Scientific Press, 1984
Chapter 6, Expected Value and Population Parameters
Section 2, Population Mean and Variance

Lincoln L. Chao published his book while at California State University, Long Beach.

The chi-square test is similar to:

Chapter 12, Chi-square Tests
Section 3, Testing for Goodness of Fit
Formula 12-3
Example 12-4

In Table 12-3, each category in the chi-square test has a different expected frequency. This corresponds to the different expected frequencies for the score of the dice.


John Scarne
Scarne's New Complete Guide to Gambling
Fully revised, expanded, updated edition
New York: Simon & Schuster, 1961, 1974, 1986
A Fireside book, 871 p.
ISBN: 0-671-21734-8 hardback
ISBN: 0-671-63063-6 paperback
Chapter 11, Correct Odds in Dice Games Using Two, Three, Four, or Five Dice