Use the following HTML code to embed the calculators within other websites:
Class RandomSample
The negative binomial distribution, also known as the Pascal distribution or Pólya distribution,
gives the probability of successes and failures in trials,
and success on the th trial. The probability density function is therefore given by
Using this class, the diagram below is generated from two distinct sequences of 1000 random numbers.
Each pair of numbers are plotted against each other, to illustrate the negative binomial behaviour
of this non-uniform random number generator.
Below you will find 20 numbers corresponding to the output of the first generator :
1210121312777713771131112157810
Speed:
The average running time for generating 100,000,000 random numbers using this class
on a 750MHz microprocessor is 72 seconds.
The Newran03 random number generator library of Robert Davies, http://www.robertnz.net/nr03doc.htm
Example 1
The following example displays 40 random floating point numbers from a negative binomial distribution.
It uses two different generators to achieve this. The first generator uses a particular value
to initialize the seed, while the second one is using the system timer. Notice that it was necessary
to divide the timer with the MERSENNEDIV value in order to keep the seed in the (0, 1) interval.
Since the seed of the first generator is never changed, the first 20 numbers will always
remain the same. However since the second generator is initialized via the system timer,
the next 20 numbers will obviously vary with each execution of the program,