Need Suggestions for Random Numbers

Jay R. Freeman freeman at MasPar.COM
Tue Oct 5 13:55:02 PDT 1993



> Also, can anyone recommend a statistical test for randomness, or
> for detecting repeating patterns in a "random" file?

  Try using consecutive calls to your random-number generator to
generate two-dimensional coordinate pairs, and plot them.  That is,
you do something like:

     for( i = 0; i < LOTS; ++i ) {
        x[i] = rand();
        y[i] = rand();
        }
     for( i = 0; i < LOTS; ++i ) {
        plot_point( x[i], y[i] );
        }

It's surprising how fast this will demolish many psuedorandom
generators (and how good the eye is at pulling patterns out of plots).

  And as far as nominal sources of "white" noise, be careful to avoid
contamination from 60-cycle power-line noise and its harmonics.  Do
a Fourier transform and look for peaks, for sure.

  I'm sure that the pros know lots of tricks like this.

                                 -- Jay "not a pro" Freeman






More information about the cypherpunks-legacy mailing list