📄 kiss.out
字号:
|(OBS-EXP)^2/EXP on counts for 5- and 4-letter cell counts. | |-------------------------------------------------------------| Test result for the byte stream from kiss.32 (Degrees of freedom: 5^4-5^3=2500; sample size: 2560000) chisquare z-score p-value 2569.63 0.985 0.162389 |-------------------------------------------------------------| | 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. | |-------------------------------------------------------------| Test results for specific bytes from kiss.32 (Degrees of freedom: 5^4-5^3=2500; sample size: 256000) bits used chisquare z-score p-value 1 to 8 2534.09 0.482 0.314881 2 to 9 2579.59 1.126 0.130163 3 to 10 2454.72 -0.640 0.739022 4 to 11 2421.58 -1.109 0.866290 5 to 12 2388.23 -1.581 0.943023 6 to 13 2392.09 -1.526 0.936499 7 to 14 2658.54 2.242 0.012476 8 to 15 2475.71 -0.344 0.634403 9 to 16 2389.81 -1.558 0.940419 10 to 17 2626.24 1.785 0.037108 11 to 18 2448.12 -0.734 0.768427 12 to 19 2478.40 -0.305 0.620006 13 to 20 2409.81 -1.276 0.898937 14 to 21 2526.94 0.381 0.351593 15 to 22 2519.69 0.278 0.390349 16 to 23 2495.75 -0.060 0.523965 17 to 24 2698.18 2.803 0.002534 18 to 25 2562.83 0.889 0.187107 19 to 26 2472.54 -0.388 0.651141 20 to 27 2450.04 -0.706 0.760057 21 to 28 2511.11 0.157 0.437590 22 to 29 2430.02 -0.990 0.838847 23 to 30 2678.79 2.529 0.005727 24 to 31 2422.40 -1.097 0.863774 25 to 32 2558.90 0.833 0.202414 |-------------------------------------------------------------| | 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 10 tests on file kiss.32 (Of 12000 tries, the average no. of successes should be 3523.0 with sigma=21.9) No. succeses z-score p-value 3522 -0.0457 0.518210 3523 0.0000 0.500000 3528 0.2283 0.409702 3552 1.3242 0.092718 3495 -1.2785 0.899470 3497 -1.1872 0.882429 3517 -0.2740 0.607947 3524 0.0457 0.481790 3518 -0.2283 0.590298 3558 1.5982 0.055002 Square side=100, avg. no. parked=3523.40 sample std.=19.01 p-value of the KSTEST for those 10 p-values: 0.791810 |-------------------------------------------------------------| | 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 file kiss.32 Sample no. d^2 mean equiv uni 5 0.2407 0.6853 0.214846 10 0.2691 1.3127 0.236941 15 0.5289 1.0430 0.412292 20 2.6530 1.2501 0.930494 25 1.1462 1.1289 0.683971 30 0.5493 1.1258 0.424251 35 1.0378 1.1293 0.647593 40 1.3810 1.0513 0.750398 45 0.0568 0.9854 0.055528 50 0.2866 0.9918 0.250301 55 1.4535 0.9500 0.767949 60 0.3224 0.9427 0.276778 65 0.2098 0.9488 0.190091 70 1.2683 0.9188 0.720464 75 0.4661 0.8860 0.374017 80 0.1541 0.8685 0.143476 85 2.1244 0.9002 0.881767 90 0.5448 0.8727 0.421622 95 0.8266 0.8758 0.564282 100 0.9794 0.8981 0.626309 -------------------------------------------------------------- Result of KS test on 100 transformed mindist^2's: p-value=0.339825 |-------------------------------------------------------------| | 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 kiss.32 sample no r^3 equiv. uni. 1 13.084 0.353465 2 36.078 0.699590 3 13.449 0.361279 4 2.501 0.079978 5 8.187 0.238822 6 31.268 0.647350 7 7.178 0.212801 8 1.237 0.040411 9 8.990 0.258923 10 22.029 0.520155 11 0.985 0.032315 12 29.327 0.623777 13 25.061 0.566286 14 18.910 0.467589 15 6.227 0.187435 16 34.239 0.680600 17 3.653 0.114642 18 25.439 0.571711 19 4.945 0.151976 20 9.214 0.264445 -------------------------------------------------------------- p-value for KS test on those 20 p-values: 0.033280 |-------------------------------------------------------------| | This is the SQUEEZE 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 kiss.32 Table of standardized frequency counts (obs-exp)^2/exp for j=(1,..,6), 7,...,47,(48,...) -1.5 -0.7 0.6 -0.3 -0.7 1.6 1.4 1.0 -0.7 0.9 0.3 -0.3 1.3 1.5 2.0 -1.1 -0.7 -0.9 -0.6 -1.1 -0.9 0.1 0.4 -0.2 -0.9 -0.8 0.7 -0.1 0.3 -1.1 -0.3 0.6 0.7 2.0 -0.2 1.0 -0.2 1.1 1.7 1.0 0.9 -1.0 0.8 Chi-square with 42 degrees of freedom:40.358142 z-score=-0.179141, p-value=0.543189 _____________________________________________________________ |-------------------------------------------------------------| | 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. | |-------------------------------------------------------------| Results of the OSUM test for kiss.32 Test no p-value 1 0.360690 2 0.206068 3 0.290307 4 0.769668 5 0.445720 6 0.279731 7 0.729134 8 0.948065 9 0.169536 10 0.538107 _____________________________________________________________ p-value for 10 kstests on 100 kstests:0.825647 |-------------------------------------------------------------| | 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| |another three sets of ten. | |-------------------------------------------------------------| The RUNS test for file kiss.32 (Up and down runs in a sequence of 10000 numbers) Set 1 runs up; ks test for 10 p's: 0.067228 runs down; ks test for 10 p's: 0.333222 Set 2 runs up; ks test for 10 p's: 0.581523 runs down; ks test for 10 p's: 0.217533 |-------------------------------------------------------------| |This the CRAPS TEST. It plays 200,000 games of craps, counts| |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), and | |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 kiss.32 No. of wins: Observed Expected 98760 98585.858586 z-score= 0.779, pvalue=0.21803 Analysis of Throws-per-Game: Throws Observed Expected Chisq Sum of (O-E)^2/E 1 66445 66666.7 0.737 0.737 2 37506 37654.3 0.584 1.321 3 27179 26954.7 1.866 3.187 4 19499 19313.5 1.782 4.970 5 13788 13851.4 0.290 5.260 6 9821 9943.5 1.510 6.770 7 7173 7145.0 0.110 6.880 8 5329 5139.1 7.019 13.899 9 3686 3699.9 0.052 13.951 10 2690 2666.3 0.211 14.162 11 1887 1923.3 0.686 14.848 12 1370 1388.7 0.253 15.101 13 982 1003.7 0.470 15.571 14 751 726.1 0.851 16.422 15 523 525.8 0.015 16.437 16 368 381.2 0.454 16.891 17 273 276.5 0.045 16.936 18 175 200.8 3.322 20.258 19 143 146.0 0.061 20.319 20 138 106.2 9.512 29.831 21 274 287.1 0.599 30.430 Chisq= 30.43 for 20 degrees of freedom, p= 0.06318 SUMMARY of craptest on kiss.32 p-value for no. of wins: 0.218031 p-value for throws/game: 0.063185 _____________________________________________________________
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -