Verifying uniform distribution of random numbers

Doug Palmer doug at charvolant.org
Tue Apr 9 13:18:11 EST 2002


On 2002.04.09 11:55 Brad Hards wrote:

> In addition to not paying much notice this time round, I was a lousy
> student
> of stats, and while I think that there is some statistical test
> (chi-squared?) to test hypothesis about distributions, I know nothing
> about
> it. I don't even have the textbook (which might explain why I nearly
> failed
> stats :)

If you can get hold of a copy of Knuth volume 2 (Semi-numerical 
algorithms) then that book contains a lot on how to test for decent 
pseudo-random number generation. Sorry, I don't have my copy to hand at 
the moment.

"Numerical Recipes in C" also has a chapter on random number generation. 
See http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf.html You 
might just want to use one of their algorithms, suitably re-written so 
that you're both not violating the copyright conditions and not writing 
FORTRAN in C. That way you've got something authoritatively correct.

Or you could just use the lava lamp method :-) http://lavarand.sgi.com/ 
though I can't contact it at the moment. Or, more boringly, bits generated 
from Cesium decay http://www.fourmilab.ch/hotbits/ (This site also has a 
randomness test program that you might want to use)

-- 
Doug Palmer     http://www.charvolant.org/~doug   doug at charvolant.org




More information about the linux mailing list