FOR COMPARISON PURPOSES, WE USED THE rand() FUNCTION IN VISUAL C++ 6 TO GENERATE A 12.5 MB FILE OF TEST DATA. WE PERFORMED THE SAME TESTS AS ON THE FILE GENERATED BY REALLY RANDOM NUMBERS. NOTICE THE DIFFERENCES: * The C++ generated file fails the chi-square test badly with ENT.EXE * The C++ generated file generates extreme p-values 0 or 1 often with DIEHARD.EXE CONCLUSION? C++ DOES NOT GENERATE REALLY RANDOM NUMBERS. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: TEST RESULTS FROM ENT.EXE :: :: http://www.fourmilab.ch/random/ :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Entropy = 7.999997 bits per byte. Optimum compression would reduce the size of this 12750000 byte file by 0 percent. Chi square distribution for 12750000 samples is 59.25, and randomly would exceed this value 99.99 percent of the times. Arithmetic mean value of data bytes is 127.5046 (127.5 = random). Monte Carlo value for Pi is 3.140747294 (error 0.03 percent). Serial correlation coefficient is 0.000092 (totally uncorrelated = 0.0). ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: TEST RESULTS FROM DIEHARD.EXE :: :: http://stat.fsu.edu/~geo/diehard.html :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: NOTE: Most of the tests in DIEHARD return a p-value, which should be uniform on [0,1) if the input file contains truly independent random bits. Those p-values are obtained by p=F(X), where F is the assumed distribution of the sample random variable X---often normal. But that assumed F is just an asymptotic approximation, for which the fit will be worst in the tails. Thus you should not be surprised with occasional p-values near 0 or 1, such as .0012 or .9983. When a bit stream really FAILS BIG, you will get p's of 0 or 1 to six or more places. By all means, do not, as a Statistician might, think that a p < .025 or p> .975 means that the RNG has "failed the test at the .05 level". Such p's happen among the hundreds that DIEHARD produces, even with good RNG's. So keep in mind that " p happens". ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the BIRTHDAY SPACINGS TEST :: :: Choose m birthdays in a year of n days. List the spacings :: :: between the birthdays. If j is the number of values that :: :: occur more than once in that list, then j is asymptotically :: :: Poisson distributed with mean m^3/(4n). Experience shows n :: :: must be quite large, say n>=2^18, for comparing the results :: :: to the Poisson distribution with that mean. This test uses :: :: n=2^24 and m=2^9, so that the underlying distribution for j :: :: is taken to be Poisson with lambda=2^27/(2^26)=2. A sample :: :: of 500 j's is taken, and a chi-square goodness of fit test :: :: provides a p value. The first test uses bits 1-24 (counting :: :: from the left) from integers in the specified file. :: :: Then the file is closed and reopened. Next, bits 2-25 are :: :: used to provide birthdays, then 3-26 and so on to bits 9-32. :: :: Each set of bits provides a p-value, and the nine p-values :: :: provide a sample for a KSTEST. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: BIRTHDAY SPACINGS TEST, M= 512 N=2**24 LAMBDA= 2.0000 Results for RANDOM.DAT For a sample of size 500: mean RANDOM.DAT using bits 1 to 24 6.574 duplicate number number spacings observed expected 0 0. 67.668 1 3. 135.335 2 11. 135.335 3 37. 90.224 4 49. 45.112 5 81. 18.045 6 to INF 319. 8.282 Chisquare with 6 d.o.f. = 12220.25 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 2 to 25 5.686 duplicate number number spacings observed expected 0 1. 67.668 1 10. 135.335 2 39. 135.335 3 47. 90.224 4 73. 45.112 5 87. 18.045 6 to INF 243. 8.282 Chisquare with 6 d.o.f. = 7204.03 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 3 to 26 5.470 duplicate number number spacings observed expected 0 0. 67.668 1 7. 135.335 2 35. 135.335 3 64. 90.224 4 77. 45.112 5 82. 18.045 6 to INF 235. 8.282 Chisquare with 6 d.o.f. = 6727.10 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 4 to 27 2.532 duplicate number number spacings observed expected 0 31. 67.668 1 115. 135.335 2 126. 135.335 3 93. 90.224 4 85. 45.112 5 31. 18.045 6 to INF 19. 8.282 Chisquare with 6 d.o.f. = 82.10 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 5 to 28 2.084 duplicate number number spacings observed expected 0 57. 67.668 1 132. 135.335 2 139. 135.335 3 91. 90.224 4 53. 45.112 5 22. 18.045 6 to INF 6. 8.282 Chisquare with 6 d.o.f. = 4.74 p-value= .423070 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 6 to 29 2.286 duplicate number number spacings observed expected 0 32. 67.668 1 129. 135.335 2 141. 135.335 3 98. 90.224 4 71. 45.112 5 20. 18.045 6 to INF 9. 8.282 Chisquare with 6 d.o.f. = 35.13 p-value= .999996 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 7 to 30 2.568 duplicate number number spacings observed expected 0 43. 67.668 1 94. 135.335 2 131. 135.335 3 85. 90.224 4 88. 45.112 5 39. 18.045 6 to INF 20. 8.282 Chisquare with 6 d.o.f. = 103.75 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 8 to 31 5.028 duplicate number number spacings observed expected 0 3. 67.668 1 20. 135.335 2 43. 135.335 3 62. 90.224 4 102. 45.112 5 79. 18.045 6 to INF 191. 8.282 Chisquare with 6 d.o.f. = 4540.80 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 9 to 32 6.682 duplicate number number spacings observed expected 0 1. 67.668 1 6. 135.335 2 11. 135.335 3 33. 90.224 4 51. 45.112 5 74. 18.045 6 to INF 324. 8.282 Chisquare with 6 d.o.f. = 12549.86 p-value= 1.000000 ::::::::::::::::::::::::::::::::::::::::: The 9 p-values were 1.000000 1.000000 1.000000 1.000000 .423070 .999996 1.000000 1.000000 1.000000 A KSTEST for the 9 p-values yields 1.000000 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: THE OVERLAPPING 5-PERMUTATION TEST :: :: This is the OPERM5 test. It looks at a sequence of one mill- :: :: ion 32-bit random integers. Each set of five consecutive :: :: integers can be in one of 120 states, for the 5! possible or- :: :: derings of five numbers. Thus the 5th, 6th, 7th,...numbers :: :: each provide a state. As many thousands of state transitions :: :: are observed, cumulative counts are made of the number of :: :: occurences of each state. Then the quadratic form in the :: :: weak inverse of the 120x120 covariance matrix yields a test :: :: equivalent to the likelihood ratio test that the 120 cell :: :: counts came from the specified (asymptotically) normal dis- :: :: tribution with the specified 120x120 covariance matrix (with :: :: rank 99). This version uses 1,000,000 integers, twice. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: OPERM5 test for file RANDOM.DAT For a sample of 1,000,000 consecutive 5-tuples, chisquare for 99 degrees of freedom= 48.942; p-value= .000006 OPERM5 test for file RANDOM.DAT For a sample of 1,000,000 consecutive 5-tuples, chisquare for 99 degrees of freedom= 44.644; p-value= .000001 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the BINARY RANK TEST for 31x31 matrices. The leftmost :: :: 31 bits of 31 random integers from the test sequence are used :: :: to form a 31x31 binary matrix over the field {0,1}. The rank :: :: is determined. That rank can be from 0 to 31, but ranks< 28 :: :: are rare, and their counts are pooled with those for rank 28. :: :: Ranks are found for 40,000 such random matrices and a chisqua-:: :: re test is performed on counts for ranks 31,30,29 and <=28. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Binary rank test for RANDOM.DAT Rank test for 31x31 binary matrices: rows from leftmost 31 bits of each 32-bit integer rank observed expected (o-e)^2/e sum 28 202 211.4 .419543 .420 29 5137 5134.0 .001741 .421 30 23230 23103.0 .697618 1.119 31 11431 11551.5 1.257508 2.376 chisquare= 2.376 for 3 d. of f.; p-value= .563550 -------------------------------------------------------------- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the BINARY RANK TEST for 32x32 matrices. A random 32x :: :: 32 binary matrix is formed, each row a 32-bit random integer. :: :: The rank is determined. That rank can be from 0 to 32, ranks :: :: less than 29 are rare, and their counts are pooled with those :: :: for rank 29. Ranks are found for 40,000 such random matrices :: :: and a chisquare test is performed on counts for ranks 32,31, :: :: 30 and <=29. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Binary rank test for RANDOM.DAT Rank test for 32x32 binary matrices: rows from leftmost 32 bits of each 32-bit integer rank observed expected (o-e)^2/e sum 29 223 211.4 .634489 .634 30 5107 5134.0 .142102 .777 31 23148 23103.0 .087468 .864 32 11522 11551.5 .075461 .940 chisquare= .940 for 3 d. of f.; p-value= .350319 -------------------------------------------------------------- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the BINARY RANK TEST for 6x8 matrices. From each of :: :: six random 32-bit integers from the generator under test, a :: :: specified byte is chosen, and the resulting six bytes form a :: :: 6x8 binary matrix whose rank is determined. That rank can be :: :: from 0 to 6, but ranks 0,1,2,3 are rare; their counts are :: :: pooled with those for rank 4. Ranks are found for 100,000 :: :: random matrices, and a chi-square test is performed on :: :: counts for ranks 6,5 and <=4. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Binary Rank Test for RANDOM.DAT Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 1 to 8 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 916 944.3 .848 .848 r =5 21782 21743.9 .067 .915 r =6 77302 77311.8 .001 .916 p=1-exp(-SUM/2)= .36752 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 2 to 9 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 958 944.3 .199 .199 r =5 21677 21743.9 .206 .405 r =6 77365 77311.8 .037 .441 p=1-exp(-SUM/2)= .19795 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 3 to 10 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 965 944.3 .454 .454 r =5 21813 21743.9 .220 .673 r =6 77222 77311.8 .104 .778 p=1-exp(-SUM/2)= .32214 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 4 to 11 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 875 944.3 5.086 5.086 r =5 21933 21743.9 1.645 6.730 r =6 77192 77311.8 .186 6.916 p=1-exp(-SUM/2)= .96851 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 5 to 12 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 906 944.3 1.554 1.554 r =5 21830 21743.9 .341 1.894 r =6 77264 77311.8 .030 1.924 p=1-exp(-SUM/2)= .61787 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 6 to 13 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 980 944.3 1.350 1.350 r =5 21821 21743.9 .273 1.623 r =6 77199 77311.8 .165 1.788 p=1-exp(-SUM/2)= .59089 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 7 to 14 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 982 944.3 1.505 1.505 r =5 21704 21743.9 .073 1.578 r =6 77314 77311.8 .000 1.578 p=1-exp(-SUM/2)= .54577 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 8 to 15 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 948 944.3 .014 .014 r =5 21757 21743.9 .008 .022 r =6 77295 77311.8 .004 .026 p=1-exp(-SUM/2)= .01293 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 9 to 16 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 1001 944.3 3.404 3.404 r =5 21548 21743.9 1.765 5.169 r =6 77451 77311.8 .251 5.420 p=1-exp(-SUM/2)= .93346 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 10 to 17 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 919 944.3 .678 .678 r =5 21588 21743.9 1.118 1.796 r =6 77493 77311.8 .425 2.220 p=1-exp(-SUM/2)= .67050 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 11 to 18 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 940 944.3 .020 .020 r =5 21693 21743.9 .119 .139 r =6 77367 77311.8 .039 .178 p=1-exp(-SUM/2)= .08522 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 12 to 19 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 912 944.3 1.105 1.105 r =5 21533 21743.9 2.046 3.150 r =6 77555 77311.8 .765 3.916 p=1-exp(-SUM/2)= .85882 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 13 to 20 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 922 944.3 .527 .527 r =5 21818 21743.9 .253 .779 r =6 77260 77311.8 .035 .814 p=1-exp(-SUM/2)= .33433 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 14 to 21 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 984 944.3 1.669 1.669 r =5 21690 21743.9 .134 1.803 r =6 77326 77311.8 .003 1.805 p=1-exp(-SUM/2)= .59448 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 15 to 22 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 1017 944.3 5.597 5.597 r =5 21663 21743.9 .301 5.898 r =6 77320 77311.8 .001 5.899 p=1-exp(-SUM/2)= .94763 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 16 to 23 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 954 944.3 .100 .100 r =5 21877 21743.9 .815 .914 r =6 77169 77311.8 .264 1.178 p=1-exp(-SUM/2)= .44515 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 17 to 24 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 996 944.3 2.830 2.830 r =5 21826 21743.9 .310 3.140 r =6 77178 77311.8 .232 3.372 p=1-exp(-SUM/2)= .81474 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 18 to 25 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 924 944.3 .436 .436 r =5 21840 21743.9 .425 .861 r =6 77236 77311.8 .074 .936 p=1-exp(-SUM/2)= .37359 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 19 to 26 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 925 944.3 .395 .395 r =5 21755 21743.9 .006 .400 r =6 77320 77311.8 .001 .401 p=1-exp(-SUM/2)= .18170 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 20 to 27 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 949 944.3 .023 .023 r =5 21693 21743.9 .119 .143 r =6 77358 77311.8 .028 .170 p=1-exp(-SUM/2)= .08155 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 21 to 28 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 929 944.3 .248 .248 r =5 21775 21743.9 .044 .292 r =6 77296 77311.8 .003 .296 p=1-exp(-SUM/2)= .13742 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 22 to 29 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 1009 944.3 4.433 4.433 r =5 21561 21743.9 1.538 5.971 r =6 77430 77311.8 .181 6.152 p=1-exp(-SUM/2)= .95386 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 23 to 30 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 963 944.3 .370 .370 r =5 21741 21743.9 .000 .371 r =6 77296 77311.8 .003 .374 p=1-exp(-SUM/2)= .17051 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 24 to 31 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 988 944.3 2.022 2.022 r =5 21542 21743.9 1.875 3.897 r =6 77470 77311.8 .324 4.221 p=1-exp(-SUM/2)= .87880 Rank of a 6x8 binary matrix, rows formed from eight bits of the RNG RANDOM.DAT b-rank test for bits 25 to 32 OBSERVED EXPECTED (O-E)^2/E SUM r<=4 926 944.3 .355 .355 r =5 21578 21743.9 1.266 1.620 r =6 77496 77311.8 .439 2.059 p=1-exp(-SUM/2)= .64287 TEST SUMMARY, 25 tests on 100,000 random 6x8 matrices These should be 25 uniform [0,1] random variables: .367518 .197947 .322135 .968509 .617873 .590890 .545770 .012932 .933461 .670501 .085223 .858825 .334327 .594479 .947627 .445153 .814739 .373590 .181698 .081550 .137418 .953857 .170508 .878801 .642871 brank test summary for RANDOM.DAT The KS test for those 25 supposed UNI's yields KS p-value= .095433 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: THE BITSTREAM TEST :: :: The file under test is viewed as a stream of bits. Call them :: :: b1,b2,... . Consider an alphabet with two "letters", 0 and 1 :: :: and think of the stream of bits as a succession of 20-letter :: :: "words", overlapping. Thus the first word is b1b2...b20, the :: :: second is b2b3...b21, and so on. The bitstream test counts :: :: the number of missing 20-letter (20-bit) words in a string of :: :: 2^21 overlapping 20-letter words. There are 2^20 possible 20 :: :: letter words. For a truly random string of 2^21+19 bits, the :: :: number of missing words j should be (very close to) normally :: :: distributed with mean 141,909 and sigma 428. Thus :: :: (j-141909)/428 should be a standard normal variate (z score) :: :: that leads to a uniform [0,1) p value. The test is repeated :: :: twenty times. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: THE OVERLAPPING 20-tuples BITSTREAM TEST, 20 BITS PER WORD, N words This test uses N=2^21 and samples the bitstream 20 times. No. missing words should average 141909. with sigma=428. --------------------------------------------------------- tst no 1: 142665 missing words, 1.77 sigmas from mean, p-value= .96127 tst no 2: 143178 missing words, 2.96 sigmas from mean, p-value= .99848 tst no 3: 142630 missing words, 1.68 sigmas from mean, p-value= .95389 tst no 4: 142420 missing words, 1.19 sigmas from mean, p-value= .88360 tst no 5: 143280 missing words, 3.20 sigmas from mean, p-value= .99932 tst no 6: 142999 missing words, 2.55 sigmas from mean, p-value= .99455 tst no 7: 142635 missing words, 1.70 sigmas from mean, p-value= .95501 tst no 8: 142651 missing words, 1.73 sigmas from mean, p-value= .95844 tst no 9: 142757 missing words, 1.98 sigmas from mean, p-value= .97618 tst no 10: 142842 missing words, 2.18 sigmas from mean, p-value= .98534 tst no 11: 142148 missing words, .56 sigmas from mean, p-value= .71146 tst no 12: 142588 missing words, 1.59 sigmas from mean, p-value= .94359 tst no 13: 142844 missing words, 2.18 sigmas from mean, p-value= .98551 tst no 14: 142798 missing words, 2.08 sigmas from mean, p-value= .98107 tst no 15: 142608 missing words, 1.63 sigmas from mean, p-value= .94870 tst no 16: 142358 missing words, 1.05 sigmas from mean, p-value= .85275 tst no 17: 143085 missing words, 2.75 sigmas from mean, p-value= .99699 tst no 18: 142985 missing words, 2.51 sigmas from mean, p-value= .99402 tst no 19: 143131 missing words, 2.85 sigmas from mean, p-value= .99784 tst no 20: 142854 missing words, 2.21 sigmas from mean, p-value= .98635 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: The tests OPSO, OQSO and DNA :: :: OPSO means Overlapping-Pairs-Sparse-Occupancy :: :: The OPSO test considers 2-letter words from an alphabet of :: :: 1024 letters. Each letter is determined by a specified ten :: :: bits from a 32-bit integer in the sequence to be tested. OPSO :: :: generates 2^21 (overlapping) 2-letter words (from 2^21+1 :: :: "keystrokes") and counts the number of missing words---that :: :: is 2-letter words which do not appear in the entire sequence. :: :: That count should be very close to normally distributed with :: :: mean 141,909, sigma 290. Thus (missingwrds-141909)/290 should :: :: be a standard normal variable. The OPSO test takes 32 bits at :: :: a time from the test file and uses a designated set of ten :: :: consecutive bits. It then restarts the file for the next de- :: :: signated 10 bits, and so on. :: :: :: :: OQSO means Overlapping-Quadruples-Sparse-Occupancy :: :: The test OQSO is similar, except that it considers 4-letter :: :: words from an alphabet of 32 letters, each letter determined :: :: by a designated string of 5 consecutive bits from the test :: :: file, elements of which are assumed 32-bit random integers. :: :: The mean number of missing words in a sequence of 2^21 four- :: :: letter words, (2^21+3 "keystrokes"), is again 141909, with :: :: sigma = 295. The mean is based on theory; sigma comes from :: :: extensive simulation. :: :: :: :: The DNA test considers an alphabet of 4 letters:: C,G,A,T,:: :: determined by two designated bits in the sequence of random :: :: integers being tested. It considers 10-letter words, so that :: :: as in OPSO and OQSO, there are 2^20 possible words, and the :: :: mean number of missing words from a string of 2^21 (over- :: :: lapping) 10-letter words (2^21+9 "keystrokes") is 141909. :: :: The standard deviation sigma=339 was determined as for OQSO :: :: by simulation. (Sigma for OPSO, 290, is the true value (to :: :: three places), not determined by simulation. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: OPSO test for generator RANDOM.DAT Output: No. missing words (mw), equiv normal variate (z), p-value (p) mw z p OPSO for RANDOM.DAT using bits 23 to 32 85186******* .0000 OPSO for RANDOM.DAT using bits 22 to 31 84244******* .0000 OPSO for RANDOM.DAT using bits 21 to 30 81032******* .0000 OPSO for RANDOM.DAT using bits 20 to 29 89058******* .0000 OPSO for RANDOM.DAT using bits 19 to 28 118236-81.632 .0000 OPSO for RANDOM.DAT using bits 18 to 27 96336******* .0000 OPSO for RANDOM.DAT using bits 17 to 26 79380******* .0000 OPSO for RANDOM.DAT using bits 16 to 25 102845******* .0000 OPSO for RANDOM.DAT using bits 15 to 24 85710******* .0000 OPSO for RANDOM.DAT using bits 14 to 23 84221******* .0000 OPSO for RANDOM.DAT using bits 13 to 22 80847******* .0000 OPSO for RANDOM.DAT using bits 12 to 21 89336******* .0000 OPSO for RANDOM.DAT using bits 11 to 20 118132-81.991 .0000 OPSO for RANDOM.DAT using bits 10 to 19 95353******* .0000 OPSO for RANDOM.DAT using bits 9 to 18 79485******* .0000 OPSO for RANDOM.DAT using bits 8 to 17 102316******* .0000 OPSO for RANDOM.DAT using bits 7 to 16 85111******* .0000 OPSO for RANDOM.DAT using bits 6 to 15 84237******* .0000 OPSO for RANDOM.DAT using bits 5 to 14 80612******* .0000 OPSO for RANDOM.DAT using bits 4 to 13 89510******* .0000 OPSO for RANDOM.DAT using bits 3 to 12 117776-83.218 .0000 OPSO for RANDOM.DAT using bits 2 to 11 95801******* .0000 OPSO for RANDOM.DAT using bits 1 to 10 79455******* .0000 OQSO test for generator RANDOM.DAT Output: No. missing words (mw), equiv normal variate (z), p-value (p) mw z p OQSO for RANDOM.DAT using bits 28 to 32 641472******* 1.0000 OQSO for RANDOM.DAT using bits 27 to 31 333376649.040 1.0000 OQSO for RANDOM.DAT using bits 26 to 30 60384******* .0000 OQSO for RANDOM.DAT using bits 25 to 29 103500******* .0000 OQSO for RANDOM.DAT using bits 24 to 28 134083-26.530 .0000 OQSO for RANDOM.DAT using bits 23 to 27 206030217.358 1.0000 OQSO for RANDOM.DAT using bits 22 to 26 147342 18.416 1.0000 OQSO for RANDOM.DAT using bits 21 to 25 321087607.382 1.0000 OQSO for RANDOM.DAT using bits 20 to 24 641248******* 1.0000 OQSO for RANDOM.DAT using bits 19 to 23 333472649.365 1.0000 OQSO for RANDOM.DAT using bits 18 to 22 61056******* .0000 OQSO for RANDOM.DAT using bits 17 to 21 103567******* .0000 OQSO for RANDOM.DAT using bits 16 to 20 126117-53.533 .0000 OQSO for RANDOM.DAT using bits 15 to 19 209170228.002 1.0000 OQSO for RANDOM.DAT using bits 14 to 18 187714155.270 1.0000 OQSO for RANDOM.DAT using bits 13 to 17 359471737.497 1.0000 OQSO for RANDOM.DAT using bits 12 to 16 641408******* 1.0000 OQSO for RANDOM.DAT using bits 11 to 15 333568649.690 1.0000 OQSO for RANDOM.DAT using bits 10 to 14 61216******* .0000 OQSO for RANDOM.DAT using bits 9 to 13 102816******* .0000 OQSO for RANDOM.DAT using bits 8 to 12 134310-25.760 .0000 OQSO for RANDOM.DAT using bits 7 to 11 211559236.101 1.0000 OQSO for RANDOM.DAT using bits 6 to 10 222853274.385 1.0000 OQSO for RANDOM.DAT using bits 5 to 9 424544958.084 1.0000 OQSO for RANDOM.DAT using bits 4 to 8 640960******* 1.0000 OQSO for RANDOM.DAT using bits 3 to 7 334016651.209 1.0000 OQSO for RANDOM.DAT using bits 2 to 6 60640******* .0000 OQSO for RANDOM.DAT using bits 1 to 5 103611******* .0000 DNA test for generator RANDOM.DAT Output: No. missing words (mw), equiv normal variate (z), p-value (p) mw z p DNA for RANDOM.DAT using bits 31 to 32 988364******* 1.0000 DNA for RANDOM.DAT using bits 30 to 31 934892******* 1.0000 DNA for RANDOM.DAT using bits 29 to 30 840284******* 1.0000 DNA for RANDOM.DAT using bits 28 to 29 650172******* 1.0000 DNA for RANDOM.DAT using bits 27 to 28 454452921.955 1.0000 DNA for RANDOM.DAT using bits 26 to 27 257852342.014 1.0000 DNA for RANDOM.DAT using bits 25 to 26 254529332.211 1.0000 DNA for RANDOM.DAT using bits 24 to 25 165710 70.208 1.0000 DNA for RANDOM.DAT using bits 23 to 24 988292******* 1.0000 DNA for RANDOM.DAT using bits 22 to 23 934816******* 1.0000 DNA for RANDOM.DAT using bits 21 to 22 839084******* 1.0000 DNA for RANDOM.DAT using bits 20 to 21 651672******* 1.0000 DNA for RANDOM.DAT using bits 19 to 20 454172921.129 1.0000 DNA for RANDOM.DAT using bits 18 to 19 257644341.400 1.0000 DNA for RANDOM.DAT using bits 17 to 18 257670341.477 1.0000 DNA for RANDOM.DAT using bits 16 to 17 208689196.990 1.0000 DNA for RANDOM.DAT using bits 15 to 16 988656******* 1.0000 DNA for RANDOM.DAT using bits 14 to 15 934788******* 1.0000 DNA for RANDOM.DAT using bits 13 to 14 839016******* 1.0000 DNA for RANDOM.DAT using bits 12 to 13 650120******* 1.0000 DNA for RANDOM.DAT using bits 11 to 12 454120920.975 1.0000 DNA for RANDOM.DAT using bits 10 to 11 257560341.152 1.0000 DNA for RANDOM.DAT using bits 9 to 10 259593347.149 1.0000 DNA for RANDOM.DAT using bits 8 to 9 225272245.908 1.0000 DNA for RANDOM.DAT using bits 7 to 8 988228******* 1.0000 DNA for RANDOM.DAT using bits 6 to 7 934768******* 1.0000 DNA for RANDOM.DAT using bits 5 to 6 839208******* 1.0000 DNA for RANDOM.DAT using bits 4 to 5 651560******* 1.0000 DNA for RANDOM.DAT using bits 3 to 4 453760919.914 1.0000 DNA for RANDOM.DAT using bits 2 to 3 257824341.931 1.0000 DNA for RANDOM.DAT using bits 1 to 2 255914336.297 1.0000 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the COUNT-THE-1's TEST on a stream of bytes. :: :: Consider the file under test as a stream of bytes (four per :: :: 32 bit integer). Each byte can contain from 0 to 8 1's, :: :: with probabilities 1,8,28,56,70,56,28,8,1 over 256. Now let :: :: the stream of bytes provide a string of overlapping 5-letter :: :: words, each "letter" taking values A,B,C,D,E. The letters are :: :: determined by the number of 1's in a byte:: 0,1,or 2 yield A,:: :: 3 yields B, 4 yields C, 5 yields D and 6,7 or 8 yield E. Thus :: :: we have a monkey at a typewriter hitting five keys with vari- :: :: ous probabilities (37,56,70,56,37 over 256). There are 5^5 :: :: possible 5-letter words, and from a string of 256,000 (over- :: :: lapping) 5-letter words, counts are made on the frequencies :: :: for each word. The quadratic form in the weak inverse of :: :: the covariance matrix of the cell counts provides a chisquare :: :: test:: Q5-Q4, the difference of the naive Pearson sums of :: :: (OBS-EXP)^2/EXP on counts for 5- and 4-letter cell counts. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Test results for RANDOM.DAT Chi-square with 5^5-5^4=2500 d.of f. for sample size:2560000 chisquare equiv normal p-value Results fo COUNT-THE-1's in successive bytes: byte stream for RANDOM.DAT 2479.78 -.286 .387483 byte stream for RANDOM.DAT 2562.09 .878 .810056 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the COUNT-THE-1's TEST for specific bytes. :: :: Consider the file under test as a stream of 32-bit integers. :: :: From each integer, a specific byte is chosen , say the left- :: :: most:: bits 1 to 8. Each byte can contain from 0 to 8 1's, :: :: with probabilitie 1,8,28,56,70,56,28,8,1 over 256. Now let :: :: the specified bytes from successive integers provide a string :: :: of (overlapping) 5-letter words, each "letter" taking values :: :: A,B,C,D,E. The letters are determined by the number of 1's, :: :: in that byte:: 0,1,or 2 ---> A, 3 ---> B, 4 ---> C, 5 ---> D,:: :: and 6,7 or 8 ---> E. Thus we have a monkey at a typewriter :: :: hitting five keys with with various probabilities:: 37,56,70,:: :: 56,37 over 256. There are 5^5 possible 5-letter words, and :: :: from a string of 256,000 (overlapping) 5-letter words, counts :: :: are made on the frequencies for each word. The quadratic form :: :: in the weak inverse of the covariance matrix of the cell :: :: counts provides a chisquare test:: Q5-Q4, the difference of :: :: the naive Pearson sums of (OBS-EXP)^2/EXP on counts for 5- :: :: and 4-letter cell counts. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Chi-square with 5^5-5^4=2500 d.of f. for sample size: 256000 chisquare equiv normal p value Results for COUNT-THE-1's in specified bytes: bits 1 to 8 2446.26 -.760 .223610 bits 2 to 9 2418.35 -1.155 .124099 bits 3 to 10 2545.54 .644 .740214 bits 4 to 11 2529.78 .421 .663165 bits 5 to 12 2566.01 .933 .824717 bits 6 to 13 2460.36 -.561 .287538 bits 7 to 14 2495.92 -.058 .476978 bits 8 to 15 2536.53 .517 .697274 bits 9 to 16 2506.22 .088 .535021 bits 10 to 17 2465.68 -.485 .313735 bits 11 to 18 2488.06 -.169 .432934 bits 12 to 19 2484.02 -.226 .410601 bits 13 to 20 2566.01 .934 .824721 bits 14 to 21 2592.61 1.310 .904857 bits 15 to 22 2593.77 1.326 .907589 bits 16 to 23 2402.07 -1.385 .083035 bits 17 to 24 2417.84 -1.162 .122625 bits 18 to 25 2501.43 .020 .508080 bits 19 to 26 2438.04 -.876 .190454 bits 20 to 27 2391.54 -1.534 .062528 bits 21 to 28 2363.70 -1.928 .026952 bits 22 to 29 2444.48 -.785 .216190 bits 23 to 30 2512.49 .177 .570130 bits 24 to 31 2546.05 .651 .742543 bits 25 to 32 2519.22 .272 .607093 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: THIS IS A PARKING LOT TEST :: :: In a square of side 100, randomly "park" a car---a circle of :: :: radius 1. Then try to park a 2nd, a 3rd, and so on, each :: :: time parking "by ear". That is, if an attempt to park a car :: :: causes a crash with one already parked, try again at a new :: :: random location. (To avoid path problems, consider parking :: :: helicopters rather than cars.) Each attempt leads to either :: :: a crash or a success, the latter followed by an increment to :: :: the list of cars already parked. If we plot n: the number of :: :: attempts, versus k:: the number successfully parked, we get a:: :: curve that should be similar to those provided by a perfect :: :: random number generator. Theory for the behavior of such a :: :: random curve seems beyond reach, and as graphics displays are :: :: not available for this battery of tests, a simple characteriz :: :: ation of the random experiment is used: k, the number of cars :: :: successfully parked after n=12,000 attempts. Simulation shows :: :: that k should average 3523 with sigma 21.9 and is very close :: :: to normally distributed. Thus (k-3523)/21.9 should be a st- :: :: andard normal variable, which, converted to a uniform varia- :: :: ble, provides input to a KSTEST based on a sample of 10. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: CDPARK: result of ten tests on file RANDOM.DAT Of 12,000 tries, the average no. of successes should be 3523 with sigma=21.9 Successes: 3491 z-score: -1.461 p-value: .071982 Successes: 3468 z-score: -2.511 p-value: .006012 Successes: 3499 z-score: -1.096 p-value: .136563 Successes: 3486 z-score: -1.689 p-value: .045562 Successes: 3483 z-score: -1.826 p-value: .033889 Successes: 3502 z-score: -.959 p-value: .168804 Successes: 3501 z-score: -1.005 p-value: .157553 Successes: 3501 z-score: -1.005 p-value: .157553 Successes: 3467 z-score: -2.557 p-value: .005278 Successes: 3483 z-score: -1.826 p-value: .033889 square size avg. no. parked sample sigma 100. 3488.100 12.458 KSTEST for the above 10: p= 1.000000 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: THE MINIMUM DISTANCE TEST :: :: It does this 100 times:: choose n=8000 random points in a :: :: square of side 10000. Find d, the minimum distance between :: :: the (n^2-n)/2 pairs of points. If the points are truly inde- :: :: pendent uniform, then d^2, the square of the minimum distance :: :: should be (very close to) exponentially distributed with mean :: :: .995 . Thus 1-exp(-d^2/.995) should be uniform on [0,1) and :: :: a KSTEST on the resulting 100 values serves as a test of uni- :: :: formity for random points in the square. Test numbers=0 mod 5 :: :: are printed but the KSTEST is based on the full set of 100 :: :: random choices of 8000 points in the 10000x10000 square. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: This is the MINIMUM DISTANCE test for random integers in the file RANDOM.DAT Sample no. d^2 avg equiv uni 5 .6245 .6206 .466134 10 .6259 .6207 .466886 15 .6242 1.3358 .465961 20 .7586 1.1532 .533460 25 .8676 1.0802 .581848 30 .6254 1.0021 .466612 35 .7889 .9623 .547434 40 .7902 .9218 .548054 45 .7895 .8981 .547746 50 .5468 .8757 .422785 55 .5479 .8633 .423402 60 .8661 .8476 .581219 65 .7584 .9891 .533348 70 .8665 .9685 .581403 75 .5478 .9490 .423358 80 .6250 .9350 .466424 85 .5475 .9216 .423189 90 .7900 .9094 .547975 95 .5475 .8963 .423198 100 .6247 .8852 .466236 MINIMUM DISTANCE TEST for RANDOM.DAT Result of KS test on 20 transformed mindist^2's: p-value=1.000000 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: THE 3DSPHERES TEST :: :: Choose 4000 random points in a cube of edge 1000. At each :: :: point, center a sphere large enough to reach the next closest :: :: point. Then the volume of the smallest such sphere is (very :: :: close to) exponentially distributed with mean 120pi/3. Thus :: :: the radius cubed is exponential with mean 30. (The mean is :: :: obtained by extensive simulation). The 3DSPHERES test gener- :: :: ates 4000 such spheres 20 times. Each min radius cubed leads :: :: to a uniform variable by means of 1-exp(-r^3/30.), then a :: :: KSTEST is done on the 20 p-values. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: The 3DSPHERES test for file RANDOM.DAT sample no: 1 r^3= 33.278 p-value= .67019 sample no: 2 r^3= 5.155 p-value= .15789 sample no: 3 r^3= 55.510 p-value= .84282 sample no: 4 r^3= 10.246 p-value= .28932 sample no: 5 r^3= 3.630 p-value= .11398 sample no: 6 r^3= 93.699 p-value= .95599 sample no: 7 r^3= 19.268 p-value= .47390 sample no: 8 r^3= 156.363 p-value= .99455 sample no: 9 r^3= 5.190 p-value= .15885 sample no: 10 r^3= 18.764 p-value= .46499 sample no: 11 r^3= 23.078 p-value= .53665 sample no: 12 r^3= 24.382 p-value= .55636 sample no: 13 r^3= 30.261 p-value= .63531 sample no: 14 r^3= 102.479 p-value= .96716 sample no: 15 r^3= 20.199 p-value= .48998 sample no: 16 r^3= 6.531 p-value= .19564 sample no: 17 r^3= 39.945 p-value= .73592 sample no: 18 r^3= 20.258 p-value= .49098 sample no: 19 r^3= 88.295 p-value= .94730 sample no: 20 r^3= 4.908 p-value= .15092 A KS test is applied to those 20 p-values. --------------------------------------------------------- 3DSPHERES test for file RANDOM.DAT p-value= .500917 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the SQEEZE test :: :: Random integers are floated to get uniforms on [0,1). Start- :: :: ing with k=2^31=2147483647, the test finds j, the number of :: :: iterations necessary to reduce k to 1, using the reduction :: :: k=ceiling(k*U), with U provided by floating integers from :: :: the file being tested. Such j's are found 100,000 times, :: :: then counts for the number of times j was <=6,7,...,47,>=48 :: :: are used to provide a chi-square test for cell frequencies. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: RESULTS OF SQUEEZE TEST FOR RANDOM.DAT Table of standardized frequency counts ( (obs-exp)/sqrt(exp) )^2 for j taking values <=6,7,8,...,47,>=48: -.8 .9 .3 -.7 -.8 .3 -.7 -.2 .6 .8 -1.1 .5 .5 2.3 -.2 .4 -1.2 .4 -1.2 -.9 -.3 .9 -.6 -.5 -.5 .0 1.3 1.9 -.7 -.4 .5 -.8 -.1 -.5 -.6 .2 .5 -1.0 -1.6 .4 .9 .0 .8 Chi-square with 42 degrees of freedom: 30.269 z-score= -1.280 p-value= .088639 ______________________________________________________________ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: The OVERLAPPING SUMS test :: :: Integers are floated to get a sequence U(1),U(2),... of uni- :: :: form [0,1) variables. Then overlapping sums, :: :: S(1)=U(1)+...+U(100), S2=U(2)+...+U(101),... are formed. :: :: The S's are virtually normal with a certain covariance mat- :: :: rix. A linear transformation of the S's converts them to a :: :: sequence of independent standard normals, which are converted :: :: to uniform variables for a KSTEST. The p-values from ten :: :: KSTESTs are given still another KSTEST. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Test no. 1 p-value .466175 Test no. 2 p-value .619766 Test no. 3 p-value .979910 Test no. 4 p-value .639836 Test no. 5 p-value .325572 Test no. 6 p-value .594480 Test no. 7 p-value .199097 Test no. 8 p-value .838390 Test no. 9 p-value .569209 Test no. 10 p-value .469628 Results of the OSUM test for RANDOM.DAT KSTEST on the above 10 p-values: .546348 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the RUNS test. It counts runs up, and runs down, :: :: in a sequence of uniform [0,1) variables, obtained by float- :: :: ing the 32-bit integers in the specified file. This example :: :: shows how runs are counted: .123,.357,.789,.425,.224,.416,.95:: :: contains an up-run of length 3, a down-run of length 2 and an :: :: up-run of (at least) 2, depending on the next values. The :: :: covariance matrices for the runs-up and runs-down are well :: :: known, leading to chisquare tests for quadratic forms in the :: :: weak inverses of the covariance matrices. Runs are counted :: :: for sequences of length 10,000. This is done ten times. Then :: :: repeated. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: The RUNS test for file RANDOM.DAT Up and down runs in a sample of 10000 _________________________________________________ Run test for RANDOM.DAT : runs up; ks test for 10 p's: .976208 runs down; ks test for 10 p's: .470858 Run test for RANDOM.DAT : runs up; ks test for 10 p's: .109378 runs down; ks test for 10 p's: .089398 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This is the CRAPS TEST. It plays 200,000 games of craps, finds:: :: the number of wins and the number of throws necessary to end :: :: each game. The number of wins should be (very close to) a :: :: normal with mean 200000p and variance 200000p(1-p), with :: :: p=244/495. Throws necessary to complete the game can vary :: :: from 1 to infinity, but counts for all>21 are lumped with 21. :: :: A chi-square test is made on the no.-of-throws cell counts. :: :: Each 32-bit integer from the test file provides the value for :: :: the throw of a die, by floating to [0,1), multiplying by 6 :: :: and taking 1 plus the integer part of the result. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Results of craps test for RANDOM.DAT No. of wins: Observed Expected 98647 98585.86 98647= No. of wins, z-score= .273 pvalue= .60775 Analysis of Throws-per-Game: Chisq= 16.15 for 20 degrees of freedom, p= .29244 Throws Observed Expected Chisq Sum 1 66556 66666.7 .184 .184 2 37645 37654.3 .002 .186 3 27032 26954.7 .222 .408 4 19306 19313.5 .003 .410 5 13953 13851.4 .745 1.155 6 9955 9943.5 .013 1.169 7 7154 7145.0 .011 1.180 8 5158 5139.1 .070 1.250 9 3611 3699.9 2.134 3.384 10 2703 2666.3 .505 3.889 11 1940 1923.3 .145 4.034 12 1362 1388.7 .515 4.549 13 1021 1003.7 .298 4.846 14 704 726.1 .675 5.521 15 504 525.8 .907 6.428 16 368 381.2 .454 6.882 17 262 276.5 .764 7.646 18 201 200.8 .000 7.646 19 136 146.0 .683 8.329 20 97 106.2 .800 9.129 21 332 287.1 7.017 16.145 SUMMARY FOR RANDOM.DAT p-value for no. of wins: .607749 p-value for throws/game: .292440 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Results of DIEHARD battery of tests sent to file cresults.txt