WE TOOK A RANDOM.DAT FILE OF ABOUT 12.5 MB GENERATED BY REALLY RANDOM NUMBERS AND RAN SOME OF THE COMMONLY AVAILABLE AND MOST STRINGENT RANDOM NUMBER TESTS ON THE WEB ON IT. THE RESULTS ARE SHOWN BELOW. WHEN YOU COMPARE TO RESULTS FROM THE C++ RAND() FUNCTION, YOU WILL FIND REALLY RANDOM NUMBERS OUTPERFORMS SIGNIFICANTLY ON VIRTUALLY ALL RANDOMNESS TESTS. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: TEST RESULTS FROM ENT.EXE :: :: http://www.fourmilab.ch/random/ :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Entropy = 7.999986 bits per byte. Optimum compression would reduce the size of this 12750000 byte file by 0 percent. Chi square distribution for 12750000 samples is 245.97, and randomly would exceed this value 50.00 percent of the times. Arithmetic mean value of data bytes is 127.4865 (127.5 = random). Monte Carlo value for Pi is 3.142439529 (error 0.03 percent). Serial correlation coefficient is 0.000186 (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 1.968 duplicate number number spacings observed expected 0 61. 67.668 1 141. 135.335 2 135. 135.335 3 112. 90.224 4 28. 45.112 5 15. 18.045 6 to INF 8. 8.282 Chisquare with 6 d.o.f. = 13.17 p-value= .959512 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 2 to 25 1.988 duplicate number number spacings observed expected 0 58. 67.668 1 142. 135.335 2 138. 135.335 3 95. 90.224 4 50. 45.112 5 12. 18.045 6 to INF 5. 8.282 Chisquare with 6 d.o.f. = 5.87 p-value= .562068 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 3 to 26 2.046 duplicate number number spacings observed expected 0 66. 67.668 1 124. 135.335 2 147. 135.335 3 92. 90.224 4 41. 45.112 5 18. 18.045 6 to INF 12. 8.282 Chisquare with 6 d.o.f. = 4.08 p-value= .333483 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 4 to 27 2.026 duplicate number number spacings observed expected 0 65. 67.668 1 137. 135.335 2 134. 135.335 3 88. 90.224 4 47. 45.112 5 20. 18.045 6 to INF 9. 8.282 Chisquare with 6 d.o.f. = .55 p-value= .002779 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 5 to 28 2.008 duplicate number number spacings observed expected 0 71. 67.668 1 130. 135.335 2 148. 135.335 3 73. 90.224 4 51. 45.112 5 15. 18.045 6 to INF 12. 8.282 Chisquare with 6 d.o.f. = 7.80 p-value= .746810 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 6 to 29 2.074 duplicate number number spacings observed expected 0 56. 67.668 1 140. 135.335 2 119. 135.335 3 108. 90.224 4 55. 45.112 5 18. 18.045 6 to INF 4. 8.282 Chisquare with 6 d.o.f. = 12.03 p-value= .938654 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 7 to 30 1.948 duplicate number number spacings observed expected 0 74. 67.668 1 126. 135.335 2 149. 135.335 3 88. 90.224 4 35. 45.112 5 22. 18.045 6 to INF 6. 8.282 Chisquare with 6 d.o.f. = 6.43 p-value= .623554 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 8 to 31 1.976 duplicate number number spacings observed expected 0 74. 67.668 1 138. 135.335 2 126. 135.335 3 84. 90.224 4 57. 45.112 5 11. 18.045 6 to INF 10. 8.282 Chisquare with 6 d.o.f. = 7.96 p-value= .758797 ::::::::::::::::::::::::::::::::::::::::: For a sample of size 500: mean RANDOM.DAT using bits 9 to 32 1.948 duplicate number number spacings observed expected 0 72. 67.668 1 155. 135.335 2 111. 135.335 3 86. 90.224 4 51. 45.112 5 17. 18.045 6 to INF 8. 8.282 Chisquare with 6 d.o.f. = 8.55 p-value= .799293 ::::::::::::::::::::::::::::::::::::::::: The 9 p-values were .959512 .562068 .333483 .002779 .746810 .938654 .623554 .758797 .799293 A KSTEST for the 9 p-values yields .839674 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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=117.976; p-value= .906231 OPERM5 test for file RANDOM.DAT For a sample of 1,000,000 consecutive 5-tuples, chisquare for 99 degrees of freedom=120.491; p-value= .930004 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 221 211.4 .434279 .434 29 5146 5134.0 .028000 .462 30 23062 23103.0 .072927 .535 31 11571 11551.5 .032835 .568 chisquare= .568 for 3 d. of f.; p-value= .321812 -------------------------------------------------------------- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 191 211.4 1.971901 1.972 30 5096 5134.0 .281413 2.253 31 23132 23103.0 .036285 2.290 32 11581 11551.5 .075212 2.365 chisquare= 2.365 for 3 d. of f.; p-value= .561831 -------------------------------------------------------------- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 950 944.3 .034 .034 r =5 21879 21743.9 .839 .874 r =6 77171 77311.8 .256 1.130 p=1-exp(-SUM/2)= .43171 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 978 944.3 1.203 1.203 r =5 21693 21743.9 .119 1.322 r =6 77329 77311.8 .004 1.326 p=1-exp(-SUM/2)= .48458 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 954 944.3 .100 .100 r =5 21663 21743.9 .301 .401 r =6 77383 77311.8 .066 .466 p=1-exp(-SUM/2)= .20792 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 959 944.3 .229 .229 r =5 21653 21743.9 .380 .609 r =6 77388 77311.8 .075 .684 p=1-exp(-SUM/2)= .28962 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 930 944.3 .217 .217 r =5 21720 21743.9 .026 .243 r =6 77350 77311.8 .019 .262 p=1-exp(-SUM/2)= .12266 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 946 944.3 .003 .003 r =5 21453 21743.9 3.892 3.895 r =6 77601 77311.8 1.082 4.977 p=1-exp(-SUM/2)= .91695 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 936 944.3 .073 .073 r =5 21647 21743.9 .432 .505 r =6 77417 77311.8 .143 .648 p=1-exp(-SUM/2)= .27673 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 973 944.3 .872 .872 r =5 21715 21743.9 .038 .911 r =6 77312 77311.8 .000 .911 p=1-exp(-SUM/2)= .36575 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 946 944.3 .003 .003 r =5 21692 21743.9 .124 .127 r =6 77362 77311.8 .033 .160 p=1-exp(-SUM/2)= .07667 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 957 944.3 .171 .171 r =5 21642 21743.9 .478 .648 r =6 77401 77311.8 .103 .751 p=1-exp(-SUM/2)= .31313 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 941 944.3 .012 .012 r =5 21702 21743.9 .081 .092 r =6 77357 77311.8 .026 .119 p=1-exp(-SUM/2)= .05762 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 979 944.3 1.275 1.275 r =5 21909 21743.9 1.254 2.529 r =6 77112 77311.8 .516 3.045 p=1-exp(-SUM/2)= .78183 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 991 944.3 2.309 2.309 r =5 21737 21743.9 .002 2.312 r =6 77272 77311.8 .020 2.332 p=1-exp(-SUM/2)= .68840 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 925 944.3 .395 .395 r =5 21587 21743.9 1.132 1.527 r =6 77488 77311.8 .402 1.928 p=1-exp(-SUM/2)= .61868 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 952 944.3 .063 .063 r =5 21676 21743.9 .212 .275 r =6 77372 77311.8 .047 .322 p=1-exp(-SUM/2)= .14857 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 922 944.3 .527 .527 r =5 21695 21743.9 .110 .637 r =6 77383 77311.8 .066 .702 p=1-exp(-SUM/2)= .29609 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 973 944.3 .872 .872 r =5 21672 21743.9 .238 1.110 r =6 77355 77311.8 .024 1.134 p=1-exp(-SUM/2)= .43280 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 931 944.3 .187 .187 r =5 21652 21743.9 .388 .576 r =6 77417 77311.8 .143 .719 p=1-exp(-SUM/2)= .30194 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 22003 21743.9 3.087 3.482 r =6 77072 77311.8 .744 4.226 p=1-exp(-SUM/2)= .87911 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 930 944.3 .217 .217 r =5 21869 21743.9 .720 .936 r =6 77201 77311.8 .159 1.095 p=1-exp(-SUM/2)= .42165 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 952 944.3 .063 .063 r =5 21993 21743.9 2.854 2.916 r =6 77055 77311.8 .853 3.769 p=1-exp(-SUM/2)= .84813 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 901 944.3 1.986 1.986 r =5 21895 21743.9 1.050 3.036 r =6 77204 77311.8 .150 3.186 p=1-exp(-SUM/2)= .79668 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 917 944.3 .789 .789 r =5 21803 21743.9 .161 .950 r =6 77280 77311.8 .013 .963 p=1-exp(-SUM/2)= .38216 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 947 944.3 .008 .008 r =5 21884 21743.9 .903 .910 r =6 77169 77311.8 .264 1.174 p=1-exp(-SUM/2)= .44406 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 922 944.3 .527 .527 r =5 21887 21743.9 .942 1.468 r =6 77191 77311.8 .189 1.657 p=1-exp(-SUM/2)= .56334 TEST SUMMARY, 25 tests on 100,000 random 6x8 matrices These should be 25 uniform [0,1] random variables: .431707 .484585 .207916 .289616 .122664 .916950 .276729 .365746 .076665 .313130 .057625 .781832 .688402 .618680 .148567 .296093 .432799 .301944 .879111 .421645 .848132 .796677 .382156 .444056 .563341 brank test summary for RANDOM.DAT The KS test for those 25 supposed UNI's yields KS p-value= .610572 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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: 142006 missing words, .23 sigmas from mean, p-value= .58935 tst no 2: 141653 missing words, -.60 sigmas from mean, p-value= .27462 tst no 3: 142202 missing words, .68 sigmas from mean, p-value= .75295 tst no 4: 142030 missing words, .28 sigmas from mean, p-value= .61101 tst no 5: 141844 missing words, -.15 sigmas from mean, p-value= .43934 tst no 6: 142144 missing words, .55 sigmas from mean, p-value= .70826 tst no 7: 141572 missing words, -.79 sigmas from mean, p-value= .21530 tst no 8: 141954 missing words, .10 sigmas from mean, p-value= .54156 tst no 9: 142098 missing words, .44 sigmas from mean, p-value= .67033 tst no 10: 142575 missing words, 1.56 sigmas from mean, p-value= .94006 tst no 11: 141601 missing words, -.72 sigmas from mean, p-value= .23564 tst no 12: 142067 missing words, .37 sigmas from mean, p-value= .64371 tst no 13: 141983 missing words, .17 sigmas from mean, p-value= .56833 tst no 14: 141504 missing words, -.95 sigmas from mean, p-value= .17181 tst no 15: 141438 missing words, -1.10 sigmas from mean, p-value= .13540 tst no 16: 141594 missing words, -.74 sigmas from mean, p-value= .23064 tst no 17: 141745 missing words, -.38 sigmas from mean, p-value= .35051 tst no 18: 141544 missing words, -.85 sigmas from mean, p-value= .19667 tst no 19: 141771 missing words, -.32 sigmas from mean, p-value= .37327 tst no 20: 142689 missing words, 1.82 sigmas from mean, p-value= .96575 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 142353 1.530 .9370 OPSO for RANDOM.DAT using bits 22 to 31 141948 .133 .5530 OPSO for RANDOM.DAT using bits 21 to 30 141359 -1.898 .0289 OPSO for RANDOM.DAT using bits 20 to 29 141952 .147 .5585 OPSO for RANDOM.DAT using bits 19 to 28 141574 -1.156 .1238 OPSO for RANDOM.DAT using bits 18 to 27 141708 -.694 .2438 OPSO for RANDOM.DAT using bits 17 to 26 141989 .275 .6082 OPSO for RANDOM.DAT using bits 16 to 25 141829 -.277 .3909 OPSO for RANDOM.DAT using bits 15 to 24 142060 .520 .6983 OPSO for RANDOM.DAT using bits 14 to 23 142452 1.871 .9693 OPSO for RANDOM.DAT using bits 13 to 22 141985 .261 .6029 OPSO for RANDOM.DAT using bits 12 to 21 141683 -.780 .2176 OPSO for RANDOM.DAT using bits 11 to 20 141499 -1.415 .0785 OPSO for RANDOM.DAT using bits 10 to 19 141770 -.480 .3155 OPSO for RANDOM.DAT using bits 9 to 18 142478 1.961 .9751 OPSO for RANDOM.DAT using bits 8 to 17 142486 1.989 .9766 OPSO for RANDOM.DAT using bits 7 to 16 141857 -.180 .4284 OPSO for RANDOM.DAT using bits 6 to 15 141427 -1.663 .0481 OPSO for RANDOM.DAT using bits 5 to 14 142004 .326 .6280 OPSO for RANDOM.DAT using bits 4 to 13 141936 .092 .5366 OPSO for RANDOM.DAT using bits 3 to 12 141720 -.653 .2569 OPSO for RANDOM.DAT using bits 2 to 11 141737 -.594 .2762 OPSO for RANDOM.DAT using bits 1 to 10 141786 -.425 .3353 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 141803 -.360 .3593 OQSO for RANDOM.DAT using bits 27 to 31 142025 .392 .6525 OQSO for RANDOM.DAT using bits 26 to 30 142139 .779 .7819 OQSO for RANDOM.DAT using bits 25 to 29 141758 -.513 .3040 OQSO for RANDOM.DAT using bits 24 to 28 141477 -1.466 .0714 OQSO for RANDOM.DAT using bits 23 to 27 142028 .402 .6563 OQSO for RANDOM.DAT using bits 22 to 26 141830 -.269 .3940 OQSO for RANDOM.DAT using bits 21 to 25 142098 .640 .7388 OQSO for RANDOM.DAT using bits 20 to 24 141608 -1.021 .1535 OQSO for RANDOM.DAT using bits 19 to 23 141877 -.110 .4564 OQSO for RANDOM.DAT using bits 18 to 22 142625 2.426 .9924 OQSO for RANDOM.DAT using bits 17 to 21 141716 -.655 .2561 OQSO for RANDOM.DAT using bits 16 to 20 141698 -.716 .2369 OQSO for RANDOM.DAT using bits 15 to 19 141835 -.252 .4005 OQSO for RANDOM.DAT using bits 14 to 18 142062 .518 .6976 OQSO for RANDOM.DAT using bits 13 to 17 142346 1.480 .9306 OQSO for RANDOM.DAT using bits 12 to 16 142301 1.328 .9079 OQSO for RANDOM.DAT using bits 11 to 15 141761 -.503 .3075 OQSO for RANDOM.DAT using bits 10 to 14 142438 1.792 .9634 OQSO for RANDOM.DAT using bits 9 to 13 141924 .050 .5198 OQSO for RANDOM.DAT using bits 8 to 12 141234 -2.289 .0110 OQSO for RANDOM.DAT using bits 7 to 11 141910 .002 .5009 OQSO for RANDOM.DAT using bits 6 to 10 141864 -.154 .4389 OQSO for RANDOM.DAT using bits 5 to 9 141973 .216 .5854 OQSO for RANDOM.DAT using bits 4 to 8 141923 .046 .5185 OQSO for RANDOM.DAT using bits 3 to 7 141481 -1.452 .0733 OQSO for RANDOM.DAT using bits 2 to 6 141798 -.377 .3529 OQSO for RANDOM.DAT using bits 1 to 5 141897 -.042 .4833 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 141440 -1.384 .0831 DNA for RANDOM.DAT using bits 30 to 31 141983 .217 .5860 DNA for RANDOM.DAT using bits 29 to 30 142227 .937 .8256 DNA for RANDOM.DAT using bits 28 to 29 141438 -1.390 .0822 DNA for RANDOM.DAT using bits 27 to 28 141153 -2.231 .0128 DNA for RANDOM.DAT using bits 26 to 27 142479 1.680 .9536 DNA for RANDOM.DAT using bits 25 to 26 141691 -.644 .2598 DNA for RANDOM.DAT using bits 24 to 25 142340 1.270 .8980 DNA for RANDOM.DAT using bits 23 to 24 141246 -1.957 .0252 DNA for RANDOM.DAT using bits 22 to 23 141262 -1.910 .0281 DNA for RANDOM.DAT using bits 21 to 22 142179 .795 .7868 DNA for RANDOM.DAT using bits 20 to 21 140875 -3.051 .0011 DNA for RANDOM.DAT using bits 19 to 20 141821 -.261 .3972 DNA for RANDOM.DAT using bits 18 to 19 141599 -.915 .1800 DNA for RANDOM.DAT using bits 17 to 18 143063 3.403 .9997 DNA for RANDOM.DAT using bits 16 to 17 142477 1.675 .9530 DNA for RANDOM.DAT using bits 15 to 16 141627 -.833 .2025 DNA for RANDOM.DAT using bits 14 to 15 141751 -.467 .3202 DNA for RANDOM.DAT using bits 13 to 14 141737 -.508 .3056 DNA for RANDOM.DAT using bits 12 to 13 142065 .459 .6770 DNA for RANDOM.DAT using bits 11 to 12 141656 -.747 .2274 DNA for RANDOM.DAT using bits 10 to 11 141638 -.800 .2117 DNA for RANDOM.DAT using bits 9 to 10 141590 -.942 .1731 DNA for RANDOM.DAT using bits 8 to 9 141788 -.358 .3602 DNA for RANDOM.DAT using bits 7 to 8 141491 -1.234 .1086 DNA for RANDOM.DAT using bits 6 to 7 141271 -1.883 .0299 DNA for RANDOM.DAT using bits 5 to 6 141837 -.213 .4155 DNA for RANDOM.DAT using bits 4 to 5 141648 -.771 .2204 DNA for RANDOM.DAT using bits 3 to 4 142162 .745 .7720 DNA for RANDOM.DAT using bits 2 to 3 141776 -.393 .3470 DNA for RANDOM.DAT using bits 1 to 2 141928 .055 .5220 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 2414.83 -1.205 .114198 byte stream for RANDOM.DAT 2461.03 -.551 .290760 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 2593.13 1.317 .906078 bits 2 to 9 2444.86 -.780 .217767 bits 3 to 10 2456.36 -.617 .268566 bits 4 to 11 2525.77 .364 .642228 bits 5 to 12 2510.96 .155 .561603 bits 6 to 13 2421.20 -1.114 .132544 bits 7 to 14 2388.79 -1.573 .057893 bits 8 to 15 2525.51 .361 .640882 bits 9 to 16 2524.32 .344 .634563 bits 10 to 17 2533.04 .467 .679847 bits 11 to 18 2471.87 -.398 .345388 bits 12 to 19 2484.95 -.213 .415749 bits 13 to 20 2605.33 1.490 .931825 bits 14 to 21 2527.99 .396 .653887 bits 15 to 22 2447.65 -.740 .229543 bits 16 to 23 2482.62 -.246 .402910 bits 17 to 24 2477.67 -.316 .376055 bits 18 to 25 2501.71 .024 .509664 bits 19 to 26 2491.46 -.121 .451938 bits 20 to 27 2460.94 -.552 .290343 bits 21 to 28 2534.19 .483 .685616 bits 22 to 29 2463.83 -.512 .304493 bits 23 to 30 2471.00 -.410 .340849 bits 24 to 31 2522.05 .312 .622398 bits 25 to 32 2492.93 -.100 .460151 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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: 3512 z-score: -.502 p-value: .307734 Successes: 3533 z-score: .457 p-value: .676028 Successes: 3507 z-score: -.731 p-value: .232514 Successes: 3504 z-score: -.868 p-value: .192812 Successes: 3507 z-score: -.731 p-value: .232514 Successes: 3523 z-score: .000 p-value: .500000 Successes: 3569 z-score: 2.100 p-value: .982156 Successes: 3547 z-score: 1.096 p-value: .863437 Successes: 3525 z-score: .091 p-value: .536382 Successes: 3564 z-score: 1.872 p-value: .969407 square size avg. no. parked sample sigma 100. 3529.100 22.565 KSTEST for the above 10: p= .442307 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 .6879 .7557 .499098 10 .3424 .9733 .291163 15 .8746 .8918 .584817 20 1.0775 .8223 .661398 25 .2010 .8786 .182884 30 1.5725 .8188 .794105 35 .4604 .7938 .370454 40 1.3411 .8860 .740201 45 1.1714 .9274 .691874 50 .9768 1.0376 .625330 55 2.3302 1.1016 .903856 60 .4418 1.0587 .358542 65 3.2638 1.0556 .962379 70 .3543 1.0440 .299559 75 .5456 1.0239 .422082 80 .0511 .9845 .050064 85 .3677 .9887 .308948 90 1.2586 .9631 .717744 95 .1363 .9543 .128034 100 1.7100 .9480 .820678 MINIMUM DISTANCE TEST for RANDOM.DAT Result of KS test on 20 transformed mindist^2's: p-value= .651329 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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= 18.139 p-value= .45372 sample no: 2 r^3= 7.267 p-value= .21514 sample no: 3 r^3= 29.283 p-value= .62322 sample no: 4 r^3= 4.889 p-value= .15037 sample no: 5 r^3= 40.659 p-value= .74213 sample no: 6 r^3= 85.962 p-value= .94304 sample no: 7 r^3= 11.160 p-value= .31064 sample no: 8 r^3= 59.258 p-value= .86127 sample no: 9 r^3= 66.360 p-value= .89052 sample no: 10 r^3= 43.366 p-value= .76438 sample no: 11 r^3= 9.566 p-value= .27303 sample no: 12 r^3= 65.531 p-value= .88745 sample no: 13 r^3= 40.858 p-value= .74383 sample no: 14 r^3= 23.785 p-value= .54744 sample no: 15 r^3= 40.013 p-value= .73651 sample no: 16 r^3= 20.736 p-value= .49903 sample no: 17 r^3= 115.710 p-value= .97887 sample no: 18 r^3= 4.672 p-value= .14423 sample no: 19 r^3= 69.854 p-value= .90256 sample no: 20 r^3= 12.950 p-value= .35057 A KS test is applied to those 20 p-values. --------------------------------------------------------- 3DSPHERES test for file RANDOM.DAT p-value= .808836 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 .5 -.6 -1.1 -.9 -.8 .9 -.2 -1.5 -.6 -.3 .5 .8 -.2 .4 .4 1.3 .0 .3 -.3 -.6 .3 .5 -1.3 .0 .6 -1.4 -2.4 .8 .6 .8 .7 -1.7 .5 -.8 .2 .5 -1.3 -.8 -.1 -.6 .0 -.1 Chi-square with 42 degrees of freedom: 30.167 z-score= -1.291 p-value= .086423 ______________________________________________________________ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 .603623 Test no. 2 p-value .439628 Test no. 3 p-value .343840 Test no. 4 p-value .406551 Test no. 5 p-value .076443 Test no. 6 p-value .284891 Test no. 7 p-value .035207 Test no. 8 p-value .122706 Test no. 9 p-value .253004 Test no. 10 p-value .985781 Results of the OSUM test for RANDOM.DAT KSTEST on the above 10 p-values: .844669 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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: .171462 runs down; ks test for 10 p's: .515727 Run test for RANDOM.DAT : runs up; ks test for 10 p's: .748610 runs down; ks test for 10 p's: .588038 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 98442 98585.86 98442= No. of wins, z-score= -.643 pvalue= .25997 Analysis of Throws-per-Game: Chisq= 14.76 for 20 degrees of freedom, p= .21012 Throws Observed Expected Chisq Sum 1 66588 66666.7 .093 .093 2 37538 37654.3 .359 .452 3 26984 26954.7 .032 .484 4 19418 19313.5 .566 1.050 5 13747 13851.4 .787 1.837 6 9918 9943.5 .066 1.903 7 7148 7145.0 .001 1.904 8 5206 5139.1 .872 2.775 9 3741 3699.9 .457 3.233 10 2774 2666.3 4.351 7.583 11 1933 1923.3 .049 7.632 12 1361 1388.7 .554 8.186 13 1045 1003.7 1.698 9.884 14 700 726.1 .941 10.825 15 541 525.8 .437 11.263 16 354 381.2 1.934 13.197 17 271 276.5 .111 13.308 18 190 200.8 .584 13.892 19 156 146.0 .687 14.579 20 102 106.2 .167 14.746 21 285 287.1 .016 14.762 SUMMARY FOR RANDOM.DAT p-value for no. of wins: .259975 p-value for throws/game: .210121 $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Results of DIEHARD battery of tests sent to file RESULTS.TXT