Saturday, October 09, 2010

Tests of randomness

     If you do a Google search you can find several sites that have "tests of randomness." Of course, the tests do not actually test the randomness of a source. Is the sequence of bits "0000000000000000" random? It could be, if, say it were generated as the result of my flipping a coin sixteen times and having it come up heads each time. The odds of such an event are a little better than 1 in 66 thousand. Still, the result "0011111011011010" looks more random. Whether a sequence of digits is random depends on how it was generated; and that cannot be tested after the fact.
     The terminology is, in fact, a type of shorthand. It is easier to say "testing randomness" than it is to say "testing statistical results for conformity to the expected range produced by a truly random source." The people who do this know what they are actually doing. Outsiders probably don't often check the sites. Still, I find it interesting.
     One thing I do find objectionable is the fact that they use threshholds that are appropriate when only more limited data are available. The 99% significance level is appropriate for a drug trial in which it is - ah - impractical to use a million test subjects. But it is a simple matter to simulate a billion coin flips using a pseudo-random number generator. The tests could be made more specific without losing sensitivity.

No comments: