Next: , Previous: Prime Numbers, Up: Mathematical Packages


5.6 Random Numbers

A pseudo-random number generator is only as good as the tests it passes. George Marsaglia of Florida State University developed a battery of tests named DIEHARD (http://stat.fsu.edu/~geo/diehard.html). diehard.c has a bug which the patch http://groups.csail.mit.edu/mac/ftpdir/users/jaffer/diehard.c.pat corrects.

SLIB's PRNG generates 8 bits at a time. With the degenerate seed ‘0’, the numbers generated pass DIEHARD; but when bits are combined from sequential bytes, tests fail. With the seed ‘http://swissnet.ai.mit.edu/~jaffer/SLIB.html’, all of those tests pass.