- #1
Mr Peanut
- 30
- 0
I have a byte array of length 16384 bytes obtained from random.org/bytes.
There is a random number sequence test program available from http://www.fourmilab.ch/random/ that, when run on my byte array, returns the following:
**The ENT program's author was John Walker, September 1996 ( http://www.fourmilab.ch)
I am able to reproduce the results using my own implementations for all parameters except the serial correlation result. The author states: this quantity measures the extent to which each byte in the file depends upon the previous byte. I am able to follow the source code for the computation but I cannot identify what test is being performed.
One alternate approach I tried was to divide the array into two arrays that repeated the original array with an offset of 1 index (e.g. {1,2,3,4,5,...n} => (1,2,3,4,...n-1} and {2,3,4,5,...n}. I computed the the Pearson's Correlation for the resultant arrays: 0.009000. The approach, as expected, gives exactly 1.0 when testing a pair of arrays that are perfectly correlated (e.g. y = 2*x).
Is using my approach a valid way to determine the extent to which each byte in the sequence depends upon the previous byte?
(Does anyone know what test John Walker was implementing? The source code is available at http://www.fourmilab.ch/random/random.zip)
There is a random number sequence test program available from http://www.fourmilab.ch/random/ that, when run on my byte array, returns the following:
Code:
Entropy = 7.989469 bits per byte.
Optimum compression would reduce the size
of this 16384 byte file by 0 percent.
Chi square distribution for 16384 samples is 240.41, and randomly
would exceed this value 73.54 percent of the times.
Arithmetic mean value of data bytes is 127.5778 (127.5 = random).
Monte Carlo value for Pi is 3.164835165 (error 0.74 percent).
Serial correlation coefficient is -0.007476 (totally uncorrelated = 0.0).
**The ENT program's author was John Walker, September 1996 ( http://www.fourmilab.ch)
I am able to reproduce the results using my own implementations for all parameters except the serial correlation result. The author states: this quantity measures the extent to which each byte in the file depends upon the previous byte. I am able to follow the source code for the computation but I cannot identify what test is being performed.
One alternate approach I tried was to divide the array into two arrays that repeated the original array with an offset of 1 index (e.g. {1,2,3,4,5,...n} => (1,2,3,4,...n-1} and {2,3,4,5,...n}. I computed the the Pearson's Correlation for the resultant arrays: 0.009000. The approach, as expected, gives exactly 1.0 when testing a pair of arrays that are perfectly correlated (e.g. y = 2*x).
Is using my approach a valid way to determine the extent to which each byte in the sequence depends upon the previous byte?
(Does anyone know what test John Walker was implementing? The source code is available at http://www.fourmilab.ch/random/random.zip)