Testing randomness
Posted by jad on Dec 1st, 2006
I wrote about installing a Araneus Alea I the other day. Since then I have been reading about how you test random number generators.
There is a discussion of this subject at Hotbits. This a web based random number generator that uses radioactive decay to generate the numbers. They have a program called ENT for testing binary data sequences.
Generating 1000000 random bytes with the Alea I can be done like this.
time ./randomfile -b 1000000 > /tmp/myrandom real 1m21.073s user 0m0.066s sys 0m0.134s
Testing with the ENT program gives these results
./ent /tmp/myrandom Entropy = 7.999817 bits per byte. Optimum compression would reduce the size of this 1000000 byte file by 0 percent. Chi square distribution for 1000000 samples is 252.96, and randomly would exceed this value 50.00 percent of the times. Arithmetic mean value of data bytes is 127.5287 (127.5 = random). Monte Carlo value for Pi is 3.144636579 (error 0.10 percent). Serial correlation coefficient is 0.000713 (totally uncorrelated = 0.0).
According to the ENT manual this is very random data. Next I will be looking at what the NIST random number test tools have to say.

