Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Random sequence testing

1 view
Skip to first unread message

Tritt

unread,
Jul 2, 2009, 6:05:10 AM7/2/09
to
Hi,
im trying to make my own random-seq-tester built upon fourmilab's ent
(http://www.fourmilab.ch/random/).
Im not trying solely to make it but understand it too. Im a computer
scientist so i have , at some degree, notions on statistics and such.
The first thing that call my atention on the code was a mention to the
Niswander and Workman theorem that approximates the Chi^2 to a Normal
distribution when k>>.
Code:

chip = sqrt(2.0 * chisq) - sqrt(2.0 * DF - 1.0);
a = fabs(chip);
for (i = 15; i >= 0; i--) {
if (chsqt[1][i] < a) {
break;
}
}
chip = (chip >= 0.0) ? chsqt[0][i] : 1.0 - chsqt[0][i];

Where chisq is the result of a goodness of fit test, DF is degreess of
freedom (1 or 255 for bit and byte samples) and chsqt is an array with
a simplified N(0,1) table
But, here is what i do not understand...
In the manual page of the original program (Ent) John Walker states:
''
The chi-square test is the most commonly used test for the randomness
of data, and is extremely sensitive to errors in pseudorandom sequence
generators. The chi-square distribution is calculated for the stream
of bytes in the file and expressed as an absolute number and a
percentage which indicates how frequently a truly random sequence
would exceed the value calculated. We interpret the percentage as the
degree to which the sequence tested is suspected of being non-random.
If the percentage is greater than 99% or less than 1%, the sequence is
almost certainly not random. If the percentage is between 99% and 95%
or between 1% and 5%, the sequence is suspect. Percentages between 90%
and 95% and 5% and 10% indicate the sequence is “almost suspect”.
''

WTF, i dont get it. Why such decisions? my own experiments (a few of
them) say to me that the higher chip is, the higher probability of the
sample being random.
Ive made, literally, 20 handmade cases for 1 DF and each of them
proves me right. Am I?
Thanks.

0 new messages