![]() ![]() Monobit of first 200,000: 114 Pass.Īll bits from 0 to 15 fail the OFT, yet pass the Monobit test. (Note: The Diehard Overlapping Sums test is both inferior and faulty, not a faithful interpretation of Marsaglia's original Fortran code.) There are a propensity of choices from NIST, Diehard, Dieharder, Crusher. (Note that the expected total of the smallest LOR bin for "more than j" is equal to the jth bin.)Īnd then what? For many games, these two tests are all you need. Recommended is the Length Of Runs test with sample size 200,000 with 15 degrees of freedom fed into the K-S test 200 times. ![]() The OFTest does not subsume the LOR test. Any RNG which fails this test should not be tested further and immediately replaced. Shown above is a superior new Ordered Frequency Test. The K-S test is very simple It is also quite effective. The K-S answer is not a p value and should not exceed 0.115 for 200 p values. If (Kback > ansBack) Set ansBack := Kback Here is pseudocode to obtain the K-S maximum difference: Set low := 0 Set n := 200 įor (j := 0 j ansForward) Set ansForward := Kforward Different experts recommend the number of inputs to the K-S test to be from 10 to 1000. Step 4: The p values are fed to a 0-1.0 straight line Kolmogorov-Smirnov test. So, instead of a single p value for a single set sometimes providing a p value below 0.01 for an excellent RNG, many sets of sessions are taken. Some, for the sake of safety, consider 1 or 2 zeroes enough and they are in error. Some consider 6 zeroes bad enough to qualify as a definite clear failure. One test suite considers 300 zeroes to the right of the decimal as infinitesimally bad and 10-14 in a row as quite bad. Under 0.001 is where definite problems usually occur. Can an RNG be too close to perfection too often? Yes, being too predictable. ![]() P values above 0.999 are close to perfection. Step 3: A chi-square is taken on these 18 values with 17 degrees of freedom giving a resulting p value. This equation works with any number of tosses. The equation to obtain the exact percentages for bins b=2 and tosses t=100 is:įor 100-0, the odds are 1 / (2^99) = 1 / (2^(t-1))įor 99-1 previous multiplied by 100 (t) divide by 1įor 98-2 previous multiplied by 99 (t-1) divide by 2įor 97-3 previous multiplied by 98 (t-2) divide by 3įor 51-49 previous multiplied by 52 (t-48) divide by 49įor 50-50 previous multiplied by 51 (t-49) divide by 50, then divide again by 2. Minimal gain occurs above 2000.Įxpected values for 2000 sessions of 100 tosses:ĥ0-50 159.1784748 (Notice that 50-50 occurs a mere 7.96% of the time.) 2000 converges well, so 2000 different samples of 100 tosses are used. Step 2: Choice of number of Sessions: 50 sessions is never sufficient, even with huge sample sizes in the millions. Step 1: Choice of sample size: 100 tosses / bits. 50-50 is not the expected value of the ordered bins, so this test is superior to any frequency test that instead expects 50-50. When coins are flipped 100 times, the expected values are 53.9795 of one and 46.0205 of the other, sometimes more heads, sometimes more tails. This test subsumes any frequency test that expects 50-50 because it is more stringent.ĭefinitions: t= tosses / trials b=bins / urns s=sessions of tosses n=sets of sessionsīecause coin tosses are usually not 50-50, this new test can be utilized with great effectiveness using a pool of 40,000,000 bits. That said, described here is a simple effective new Ordered Frequency Test for bits. We actually don't need too many RNG tests because many "subsume" one another. Ī note about testing a Random Number Generator: The preliminary test for any RNG is the Monobit test used by the NIST which simply counts the number of 1s and 0s. Here is a detailed explanation of how to start. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |