Advertisement
Guest User

GCD1_Diehard_results

a guest
Apr 10th, 2014
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.77 KB | None | 0 0
  1. NOTE: Most of the tests in DIEHARD return a p-value, which
  2. should be uniform on [0,1) if the input file contains truly
  3. independent random bits. Those p-values are obtained by
  4. p=F(X), where F is the assumed distribution of the sample
  5. random variable X---often normal. But that assumed F is just
  6. an asymptotic approximation, for which the fit will be worst
  7. in the tails. Thus you should not be surprised with
  8. occasional p-values near 0 or 1, such as .0012 or .9983.
  9. When a bit stream really FAILS BIG, you will get p's of 0 or
  10. 1 to six or more places. By all means, do not, as a
  11. Statistician might, think that a p < .025 or p> .975 means
  12. that the RNG has "failed the test at the .05 level". Such
  13. p's happen among the hundreds that DIEHARD produces, even
  14. with good RNG's. So keep in mind that " p happens".
  15. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  16. :: This is the BIRTHDAY SPACINGS TEST ::
  17. :: Choose m birthdays in a year of n days. List the spacings ::
  18. :: between the birthdays. If j is the number of values that ::
  19. :: occur more than once in that list, then j is asymptotically ::
  20. :: Poisson distributed with mean m^3/(4n). Experience shows n ::
  21. :: must be quite large, say n>=2^18, for comparing the results ::
  22. :: to the Poisson distribution with that mean. This test uses ::
  23. :: n=2^24 and m=2^9, so that the underlying distribution for j ::
  24. :: is taken to be Poisson with lambda=2^27/(2^26)=2. A sample ::
  25. :: of 500 j's is taken, and a chi-square goodness of fit test ::
  26. :: provides a p value. The first test uses bits 1-24 (counting ::
  27. :: from the left) from integers in the specified file. ::
  28. :: Then the file is closed and reopened. Next, bits 2-25 are ::
  29. :: used to provide birthdays, then 3-26 and so on to bits 9-32. ::
  30. :: Each set of bits provides a p-value, and the nine p-values ::
  31. :: provide a sample for a KSTEST. ::
  32. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  33. BIRTHDAY SPACINGS TEST, M= 512 N=2**24 LAMBDA= 2.0000
  34. Results for gcd1_random.dat
  35. For a sample of size 500: mean
  36. gcd1_random.dat using bits 1 to 24 1.988
  37. duplicate number number
  38. spacings observed expected
  39. 0 82. 67.668
  40. 1 125. 135.335
  41. 2 134. 135.335
  42. 3 78. 90.224
  43. 4 51. 45.112
  44. 5 20. 18.045
  45. 6 to INF 10. 8.282
  46. Chisquare with 6 d.o.f. = 6.83 p-value= .663248
  47. :::::::::::::::::::::::::::::::::::::::::
  48. For a sample of size 500: mean
  49. gcd1_random.dat using bits 2 to 25 1.984
  50. duplicate number number
  51. spacings observed expected
  52. 0 60. 67.668
  53. 1 138. 135.335
  54. 2 146. 135.335
  55. 3 87. 90.224
  56. 4 50. 45.112
  57. 5 15. 18.045
  58. 6 to INF 4. 8.282
  59. Chisquare with 6 d.o.f. = 5.13 p-value= .473262
  60. :::::::::::::::::::::::::::::::::::::::::
  61. For a sample of size 500: mean
  62. gcd1_random.dat using bits 3 to 26 1.962
  63. duplicate number number
  64. spacings observed expected
  65. 0 69. 67.668
  66. 1 144. 135.335
  67. 2 132. 135.335
  68. 3 85. 90.224
  69. 4 44. 45.112
  70. 5 17. 18.045
  71. 6 to INF 9. 8.282
  72. Chisquare with 6 d.o.f. = 1.12 p-value= .019159
  73. :::::::::::::::::::::::::::::::::::::::::
  74. For a sample of size 500: mean
  75. gcd1_random.dat using bits 4 to 27 2.008
  76. duplicate number number
  77. spacings observed expected
  78. 0 74. 67.668
  79. 1 131. 135.335
  80. 2 135. 135.335
  81. 3 79. 90.224
  82. 4 47. 45.112
  83. 5 26. 18.045
  84. 6 to INF 8. 8.282
  85. Chisquare with 6 d.o.f. = 5.72 p-value= .545229
  86. :::::::::::::::::::::::::::::::::::::::::
  87. For a sample of size 500: mean
  88. gcd1_random.dat using bits 5 to 28 1.966
  89. duplicate number number
  90. spacings observed expected
  91. 0 69. 67.668
  92. 1 129. 135.335
  93. 2 142. 135.335
  94. 3 95. 90.224
  95. 4 48. 45.112
  96. 5 12. 18.045
  97. 6 to INF 5. 8.282
  98. Chisquare with 6 d.o.f. = 4.41 p-value= .379183
  99. :::::::::::::::::::::::::::::::::::::::::
  100. For a sample of size 500: mean
  101. gcd1_random.dat using bits 6 to 29 2.014
  102. duplicate number number
  103. spacings observed expected
  104. 0 61. 67.668
  105. 1 132. 135.335
  106. 2 145. 135.335
  107. 3 92. 90.224
  108. 4 47. 45.112
  109. 5 17. 18.045
  110. 6 to INF 6. 8.282
  111. Chisquare with 6 d.o.f. = 2.23 p-value= .102884
  112. :::::::::::::::::::::::::::::::::::::::::
  113. For a sample of size 500: mean
  114. gcd1_random.dat using bits 7 to 30 1.984
  115. duplicate number number
  116. spacings observed expected
  117. 0 60. 67.668
  118. 1 136. 135.335
  119. 2 149. 135.335
  120. 3 93. 90.224
  121. 4 43. 45.112
  122. 5 10. 18.045
  123. 6 to INF 9. 8.282
  124. Chisquare with 6 d.o.f. = 6.08 p-value= .586253
  125. :::::::::::::::::::::::::::::::::::::::::
  126. For a sample of size 500: mean
  127. gcd1_random.dat using bits 8 to 31 1.940
  128. duplicate number number
  129. spacings observed expected
  130. 0 75. 67.668
  131. 1 126. 135.335
  132. 2 154. 135.335
  133. 3 86. 90.224
  134. 4 33. 45.112
  135. 5 18. 18.045
  136. 6 to INF 8. 8.282
  137. Chisquare with 6 d.o.f. = 7.47 p-value= .720594
  138. :::::::::::::::::::::::::::::::::::::::::
  139. For a sample of size 500: mean
  140. gcd1_random.dat using bits 9 to 32 2.056
  141. duplicate number number
  142. spacings observed expected
  143. 0 74. 67.668
  144. 1 117. 135.335
  145. 2 130. 135.335
  146. 3 109. 90.224
  147. 4 37. 45.112
  148. 5 25. 18.045
  149. 6 to INF 8. 8.282
  150. Chisquare with 6 d.o.f. = 11.34 p-value= .921682
  151. :::::::::::::::::::::::::::::::::::::::::
  152. The 9 p-values were
  153. .663248 .473262 .019159 .545229 .379183
  154. .102884 .586253 .720594 .921682
  155. A KSTEST for the 9 p-values yields .101082
  156.  
  157. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  158.  
  159. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  160. :: THE OVERLAPPING 5-PERMUTATION TEST ::
  161. :: This is the OPERM5 test. It looks at a sequence of one mill- ::
  162. :: ion 32-bit random integers. Each set of five consecutive ::
  163. :: integers can be in one of 120 states, for the 5! possible or- ::
  164. :: derings of five numbers. Thus the 5th, 6th, 7th,...numbers ::
  165. :: each provide a state. As many thousands of state transitions ::
  166. :: are observed, cumulative counts are made of the number of ::
  167. :: occurences of each state. Then the quadratic form in the ::
  168. :: weak inverse of the 120x120 covariance matrix yields a test ::
  169. :: equivalent to the likelihood ratio test that the 120 cell ::
  170. :: counts came from the specified (asymptotically) normal dis- ::
  171. :: tribution with the specified 120x120 covariance matrix (with ::
  172. :: rank 99). This version uses 1,000,000 integers, twice. ::
  173. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  174. OPERM5 test for file gcd1_random.dat
  175. For a sample of 1,000,000 consecutive 5-tuples,
  176. chisquare for 99 degrees of freedom= 90.794; p-value= .290241
  177. OPERM5 test for file gcd1_random.dat
  178. For a sample of 1,000,000 consecutive 5-tuples,
  179. chisquare for 99 degrees of freedom= 82.986; p-value= .123386
  180. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  181. :: This is the BINARY RANK TEST for 31x31 matrices. The leftmost ::
  182. :: 31 bits of 31 random integers from the test sequence are used ::
  183. :: to form a 31x31 binary matrix over the field {0,1}. The rank ::
  184. :: is determined. That rank can be from 0 to 31, but ranks< 28 ::
  185. :: are rare, and their counts are pooled with those for rank 28. ::
  186. :: Ranks are found for 40,000 such random matrices and a chisqua-::
  187. :: re test is performed on counts for ranks 31,30,29 and <=28. ::
  188. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  189. Binary rank test for gcd1_random.dat
  190. Rank test for 31x31 binary matrices:
  191. rows from leftmost 31 bits of each 32-bit integer
  192. rank observed expected (o-e)^2/e sum
  193. 28 194 211.4 1.435011 1.435
  194. 29 5116 5134.0 .063180 1.498
  195. 30 23083 23103.0 .017395 1.516
  196. 31 11607 11551.5 .266419 1.782
  197. chisquare= 1.782 for 3 d. of f.; p-value= .472094
  198. --------------------------------------------------------------
  199. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  200. :: This is the BINARY RANK TEST for 32x32 matrices. A random 32x ::
  201. :: 32 binary matrix is formed, each row a 32-bit random integer. ::
  202. :: The rank is determined. That rank can be from 0 to 32, ranks ::
  203. :: less than 29 are rare, and their counts are pooled with those ::
  204. :: for rank 29. Ranks are found for 40,000 such random matrices ::
  205. :: and a chisquare test is performed on counts for ranks 32,31, ::
  206. :: 30 and <=29. ::
  207. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  208. Binary rank test for gcd1_random.dat
  209. Rank test for 32x32 binary matrices:
  210. rows from leftmost 32 bits of each 32-bit integer
  211. rank observed expected (o-e)^2/e sum
  212. 29 208 211.4 .055259 .055
  213. 30 4976 5134.0 4.863107 4.918
  214. 31 23084 23103.0 .015703 4.934
  215. 32 11732 11551.5 2.819666 7.754
  216. chisquare= 7.754 for 3 d. of f.; p-value= .951295
  217. --------------------------------------------------------------
  218.  
  219. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  220.  
  221. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  222. :: This is the BINARY RANK TEST for 6x8 matrices. From each of ::
  223. :: six random 32-bit integers from the generator under test, a ::
  224. :: specified byte is chosen, and the resulting six bytes form a ::
  225. :: 6x8 binary matrix whose rank is determined. That rank can be ::
  226. :: from 0 to 6, but ranks 0,1,2,3 are rare; their counts are ::
  227. :: pooled with those for rank 4. Ranks are found for 100,000 ::
  228. :: random matrices, and a chi-square test is performed on ::
  229. :: counts for ranks 6,5 and <=4. ::
  230. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  231. Binary Rank Test for gcd1_random.dat
  232. Rank of a 6x8 binary matrix,
  233. rows formed from eight bits of the RNG gcd1_random.dat
  234. b-rank test for bits 1 to 8
  235. OBSERVED EXPECTED (O-E)^2/E SUM
  236. r<=4 957 944.3 .171 .171
  237. r =5 21653 21743.9 .380 .551
  238. r =6 77390 77311.8 .079 .630
  239. p=1-exp(-SUM/2)= .27016
  240. Rank of a 6x8 binary matrix,
  241. rows formed from eight bits of the RNG gcd1_random.dat
  242. b-rank test for bits 2 to 9
  243. OBSERVED EXPECTED (O-E)^2/E SUM
  244. r<=4 904 944.3 1.720 1.720
  245. r =5 21568 21743.9 1.423 3.143
  246. r =6 77528 77311.8 .605 3.748
  247. p=1-exp(-SUM/2)= .84646
  248. Rank of a 6x8 binary matrix,
  249. rows formed from eight bits of the RNG gcd1_random.dat
  250. b-rank test for bits 3 to 10
  251. OBSERVED EXPECTED (O-E)^2/E SUM
  252. r<=4 994 944.3 2.616 2.616
  253. r =5 21523 21743.9 2.244 4.860
  254. r =6 77483 77311.8 .379 5.239
  255. p=1-exp(-SUM/2)= .92716
  256. Rank of a 6x8 binary matrix,
  257. rows formed from eight bits of the RNG gcd1_random.dat
  258. b-rank test for bits 4 to 11
  259. OBSERVED EXPECTED (O-E)^2/E SUM
  260. r<=4 967 944.3 .546 .546
  261. r =5 21589 21743.9 1.103 1.649
  262. r =6 77444 77311.8 .226 1.875
  263. p=1-exp(-SUM/2)= .60842
  264. Rank of a 6x8 binary matrix,
  265. rows formed from eight bits of the RNG gcd1_random.dat
  266. b-rank test for bits 5 to 12
  267. OBSERVED EXPECTED (O-E)^2/E SUM
  268. r<=4 925 944.3 .395 .395
  269. r =5 21667 21743.9 .272 .666
  270. r =6 77408 77311.8 .120 .786
  271. p=1-exp(-SUM/2)= .32503
  272. Rank of a 6x8 binary matrix,
  273. rows formed from eight bits of the RNG gcd1_random.dat
  274. b-rank test for bits 6 to 13
  275. OBSERVED EXPECTED (O-E)^2/E SUM
  276. r<=4 911 944.3 1.174 1.174
  277. r =5 21867 21743.9 .697 1.871
  278. r =6 77222 77311.8 .104 1.976
  279. p=1-exp(-SUM/2)= .62761
  280. Rank of a 6x8 binary matrix,
  281. rows formed from eight bits of the RNG gcd1_random.dat
  282. b-rank test for bits 7 to 14
  283. OBSERVED EXPECTED (O-E)^2/E SUM
  284. r<=4 934 944.3 .112 .112
  285. r =5 21780 21743.9 .060 .172
  286. r =6 77286 77311.8 .009 .181
  287. p=1-exp(-SUM/2)= .08649
  288. Rank of a 6x8 binary matrix,
  289. rows formed from eight bits of the RNG gcd1_random.dat
  290. b-rank test for bits 8 to 15
  291. OBSERVED EXPECTED (O-E)^2/E SUM
  292. r<=4 908 944.3 1.396 1.396
  293. r =5 21546 21743.9 1.801 3.197
  294. r =6 77546 77311.8 .709 3.906
  295. p=1-exp(-SUM/2)= .85816
  296. Rank of a 6x8 binary matrix,
  297. rows formed from eight bits of the RNG gcd1_random.dat
  298. b-rank test for bits 9 to 16
  299. OBSERVED EXPECTED (O-E)^2/E SUM
  300. r<=4 949 944.3 .023 .023
  301. r =5 21735 21743.9 .004 .027
  302. r =6 77316 77311.8 .000 .027
  303. p=1-exp(-SUM/2)= .01353
  304. Rank of a 6x8 binary matrix,
  305. rows formed from eight bits of the RNG gcd1_random.dat
  306. b-rank test for bits 10 to 17
  307. OBSERVED EXPECTED (O-E)^2/E SUM
  308. r<=4 930 944.3 .217 .217
  309. r =5 21691 21743.9 .129 .345
  310. r =6 77379 77311.8 .058 .404
  311. p=1-exp(-SUM/2)= .18278
  312. Rank of a 6x8 binary matrix,
  313. rows formed from eight bits of the RNG gcd1_random.dat
  314. b-rank test for bits 11 to 18
  315. OBSERVED EXPECTED (O-E)^2/E SUM
  316. r<=4 995 944.3 2.722 2.722
  317. r =5 21781 21743.9 .063 2.785
  318. r =6 77224 77311.8 .100 2.885
  319. p=1-exp(-SUM/2)= .76366
  320. Rank of a 6x8 binary matrix,
  321. rows formed from eight bits of the RNG gcd1_random.dat
  322. b-rank test for bits 12 to 19
  323. OBSERVED EXPECTED (O-E)^2/E SUM
  324. r<=4 961 944.3 .295 .295
  325. r =5 21477 21743.9 3.276 3.571
  326. r =6 77562 77311.8 .810 4.381
  327. p=1-exp(-SUM/2)= .88814
  328. Rank of a 6x8 binary matrix,
  329. rows formed from eight bits of the RNG gcd1_random.dat
  330. b-rank test for bits 13 to 20
  331. OBSERVED EXPECTED (O-E)^2/E SUM
  332. r<=4 994 944.3 2.616 2.616
  333. r =5 21758 21743.9 .009 2.625
  334. r =6 77248 77311.8 .053 2.677
  335. p=1-exp(-SUM/2)= .73782
  336. Rank of a 6x8 binary matrix,
  337. rows formed from eight bits of the RNG gcd1_random.dat
  338. b-rank test for bits 14 to 21
  339. OBSERVED EXPECTED (O-E)^2/E SUM
  340. r<=4 964 944.3 .411 .411
  341. r =5 21621 21743.9 .695 1.106
  342. r =6 77415 77311.8 .138 1.243
  343. p=1-exp(-SUM/2)= .46295
  344. Rank of a 6x8 binary matrix,
  345. rows formed from eight bits of the RNG gcd1_random.dat
  346. b-rank test for bits 15 to 22
  347. OBSERVED EXPECTED (O-E)^2/E SUM
  348. r<=4 959 944.3 .229 .229
  349. r =5 21780 21743.9 .060 .289
  350. r =6 77261 77311.8 .033 .322
  351. p=1-exp(-SUM/2)= .14876
  352. Rank of a 6x8 binary matrix,
  353. rows formed from eight bits of the RNG gcd1_random.dat
  354. b-rank test for bits 16 to 23
  355. OBSERVED EXPECTED (O-E)^2/E SUM
  356. r<=4 952 944.3 .063 .063
  357. r =5 21619 21743.9 .717 .780
  358. r =6 77429 77311.8 .178 .958
  359. p=1-exp(-SUM/2)= .38056
  360. Rank of a 6x8 binary matrix,
  361. rows formed from eight bits of the RNG gcd1_random.dat
  362. b-rank test for bits 17 to 24
  363. OBSERVED EXPECTED (O-E)^2/E SUM
  364. r<=4 968 944.3 .595 .595
  365. r =5 21760 21743.9 .012 .607
  366. r =6 77272 77311.8 .020 .627
  367. p=1-exp(-SUM/2)= .26918
  368. Rank of a 6x8 binary matrix,
  369. rows formed from eight bits of the RNG gcd1_random.dat
  370. b-rank test for bits 18 to 25
  371. OBSERVED EXPECTED (O-E)^2/E SUM
  372. r<=4 922 944.3 .527 .527
  373. r =5 21906 21743.9 1.208 1.735
  374. r =6 77172 77311.8 .253 1.988
  375. p=1-exp(-SUM/2)= .62990
  376. Rank of a 6x8 binary matrix,
  377. rows formed from eight bits of the RNG gcd1_random.dat
  378. b-rank test for bits 19 to 26
  379. OBSERVED EXPECTED (O-E)^2/E SUM
  380. r<=4 993 944.3 2.511 2.511
  381. r =5 21786 21743.9 .082 2.593
  382. r =6 77221 77311.8 .107 2.700
  383. p=1-exp(-SUM/2)= .74071
  384. Rank of a 6x8 binary matrix,
  385. rows formed from eight bits of the RNG gcd1_random.dat
  386. b-rank test for bits 20 to 27
  387. OBSERVED EXPECTED (O-E)^2/E SUM
  388. r<=4 969 944.3 .646 .646
  389. r =5 21851 21743.9 .528 1.174
  390. r =6 77180 77311.8 .225 1.398
  391. p=1-exp(-SUM/2)= .50298
  392. Rank of a 6x8 binary matrix,
  393. rows formed from eight bits of the RNG gcd1_random.dat
  394. b-rank test for bits 21 to 28
  395. OBSERVED EXPECTED (O-E)^2/E SUM
  396. r<=4 965 944.3 .454 .454
  397. r =5 21790 21743.9 .098 .551
  398. r =6 77245 77311.8 .058 .609
  399. p=1-exp(-SUM/2)= .26257
  400. Rank of a 6x8 binary matrix,
  401. rows formed from eight bits of the RNG gcd1_random.dat
  402. b-rank test for bits 22 to 29
  403. OBSERVED EXPECTED (O-E)^2/E SUM
  404. r<=4 950 944.3 .034 .034
  405. r =5 21599 21743.9 .966 1.000
  406. r =6 77451 77311.8 .251 1.251
  407. p=1-exp(-SUM/2)= .46490
  408. Rank of a 6x8 binary matrix,
  409. rows formed from eight bits of the RNG gcd1_random.dat
  410. b-rank test for bits 23 to 30
  411. OBSERVED EXPECTED (O-E)^2/E SUM
  412. r<=4 947 944.3 .008 .008
  413. r =5 21709 21743.9 .056 .064
  414. r =6 77344 77311.8 .013 .077
  415. p=1-exp(-SUM/2)= .03783
  416. Rank of a 6x8 binary matrix,
  417. rows formed from eight bits of the RNG gcd1_random.dat
  418. b-rank test for bits 24 to 31
  419. OBSERVED EXPECTED (O-E)^2/E SUM
  420. r<=4 1007 944.3 4.163 4.163
  421. r =5 21646 21743.9 .441 4.604
  422. r =6 77347 77311.8 .016 4.620
  423. p=1-exp(-SUM/2)= .90073
  424. Rank of a 6x8 binary matrix,
  425. rows formed from eight bits of the RNG gcd1_random.dat
  426. b-rank test for bits 25 to 32
  427. OBSERVED EXPECTED (O-E)^2/E SUM
  428. r<=4 913 944.3 1.038 1.038
  429. r =5 21634 21743.9 .555 1.593
  430. r =6 77453 77311.8 .258 1.851
  431. p=1-exp(-SUM/2)= .60365
  432. TEST SUMMARY, 25 tests on 100,000 random 6x8 matrices
  433. These should be 25 uniform [0,1] random variables:
  434. .270163 .846456 .927157 .608424 .325030
  435. .627607 .086490 .858160 .013533 .182780
  436. .763663 .888145 .737821 .462950 .148757
  437. .380557 .269178 .629895 .740710 .502976
  438. .262571 .464903 .037834 .900730 .603646
  439. brank test summary for gcd1_random.dat
  440. The KS test for those 25 supposed UNI's yields
  441. KS p-value= .007880
  442.  
  443. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  444.  
  445. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  446. :: THE BITSTREAM TEST ::
  447. :: The file under test is viewed as a stream of bits. Call them ::
  448. :: b1,b2,... . Consider an alphabet with two "letters", 0 and 1 ::
  449. :: and think of the stream of bits as a succession of 20-letter ::
  450. :: "words", overlapping. Thus the first word is b1b2...b20, the ::
  451. :: second is b2b3...b21, and so on. The bitstream test counts ::
  452. :: the number of missing 20-letter (20-bit) words in a string of ::
  453. :: 2^21 overlapping 20-letter words. There are 2^20 possible 20 ::
  454. :: letter words. For a truly random string of 2^21+19 bits, the ::
  455. :: number of missing words j should be (very close to) normally ::
  456. :: distributed with mean 141,909 and sigma 428. Thus ::
  457. :: (j-141909)/428 should be a standard normal variate (z score) ::
  458. :: that leads to a uniform [0,1) p value. The test is repeated ::
  459. :: twenty times. ::
  460. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  461. THE OVERLAPPING 20-tuples BITSTREAM TEST, 20 BITS PER WORD, N words
  462. This test uses N=2^21 and samples the bitstream 20 times.
  463. No. missing words should average 141909. with sigma=428.
  464. ---------------------------------------------------------
  465. tst no 1: 142137 missing words, .53 sigmas from mean, p-value= .70262
  466. tst no 2: 142168 missing words, .60 sigmas from mean, p-value= .72720
  467. tst no 3: 142170 missing words, .61 sigmas from mean, p-value= .72875
  468. tst no 4: 141696 missing words, -.50 sigmas from mean, p-value= .30909
  469. tst no 5: 141808 missing words, -.24 sigmas from mean, p-value= .40643
  470. tst no 6: 141534 missing words, -.88 sigmas from mean, p-value= .19026
  471. tst no 7: 141567 missing words, -.80 sigmas from mean, p-value= .21190
  472. tst no 8: 141568 missing words, -.80 sigmas from mean, p-value= .21258
  473. tst no 9: 141798 missing words, -.26 sigmas from mean, p-value= .39739
  474. tst no 10: 141920 missing words, .02 sigmas from mean, p-value= .50995
  475. tst no 11: 141752 missing words, -.37 sigmas from mean, p-value= .35659
  476. tst no 12: 141840 missing words, -.16 sigmas from mean, p-value= .43566
  477. tst no 13: 141536 missing words, -.87 sigmas from mean, p-value= .19153
  478. tst no 14: 142404 missing words, 1.16 sigmas from mean, p-value= .87611
  479. tst no 15: 142045 missing words, .32 sigmas from mean, p-value= .62437
  480. tst no 16: 142349 missing words, 1.03 sigmas from mean, p-value= .84785
  481. tst no 17: 141626 missing words, -.66 sigmas from mean, p-value= .25399
  482. tst no 18: 141622 missing words, -.67 sigmas from mean, p-value= .25101
  483. tst no 19: 141848 missing words, -.14 sigmas from mean, p-value= .44303
  484. tst no 20: 141437 missing words, -1.10 sigmas from mean, p-value= .13489
  485.  
  486. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  487.  
  488. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  489. :: The tests OPSO, OQSO and DNA ::
  490. :: OPSO means Overlapping-Pairs-Sparse-Occupancy ::
  491. :: The OPSO test considers 2-letter words from an alphabet of ::
  492. :: 1024 letters. Each letter is determined by a specified ten ::
  493. :: bits from a 32-bit integer in the sequence to be tested. OPSO ::
  494. :: generates 2^21 (overlapping) 2-letter words (from 2^21+1 ::
  495. :: "keystrokes") and counts the number of missing words---that ::
  496. :: is 2-letter words which do not appear in the entire sequence. ::
  497. :: That count should be very close to normally distributed with ::
  498. :: mean 141,909, sigma 290. Thus (missingwrds-141909)/290 should ::
  499. :: be a standard normal variable. The OPSO test takes 32 bits at ::
  500. :: a time from the test file and uses a designated set of ten ::
  501. :: consecutive bits. It then restarts the file for the next de- ::
  502. :: signated 10 bits, and so on. ::
  503. :: ::
  504. :: OQSO means Overlapping-Quadruples-Sparse-Occupancy ::
  505. :: The test OQSO is similar, except that it considers 4-letter ::
  506. :: words from an alphabet of 32 letters, each letter determined ::
  507. :: by a designated string of 5 consecutive bits from the test ::
  508. :: file, elements of which are assumed 32-bit random integers. ::
  509. :: The mean number of missing words in a sequence of 2^21 four- ::
  510. :: letter words, (2^21+3 "keystrokes"), is again 141909, with ::
  511. :: sigma = 295. The mean is based on theory; sigma comes from ::
  512. :: extensive simulation. ::
  513. :: ::
  514. :: The DNA test considers an alphabet of 4 letters:: C,G,A,T,::
  515. :: determined by two designated bits in the sequence of random ::
  516. :: integers being tested. It considers 10-letter words, so that ::
  517. :: as in OPSO and OQSO, there are 2^20 possible words, and the ::
  518. :: mean number of missing words from a string of 2^21 (over- ::
  519. :: lapping) 10-letter words (2^21+9 "keystrokes") is 141909. ::
  520. :: The standard deviation sigma=339 was determined as for OQSO ::
  521. :: by simulation. (Sigma for OPSO, 290, is the true value (to ::
  522. :: three places), not determined by simulation. ::
  523. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  524. OPSO test for generator gcd1_random.dat
  525. Output: No. missing words (mw), equiv normal variate (z), p-value (p)
  526. mw z p
  527. OPSO for gcd1_random.dat using bits 23 to 32 141980 .244 .5963
  528. OPSO for gcd1_random.dat using bits 22 to 31 141549 -1.243 .1070
  529. OPSO for gcd1_random.dat using bits 21 to 30 141818 -.315 .3764
  530. OPSO for gcd1_random.dat using bits 20 to 29 141760 -.515 .3033
  531. OPSO for gcd1_random.dat using bits 19 to 28 141739 -.587 .2785
  532. OPSO for gcd1_random.dat using bits 18 to 27 142074 .568 .7149
  533. OPSO for gcd1_random.dat using bits 17 to 26 141844 -.225 .4109
  534. OPSO for gcd1_random.dat using bits 16 to 25 142007 .337 .6319
  535. OPSO for gcd1_random.dat using bits 15 to 24 141787 -.422 .3366
  536. OPSO for gcd1_random.dat using bits 14 to 23 142184 .947 .8282
  537. OPSO for gcd1_random.dat using bits 13 to 22 142029 .413 .6601
  538. OPSO for gcd1_random.dat using bits 12 to 21 141733 -.608 .2716
  539. OPSO for gcd1_random.dat using bits 11 to 20 141979 .240 .5949
  540. OPSO for gcd1_random.dat using bits 10 to 19 142099 .654 .7435
  541. OPSO for gcd1_random.dat using bits 9 to 18 141915 .020 .5078
  542. OPSO for gcd1_random.dat using bits 8 to 17 142203 1.013 .8444
  543. OPSO for gcd1_random.dat using bits 7 to 16 141334 -1.984 .0236
  544. OPSO for gcd1_random.dat using bits 6 to 15 141742 -.577 .2820
  545. OPSO for gcd1_random.dat using bits 5 to 14 141868 -.143 .4433
  546. OPSO for gcd1_random.dat using bits 4 to 13 141703 -.711 .2384
  547. OPSO for gcd1_random.dat using bits 3 to 12 141685 -.774 .2196
  548. OPSO for gcd1_random.dat using bits 2 to 11 141906 -.011 .4954
  549. OPSO for gcd1_random.dat using bits 1 to 10 142081 .592 .7231
  550. OQSO test for generator gcd1_random.dat
  551. Output: No. missing words (mw), equiv normal variate (z), p-value (p)
  552. mw z p
  553. OQSO for gcd1_random.dat using bits 28 to 32 142275 1.240 .8924
  554. OQSO for gcd1_random.dat using bits 27 to 31 142247 1.145 .8738
  555. OQSO for gcd1_random.dat using bits 26 to 30 142029 .406 .6575
  556. OQSO for gcd1_random.dat using bits 25 to 29 142425 1.748 .9598
  557. OQSO for gcd1_random.dat using bits 24 to 28 141643 -.903 .1833
  558. OQSO for gcd1_random.dat using bits 23 to 27 141824 -.289 .3862
  559. OQSO for gcd1_random.dat using bits 22 to 26 141925 .053 .5212
  560. OQSO for gcd1_random.dat using bits 21 to 25 141871 -.130 .4483
  561. OQSO for gcd1_random.dat using bits 20 to 24 141897 -.042 .4833
  562. OQSO for gcd1_random.dat using bits 19 to 23 141486 -1.435 .0756
  563. OQSO for gcd1_random.dat using bits 18 to 22 141980 .240 .5947
  564. OQSO for gcd1_random.dat using bits 17 to 21 141736 -.588 .2784
  565. OQSO for gcd1_random.dat using bits 16 to 20 141608 -1.021 .1535
  566. OQSO for gcd1_random.dat using bits 15 to 19 141701 -.706 .2400
  567. OQSO for gcd1_random.dat using bits 14 to 18 141728 -.615 .2694
  568. OQSO for gcd1_random.dat using bits 13 to 17 142251 1.158 .8766
  569. OQSO for gcd1_random.dat using bits 12 to 16 141719 -.645 .2594
  570. OQSO for gcd1_random.dat using bits 11 to 15 142125 .731 .7676
  571. OQSO for gcd1_random.dat using bits 10 to 14 141691 -.740 .2296
  572. OQSO for gcd1_random.dat using bits 9 to 13 142155 .833 .7975
  573. OQSO for gcd1_random.dat using bits 8 to 12 141833 -.259 .3979
  574. OQSO for gcd1_random.dat using bits 7 to 11 141795 -.388 .3492
  575. OQSO for gcd1_random.dat using bits 6 to 10 141855 -.184 .4269
  576. OQSO for gcd1_random.dat using bits 5 to 9 141822 -.296 .3836
  577. OQSO for gcd1_random.dat using bits 4 to 8 142281 1.260 .8961
  578. OQSO for gcd1_random.dat using bits 3 to 7 142204 .999 .8411
  579. OQSO for gcd1_random.dat using bits 2 to 6 141833 -.259 .3979
  580. OQSO for gcd1_random.dat using bits 1 to 5 142030 .409 .6588
  581. DNA test for generator gcd1_random.dat
  582. Output: No. missing words (mw), equiv normal variate (z), p-value (p)
  583. mw z p
  584. DNA for gcd1_random.dat using bits 31 to 32 142061 .447 .6727
  585. DNA for gcd1_random.dat using bits 30 to 31 142300 1.152 .8754
  586. DNA for gcd1_random.dat using bits 29 to 30 142425 1.521 .9359
  587. DNA for gcd1_random.dat using bits 28 to 29 141880 -.087 .4655
  588. DNA for gcd1_random.dat using bits 27 to 28 142079 .501 .6916
  589. DNA for gcd1_random.dat using bits 26 to 27 141236 -1.986 .0235
  590. DNA for gcd1_random.dat using bits 25 to 26 142048 .409 .6588
  591. DNA for gcd1_random.dat using bits 24 to 25 141969 .176 .5699
  592. DNA for gcd1_random.dat using bits 23 to 24 142704 2.344 .9905
  593. DNA for gcd1_random.dat using bits 22 to 23 141436 -1.396 .0813
  594. DNA for gcd1_random.dat using bits 21 to 22 142090 .533 .7030
  595. DNA for gcd1_random.dat using bits 20 to 21 142312 1.188 .8825
  596. DNA for gcd1_random.dat using bits 19 to 20 141991 .241 .5952
  597. DNA for gcd1_random.dat using bits 18 to 19 142139 .677 .7510
  598. DNA for gcd1_random.dat using bits 17 to 18 141882 -.081 .4679
  599. DNA for gcd1_random.dat using bits 16 to 17 141704 -.606 .2724
  600. DNA for gcd1_random.dat using bits 15 to 16 141578 -.977 .1642
  601. DNA for gcd1_random.dat using bits 14 to 15 141481 -1.264 .1032
  602. DNA for gcd1_random.dat using bits 13 to 14 142005 .282 .6111
  603. DNA for gcd1_random.dat using bits 12 to 13 141628 -.830 .2033
  604. DNA for gcd1_random.dat using bits 11 to 12 141828 -.240 .4052
  605. DNA for gcd1_random.dat using bits 10 to 11 141181 -2.148 .0158
  606. DNA for gcd1_random.dat using bits 9 to 10 142123 .630 .7358
  607. DNA for gcd1_random.dat using bits 8 to 9 142247 .996 .8404
  608. DNA for gcd1_random.dat using bits 7 to 8 142601 2.040 .9793
  609. DNA for gcd1_random.dat using bits 6 to 7 142088 .527 .7009
  610. DNA for gcd1_random.dat using bits 5 to 6 142012 .303 .6190
  611. DNA for gcd1_random.dat using bits 4 to 5 141730 -.529 .2984
  612. DNA for gcd1_random.dat using bits 3 to 4 142036 .374 .6457
  613. DNA for gcd1_random.dat using bits 2 to 3 142232 .952 .8294
  614. DNA for gcd1_random.dat using bits 1 to 2 141973 .188 .5745
  615.  
  616. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  617.  
  618. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  619. :: This is the COUNT-THE-1's TEST on a stream of bytes. ::
  620. :: Consider the file under test as a stream of bytes (four per ::
  621. :: 32 bit integer). Each byte can contain from 0 to 8 1's, ::
  622. :: with probabilities 1,8,28,56,70,56,28,8,1 over 256. Now let ::
  623. :: the stream of bytes provide a string of overlapping 5-letter ::
  624. :: words, each "letter" taking values A,B,C,D,E. The letters are ::
  625. :: determined by the number of 1's in a byte:: 0,1,or 2 yield A,::
  626. :: 3 yields B, 4 yields C, 5 yields D and 6,7 or 8 yield E. Thus ::
  627. :: we have a monkey at a typewriter hitting five keys with vari- ::
  628. :: ous probabilities (37,56,70,56,37 over 256). There are 5^5 ::
  629. :: possible 5-letter words, and from a string of 256,000 (over- ::
  630. :: lapping) 5-letter words, counts are made on the frequencies ::
  631. :: for each word. The quadratic form in the weak inverse of ::
  632. :: the covariance matrix of the cell counts provides a chisquare ::
  633. :: test:: Q5-Q4, the difference of the naive Pearson sums of ::
  634. :: (OBS-EXP)^2/EXP on counts for 5- and 4-letter cell counts. ::
  635. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  636. Test results for gcd1_random.dat
  637. Chi-square with 5^5-5^4=2500 d.of f. for sample size:2560000
  638. chisquare equiv normal p-value
  639. Results fo COUNT-THE-1's in successive bytes:
  640. byte stream for gcd1_random.dat 2532.72 .463 .678232
  641. byte stream for gcd1_random.dat 2569.44 .982 .836941
  642.  
  643. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  644.  
  645. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  646. :: This is the COUNT-THE-1's TEST for specific bytes. ::
  647. :: Consider the file under test as a stream of 32-bit integers. ::
  648. :: From each integer, a specific byte is chosen , say the left- ::
  649. :: most:: bits 1 to 8. Each byte can contain from 0 to 8 1's, ::
  650. :: with probabilitie 1,8,28,56,70,56,28,8,1 over 256. Now let ::
  651. :: the specified bytes from successive integers provide a string ::
  652. :: of (overlapping) 5-letter words, each "letter" taking values ::
  653. :: A,B,C,D,E. The letters are determined by the number of 1's, ::
  654. :: in that byte:: 0,1,or 2 ---> A, 3 ---> B, 4 ---> C, 5 ---> D,::
  655. :: and 6,7 or 8 ---> E. Thus we have a monkey at a typewriter ::
  656. :: hitting five keys with with various probabilities:: 37,56,70,::
  657. :: 56,37 over 256. There are 5^5 possible 5-letter words, and ::
  658. :: from a string of 256,000 (overlapping) 5-letter words, counts ::
  659. :: are made on the frequencies for each word. The quadratic form ::
  660. :: in the weak inverse of the covariance matrix of the cell ::
  661. :: counts provides a chisquare test:: Q5-Q4, the difference of ::
  662. :: the naive Pearson sums of (OBS-EXP)^2/EXP on counts for 5- ::
  663. :: and 4-letter cell counts. ::
  664. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  665. Chi-square with 5^5-5^4=2500 d.of f. for sample size: 256000
  666. chisquare equiv normal p value
  667. Results for COUNT-THE-1's in specified bytes:
  668. bits 1 to 8 2492.27 -.109 .456454
  669. bits 2 to 9 2511.29 .160 .563450
  670. bits 3 to 10 2318.75 -2.563 .005184
  671. bits 4 to 11 2528.76 .407 .657899
  672. bits 5 to 12 2603.12 1.458 .927623
  673. bits 6 to 13 2557.80 .817 .793159
  674. bits 7 to 14 2528.91 .409 .658666
  675. bits 8 to 15 2463.30 -.519 .301885
  676. bits 9 to 16 2427.14 -1.030 .151401
  677. bits 10 to 17 2484.04 -.226 .410695
  678. bits 11 to 18 2428.50 -1.011 .155970
  679. bits 12 to 19 2608.19 1.530 .936995
  680. bits 13 to 20 2508.85 .125 .549778
  681. bits 14 to 21 2459.67 -.570 .284205
  682. bits 15 to 22 2354.49 -2.058 .019806
  683. bits 16 to 23 2552.84 .747 .772541
  684. bits 17 to 24 2532.61 .461 .677651
  685. bits 18 to 25 2559.94 .848 .801675
  686. bits 19 to 26 2424.52 -1.067 .142892
  687. bits 20 to 27 2506.13 .087 .534537
  688. bits 21 to 28 2509.23 .130 .551901
  689. bits 22 to 29 2443.94 -.793 .213932
  690. bits 23 to 30 2455.85 -.624 .266171
  691. bits 24 to 31 2464.99 -.495 .310279
  692. bits 25 to 32 2451.96 -.679 .248435
  693.  
  694. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  695.  
  696. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  697. :: THIS IS A PARKING LOT TEST ::
  698. :: In a square of side 100, randomly "park" a car---a circle of ::
  699. :: radius 1. Then try to park a 2nd, a 3rd, and so on, each ::
  700. :: time parking "by ear". That is, if an attempt to park a car ::
  701. :: causes a crash with one already parked, try again at a new ::
  702. :: random location. (To avoid path problems, consider parking ::
  703. :: helicopters rather than cars.) Each attempt leads to either ::
  704. :: a crash or a success, the latter followed by an increment to ::
  705. :: the list of cars already parked. If we plot n: the number of ::
  706. :: attempts, versus k:: the number successfully parked, we get a::
  707. :: curve that should be similar to those provided by a perfect ::
  708. :: random number generator. Theory for the behavior of such a ::
  709. :: random curve seems beyond reach, and as graphics displays are ::
  710. :: not available for this battery of tests, a simple characteriz ::
  711. :: ation of the random experiment is used: k, the number of cars ::
  712. :: successfully parked after n=12,000 attempts. Simulation shows ::
  713. :: that k should average 3523 with sigma 21.9 and is very close ::
  714. :: to normally distributed. Thus (k-3523)/21.9 should be a st- ::
  715. :: andard normal variable, which, converted to a uniform varia- ::
  716. :: ble, provides input to a KSTEST based on a sample of 10. ::
  717. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  718. CDPARK: result of ten tests on file gcd1_random.dat
  719. Of 12,000 tries, the average no. of successes
  720. should be 3523 with sigma=21.9
  721. Successes: 3526 z-score: .137 p-value: .554479
  722. Successes: 3547 z-score: 1.096 p-value: .863437
  723. Successes: 3545 z-score: 1.005 p-value: .842447
  724. Successes: 3514 z-score: -.411 p-value: .340551
  725. Successes: 3580 z-score: 2.603 p-value: .995376
  726. Successes: 3541 z-score: .822 p-value: .794438
  727. Successes: 3527 z-score: .183 p-value: .572463
  728. Successes: 3491 z-score: -1.461 p-value: .071982
  729. Successes: 3559 z-score: 1.644 p-value: .949895
  730. Successes: 3508 z-score: -.685 p-value: .246694
  731.  
  732. square size avg. no. parked sample sigma
  733. 100. 3533.800 24.722
  734. KSTEST for the above 10: p= .771386
  735.  
  736. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  737.  
  738. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  739. :: THE MINIMUM DISTANCE TEST ::
  740. :: It does this 100 times:: choose n=8000 random points in a ::
  741. :: square of side 10000. Find d, the minimum distance between ::
  742. :: the (n^2-n)/2 pairs of points. If the points are truly inde- ::
  743. :: pendent uniform, then d^2, the square of the minimum distance ::
  744. :: should be (very close to) exponentially distributed with mean ::
  745. :: .995 . Thus 1-exp(-d^2/.995) should be uniform on [0,1) and ::
  746. :: a KSTEST on the resulting 100 values serves as a test of uni- ::
  747. :: formity for random points in the square. Test numbers=0 mod 5 ::
  748. :: are printed but the KSTEST is based on the full set of 100 ::
  749. :: random choices of 8000 points in the 10000x10000 square. ::
  750. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  751. This is the MINIMUM DISTANCE test
  752. for random integers in the file gcd1_random.dat
  753. Sample no. d^2 avg equiv uni
  754. 5 .2110 .5529 .191071
  755. 10 .1822 .4946 .167294
  756. 15 2.0950 .7466 .878215
  757. 20 1.2951 .7297 .727898
  758. 25 .2933 .7646 .255316
  759. 30 .4497 .9681 .363625
  760. 35 1.2274 .9661 .708757
  761. 40 .0228 1.0578 .022679
  762. 45 .2460 1.0682 .219077
  763. 50 .7823 1.0286 .544460
  764. 55 .4192 1.0102 .343834
  765. 60 .5085 1.0842 .400110
  766. 65 .4174 1.0485 .342592
  767. 70 1.1765 1.0658 .693449
  768. 75 .8447 1.0524 .572146
  769. 80 .3917 1.0334 .325447
  770. 85 1.3140 1.0794 .733020
  771. 90 .5307 1.1127 .413352
  772. 95 2.0993 1.1043 .878740
  773. 100 3.9393 1.1266 .980919
  774. MINIMUM DISTANCE TEST for gcd1_random.dat
  775. Result of KS test on 20 transformed mindist^2's:
  776. p-value= .905706
  777.  
  778. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  779.  
  780. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  781. :: THE 3DSPHERES TEST ::
  782. :: Choose 4000 random points in a cube of edge 1000. At each ::
  783. :: point, center a sphere large enough to reach the next closest ::
  784. :: point. Then the volume of the smallest such sphere is (very ::
  785. :: close to) exponentially distributed with mean 120pi/3. Thus ::
  786. :: the radius cubed is exponential with mean 30. (The mean is ::
  787. :: obtained by extensive simulation). The 3DSPHERES test gener- ::
  788. :: ates 4000 such spheres 20 times. Each min radius cubed leads ::
  789. :: to a uniform variable by means of 1-exp(-r^3/30.), then a ::
  790. :: KSTEST is done on the 20 p-values. ::
  791. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  792. The 3DSPHERES test for file gcd1_random.dat
  793. sample no: 1 r^3= 47.629 p-value= .79559
  794. sample no: 2 r^3= 70.926 p-value= .90598
  795. sample no: 3 r^3= 34.603 p-value= .68444
  796. sample no: 4 r^3= 2.972 p-value= .09430
  797. sample no: 5 r^3= 11.322 p-value= .31436
  798. sample no: 6 r^3= 24.203 p-value= .55369
  799. sample no: 7 r^3= 21.796 p-value= .51642
  800. sample no: 8 r^3= 7.582 p-value= .22332
  801. sample no: 9 r^3= 80.985 p-value= .93276
  802. sample no: 10 r^3= 4.670 p-value= .14415
  803. sample no: 11 r^3= 64.123 p-value= .88204
  804. sample no: 12 r^3= 2.611 p-value= .08335
  805. sample no: 13 r^3= 56.412 p-value= .84747
  806. sample no: 14 r^3= 13.879 p-value= .37038
  807. sample no: 15 r^3= 2.981 p-value= .09458
  808. sample no: 16 r^3= 130.525 p-value= .98710
  809. sample no: 17 r^3= 99.077 p-value= .96321
  810. sample no: 18 r^3= 50.667 p-value= .81528
  811. sample no: 19 r^3= 26.643 p-value= .58857
  812. sample no: 20 r^3= 35.892 p-value= .69772
  813. A KS test is applied to those 20 p-values.
  814. ---------------------------------------------------------
  815. 3DSPHERES test for file gcd1_random.dat p-value= .700030
  816. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  817.  
  818. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  819. :: This is the SQEEZE test ::
  820. :: Random integers are floated to get uniforms on [0,1). Start- ::
  821. :: ing with k=2^31=2147483647, the test finds j, the number of ::
  822. :: iterations necessary to reduce k to 1, using the reduction ::
  823. :: k=ceiling(k*U), with U provided by floating integers from ::
  824. :: the file being tested. Such j's are found 100,000 times, ::
  825. :: then counts for the number of times j was <=6,7,...,47,>=48 ::
  826. :: are used to provide a chi-square test for cell frequencies. ::
  827. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  828. RESULTS OF SQUEEZE TEST FOR gcd1_random.dat
  829. Table of standardized frequency counts
  830. ( (obs-exp)/sqrt(exp) )^2
  831. for j taking values <=6,7,8,...,47,>=48:
  832. -.1 -.3 .6 .8 1.1 .0
  833. -.7 -.1 -.2 .6 -.1 -.8
  834. -1.3 -.2 -.6 .4 1.0 -.6
  835. -.3 -1.3 .1 1.4 .2 1.3
  836. -.1 -.5 -.4 .2 1.9 .7
  837. 1.2 -.7 -.9 1.7 1.9 -.1
  838. -.9 -.1 .1 -1.8 .1 1.0
  839. -.1
  840. Chi-square with 42 degrees of freedom: 31.987
  841. z-score= -1.093 p-value= .131288
  842. ______________________________________________________________
  843.  
  844. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  845.  
  846. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  847. :: The OVERLAPPING SUMS test ::
  848. :: Integers are floated to get a sequence U(1),U(2),... of uni- ::
  849. :: form [0,1) variables. Then overlapping sums, ::
  850. :: S(1)=U(1)+...+U(100), S2=U(2)+...+U(101),... are formed. ::
  851. :: The S's are virtually normal with a certain covariance mat- ::
  852. :: rix. A linear transformation of the S's converts them to a ::
  853. :: sequence of independent standard normals, which are converted ::
  854. :: to uniform variables for a KSTEST. The p-values from ten ::
  855. :: KSTESTs are given still another KSTEST. ::
  856. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  857. Test no. 1 p-value .806701
  858. Test no. 2 p-value .470101
  859. Test no. 3 p-value .348392
  860. Test no. 4 p-value .196140
  861. Test no. 5 p-value .011140
  862. Test no. 6 p-value .267222
  863. Test no. 7 p-value .568066
  864. Test no. 8 p-value .929084
  865. Test no. 9 p-value .142401
  866. Test no. 10 p-value .239075
  867. Results of the OSUM test for gcd1_random.dat
  868. KSTEST on the above 10 p-values: .551882
  869.  
  870. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  871.  
  872. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  873. :: This is the RUNS test. It counts runs up, and runs down, ::
  874. :: in a sequence of uniform [0,1) variables, obtained by float- ::
  875. :: ing the 32-bit integers in the specified file. This example ::
  876. :: shows how runs are counted: .123,.357,.789,.425,.224,.416,.95::
  877. :: contains an up-run of length 3, a down-run of length 2 and an ::
  878. :: up-run of (at least) 2, depending on the next values. The ::
  879. :: covariance matrices for the runs-up and runs-down are well ::
  880. :: known, leading to chisquare tests for quadratic forms in the ::
  881. :: weak inverses of the covariance matrices. Runs are counted ::
  882. :: for sequences of length 10,000. This is done ten times. Then ::
  883. :: repeated. ::
  884. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  885. The RUNS test for file gcd1_random.dat
  886. Up and down runs in a sample of 10000
  887. _________________________________________________
  888. Run test for gcd1_random.dat:
  889. runs up; ks test for 10 p's: .533980
  890. runs down; ks test for 10 p's: .563354
  891. Run test for gcd1_random.dat:
  892. runs up; ks test for 10 p's: .103345
  893. runs down; ks test for 10 p's: .287414
  894.  
  895. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  896.  
  897. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  898. :: This is the CRAPS TEST. It plays 200,000 games of craps, finds::
  899. :: the number of wins and the number of throws necessary to end ::
  900. :: each game. The number of wins should be (very close to) a ::
  901. :: normal with mean 200000p and variance 200000p(1-p), with ::
  902. :: p=244/495. Throws necessary to complete the game can vary ::
  903. :: from 1 to infinity, but counts for all>21 are lumped with 21. ::
  904. :: A chi-square test is made on the no.-of-throws cell counts. ::
  905. :: Each 32-bit integer from the test file provides the value for ::
  906. :: the throw of a die, by floating to [0,1), multiplying by 6 ::
  907. :: and taking 1 plus the integer part of the result. ::
  908. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  909. Results of craps test for gcd1_random.dat
  910. No. of wins: Observed Expected
  911. 98604 98585.86
  912. 98604= No. of wins, z-score= .081 pvalue= .53233
  913. Analysis of Throws-per-Game:
  914. Chisq= 15.69 for 20 degrees of freedom, p= .26415
  915. Throws Observed Expected Chisq Sum
  916. 1 66538 66666.7 .248 .248
  917. 2 37657 37654.3 .000 .249
  918. 3 26938 26954.7 .010 .259
  919. 4 19422 19313.5 .610 .869
  920. 5 13905 13851.4 .207 1.076
  921. 6 9928 9943.5 .024 1.100
  922. 7 7215 7145.0 .685 1.786
  923. 8 5203 5139.1 .795 2.581
  924. 9 3720 3699.9 .110 2.691
  925. 10 2605 2666.3 1.409 4.100
  926. 11 1953 1923.3 .458 4.558
  927. 12 1329 1388.7 2.570 7.127
  928. 13 1013 1003.7 .086 7.213
  929. 14 708 726.1 .453 7.666
  930. 15 496 525.8 1.693 9.359
  931. 16 410 381.2 2.184 11.543
  932. 17 262 276.5 .764 12.307
  933. 18 183 200.8 1.583 13.890
  934. 19 131 146.0 1.538 15.428
  935. 20 102 106.2 .167 15.596
  936. 21 282 287.1 .091 15.687
  937. SUMMARY FOR gcd1_random.dat
  938. p-value for no. of wins: .532333
  939. p-value for throws/game: .264147
  940.  
  941. $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  942.  
  943. Results of DIEHARD battery of tests sent to file GCD1_report.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement