Difference Between Datagen and Ran2

Binomial Distribution

Copying twobnm

twobnm is a program that allows you to create two binomial distributions, based on two different randomizing routines. The resulting means are subtracted and compared to zero. The program displays an upper and lower limit with 95 percent confidence for the difference between the means.

The purpose of this program is to show that the random number generator in datagen compares favorably to one of the best pseudo-random number generators in existence.

twobnm is a program that allows you to conduct from 2 to 30 binomial experiments to see how many successes you have after a given number of trials.

twobnm has the following parameters:

Examples of how to run the program.

      twobnm 10000 17 0.6

In this example, the program makes 17 trials for success, 10 thousand times, and then prints the probability distribution, the standard deviation, and the chi-square test.

Each random number generator has separate results. The means for each generator are compared and the difference is printed out. The test fails if the difference is greater than the confidence level of 95 percent.


References

The calculation of probabilities for the sample mean distribution is based on the following book:

Lincoln L. Chao
Statistics for Management
2nd Edition
Palo Alto: The Scientific Press, 1984
Chapter 7, Discrete Probability Distributions
Section 2, Binomial Distribution

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


The ran2 random number generator is taken from:

Numerical Recipes in C
Chapter 7.1