source/ 40755 765 144 0 6077510410 10440 5ustar geouserssource/asc2bin.c100644 765 144 17766 6077246015 12272 0ustar geousers/* asc2bin.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static integer c__4096 = 4096; /* Main program */ MAIN__() { /* Format strings */ static char fmt_852[] = "(a1)"; static char fmt_818[] = "(a15)"; static char fmt_21[] = "(10z8)"; static char fmt_23[] = "(\002 OK, binary file \002,a15,\002 has been cr\ eated.\002)"; /* System generated locals */ olist o__1; cllist cl__1; /* Builtin functions */ integer s_wsle(), do_lio(), e_wsle(), s_rsfe(), do_fio(), e_rsfe(), f_open(), s_wdue(), do_uio(), e_wdue(), s_wsfe(), e_wsfe(), f_clos(); /* Local variables */ static integer i, m[4096], jk; static char dum[1], ascfile[15], binfile[15]; /* Fortran I/O blocks */ static cilist io___1 = { 0, 6, 0, 0, 0 }; static cilist io___2 = { 0, 6, 0, 0, 0 }; static cilist io___3 = { 0, 6, 0, 0, 0 }; static cilist io___4 = { 0, 6, 0, 0, 0 }; static cilist io___5 = { 0, 5, 0, fmt_852, 0 }; static cilist io___7 = { 0, 6, 0, 0, 0 }; static cilist io___8 = { 0, 6, 0, 0, 0 }; static cilist io___9 = { 0, 6, 0, 0, 0 }; static cilist io___10 = { 0, 6, 0, 0, 0 }; static cilist io___11 = { 0, 6, 0, 0, 0 }; static cilist io___12 = { 0, 6, 0, 0, 0 }; static cilist io___13 = { 0, 6, 0, 0, 0 }; static cilist io___14 = { 0, 6, 0, 0, 0 }; static cilist io___15 = { 0, 6, 0, 0, 0 }; static cilist io___16 = { 0, 6, 0, 0, 0 }; static cilist io___17 = { 0, 6, 0, 0, 0 }; static cilist io___18 = { 0, 6, 0, 0, 0 }; static cilist io___19 = { 0, 6, 0, 0, 0 }; static cilist io___20 = { 0, 6, 0, 0, 0 }; static cilist io___21 = { 0, 5, 0, fmt_852, 0 }; static cilist io___22 = { 0, 6, 0, 0, 0 }; static cilist io___23 = { 0, 6, 0, 0, 0 }; static cilist io___24 = { 0, 6, 0, 0, 0 }; static cilist io___25 = { 0, 6, 0, 0, 0 }; static cilist io___26 = { 0, 6, 0, 0, 0 }; static cilist io___27 = { 0, 6, 0, 0, 0 }; static cilist io___28 = { 0, 6, 0, 0, 0 }; static cilist io___29 = { 0, 6, 0, 0, 0 }; static cilist io___30 = { 0, 6, 0, 0, 0 }; static cilist io___31 = { 0, 6, 0, 0, 0 }; static cilist io___32 = { 0, 6, 0, 0, 0 }; static cilist io___33 = { 0, 6, 0, 0, 0 }; static cilist io___34 = { 0, 6, 0, 0, 0 }; static cilist io___35 = { 0, 6, 0, 0, 0 }; static cilist io___36 = { 0, 6, 0, 0, 0 }; static cilist io___37 = { 0, 6, 0, 0, 0 }; static cilist io___38 = { 0, 5, 0, fmt_818, 0 }; static cilist io___40 = { 0, 6, 0, 0, 0 }; static cilist io___41 = { 0, 5, 0, fmt_818, 0 }; static cilist io___43 = { 0, 6, 0, 0, 0 }; static cilist io___46 = { 0, 1, 0, fmt_21, 0 }; static cilist io___48 = { 0, 2, 0, 0, 0 }; static cilist io___49 = { 0, 6, 0, fmt_23, 0 }; s_wsle(&io___1); do_lio(&c__9, &c__1, " This program reads an ascii file of 32-bit integ\ ers", 53L); e_wsle(); s_wsle(&io___2); do_lio(&c__9, &c__1, " and converts it to a binary file for use in DIEH\ ARD.", 54L); e_wsle(); s_wsle(&io___3); do_lio(&c__9, &c__1, " ", 6L); e_wsle(); s_wsle(&io___4); do_lio(&c__9, &c__1, " To continue, hit space ret", 28L); e_wsle(); s_rsfe(&io___5); do_fio(&c__1, dum, 1L); e_rsfe(); s_wsle(&io___7); do_lio(&c__9, &c__1, " You must first create the ascii file. To do tha\ t,", 52L); e_wsle(); s_wsle(&io___8); do_lio(&c__9, &c__1, " generate your 32-bit integers and write them to a\ file,", 56L); e_wsle(); s_wsle(&io___9); do_lio(&c__9, &c__1, " in hex format, 80 characters (ten 32-bit integers\ ) per", 55L); e_wsle(); s_wsle(&io___10); do_lio(&c__9, &c__1, " line. For example, in Fortran, if your array is,\ say,", 55L); e_wsle(); s_wsle(&io___11); do_lio(&c__9, &c__1, " mran(5000), then the statements", 32L); e_wsle(); s_wsle(&io___12); do_lio(&c__9, &c__1, " write(1,21) mran ", 30L); e_wsle(); s_wsle(&io___13); do_lio(&c__9, &c__1, " 21 format(10z8)", 24L); e_wsle(); s_wsle(&io___14); do_lio(&c__9, &c__1, " will cause your 5000 integers to be written to the" , 51L); e_wsle(); s_wsle(&io___15); do_lio(&c__9, &c__1, " file designated unit 1. Of course you must have\ first", 56L); e_wsle(); s_wsle(&io___16); do_lio(&c__9, &c__1, " opened that unit with a statement such as", 42L); e_wsle(); s_wsle(&io___17); do_lio(&c__9, &c__1, " open(1,file='whatever')", 36L); e_wsle(); s_wsle(&io___18); do_lio(&c__9, &c__1, " ", 6L); e_wsle(); s_wsle(&io___19); do_lio(&c__9, &c__1, " You must first create the ascii file. To do tha\ t,", 52L); e_wsle(); s_wsle(&io___20); do_lio(&c__9, &c__1, " To continue, hit space ret", 28L); e_wsle(); s_rsfe(&io___21); do_fio(&c__1, dum, 1L); e_rsfe(); s_wsle(&io___22); do_lio(&c__9, &c__1, " Since DIEHARD expects BIG files, you will get few" , 51L); e_wsle(); s_wsle(&io___23); do_lio(&c__9, &c__1, " results from a file of a mere 5000 integers. Yo\ u are", 55L); e_wsle(); s_wsle(&io___24); do_lio(&c__9, &c__1, " presumably creating a file of random numbers to \ test,", 55L); e_wsle(); s_wsle(&io___25); do_lio(&c__9, &c__1, " and you need about 2.9 million for DIEHARD. Thi\ s may", 55L); e_wsle(); s_wsle(&io___26); do_lio(&c__9, &c__1, " be done with a double loop. A (Fortran) program\ with", 55L); e_wsle(); s_wsle(&io___27); do_lio(&c__9, &c__1, " this structure would do it:", 29L); e_wsle(); s_wsle(&io___28); do_lio(&c__9, &c__1, " integer*4 m(4096) ", 36L); e_wsle(); s_wsle(&io___29); do_lio(&c__9, &c__1, " open(1,file='ascfile') ", 36L); e_wsle(); s_wsle(&io___30); do_lio(&c__9, &c__1, " do 2 i=1,700 ", 36L); e_wsle(); s_wsle(&io___31); do_lio(&c__9, &c__1, " do 3 j=1,4096 ", 36L); e_wsle(); s_wsle(&io___32); do_lio(&c__9, &c__1, " 3 m(j)=NEXTRANDOM32BIT ", 41L); e_wsle(); s_wsle(&io___33); do_lio(&c__9, &c__1, " 2 write(1,21) ", 36L); e_wsle(); s_wsle(&io___34); do_lio(&c__9, &c__1, " 21 format(10z8) ", 36L); e_wsle(); s_wsle(&io___35); do_lio(&c__9, &c__1, " end ", 36L); e_wsle(); s_wsle(&io___36); do_lio(&c__9, &c__1, " OK, I assume you have created your ascii file. ", 49L); e_wsle(); s_wsle(&io___37); do_lio(&c__9, &c__1, " Now enter the name of that file (<=15 characters\ ):", 52L); e_wsle(); s_rsfe(&io___38); do_fio(&c__1, ascfile, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = ascfile; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___40); do_lio(&c__9, &c__1, " Next, enter the name of your binary file:", 43L); e_wsle(); s_rsfe(&io___41); do_fio(&c__1, binfile, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 15; o__1.ofnm = binfile; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___43); do_lio(&c__9, &c__1, " Please wait...........", 25L); e_wsle(); jk = 0; for (i = 1; i <= 700; ++i) { s_rsfe(&io___46); do_fio(&c__4096, (char *)&m[0], (ftnlen)sizeof(integer)); e_rsfe(); ++jk; /* L2: */ io___48.cirec = jk; s_wdue(&io___48); do_uio(&c__4096, (char *)&m[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsfe(&io___49); do_fio(&c__1, binfile, 15L); e_wsfe(); /* L5: */ cl__1.cerr = 0; cl__1.cunit = 2; cl__1.csta = 0; f_clos(&cl__1); } /* MAIN__ */ source/diehard.c100644 765 144 371754 6100243372 12357 0ustar geousers/* diehard.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__1 = 1; static integer c__9 = 9; static integer c__15 = 15; static real c_b135 = (float)2.; static integer c__2 = 2; static integer c__20 = 20; static integer c__4096 = 4096; static integer c__42 = 42; static real c_b274 = (float)100.; static integer c__10 = 10; static integer c__8000 = 8000; static real c_b394 = (float).75; static real c_b395 = (float).72222222222222221; static real c_b396 = (float).69444444444444442; static integer c__5 = 5; static integer c__6 = 6; static integer c__8 = 8; static integer c__25 = 25; static integer c__3 = 3; static integer c__99 = 99; static doublereal c_b822 = 2.; static integer c__100 = 100; static real c_b1029 = (float).5; static doublereal c_b1030 = .5; static doublereal c_b1033 = .33333; /* ************top of file */ /* Main program */ MAIN__() { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_845[] = "(a25)"; static char fmt_158[] = "(a)"; static char fmt_876[] = "(15i1)"; static char fmt_472[] = "(\002 Results of DIEHARD battery of tests sent \ to file \002,a15)"; /* System generated locals */ olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(), s_wsle(), do_lio(), e_wsle(); /* Local variables */ static char filename[25]; extern /* Subroutine */ int cdbinrnk_(); static char text[80*36]; extern /* Subroutine */ int craptest_(); static integer j, which[15]; extern /* Subroutine */ int sqeez_(), sknt1s_(), cdbday_(), wknt1s_(), rank3132_(), cdpark_(), cdomso_(), cdosum_(); static char dum[80]; extern /* Subroutine */ int cdbitst_(); static char fileout[25]; extern /* Subroutine */ int mindist_(), runtest_(), d3sphere_(), cdoperm5_(); /* Fortran I/O blocks */ static cilist io___1 = { 0, 4, 0, fmt_766, 0 }; static cilist io___4 = { 0, 4, 0, fmt_766, 0 }; static cilist io___6 = { 0, 6, 0, fmt_766, 0 }; static cilist io___7 = { 0, 6, 0, 0, 0 }; static cilist io___8 = { 0, 5, 0, fmt_845, 0 }; static cilist io___10 = { 0, 6, 0, 0, 0 }; static cilist io___11 = { 0, 5, 0, fmt_845, 0 }; static cilist io___13 = { 0, 6, 0, fmt_766, 0 }; static cilist io___14 = { 0, 3, 0, fmt_766, 0 }; static cilist io___15 = { 0, 6, 0, 0, 0 }; static cilist io___16 = { 0, 6, 0, 0, 0 }; static cilist io___17 = { 0, 6, 0, 0, 0 }; static cilist io___18 = { 0, 6, 0, 0, 0 }; static cilist io___19 = { 0, 6, 0, 0, 0 }; static cilist io___20 = { 0, 6, 0, 0, 0 }; static cilist io___21 = { 0, 6, 0, 0, 0 }; static cilist io___22 = { 0, 6, 0, 0, 0 }; static cilist io___23 = { 0, 6, 0, 0, 0 }; static cilist io___24 = { 0, 6, 0, 0, 0 }; static cilist io___25 = { 0, 6, 0, 0, 0 }; static cilist io___26 = { 0, 6, 0, 0, 0 }; static cilist io___27 = { 0, 6, 0, 0, 0 }; static cilist io___28 = { 0, 6, 0, 0, 0 }; static cilist io___29 = { 0, 6, 0, 0, 0 }; static cilist io___30 = { 0, 6, 0, 0, 0 }; static cilist io___31 = { 0, 6, 0, 0, 0 }; static cilist io___32 = { 0, 6, 0, 0, 0 }; static cilist io___33 = { 0, 6, 0, 0, 0 }; static cilist io___34 = { 0, 6, 0, 0, 0 }; static cilist io___35 = { 0, 6, 0, 0, 0 }; static cilist io___36 = { 0, 6, 0, 0, 0 }; static cilist io___37 = { 0, 6, 0, fmt_158, 0 }; static cilist io___38 = { 0, 5, 0, fmt_876, 0 }; static cilist io___40 = { 0, 6, 0, fmt_472, 0 }; static cilist io___41 = { 0, 3, 0, fmt_472, 0 }; o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___1); for (j = 1; j <= 244; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___4); for (j = 1; j <= 15; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___6); for (j = 1; j <= 15; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /* L1: */ s_wsle(&io___7); do_lio(&c__9, &c__1, " Enter filename (<=25 characters):", 34L); e_wsle(); s_rsfe(&io___8); do_fio(&c__1, filename, 25L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 25; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___10); do_lio(&c__9, &c__1, " Enter name of output file (<=15 characters):", 45L) ; e_wsle(); s_rsfe(&io___11); do_fio(&c__1, fileout, 25L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 3; o__1.ofnmlen = 25; o__1.ofnm = fileout; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_wsfe(&io___13); for (j = 1; j <= 14; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___14); for (j = 1; j <= 14; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsle(&io___15); do_lio(&c__9, &c__1, " Which tests do you want performed?", 35L); e_wsle(); s_wsle(&io___16); do_lio(&c__9, &c__1, " For all tests, enter 15 1`s:", 29L); e_wsle(); s_wsle(&io___17); do_lio(&c__9, &c__1, " 111111111111111", 16L); e_wsle(); s_wsle(&io___18); do_lio(&c__9, &c__1, " For, say, tests 1,3,7 and 14, enter", 36L); e_wsle(); s_wsle(&io___19); do_lio(&c__9, &c__1, " 101000100000010", 16L); e_wsle(); s_wsle(&io___20); do_lio(&c__9, &c__1, " HERE ARE YOUR CHOICES:", 27L); e_wsle(); s_wsle(&io___21); do_lio(&c__9, &c__1, " 1 Birthday Spacings", 25L); e_wsle(); s_wsle(&io___22); do_lio(&c__9, &c__1, " 2 Overlapping Permutations", 32L); e_wsle(); s_wsle(&io___23); do_lio(&c__9, &c__1, " 3 Ranks of 31x31 and 32x32 matrices", 41L); e_wsle(); s_wsle(&io___24); do_lio(&c__9, &c__1, " 4 Ranks of 6x8 Matrices", 29L); e_wsle(); s_wsle(&io___25); do_lio(&c__9, &c__1, " 5 Monkey Tests on 20-bit Words", 36L); e_wsle(); s_wsle(&io___26); do_lio(&c__9, &c__1, " 6 Monkey Tests OPSO,OQSO,DNA", 34L); e_wsle(); s_wsle(&io___27); do_lio(&c__9, &c__1, " 7 Count the 1`s in a Stream of Bytes", 42L); e_wsle(); s_wsle(&io___28); do_lio(&c__9, &c__1, " 8 Count the 1`s in Specific Bytes", 39L); e_wsle(); s_wsle(&io___29); do_lio(&c__9, &c__1, " 9 Parking Lot Test", 24L); e_wsle(); s_wsle(&io___30); do_lio(&c__9, &c__1, " 10 Minimum Distance Test", 29L); e_wsle(); s_wsle(&io___31); do_lio(&c__9, &c__1, " 11 Random Spheres Test", 27L); e_wsle(); s_wsle(&io___32); do_lio(&c__9, &c__1, " 12 The Sqeeze Test", 23L); e_wsle(); s_wsle(&io___33); do_lio(&c__9, &c__1, " 13 Overlapping Sums Test", 29L); e_wsle(); s_wsle(&io___34); do_lio(&c__9, &c__1, " 14 Runs Test", 17L); e_wsle(); s_wsle(&io___35); do_lio(&c__9, &c__1, " 15 The Craps Test", 22L); e_wsle(); s_wsle(&io___36); do_lio(&c__9, &c__1, " Enter your choices, 1`s yes, 0`s no. using 15 col\ umns:", 55L); e_wsle(); /* L158: */ s_wsfe(&io___37); do_fio(&c__1, "123456789012345", 15L); e_wsfe(); s_rsfe(&io___38); do_fio(&c__15, (char *)&which[0], (ftnlen)sizeof(integer)); e_rsfe(); if (which[0] == 1) { cdbday_(filename, 25L); } if (which[1] == 1) { cdoperm5_(filename, 25L); } if (which[2] == 1) { rank3132_(filename, 25L); } if (which[3] == 1) { cdbinrnk_(filename, 25L); } if (which[4] == 1) { cdbitst_(filename, 25L); } if (which[5] == 1) { cdomso_(filename, 25L); } if (which[6] == 1) { sknt1s_(filename, 25L); } if (which[7] == 1) { wknt1s_(filename, 25L); } if (which[8] == 1) { cdpark_(filename, 25L); } if (which[9] == 1) { mindist_(filename, 25L); } if (which[10] == 1) { d3sphere_(filename, 25L); } if (which[11] == 1) { sqeez_(filename, 25L); } if (which[12] == 1) { cdosum_(filename, 25L); } if (which[13] == 1) { runtest_(filename, 25L); } if (which[14] == 1) { craptest_(filename, 25L); } s_wsfe(&io___40); do_fio(&c__1, fileout, 25L); e_wsfe(); s_wsfe(&io___41); do_fio(&c__1, fileout, 25L); e_wsfe(); } /* MAIN__ */ /* Subroutine */ int cdbitst_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2511[] = "(\002 No. missing words should average\002,f9\ .0,\002 with sigma=\002,f4.0,/,\002----------------------------------- \ ---------------\002)"; static char fmt_2345[] = "(\002 BITSTREAM test results for\002,a15)"; static char fmt_22[] = "(\002 tst no \002,i2,\002: \002,i7,\002 missing \ words, \002,f7.2,\002 sigmas from mean, p-value=\002,f7.5)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(), s_wsle(), do_lio(), e_wsle(); double pow_ri(), exp(); integer pow_ii(); /* Local variables */ static integer mbit[32]; extern integer jtbl_(); static integer nint, kpow; static char text[80*36]; static integer i, j, k, l, n; static real s; static integer w[32768]; static real x, sigma; static integer kount, ib, ic; static real mu; static integer nt; static real ss; static integer ntries, jkk; extern doublereal phi_(); static real dum; static integer num; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___43 = { 0, 4, 0, fmt_766, 0 }; static cilist io___46 = { 0, 4, 0, fmt_766, 0 }; static cilist io___48 = { 0, 6, 0, fmt_766, 0 }; static cilist io___49 = { 0, 3, 0, fmt_766, 0 }; static cilist io___56 = { 0, 3, 0, 0, 0 }; static cilist io___57 = { 0, 3, 0, 0, 0 }; static cilist io___58 = { 0, 6, 0, 0, 0 }; static cilist io___59 = { 0, 6, 0, 0, 0 }; static cilist io___60 = { 0, 3, 0, 0, 0 }; static cilist io___61 = { 0, 6, 0, 0, 0 }; static cilist io___63 = { 0, 3, 0, fmt_2511, 0 }; static cilist io___64 = { 0, 6, 0, fmt_2511, 0 }; static cilist io___68 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___78 = { 0, 3, 0, fmt_22, 0 }; static cilist io___79 = { 0, 6, 0, fmt_22, 0 }; static cilist io___80 = { 0, 6, 0, fmt_489, 0 }; static cilist io___81 = { 0, 3, 0, fmt_489, 0 }; /* THE OVERLAPPING 20-tuples TEST BITSTREAM, 20 BITS PER WORD, N words */ /* If n=2^22, should be 19205.3 missing 20-letter words, sigma 167. */ /* If n=2^21, should be 141909 missing 20-letter words, sigma 428. */ /* If n=2^20, should be 385750 missing 20-letter words, sigma 512 */ jkk = jkreset_(); o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___43); for (j = 1; j <= 61; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___46); for (j = 1; j <= 16; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___48); for (j = 1; j <= 16; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___49); for (j = 1; j <= 16; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); n = 20; kpow = 21; ntries = 20; sigma = (float)428.; /* **** SET MASK BITS*************** */ mbit[0] = 1; for (i = 1; i <= 31; ++i) { /* L8: */ mbit[i] = mbit[i - 1] << 1; } /* ***********INITIALIZE***************** */ s_wsle(&io___56); do_lio(&c__9, &c__1, " THE OVERLAPPING 20-tuples BITSTREAM TEST,", 47L); e_wsle(); s_wsle(&io___57); do_lio(&c__9, &c__1, " 20 BITS PER WORD, 2^21 words.", 40L); e_wsle(); s_wsle(&io___58); do_lio(&c__9, &c__1, " THE OVERLAPPING 20-tuples BITSTREAM TEST,", 47L); e_wsle(); s_wsle(&io___59); do_lio(&c__9, &c__1, " 20 BITS PER WORD, 2^21 words.", 40L); e_wsle(); s_wsle(&io___60); do_lio(&c__9, &c__1, " This test samples the bitstream 20 times.", 44L); e_wsle(); s_wsle(&io___61); do_lio(&c__9, &c__1, " This test samples the bitstream 20 times.", 44L); e_wsle(); i__1 = kpow - 20; mu = exp(-(doublereal)pow_ri(&c_b135, &i__1)) * 1048576; s_wsfe(&io___63); do_fio(&c__1, (char *)&mu, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sigma, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___64); do_fio(&c__1, (char *)&mu, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sigma, (ftnlen)sizeof(real)); e_wsfe(); /* *****MAIN LOOP********* */ /* **** GET INITIAL WORD */ j = jtbl_(); j &= 1048575; s = (float)0.; ss = (float)0.; nint = 1024; s_wsfe(&io___68); do_fio(&c__1, filename, 25L); e_wsfe(); i__1 = ntries; for (nt = 1; nt <= i__1; ++nt) { /* ********SET W-TABLE TO ZEROS******* */ for (i = 0; i <= 32767; ++i) { /* L9: */ w[i] = 0; } /* **** GENERATE 2**kpow OVERLAPPING WORDS********** */ i__3 = kpow - 5; i__2 = pow_ii(&c__2, &i__3); for (ic = 1; ic <= i__2; ++ic) { num = jtbl_(); for (ib = 1; ib <= 32; ++ib) { /* *** GET NEW J ***** */ j = ((j & 524287) << 1) + (num & 1); num = num >> 1; /* *** GET BIT INDEX FROM LAST 5 BITS OF J *** */ l = j & 31; /* *** GET TABLE INDEX FROM LEADING 15 BITS OF J*** */ k = j >> 5; /* *** SET BIT L IN W(K) *** */ /* L3: */ w[k] |= mbit[l]; } } /* ********** COUNT NUMBER OF EMPTY CELLS ******* */ kount = 0; for (k = 0; k <= 32767; ++k) { for (l = 0; l <= 31; ++l) { /* L4: */ if ((w[k] & mbit[l]) == 0) { ++kount; } } } /* ****END OF MAIN LOOP**** */ x = (kount - mu) / sigma; s_wsfe(&io___78); do_fio(&c__1, (char *)&nt, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L2: */ s_wsfe(&io___79); do_fio(&c__1, (char *)&nt, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); } jkk = jkreset_(); s_wsfe(&io___80); e_wsfe(); s_wsfe(&io___81); e_wsfe(); return 0; } /* cdbitst_ */ /* Subroutine */ int d3sphere_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_841[] = "(\002 The 3DSPHERES test for fi\ le \002,a15)"; static char fmt_28[] = "(\002 sample no: \002,i2,4x,\002 r^3= \002,f7.3,\ 4x,\002 p-value=\002,f7.5)"; static char fmt_22[] = "(\002 A KS test is applied to those 20 p-valu\ es.\002,/,\002---------------------------------------------------------\002)"; static char fmt_25[] = "(6x,\002 3DSPHERES test for file \002,a15,\002 \ p-value=\002,f8.6,/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(), exp(); /* Local variables */ static real dmin__; extern integer jtbl_(); static char text[80*36]; static real d; static integer i, j, n; static real p[20], u, v, w, x[4000], y[4000], z[4000]; extern /* Subroutine */ int asort_(); static real r3; static integer ij; static real pv; extern /* Subroutine */ int kstest_(); static integer jkk; static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___83 = { 0, 4, 0, fmt_766, 0 }; static cilist io___86 = { 0, 4, 0, fmt_766, 0 }; static cilist io___88 = { 0, 6, 0, fmt_766, 0 }; static cilist io___89 = { 0, 3, 0, fmt_766, 0 }; static cilist io___91 = { 0, 3, 0, fmt_841, 0 }; static cilist io___92 = { 0, 6, 0, fmt_841, 0 }; static cilist io___105 = { 0, 3, 0, fmt_28, 0 }; static cilist io___106 = { 0, 6, 0, fmt_28, 0 }; static cilist io___107 = { 0, 3, 0, fmt_22, 0 }; static cilist io___108 = { 0, 6, 0, fmt_22, 0 }; static cilist io___110 = { 0, 6, 0, fmt_25, 0 }; static cilist io___111 = { 0, 3, 0, fmt_25, 0 }; n = 4000; o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___83); for (j = 1; j <= 186; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___86); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___88); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___89); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); jkk = jkreset_(); s_wsfe(&io___91); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___92); do_fio(&c__1, filename, 25L); e_wsfe(); for (ij = 1; ij <= 20; ++ij) { dmin__ = (float)1e7; i__1 = n; for (i = 1; i <= i__1; ++i) { /* L2: */ x[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; } asort_(x, &n); i__1 = n; for (i = 1; i <= i__1; ++i) { y[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; /* L3: */ z[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; } i__1 = n; for (i = 1; i <= i__1; ++i) { u = x[i - 1]; v = y[i - 1]; w = z[i - 1]; i__2 = n; for (j = i + 1; j <= i__2; ++j) { /* Computing 2nd power */ r__1 = u - x[j - 1]; d = r__1 * r__1; if (d >= dmin__) { goto L4; } /* Computing 2nd power */ r__1 = v - y[j - 1]; /* Computing 2nd power */ r__2 = w - z[j - 1]; d = d + r__1 * r__1 + r__2 * r__2; /* L5: */ if (d < dmin__) { dmin__ = d; } } L4: ; } r3 = dmin__ * sqrt(dmin__); p[ij - 1] = 1 - exp(-(doublereal)r3 / (float)30.); s_wsfe(&io___105); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&r3, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&p[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); /* L6: */ s_wsfe(&io___106); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&r3, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&p[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___107); e_wsfe(); s_wsfe(&io___108); e_wsfe(); kstest_(p, &c__20, &pv); s_wsfe(&io___110); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&pv, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___111); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&pv, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); return 0; } /* d3sphere_ */ integer jtbl8_() { /* Initialized data */ static integer j = 4097; static integer nleft = 0; static integer jk = 1; /* System generated locals */ integer ret_val; /* Builtin functions */ integer s_rdue(), do_uio(), e_rdue(); /* Local variables */ static integer b[4096], k; /* Fortran I/O blocks */ static cilist io___115 = { 0, 1, 0, 0, 0 }; if (j > 4096) { io___115.cirec = jk; s_rdue(&io___115); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); j = 1; ++jk; } if (nleft == 0) { k = b[j - 1]; ++j; nleft = 4; } ret_val = k >> 24 & 255; k <<= 8; --nleft; return ret_val; } /* jtbl8_ */ /* Subroutine */ int sqeez_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real ex[43] = { (float)21.03,(float)57.79,(float)175.54,(float) 467.32,(float)1107.83,(float)2367.84,(float)4609.44,(float) 8241.16,(float)13627.81,(float)20968.49,(float)30176.12,(float) 40801.97,(float)52042.03,(float)62838.28,(float)72056.37,(float) 78694.51,(float)82067.55,(float)81919.35,(float)78440.08,(float) 72194.12,(float)63986.79,(float)54709.31,(float)45198.52,(float) 36136.61,(float)28000.28,(float)21055.67,(float)15386.52,(float) 10940.2,(float)7577.96,(float)5119.56,(float)3377.26,(float) 2177.87,(float)1374.39,(float)849.7,(float)515.18,(float)306.66,( float)179.39,(float)103.24,(float)58.51,(float)32.69,(float)18.03, (float)9.82,(float)11.21 }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_345[] = "(\002 RESULTS OF SQUEEZE TEST FOR\ \002,a15)"; static char fmt_348[] = "(\002 Table of standardized frequency c\ ounts\002,/,\002 ( (obs-exp)/sqrt(exp) )^2\002,/,\002 for j takin\ g values <=6,7,8,...,47,>=48:\002)"; static char fmt_25[] = "(6f8.1)"; static char fmt_71[] = "(8x,\002 Chi-square with 42 degrees of freed\ om:\002,f7.3)"; static char fmt_72[] = "(8x,\002 z-score=\002,f7.3,\002 p-value\ =\002,f8.6,/,\002___________________________________________________________\ ___\002)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(); /* Local variables */ extern integer jtbl_(); static real chsq; static char text[80*10]; static integer i, j, k; extern doublereal chisq_(); static integer jkk; static real tbl[43], sig, dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___120 = { 0, 4, 0, fmt_766, 0 }; static cilist io___123 = { 0, 4, 0, fmt_766, 0 }; static cilist io___125 = { 0, 6, 0, fmt_766, 0 }; static cilist io___126 = { 0, 3, 0, fmt_766, 0 }; static cilist io___132 = { 0, 3, 0, fmt_345, 0 }; static cilist io___133 = { 0, 6, 0, fmt_345, 0 }; static cilist io___134 = { 0, 3, 0, fmt_348, 0 }; static cilist io___135 = { 0, 6, 0, fmt_348, 0 }; static cilist io___136 = { 0, 3, 0, fmt_25, 0 }; static cilist io___137 = { 0, 6, 0, fmt_25, 0 }; static cilist io___138 = { 0, 3, 0, fmt_71, 0 }; static cilist io___139 = { 0, 6, 0, fmt_71, 0 }; static cilist io___140 = { 0, 6, 0, fmt_72, 0 }; static cilist io___141 = { 0, 3, 0, fmt_72, 0 }; static cilist io___142 = { 0, 6, 0, fmt_489, 0 }; static cilist io___143 = { 0, 3, 0, fmt_489, 0 }; /* SQUEEZE TEST. How many iterations of k=k*uni()+1 are required */ /* to squeeze k down to 1, starting with k=2147483647=2^31-1. */ /* The exact distribution of the required j is used, with */ /* a chi-square test based on 100,000 tries. */ /* The mean of j is 23.064779, with variance 23.70971151. */ /* Put a one-line function here to provide the uni being tested: */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); jkk = jkreset_(); s_rsfe(&io___120); for (j = 1; j <= 198; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___123); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___125); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___126); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /* L1: */ for (i = 6; i <= 48; ++i) { /* L7: */ tbl[i - 6] = (float)0.; } for (i = 1; i <= 100000; ++i) { j = 0; k = 2147483647; L11: k = k * (jtbl_() * (float)2.3283064365386963e-10 + (float).5) + 1; ++j; if (k > 1) { goto L11; } /* Computing MIN */ i__1 = max(j,6); j = min(i__1,48); /* L2: */ tbl[j - 6] += (float)1.; } chsq = (float)0.; for (i = 6; i <= 48; ++i) { /* L3: */ /* Computing 2nd power */ r__1 = tbl[i - 6] - ex[i - 6] * (float).1; chsq += r__1 * r__1 / (ex[i - 6] * (float).1); } sig = sqrt((float)84.); s_wsfe(&io___132); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___133); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___134); e_wsfe(); s_wsfe(&io___135); e_wsfe(); s_wsfe(&io___136); for (i = 6; i <= 48; ++i) { r__1 = (tbl[i - 6] - ex[i - 6] * (float).1) / sqrt(ex[i - 6] * (float) .1); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___137); for (i = 6; i <= 48; ++i) { r__1 = (tbl[i - 6] - ex[i - 6] * (float).1) / sqrt(ex[i - 6] * (float) .1); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___138); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___139); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___140); r__1 = (chsq - (float)42.) / sig; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); r__2 = chisq_(&chsq, &c__42); do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___141); r__1 = (chsq - (float)42.) / sig; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); r__2 = chisq_(&chsq, &c__42); do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___142); e_wsfe(); s_wsfe(&io___143); e_wsfe(); return 0; } /* sqeez_ */ /* Subroutine */ int cdpark_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2345[] = "(10x,\002 CDPARK: result of ten tests on file\ \002,a15,/,10x,\002 Of 12,000 tries, the average no. of successes\002,/,15\ x,\002 should be 3523 with sigma=21.9\002)"; static char fmt_27[] = "(10x,\002 Successes:\002,i5,\002 z-score:\ \002,f7.3,\002 p-value:\002,f8.6)"; static char fmt_25[] = "(10x,\002 square size avg. no. parked sampl\ e sigma\002,/,10x,f7.0,f20.3,f13.3)"; static char fmt_26[] = "(\002 KSTEST for the above 10: p= \ \002,f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(), s_wsle(), e_wsle(); double sqrt(); /* Local variables */ extern integer jtbl_(); static char text[80*22]; static real g[10]; static integer i, j, k, n; static real s, w, x[4000], y[4000], z; static integer ij; static real av, pp, ss; extern /* Subroutine */ int kstest_(); static integer jkk; extern doublereal phi_(); static real sig, dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___147 = { 0, 4, 0, fmt_766, 0 }; static cilist io___150 = { 0, 4, 0, fmt_766, 0 }; static cilist io___152 = { 0, 6, 0, fmt_766, 0 }; static cilist io___153 = { 0, 3, 0, fmt_766, 0 }; static cilist io___154 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___155 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___165 = { 0, 6, 0, fmt_27, 0 }; static cilist io___166 = { 0, 3, 0, fmt_27, 0 }; static cilist io___169 = { 0, 3, 0, 0, 0 }; static cilist io___170 = { 0, 6, 0, fmt_25, 0 }; static cilist io___171 = { 0, 3, 0, fmt_25, 0 }; static cilist io___173 = { 0, 6, 0, fmt_26, 0 }; static cilist io___174 = { 0, 3, 0, fmt_26, 0 }; static cilist io___175 = { 0, 6, 0, fmt_489, 0 }; static cilist io___176 = { 0, 3, 0, fmt_489, 0 }; jkk = jkreset_(); s = (float)0.; ss = (float)0.; o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___147); for (j = 1; j <= 151; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___150); for (j = 1; j <= 22; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___152); for (j = 1; j <= 22; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___153); for (j = 1; j <= 22; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); s_wsfe(&io___154); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___155); do_fio(&c__1, filename, 25L); e_wsfe(); for (ij = 1; ij <= 10; ++ij) { x[0] = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float) 100.; y[0] = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float) 100.; k = 1; for (n = 1; n <= 12000; ++n) { z = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * ( float)100.; w = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * ( float)100.; i__1 = k; for (i = 1; i <= i__1; ++i) { /* L5: */ if ((r__1 = x[i - 1] - z, dabs(r__1)) <= (float)1. && (r__2 = y[i - 1] - w, dabs(r__2)) <= (float)1.) { goto L3; } } ++k; x[k - 1] = z; y[k - 1] = w; L3: ; } s += k; ss += k * k; z = (k - (float)3523.) / (float)21.9; g[ij - 1] = phi_(&z); s_wsfe(&io___165); do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___166); do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); /* L8: */ } av = s / 10; /* Computing 2nd power */ r__1 = av; sig = ss / 10 - r__1 * r__1; s_wsle(&io___169); e_wsle(); s_wsfe(&io___170); do_fio(&c__1, (char *)&c_b274, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); r__1 = sqrt(sig); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___171); do_fio(&c__1, (char *)&c_b274, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); r__1 = sqrt(sig); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); kstest_(g, &c__10, &pp); s_wsfe(&io___173); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___174); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___175); e_wsfe(); s_wsfe(&io___176); e_wsfe(); return 0; } /* cdpark_ */ /* Subroutine */ int mindist_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_441[] = "(\002 This is the MINIMUM DISTANC\ E test\002,/,\002 for random integers in the file \002,a15,/,4x,\ \002 Sample no. d^2 avg equiv uni \002)"; static char fmt_23[] = "(i12,f10.4,f9.4,f12.6)"; static char fmt_35[] = "(\002 MINIMUM DISTANCE TEST for \002,a15)"; static char fmt_445[] = "(10x,\002Result of KS test on 20 transformed mi\ ndist^2's:\002)"; static char fmt_31[] = "(10x,\002 p-value=\002,f8\ .6)"; static char fmt_409[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$$$ \002,/)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; static doublereal equiv_0[8000]; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double exp(); /* Local variables */ static real dmin__; extern integer jtbl_(); static char text[80*13]; static real d, g[100]; static integer i, j, n; static real p, u, v; extern /* Subroutine */ int dsort_(); static integer ij, ns; #define qq (equiv_0) #define xy ((real *)equiv_0) extern /* Subroutine */ int kstest_(); static integer jkk; static real dum, sum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___179 = { 0, 4, 0, fmt_766, 0 }; static cilist io___182 = { 0, 4, 0, fmt_766, 0 }; static cilist io___184 = { 0, 6, 0, fmt_766, 0 }; static cilist io___185 = { 0, 3, 0, fmt_766, 0 }; static cilist io___189 = { 0, 6, 0, fmt_441, 0 }; static cilist io___190 = { 0, 3, 0, fmt_441, 0 }; static cilist io___199 = { 0, 3, 0, fmt_23, 0 }; static cilist io___200 = { 0, 6, 0, fmt_23, 0 }; static cilist io___201 = { 0, 3, 0, fmt_35, 0 }; static cilist io___202 = { 0, 6, 0, fmt_35, 0 }; static cilist io___203 = { 0, 3, 0, fmt_445, 0 }; static cilist io___204 = { 0, 6, 0, fmt_445, 0 }; static cilist io___206 = { 0, 3, 0, fmt_31, 0 }; static cilist io___207 = { 0, 6, 0, fmt_31, 0 }; static cilist io___208 = { 0, 3, 0, fmt_409, 0 }; static cilist io___209 = { 0, 6, 0, fmt_409, 0 }; /* minimum distance^2 between n random points(x(i),y(i)). */ /* mean is about .64 for 4000 points in a square of side 1000. */ /* and .995 for 8000 points in a square of side 10000. */ /* Since distance^2 is approximately exponential with mean .04, */ /* 1.-exp(-d^2/.04) should be uniform on [0,1). Thus a KS test. */ /* ***** one line function to generate a random coordinate in [0,1000). */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___179); for (j = 1; j <= 173; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___182); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___184); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___185); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); n = 8000; ns = 100; jkk = jkreset_(); s_wsfe(&io___189); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___190); do_fio(&c__1, filename, 25L); e_wsfe(); i__1 = ns; for (ij = 1; ij <= i__1; ++ij) { dmin__ = (float)1e7; for (i = 1; i <= 16000; ++i) { /* L2: */ xy[i - 1] = jtbl_() * (float)2.328306e-6 + (float)5e3; } dsort_(qq, &c__8000); for (i = 2; i <= 16000; i += 2) { u = xy[i - 1]; v = xy[i - 2]; for (j = i + 2; j <= 16000; j += 2) { /* Computing 2nd power */ r__1 = u - xy[j - 1]; d = r__1 * r__1; if (d >= dmin__) { goto L4; } /* Computing 2nd power */ r__1 = v - xy[j - 2]; d += r__1 * r__1; if (d < dmin__) { dmin__ = d; } /* L5: */ } L4: ; } d = dmin__; sum += d; g[ij - 1] = (float)1. - exp(-(doublereal)dmin__ / (float).995); if (ij % 5 == 0) { /* L9: */ s_wsfe(&io___199); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); r__1 = sum / ij; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___200); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); r__1 = sum / ij; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); } /* L345: */ } s_wsfe(&io___201); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___202); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___203); e_wsfe(); s_wsfe(&io___204); e_wsfe(); kstest_(g, &ns, &p); s_wsfe(&io___206); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___207); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___208); e_wsfe(); s_wsfe(&io___209); e_wsfe(); jkk = jkreset_(); return 0; } /* mindist_ */ #undef xy #undef qq integer jtbl_0_(n__) int n__; { /* Initialized data */ static integer j = 4097; static integer jk = 1; /* System generated locals */ integer ret_val; /* Builtin functions */ integer s_rdue(), do_uio(), e_rdue(); /* Local variables */ static integer b[4096]; /* Fortran I/O blocks */ static cilist io___212 = { 0, 1, 0, 0, 0 }; switch(n__) { case 1: goto L_jkreset; } if (j > 4096) { io___212.cirec = jk; s_rdue(&io___212); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); j = 1; ++jk; } ret_val = b[j - 1]; ++j; return ret_val; L_jkreset: jk = 1; ret_val = 1; return ret_val; } /* jtbl_ */ integer jtbl_() { return jtbl_0_(0); } integer jkreset_() { return jtbl_0_(1); } /* Subroutine */ int runtest_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2181[] = "(\002 The RUNS test for file \002,a1\ 5,/,\002 Up and down runs in a sample of 10000\002,/,\002_______________\ __________________________________ \002)"; static char fmt_234[] = "(15x\002 Run test for \002,a15,\002:\002)"; static char fmt_812[] = "(4x,\002 runs up; ks test for 10 p's:\002,f8.\ 6)"; static char fmt_813[] = "(4x,\002 runs down; ks test for 10 p's:\002,f8.\ 6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double exp(); /* Local variables */ static integer ijkn; extern integer jtbl_(); static char text[80*13]; static integer i, j; static real p, x[10000], dn[100]; static integer ij; static real dv; static integer ns; static real up[100], uv; static integer ifault; extern /* Subroutine */ int kstest_(), udruns_(); static integer jkk; static real dum; static integer nxs; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___214 = { 0, 4, 0, fmt_766, 0 }; static cilist io___217 = { 0, 4, 0, fmt_766, 0 }; static cilist io___219 = { 0, 6, 0, fmt_766, 0 }; static cilist io___220 = { 0, 3, 0, fmt_766, 0 }; static cilist io___224 = { 0, 3, 0, fmt_2181, 0 }; static cilist io___225 = { 0, 6, 0, fmt_2181, 0 }; static cilist io___236 = { 0, 6, 0, fmt_234, 0 }; static cilist io___237 = { 0, 3, 0, fmt_234, 0 }; static cilist io___238 = { 0, 3, 0, fmt_812, 0 }; static cilist io___239 = { 0, 6, 0, fmt_812, 0 }; static cilist io___240 = { 0, 3, 0, fmt_813, 0 }; static cilist io___241 = { 0, 6, 0, fmt_813, 0 }; static cilist io___242 = { 0, 6, 0, fmt_489, 0 }; static cilist io___243 = { 0, 3, 0, fmt_489, 0 }; /* **** up and down runs test****************** */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___214); for (j = 1; j <= 219; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___217); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___219); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___220); for (j = 1; j <= 13; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); ns = 10; nxs = 10000; jkk = jkreset_(); s_wsfe(&io___224); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___225); do_fio(&c__1, filename, 25L); e_wsfe(); for (ijkn = 1; ijkn <= 2; ++ijkn) { /* L1: */ i__1 = ns; for (ij = 1; ij <= i__1; ++ij) { i__2 = nxs; for (i = 1; i <= i__2; ++i) { /* L2: */ x[i - 1] = jtbl_() * (float)2.328306e-10; } udruns_(x, &nxs, &uv, &dv, &ifault); /* Computing 2nd power */ r__1 = uv; up[ij - 1] = (float)1. - exp(uv * (float)-.5) * (uv * (float).5 + (float)1. + r__1 * r__1 * (float).125); /* Computing 2nd power */ r__1 = dv; dn[ij - 1] = (float)1. - exp(dv * (float)-.5) * (dv * (float).5 + (float)1. + r__1 * r__1 * (float).125); /* L3: */ } kstest_(up, &ns, &p); s_wsfe(&io___236); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___237); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___238); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___239); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); kstest_(dn, &ns, &p); s_wsfe(&io___240); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___241); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); /* L93: */ } jkk = jkreset_(); s_wsfe(&io___242); e_wsfe(); s_wsfe(&io___243); e_wsfe(); return 0; } /* runtest_ */ /* Subroutine */ int udruns_(x, n, uv, dv, ifault) real *x; integer *n; real *uv, *dv; integer *ifault; { /* Initialized data */ static struct { real e_1; integer fill_2[5]; real e_3[2]; integer fill_4[4]; real e_5[3]; integer fill_6[3]; real e_7[4]; integer fill_8[2]; real e_9[5]; integer fill_10[1]; real e_11[6]; } equiv_255 = { (float)4529.4, {0}, (float)9044.9, (float)18097., {0}, (float)13568., (float)27139., (float)40721., {0}, (float) 18091., (float)36187., (float)54281., (float)72414., {0}, ( float)22615., (float)45234., (float)67852., (float)90470., ( float)113262., {0}, (float)27892., (float)55789., (float) 83685., (float)111580., (float)139476., (float)172860. }; #define a ((real *)&equiv_255) /* System generated locals */ integer i__1; real r__1; /* Local variables */ static real b[6]; static integer i, j, j1, rd; static real rn; static integer ru, dcount[6], ucount[6]; static real uni; /* Algorithm AS 157 Appl. Statist. (1981) vol. 30, No. 1 */ /* The Runs-up and Runs-down test. */ /* Set up the A and B matrices. */ /* Parameter adjustments */ --x; /* Function Body */ *ifault = 0; if (*n < 4000) { goto L500; } for (j = 2; j <= 6; ++j) { j1 = j - 1; i__1 = j1; for (i = 1; i <= i__1; ++i) { a[j + i * 6 - 7] = a[i + j * 6 - 7]; /* L1: */ } } b[0] = (float).16666666666666666; b[1] = (float).20833333333333334; b[2] = (float).09166666666666666; b[3] = (float).026388888888888889; b[4] = (float).0057539682539682543; b[5] = (float).0011904761904761906; for (i = 1; i <= 6; ++i) { ucount[i - 1] = 0; dcount[i - 1] = 0; /* L100: */ } /* The loop that ends at line 300 determines the number of */ /* runs-up and runs-down of length i for i = 1(1)5 and the number */ /* of runs-up and runs-down of length greater than or equal to 6. */ ru = 1; rd = 1; i__1 = *n; for (j = 2; j <= i__1; ++j) { if ((r__1 = x[j] - x[j - 1]) < (float)0.) { goto L150; } else if (r__1 == 0) { goto L600; } else { goto L200; } L600: uni = (float).4; if (uni < (float).5) { goto L150; } else { goto L200; } L150: ++ucount[ru - 1]; ru = 1; if (rd < 6) { ++rd; } goto L300; L200: ++dcount[rd - 1]; rd = 1; if (ru < 6) { ++ru; } L300: ; } ++ucount[ru - 1]; ++dcount[rd - 1]; /* print 21,ucount,dcount */ /* L21: */ /* Calculate the test statistics uv and dv. */ *uv = (float)0.; *dv = (float)0.; rn = (real) (*n); for (i = 1; i <= 6; ++i) { for (j = 1; j <= 6; ++j) { *uv += ((real) ucount[i - 1] - rn * b[i - 1]) * ((real) ucount[j - 1] - rn * b[j - 1]) * a[i + j * 6 - 7]; *dv += ((real) dcount[i - 1] - rn * b[i - 1]) * ((real) dcount[j - 1] - rn * b[j - 1]) * a[i + j * 6 - 7]; /* L400: */ } } *uv /= rn; *dv /= rn; goto L700; L500: *ifault = *n; L700: return 0; } /* udruns_ */ #undef a /* Subroutine */ int craptest_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2345[] = "(15x,\002 Results of craps test for \002,a15\ ,/,\002 No. of wins: Observed Expected\002)"; static char fmt_546[] = "(15x,\002 \002,i12,f12.2)"; static char fmt_25[] = "(15x,i8,\002= No. of wins, z-score=\002,f6.3,\ \002 pvalue=\002,f7.5,/,\002 Analysis of Throws-per-Game:\002)"; static char fmt_24[] = "(\002 Chisq=\002,f7.2,\002 for 20 degrees of fre\ edom, p=\002,f8.5,/,15x,\002Throws Observed Expected Chisq Sum\002)"; static char fmt_23[] = "(i19,i9,f11.1,f8.3,f9.3)"; static char fmt_2346[] = "(\002 SUMMARY FOR \002,a15)"; static char fmt_77[] = "(15x,\002 p-value for no. of wins:\002,f8.6)"; static char fmt_78[] = "(15x,\002 p-value for throws/game:\002,f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double pow_ri(), sqrt(); /* Local variables */ extern integer jtbl_(); static integer iwin; static char text[80*12]; static real e[21]; static integer i, j, k, m; static real t; extern doublereal chisq_(); static integer nwins; static real pwins; static integer ng; static real av, sd; static integer lp; static real ex; static integer nt[21], jkk; extern doublereal phi_(); static real dum, sum; extern integer jkreset_(); static integer nthrows; static real pthrows; /* Fortran I/O blocks */ static cilist io___257 = { 0, 4, 0, fmt_766, 0 }; static cilist io___260 = { 0, 4, 0, fmt_766, 0 }; static cilist io___262 = { 0, 6, 0, fmt_766, 0 }; static cilist io___263 = { 0, 3, 0, fmt_766, 0 }; static cilist io___278 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___279 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___280 = { 0, 6, 0, fmt_546, 0 }; static cilist io___281 = { 0, 3, 0, fmt_546, 0 }; static cilist io___283 = { 0, 6, 0, fmt_25, 0 }; static cilist io___284 = { 0, 3, 0, fmt_25, 0 }; static cilist io___287 = { 0, 3, 0, fmt_24, 0 }; static cilist io___288 = { 0, 6, 0, fmt_24, 0 }; static cilist io___289 = { 0, 3, 0, fmt_23, 0 }; static cilist io___290 = { 0, 6, 0, fmt_23, 0 }; static cilist io___291 = { 0, 3, 0, fmt_2346, 0 }; static cilist io___292 = { 0, 6, 0, fmt_2346, 0 }; static cilist io___293 = { 0, 3, 0, fmt_77, 0 }; static cilist io___294 = { 0, 6, 0, fmt_77, 0 }; static cilist io___295 = { 0, 3, 0, fmt_78, 0 }; static cilist io___296 = { 0, 6, 0, fmt_78, 0 }; static cilist io___297 = { 0, 6, 0, fmt_489, 0 }; static cilist io___298 = { 0, 3, 0, fmt_489, 0 }; jkk = jkreset_(); o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___257); for (j = 1; j <= 232; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___260); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___262); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___263); for (j = 1; j <= 12; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); e[0] = (float).33333333333333331; sum = e[0]; for (k = 2; k <= 20; ++k) { i__1 = k - 2; i__2 = k - 2; i__3 = k - 2; e[k - 1] = (pow_ri(&c_b394, &i__1) * (float)27. + pow_ri(&c_b395, & i__2) * (float)40. + pow_ri(&c_b396, &i__3) * (float)55.) / ( float)648.; /* L3: */ sum += e[k - 1]; } e[20] = (float)1. - sum; ng = 200000; nwins = 0; for (i = 1; i <= 21; ++i) { /* L2: */ nt[i - 1] = 0; } i__1 = ng; for (i = 1; i <= i__1; ++i) { lp = (integer) (jtbl_() * (float)1.3969838619232178e-9 + (float)3.) + 2 + (integer) (jtbl_() * (float)1.3969838619232178e-9 + ( float)3.); nthrows = 1; if (lp == 7 || lp == 11) { iwin = 1; goto L444; } if (lp == 2 || lp == 3 || lp == 12) { iwin = 0; goto L444; } L4: k = (integer) (jtbl_() * (float)1.3969838619232178e-9 + (float)3.) + 2 + (integer) (jtbl_() * (float)1.3969838619232178e-9 + ( float)3.); ++nthrows; if (k == 7) { iwin = 0; goto L444; } if (k == lp) { iwin = 1; goto L444; } goto L4; L444: m = min(21,nthrows); ++nt[m - 1]; /* L7: */ nwins += iwin; } av = ng * (float)244. / (float)495.; sd = sqrt(av * (float)251. / (float)495.); t = (nwins - av) / sd; s_wsfe(&io___278); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___279); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___280); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___281); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); e_wsfe(); pwins = phi_(&t); s_wsfe(&io___283); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&t, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___284); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&t, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); sum = (float)0.; for (i = 1; i <= 21; ++i) { ex = ng * e[i - 1]; /* L8: */ /* Computing 2nd power */ r__1 = nt[i - 1] - ex; sum += r__1 * r__1 / ex; } pthrows = chisq_(&sum, &c__20); s_wsfe(&io___287); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___288); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); sum = (float)0.; for (i = 1; i <= 21; ++i) { ex = ng * e[i - 1]; /* Computing 2nd power */ r__1 = nt[i - 1] - ex; sum += r__1 * r__1 / ex; s_wsfe(&io___289); do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nt[i - 1], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&ex, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = nt[i - 1] - ex; r__1 = r__2 * r__2 / ex; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); e_wsfe(); /* L9: */ s_wsfe(&io___290); do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nt[i - 1], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&ex, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = nt[i - 1] - ex; r__1 = r__2 * r__2 / ex; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___291); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___292); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___293); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___294); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___295); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___296); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___297); e_wsfe(); s_wsfe(&io___298); e_wsfe(); return 0; } /* craptest_ */ /* Subroutine */ int cdomso_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static char ctest[4*3+1] = "OPSOOQSO DNA"; static real sigs[3] = { (float)290.,(float)295.,(float)339. }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_22[] = "(a8,\002 for \002,a15,\002 using bits \002,i2\ ,\002 to \002,i2,i14,f7.3,f7.4)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3, i__4; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(), s_wsle(), do_lio(), e_wsle(), pow_ii(); double pow_ri(), exp(); /* Local variables */ static integer mbit[32]; extern integer jtbl_(); static real true; static integer kpow; static char text[80*36]; static integer i, j, k, l, w[32768]; static real x; static integer index, kount, ic, jk, kk, lk, mk, kr, nt, ntries, kij, jkk; extern doublereal phi_(); static integer mkk; static real dum; static integer krk; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___303 = { 0, 4, 0, fmt_766, 0 }; static cilist io___305 = { 0, 4, 0, fmt_766, 0 }; static cilist io___307 = { 0, 6, 0, fmt_766, 0 }; static cilist io___308 = { 0, 3, 0, fmt_766, 0 }; static cilist io___312 = { 0, 6, 0, 0, 0 }; static cilist io___313 = { 0, 6, 0, 0, 0 }; static cilist io___314 = { 0, 6, 0, 0, 0 }; static cilist io___315 = { 0, 3, 0, 0, 0 }; static cilist io___316 = { 0, 3, 0, 0, 0 }; static cilist io___317 = { 0, 3, 0, 0, 0 }; static cilist io___336 = { 0, 3, 0, fmt_22, 0 }; static cilist io___337 = { 0, 6, 0, fmt_22, 0 }; static cilist io___338 = { 0, 6, 0, fmt_489, 0 }; static cilist io___339 = { 0, 3, 0, fmt_489, 0 }; /* ***** NUMBER OF MISSING WORDS IN A STRING OF 2**21 k-LETTER WORDS,**** */ /****** EACH LETTER 20/k BITS. THERE ARE 2**20 POSSIBLE WORDS************ ***/ /* ***** EACH OF THE 32 BITS IN THE 2**15 W-TABLE IDENTIFIES A WORD******* */ /* ******** mean should be 141,909 with sigma=290 */ /* ** ONE-LINE FUNCTION TO GENERATE 5-BIT LETTER IN CONVENIENT POSITION */ j = 1232456789; for (i = 1; i <= 1000000; ++i) { /* L879: */ j *= 69069; } o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___303); for (j = 1; j <= 77; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___305); for (j = 1; j <= 36; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___307); for (j = 1; j <= 36; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___308); for (j = 1; j <= 36; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); for (jk = 1; jk <= 3; ++jk) { k = jk << 1; if (jk == 3) { k = 10; } /* Computing 2nd power */ i__1 = k - 9; index = (73 - i__1 * i__1) / 24; s_wsle(&io___312); do_lio(&c__9, &c__1, ctest + (index - 1 << 2), 4L); do_lio(&c__9, &c__1, " test for generator ", 20L); do_lio(&c__9, &c__1, filename, 25L); e_wsle(); s_wsle(&io___313); do_lio(&c__9, &c__1, " Output: No. missing words (mw), equiv normal \ variate (z), p-value (p)", 70L); e_wsle(); s_wsle(&io___314); do_lio(&c__9, &c__1, " \ mw z p", 72L); e_wsle(); s_wsle(&io___315); do_lio(&c__9, &c__1, ctest + (index - 1 << 2), 4L); do_lio(&c__9, &c__1, " test for generator ", 20L); do_lio(&c__9, &c__1, filename, 25L); e_wsle(); s_wsle(&io___316); do_lio(&c__9, &c__1, " Output: No. missing words (mw), equiv normal \ variate (z), p-value (p)", 70L); e_wsle(); s_wsle(&io___317); do_lio(&c__9, &c__1, " \ mw z p", 72L); e_wsle(); ntries = 1; kpow = 21; for (krk = 33 - 20 / k; krk >= 1; --krk) { jkk = jkreset_(); kr = 33 - 20 / k - krk; i__1 = 20 / k; mk = pow_ii(&c__2, &i__1) - 1; i__1 = 20 - 20 / k; mkk = pow_ii(&c__2, &i__1) - 1; lk = 20 / k; i__1 = ntries; for (kij = 1; kij <= i__1; ++kij) { kpow = 21; /* ****SET MASK BITS******** ******* */ mbit[0] = 1; for (i = 1; i <= 31; ++i) { /* L8: */ mbit[i] = mbit[i - 1] << 1; } /* *********** INITIALIZE***************** */ i__2 = kpow - 20; true = exp(-(doublereal)pow_ri(&c_b135, &i__2)) * 1048576; /* *****MAIN LOOP********* */ i__2 = ntries; for (nt = 1; nt <= i__2; ++nt) { /* ********SET W-TABLE TO ZEROS******* */ for (i = 0; i <= 32767; ++i) { /* L9: */ w[i] = 0; } /* **** GET INITIAL WORD */ j = jtbl_() >> kr & mk; i__3 = k - 1; for (i = 1; i <= i__3; ++i) { /* L46: */ i__4 = 20 / k; j = pow_ii(&c__2, &i__4) * j + (jtbl_() >> kr & mk); } /* **** GENERATE 2**kpow OVERLAPPING WORDS******** */ i__4 = pow_ii(&c__2, &kpow); for (ic = 1; ic <= i__4; ++ic) { /* *** GET NEW J ***** */ j = ((j & mkk) << lk) + (jtbl_() >> kr & mk); /* *** GET BIT INDEX FROM LAST 5 BITS OF J * ** */ l = j & 31; /* *** GET TABLE INDEX FROM LEADING 15 BITS OF J*** */ kk = j >> 5; /* *** SET BIT L IN W(Kk) *** */ /* L3: */ w[kk] |= mbit[l]; } /* ********** COUNT NUMBER OF EMPTY CEL LS ******* */ kount = 0; for (kk = 0; kk <= 32767; ++kk) { for (l = 0; l <= 31; ++l) { /* L4: */ if ((w[kk] & mbit[l]) == 0) { ++kount; } } } /* ****END OF MAIN LOOP**** */ x = (kount - true) / sigs[jk - 1]; s_wsfe(&io___336); do_fio(&c__1, ctest + (index - 1 << 2), 4L); do_fio(&c__1, filename, 25L); i__4 = 33 - 20 / k - kr; do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer)); i__3 = 32 - kr; do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L2: */ s_wsfe(&io___337); do_fio(&c__1, ctest + (index - 1 << 2), 4L); do_fio(&c__1, filename, 25L); i__4 = 33 - 20 / k - kr; do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer)); i__3 = 32 - kr; do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); } jkk = jkreset_(); /* L2001: */ } } } s_wsfe(&io___338); e_wsfe(); s_wsfe(&io___339); e_wsfe(); return 0; } /* cdomso_ */ /* Subroutine */ int sknt1s_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static integer p[5] = { 37,56,70,56,37 }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2345[] = "(\002 Test results for \002,a15)"; static char fmt_819[] = "(\002 Chi-square with 5^5-5^4=2500 d.of f. for \ sample size:\002,i7,/,31x,\002chisquare equiv normal p-value\002)"; static char fmt_821[] = "(\002 byte stream for \002,a15,f9.2,f11.3,f13.6)" ; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(); integer s_wsle(), do_lio(), e_wsle(); /* Local variables */ static real chsq; static char text[80*18]; extern integer jtbl8_(); static real e; static integer i, j, n, s[625], t[3125], w; static real z; static integer kbits[256], i1, i2; static real q4, q5; static integer ii, jj, jk, ks, jkk; extern doublereal phi_(); static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___341 = { 0, 4, 0, fmt_766, 0 }; static cilist io___344 = { 0, 4, 0, fmt_766, 0 }; static cilist io___346 = { 0, 6, 0, fmt_766, 0 }; static cilist io___347 = { 0, 3, 0, fmt_766, 0 }; static cilist io___354 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___355 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___368 = { 0, 6, 0, fmt_819, 0 }; static cilist io___369 = { 0, 3, 0, fmt_819, 0 }; static cilist io___370 = { 0, 6, 0, 0, 0 }; static cilist io___371 = { 0, 3, 0, 0, 0 }; static cilist io___372 = { 0, 3, 0, fmt_821, 0 }; static cilist io___373 = { 0, 6, 0, fmt_821, 0 }; static cilist io___374 = { 0, 6, 0, fmt_489, 0 }; static cilist io___375 = { 0, 3, 0, fmt_489, 0 }; /* OBC: overlapping-bit-count from stream of bytes */ /*******one-line function to return (truncated) no. of 1's in 8 random bit s*/ /* ******that is, this function provides a random keystoke, unequal p's. */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___341); for (j = 1; j <= 113; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___344); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___346); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___347); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /*******Create kbits table: kbits(j)=truncated no of bits in j, -128<=j<=1 27*/ /*****Filename reads one byte at a time, as integer*1, so -128 to 127**** **/ for (jj = 0; jj <= 255; ++jj) { j = jj; ks = 0; for (i = 1; i <= 8; ++i) { ks += j & 1; /* L233: */ j = j >> 1; } if (ks < 2) { ks = 2; } if (ks > 6) { ks = 6; } /* L234: */ kbits[jj] = ks - 2; } n = 100; jkk = jkreset_(); s_wsfe(&io___354); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___355); do_fio(&c__1, filename, 25L); e_wsfe(); for (jk = 1; jk <= 2; ++jk) { for (i = 0; i <= 624; ++i) { /* L64: */ s[i] = 0; } for (i = 0; i <= 3124; ++i) { /* L65: */ t[i] = 0; } /* ***** generate initial word with 5 random keystrokes: */ /* L127: */ w = kbits[jtbl8_()] * 625 + kbits[jtbl8_()] * 125 + kbits[jtbl8_()] * 25 + kbits[jtbl8_()] * 5 + kbits[jtbl8_()]; i__1 = n; for (i2 = 1; i2 <= i__1; ++i2) { for (i1 = 1; i1 <= 25600; ++i1) { /* ******Erase leftmost letter of w: */ w %= 625; /* ******Boost count for that 4-letter word: */ ++s[w]; /* ******Shift w left, add new letter, boost 5-letter word cou nt: */ w = w * 5 + kbits[jtbl8_()]; ++t[w]; /* L2: */ } } /* **** Find q4: sum(obs-exp)^2/exp for 4-letter words */ q4 = (float)0.; for (ii = 0; ii <= 624; ++ii) { i = ii; e = (real) (n * 25600); for (j = 0; j <= 3; ++j) { e = e * p[i % 5] / (float)256.; /* L41: */ i /= 5; } /* L4: */ /* Computing 2nd power */ r__1 = s[ii] - e; q4 += r__1 * r__1 / e; } /* **** Find q5: sum(obs-exp)^2/exp for 5-letter words */ q5 = (float)0.; for (ii = 0; ii <= 3124; ++ii) { i = ii; e = (real) (n * 25600); for (j = 0; j <= 4; ++j) { e = e * p[i % 5] / (float)256.; /* L51: */ i /= 5; } /* L5: */ /* Computing 2nd power */ r__1 = t[ii] - e; q5 += r__1 * r__1 / e; } chsq = q5 - q4; z = (chsq - (float)2500.) / sqrt((float)5e3); if (jk == 1) { s_wsfe(&io___368); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___369); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsle(&io___370); do_lio(&c__9, &c__1, " Results for COUNT-THE-1's in successive \ bytes:", 48L); e_wsle(); s_wsle(&io___371); do_lio(&c__9, &c__1, " Results fo COUNT-THE-1's in successive by\ tes:", 46L); e_wsle(); } s_wsfe(&io___372); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___373); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L888: */ } jkk = jkreset_(); s_wsfe(&io___374); e_wsfe(); s_wsfe(&io___375); e_wsfe(); return 0; } /* sknt1s_ */ /* Subroutine */ int base5_(w) integer *w; { /* Format strings */ static char fmt_21[] = "(i12,i3,4i1)"; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ static integer i, j, l[5]; /* Fortran I/O blocks */ static cilist io___379 = { 0, 6, 0, fmt_21, 0 }; j = *w; for (i = 4; i >= 0; --i) { l[i] = j % 5; /* L2: */ j /= 5; } s_wsfe(&io___379); do_fio(&c__1, (char *)&(*w), (ftnlen)sizeof(integer)); do_fio(&c__5, (char *)&l[0], (ftnlen)sizeof(integer)); e_wsfe(); return 0; } /* base5_ */ /* Subroutine */ int wknt1s_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static integer p[5] = { 37,56,70,56,37 }; static integer k[256] = { 0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,2,0,0,0,1,0,1,1,2, 0,1,1,2,1,2,2,3,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1, 2,2,3,2,3,3,4,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1,2, 2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3, 4,3,4,4,4,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1,2,2,3, 2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3, 4,4,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4, 4,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,4,2,3,3,4,3,4,4,4,3,4,4,4,4,4,4, 4 }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2345[] = "(\002 Test results for \002,a15)"; static char fmt_819[] = "(\002 Chi-square with 5^5-5^4=2500 d.of f. for \ sample size:\002,i7,/,9x,\002 chisquare equiv normal p valu\ e\002)"; static char fmt_821[] = "(\002 bits \002,i2,\002 to \002,i2,f9\ .2,f11.3,f13.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(); integer s_wsle(), do_lio(), e_wsle(); /* Local variables */ extern integer jtbl_(); static real chsq; static char text[80*20]; static real e; static integer i, j, n, s[625], t[3125], w; static real z; static integer i1, i2; static real q4, q5; static integer ii, jk, jkk; extern doublereal phi_(); static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___383 = { 0, 4, 0, fmt_766, 0 }; static cilist io___386 = { 0, 4, 0, fmt_766, 0 }; static cilist io___388 = { 0, 6, 0, fmt_766, 0 }; static cilist io___389 = { 0, 3, 0, fmt_766, 0 }; static cilist io___390 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___405 = { 0, 3, 0, fmt_819, 0 }; static cilist io___406 = { 0, 6, 0, fmt_819, 0 }; static cilist io___407 = { 0, 6, 0, 0, 0 }; static cilist io___408 = { 0, 3, 0, 0, 0 }; static cilist io___409 = { 0, 3, 0, fmt_821, 0 }; static cilist io___410 = { 0, 6, 0, fmt_821, 0 }; static cilist io___411 = { 0, 6, 0, fmt_489, 0 }; static cilist io___412 = { 0, 3, 0, fmt_489, 0 }; /* OBC: overlapping-bit-count in specified bytes */ /* ******one-line function to return no. of 1's in 8 random bits */ /* ******that is, this function provides a random keystoke, unequal p's. */ n = 10; o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___383); for (j = 1; j <= 131; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___386); for (j = 1; j <= 20; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___388); for (j = 1; j <= 20; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___389); for (j = 1; j <= 20; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); s_wsfe(&io___390); do_fio(&c__1, filename, 25L); e_wsfe(); for (jk = 1; jk <= 25; ++jk) { jkk = jkreset_(); for (i = 0; i <= 624; ++i) { /* L64: */ s[i] = 0; } for (i = 0; i <= 3124; ++i) { /* L65: */ t[i] = 0; } /* ***** generate initial word with 5 random keystrokes: */ /* L127: */ w = k[jtbl_() >> 25 - jk & 255] * 625 + k[jtbl_() >> 25 - jk & 255] * 125 + k[jtbl_() >> 25 - jk & 255] * 25 + k[jtbl_() >> 25 - jk & 255] * 5 + k[jtbl_() >> 25 - jk & 255]; for (i1 = 1; i1 <= 25600; ++i1) { i__1 = n; for (i2 = 1; i2 <= i__1; ++i2) { /* ******Erase leftmost letter of w: */ w %= 625; /* ******Boost count for that 4-letter word: */ ++s[w]; /* ******Shift w left, add new letter, boost 5-letter word cou nt: */ w = w * 5 + k[jtbl_() >> 25 - jk & 255]; ++t[w]; /* L2: */ } } /* **** Find q4: sum(obs-exp)**2/exp for 4-letter words */ q4 = (float)0.; for (ii = 0; ii <= 624; ++ii) { i = ii; e = (real) (n * 25600); for (j = 1; j <= 4; ++j) { e = e * p[i % 5] * (float).00390625; /* L41: */ i /= 5; } /* L4: */ /* Computing 2nd power */ r__1 = s[ii] - e; q4 += r__1 * r__1 / e; } /* **** Find q5: sum(obs-exp)**2/exp for 5-letter words */ q5 = (float)0.; for (ii = 0; ii <= 3124; ++ii) { i = ii; e = (real) (n * 25600); for (j = 1; j <= 5; ++j) { e = e * p[i % 5] * (float).00390625; /* L51: */ i /= 5; } /* L5: */ /* Computing 2nd power */ r__1 = t[ii] - e; q5 += r__1 * r__1 / e; } chsq = q5 - q4; z = (chsq - (float)2500.) / sqrt((float)5e3); if (jk == 1) { s_wsfe(&io___405); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___406); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsle(&io___407); do_lio(&c__9, &c__1, " Results for COUNT-THE 1's in specified b\ ytes:", 47L); e_wsle(); s_wsle(&io___408); do_lio(&c__9, &c__1, " Results for COUNT-THE-1's in specified by\ tes:", 46L); e_wsle(); } s_wsfe(&io___409); do_fio(&c__1, (char *)&jk, (ftnlen)sizeof(integer)); i__1 = jk + 7; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___410); do_fio(&c__1, (char *)&jk, (ftnlen)sizeof(integer)); i__1 = jk + 7; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L888: */ jkk = jkreset_(); } s_wsfe(&io___411); e_wsfe(); s_wsfe(&io___412); e_wsfe(); return 0; } /* wknt1s_ */ /* Subroutine */ int cdbinrnk_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static char rk[6*3+1] = " r<=4 r =5 r =6 "; static real p[5] = { (float)1.49858e-7,(float)8.08926e-5,(float).00936197, (float).217439,(float).773118 }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_37[] = "(\002 Binary Rank Test for \002,a15)"; static char fmt_371[] = "(\002 Rank of a 6x8 binary matrix,\002\ ,/,\002 rows formed from eight bits of the RNG \002,a15)"; static char fmt_27[] = "(\002 b-rank test for bits \002,i2,\002 to\ \002,i2)"; static char fmt_372[] = "(15x,\002 OBSERVED EXPECTED (O-E)^2/\ E SUM\002)"; static char fmt_29[] = "(6x,a9,i12,f12.1,f12.3,f12.3)"; static char fmt_23[] = "(12x,\002 p=1-exp(-SUM/2)=\002,f7.5)"; static char fmt_373[] = "(\002 TEST SUMMARY, 25 tests on 100,000 rando\ m 6x8 matrices\002,/,\002 These should be 25 uniform [0,1] random variables\ :\002)"; static char fmt_21[] = "(5f12.6)"; static char fmt_2345[] = "(\002 brank test summary for \002,a15,/,\002\ The KS test for those 25 supposed UNI's yields\002)"; static char fmt_31[] = "(\002 KS p-value=\002,f8.6)"; static char fmt_312[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double exp(); /* Local variables */ extern integer jtbl_(); static char text[80*10]; static real e; static integer i, j, k[5], l, r[6]; static real s, t; extern integer rankb_(); extern /* Subroutine */ int asort_(); static integer ij, kk, kr, mr; static real pp[26]; extern /* Subroutine */ int kstest_(); static integer jkk; static real dum, pks; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___415 = { 0, 4, 0, fmt_766, 0 }; static cilist io___418 = { 0, 4, 0, fmt_766, 0 }; static cilist io___420 = { 0, 6, 0, fmt_766, 0 }; static cilist io___421 = { 0, 3, 0, fmt_766, 0 }; static cilist io___422 = { 0, 3, 0, fmt_37, 0 }; static cilist io___423 = { 0, 6, 0, fmt_37, 0 }; static cilist io___426 = { 0, 6, 0, fmt_371, 0 }; static cilist io___427 = { 0, 3, 0, fmt_371, 0 }; static cilist io___431 = { 0, 6, 0, fmt_27, 0 }; static cilist io___432 = { 0, 3, 0, fmt_27, 0 }; static cilist io___433 = { 0, 6, 0, fmt_372, 0 }; static cilist io___434 = { 0, 3, 0, fmt_372, 0 }; static cilist io___442 = { 0, 3, 0, fmt_29, 0 }; static cilist io___443 = { 0, 6, 0, fmt_29, 0 }; static cilist io___445 = { 0, 6, 0, fmt_23, 0 }; static cilist io___446 = { 0, 3, 0, fmt_23, 0 }; static cilist io___447 = { 0, 6, 0, fmt_373, 0 }; static cilist io___448 = { 0, 3, 0, fmt_373, 0 }; static cilist io___449 = { 0, 6, 0, fmt_21, 0 }; static cilist io___450 = { 0, 3, 0, fmt_21, 0 }; static cilist io___451 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___452 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___454 = { 0, 6, 0, fmt_31, 0 }; static cilist io___455 = { 0, 3, 0, fmt_31, 0 }; static cilist io___456 = { 0, 6, 0, fmt_312, 0 }; static cilist io___457 = { 0, 3, 0, fmt_312, 0 }; /* *******Test ranks of 100,000 6x8 binary matrices************** */ /* *******Each row a byte from a RNG, overlapping rows************* */ /* *** rank 2 to 6 with prob p(2),...,p(6); 2,3,4 pooled. */ /* ************ one-line function to get random byte:************* */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___415); for (j = 1; j <= 51; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___418); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___420); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___421); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /* open(3,file='testout') */ s_wsfe(&io___422); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___423); do_fio(&c__1, filename, 25L); e_wsfe(); /* L371: */ for (ij = 25; ij >= 1; --ij) { jkk = jkreset_(); s_wsfe(&io___426); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___427); do_fio(&c__1, filename, 25L); e_wsfe(); kr = ij - 1; for (kk = 2; kk <= 6; ++kk) { /* L88: */ k[kk - 2] = 0; } s_wsfe(&io___431); i__1 = 25 - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___432); i__1 = 25 - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___433); e_wsfe(); s_wsfe(&io___434); e_wsfe(); for (l = 1; l <= 100000; ++l) { for (i = 1; i <= 6; ++i) { /* L1: */ r[i - 1] = jtbl_() >> kr & 255; } /* Computing MAX */ i__1 = 4, i__2 = rankb_(r, &c__6, &c__8); mr = max(i__1,i__2); /* L2: */ ++k[mr - 2]; } s = (float)0.; for (l = 4; l <= 6; ++l) { if (l > 4) { e = p[l - 2] * 100000; } else { e = (p[0] + p[1] + p[2]) * 100000; } /* Computing 2nd power */ r__1 = k[l - 2] - e; t = r__1 * r__1 / e; s += t; s_wsfe(&io___442); do_fio(&c__1, rk + (l - 4) * 6, 6L); do_fio(&c__1, (char *)&k[l - 2], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = k[l - 2] - e; r__1 = r__2 * r__2 / e; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); /* L5: */ s_wsfe(&io___443); do_fio(&c__1, rk + (l - 4) * 6, 6L); do_fio(&c__1, (char *)&k[l - 2], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = k[l - 2] - e; r__1 = r__2 * r__2 / e; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); } pp[kr] = (float)1. - exp(-(doublereal)s / 2); s_wsfe(&io___445); do_fio(&c__1, (char *)&pp[kr], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___446); do_fio(&c__1, (char *)&pp[kr], (ftnlen)sizeof(real)); e_wsfe(); /* L55: */ jkk = jkreset_(); } s_wsfe(&io___447); e_wsfe(); s_wsfe(&io___448); e_wsfe(); s_wsfe(&io___449); for (i = 24; i >= 0; --i) { do_fio(&c__1, (char *)&pp[i], (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___450); for (i = 24; i >= 0; --i) { do_fio(&c__1, (char *)&pp[i], (ftnlen)sizeof(real)); } e_wsfe(); asort_(pp, &c__25); s_wsfe(&io___451); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___452); do_fio(&c__1, filename, 25L); e_wsfe(); kstest_(pp, &c__25, &pks); s_wsfe(&io___454); do_fio(&c__1, (char *)&pks, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___455); do_fio(&c__1, (char *)&pks, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___456); e_wsfe(); s_wsfe(&io___457); e_wsfe(); return 0; } /* cdbinrnk_ */ integer rankb_(r, m, n) integer *r, *m, *n; { /* Initialized data */ static integer msk[31] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096, 8192,16384,32768,65536,131072,262144,524288,1048576,2097152, 4194304,8388608,16777216,33554432,67108864,134217728,268435456, 536870912 }; /* System generated locals */ integer ret_val, i__1, i__2; /* Local variables */ static integer i, j, k, x, ii; /* Parameter adjustments */ --r; /* Function Body */ msk[30] = 1073741824; ret_val = 0; j = *n; i = 1; L33: i__1 = *m; for (ii = i; ii <= i__1; ++ii) { if ((r[ii] & msk[j - 1]) == msk[j - 1]) { x = r[ii]; r[ii] = r[i]; r[i] = x; i__2 = *m; for (k = i + 1; k <= i__2; ++k) { /* L13: */ if ((r[k] & msk[j - 1]) == msk[j - 1]) { r[k] ^= x; } } ++ret_val; if (i == *m || j == 1) { return ret_val; } --j; ++i; goto L33; } /* L3: */ } --j; if (j == 0) { return ret_val; } goto L33; } /* rankb_ */ /* Subroutine */ int rank3132_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real p[4] = { (float).2887880952,(float).5775761902,(float) .1283502644,(float).0052854502 }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_2345[] = "(\002 Binary rank test for \002,a15)"; static char fmt_29[] = "(7x,\002 Rank test for \002,i2,\002x\002,i2,\ \002 binary matrices:\002)"; static char fmt_291[] = "(7x,\002 rows from leftmost \002,i2,\002 bits o\ f each 32-bit integer\002)"; static char fmt_2457[] = "(\002 rank observed expected (o-e)^2/e\ sum\002)"; static char fmt_22[] = "(2i10,f10.1,f10.6,f9.3)"; static char fmt_23[] = "(\002 chisquare=\002,f6.3,\002 for 3 d. of f.; \ p-value=\002,f8.6,/,\002----------------------------------------------------\ ----------\002)"; static char fmt_2348[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), f_clos(), s_wsfe(), e_wsfe(); /* Local variables */ extern integer rank_(), jtbl_(); static char text[80*18]; static integer ntry; static real d, e; static integer i, j, k, m, n; static real s; extern doublereal chisq_(); static integer ij, ntries, jkk, tbl[4]; static real dum; static integer row[32]; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___465 = { 0, 4, 0, fmt_766, 0 }; static cilist io___468 = { 0, 4, 0, fmt_766, 0 }; static cilist io___472 = { 0, 6, 0, fmt_766, 0 }; static cilist io___473 = { 0, 3, 0, fmt_766, 0 }; static cilist io___474 = { 0, 6, 0, fmt_766, 0 }; static cilist io___475 = { 0, 3, 0, fmt_766, 0 }; static cilist io___477 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___478 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___479 = { 0, 6, 0, fmt_29, 0 }; static cilist io___480 = { 0, 3, 0, fmt_29, 0 }; static cilist io___481 = { 0, 6, 0, fmt_291, 0 }; static cilist io___482 = { 0, 3, 0, fmt_291, 0 }; static cilist io___491 = { 0, 6, 0, fmt_2457, 0 }; static cilist io___492 = { 0, 3, 0, fmt_2457, 0 }; static cilist io___495 = { 0, 3, 0, fmt_22, 0 }; static cilist io___496 = { 0, 6, 0, fmt_22, 0 }; static cilist io___497 = { 0, 6, 0, fmt_23, 0 }; static cilist io___498 = { 0, 3, 0, fmt_23, 0 }; static cilist io___499 = { 0, 6, 0, fmt_2348, 0 }; static cilist io___500 = { 0, 3, 0, fmt_2348, 0 }; /* see original file \f\bprint.for that displays each step in the */ /* rank reduction. */ /* finds rank of 31x31 and 32x32 matrices. */ /* For the 31x31, uses 31 leftmost bits of a 32-bit integer */ /* to form a row of the binary matrix. */ /* For the 32x32, uses 32 full integer words for each of 32 rows */ /* function mrank(r,m,n) */ /* for nxn matrices, to at least 6 places, */ /* the probability of rank n-2,n-1,n are all virtually the same. */ /* r p */ /* <=29 .0052854502 */ /* 30 .1283502644 */ /* 31 .5775761902 */ /* 32 .2887880952 */ /* c**** Finds binary rank of m rows, n trailing bits each********** */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___465); for (j = 1; j <= 33; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___468); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /* L11: */ for (m = 31; m <= 32; ++m) { jkk = jkreset_(); if (m == 31) { s_wsfe(&io___472); for (j = 1; j <= 9; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); } if (m == 31) { s_wsfe(&io___473); for (j = 1; j <= 9; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); } if (m == 32) { s_wsfe(&io___474); for (j = 10; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); } if (m == 32) { s_wsfe(&io___475); for (j = 10; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); } n = m; s_wsfe(&io___477); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___478); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___479); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___480); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___481); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___482); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); e_wsfe(); for (i = 0; i <= 3; ++i) { /* L71: */ tbl[i] = 0; } /* L9: */ ntries = 40000; i__1 = ntries; for (ij = 1; ij <= i__1; ++ij) { i__2 = m; for (i = 1; i <= i__2; ++i) { /* L42: */ row[i - 1] = jtbl_() >> 32 - m; } ++ntry; /* Computing MIN */ i__2 = n - rank_(row, &m, &n); k = min(i__2,3); ++tbl[k]; /* L888: */ } s = (float)0.; s_wsfe(&io___491); e_wsfe(); s_wsfe(&io___492); e_wsfe(); for (i = 3; i >= 0; --i) { e = p[i] * ntries; /* Computing 2nd power */ r__1 = tbl[i] - e; d = r__1 * r__1 / e; s += d; s_wsfe(&io___495); i__1 = n - i; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&tbl[i], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); /* L7: */ s_wsfe(&io___496); i__1 = n - i; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&tbl[i], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___497); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); r__1 = chisq_(&s, &c__3); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___498); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); r__1 = chisq_(&s, &c__3); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); /* L999: */ } jkk = jkreset_(); jkk = jkreset_(); s_wsfe(&io___499); e_wsfe(); s_wsfe(&io___500); e_wsfe(); return 0; } /* rank3132_ */ integer rank_(r, m, n) integer *r, *m, *n; { /* Initialized data */ static integer msk[32] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096, 8192,16384,32768,65536,131072,262144,524288,1048576,2097152, 4194304,8388608,16777216,33554432,67108864,134217728,268435456, 536870912 }; /* System generated locals */ integer ret_val, i__1, i__2; /* Local variables */ static integer i, j, k, x, ii; /* Parameter adjustments */ --r; /* Function Body */ msk[30] = 1073741824; msk[31] = -2147483648; ret_val = 0; j = *n; i = 1; L33: /* 33 call mprint(r,m,n) */ /* ***** find row that starts with a 1 in current column (33-j) */ i__1 = *m; for (ii = i; ii <= i__1; ++ii) { if ((r[ii] & msk[j - 1]) == msk[j - 1]) { x = r[ii]; r[ii] = r[i]; r[i] = x; i__2 = *m; for (k = i + 1; k <= i__2; ++k) { /* L13: */ if ((r[k] & msk[j - 1]) == msk[j - 1]) { r[k] ^= x; } } ++ret_val; /* print*,' good row',rank,i,x */ if (i == *m || j == 1) { return ret_val; } --j; ++i; goto L33; } /* L3: */ } --j; if (j == 0) { return ret_val; } goto L33; } /* rank_ */ /* Subroutine */ int cdoperm5_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_212[] = "(8i10)"; static char fmt_766[] = "(a78)"; static char fmt_271[] = "(\002 OPERM5 test for file \002,a15\ ,/,\002 For a sample of 1,000,000 consecutive 5-tuples,\002)"; static char fmt_273[] = "(\002 chisquare for 99 degrees of freedom=\002,\ f7.3,\002; p-value=\002,f8.6)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); /* Local variables */ static integer ijkm; extern integer jtbl_(); static real chsq; static char text[80*15]; static integer i, j, k, n, r[3600] /* was [60][60] */, s[3600] /* was [60][60] */, t[120], u[1005]; static real x, y; extern doublereal chisq_(); static real av; extern integer kp_(); static integer jkk; static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___507 = { 0, 4, 0, fmt_212, 0 }; static cilist io___511 = { 0, 4, 0, fmt_212, 0 }; static cilist io___513 = { 0, 4, 0, fmt_766, 0 }; static cilist io___515 = { 0, 4, 0, fmt_766, 0 }; static cilist io___517 = { 0, 6, 0, fmt_766, 0 }; static cilist io___518 = { 0, 3, 0, fmt_766, 0 }; static cilist io___529 = { 0, 3, 0, fmt_271, 0 }; static cilist io___530 = { 0, 6, 0, fmt_271, 0 }; static cilist io___531 = { 0, 3, 0, fmt_273, 0 }; static cilist io___532 = { 0, 6, 0, fmt_273, 0 }; /* *** overlapping 5-permutations. Uses 120x120 weak inverse ******* */ /* *** of covariance matrix (in 60x60 blocks). */ /* *** 69069 passes, Randu fails, Weyl fails, SR(15,17),SR(13,18) fail. */ /* *** F(2,1,*) and F(3,1,*) pass */ /* **** divide r and s elements by (200000*n) for proper cov. inverse */ /* **** the rank is 99=50+49. */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 11; o__1.ofnm = "operm5d.ata"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___507); for (i = 1; i <= 60; ++i) { for (j = i; j <= 60; ++j) { do_fio(&c__1, (char *)&r[i + j * 60 - 61], (ftnlen)sizeof(integer) ); } } e_rsfe(); s_rsfe(&io___511); for (i = 1; i <= 60; ++i) { for (j = i; j <= 60; ++j) { do_fio(&c__1, (char *)&s[i + j * 60 - 61], (ftnlen)sizeof(integer) ); } } e_rsfe(); o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___513); for (j = 1; j <= 18; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___515); for (j = 1; j <= 15; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___517); for (j = 1; j <= 15; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___518); for (j = 1; j <= 15; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); for (ijkm = 1; ijkm <= 2; ++ijkm) { for (i = 1; i <= 59; ++i) { for (j = i + 1; j <= 60; ++j) { r[j + i * 60 - 61] = r[i + j * 60 - 61]; /* L2: */ s[j + i * 60 - 61] = s[i + j * 60 - 61]; } } /* **********************get counts t(1),...,t(120)****************** */ jkk = jkreset_(); n = 1000; for (i = 1; i <= 120; ++i) { /* L11: */ t[i - 1] = 0; } for (i = 1001; i <= 1005; ++i) { /* L4: */ u[i - 1] = jtbl_(); } i__1 = n; for (i = 1; i <= i__1; ++i) { for (j = 1; j <= 5; ++j) { /* L6: */ u[j - 1] = u[j + 999]; } for (j = 1; j <= 1000; ++j) { k = kp_(&u[j - 1]) + 1; ++t[k - 1]; /* L7: */ u[j + 4] = jtbl_(); } /* L5: */ } /* *********************evalute quadratic form in weak inverse******* */ chsq = (float)0.; av = n * (float)2e3 / (float)120.; for (i = 1; i <= 60; ++i) { x = t[i - 1] + t[i + 59] - av; y = (real) (t[i - 1] - t[i + 59]); for (j = 1; j <= 60; ++j) { /* L3: */ chsq = chsq + x * r[i + j * 60 - 61] * (t[j - 1] + t[j + 59] - av) + y * s[i + j * 60 - 61] * (t[j - 1] - t[j + 59] ); } } chsq /= n * (float)2e8; s_wsfe(&io___529); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___530); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___531); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); r__1 = chisq_(&chsq, &c__99); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___532); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); r__1 = chisq_(&chsq, &c__99); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L8888: */ } jkk = jkreset_(); /* *******put a pause in here:************* */ j = 123456789; for (i = 1; i <= 100000; ++i) { /* L678: */ j *= 69069; } return 0; } /* cdoperm5_ */ integer kp_(c) integer *c; { /* Initialized data */ static integer map[60] = { 39,38,37,36,41,40,54,55,56,57,58,59,49,48,52, 53,50,51,42,43,44,45,46,47,33,32,31,30,35,34,12,13,14,15,16,17,29, 28,24,25,27,26,21,20,19,18,23,22,2,3,5,4,1,0,10,11,9,8,6,7 }; /* System generated locals */ integer ret_val, i__1; /* Local variables */ static integer b[5], i, j, l; static real s, t; /* real b(5),c(5) */ /* Parameter adjustments */ --c; /* Function Body */ for (i = 1; i <= 5; ++i) { /* L7: */ b[i - 1] = c[i]; } ret_val = 0; for (i = 5; i >= 2; --i) { t = (real) b[0]; l = 1; i__1 = i; for (j = 2; j <= i__1; ++j) { if ((real) b[j - 1] < t) { goto L3; } t = (real) b[j - 1]; l = j; L3: ; } ret_val = i * ret_val + l - 1; s = (real) b[i - 1]; b[i - 1] = b[l - 1]; /* L2: */ b[l - 1] = s; } if (ret_val < 60) { ret_val = map[ret_val]; } return ret_val; } /* kp_ */ /* Subroutine */ int cdbday_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_22[] = "(\002 BIRTHDAY SPACINGS TEST, M=\002,i4,\002 N=2\ **\002,i2,\002 LAMBDA=\002,f8.4)"; static char fmt_2345[] = "(\002 Results for \002,a15)"; static char fmt_432[] = "(17x,\002 For a sample of size\002,i4,\002: \ mean \002)"; static char fmt_331[] = "(10x,a16,\002 using bits \002,i2,\002 to \002,i\ 2,f8.3,f10.6)"; static char fmt_652[] = "(\002 The 9 p-values were\002,/,f15.6,4f10.6,\ /,f15.6,4f10.6)"; static char fmt_38[] = "(\002 A KSTEST for the 9 p-values yields \002,f\ 8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double pow_di(); integer pow_ii(); /* Local variables */ static real alam; static integer mask; extern integer jtbl_(); static char text[80*18]; static integer b[4096], c[4096], i, j, l, m; static real s; static integer nbits; extern /* Subroutine */ int isort_(); static integer jb, lk, im, is, kr; static real pp; static integer lw, mspace[1000], nsampl; extern /* Subroutine */ int chsqts_(), kstest_(); static integer jkk; static real pks[64]; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___540 = { 0, 4, 0, fmt_766, 0 }; static cilist io___543 = { 0, 6, 0, fmt_766, 0 }; static cilist io___544 = { 0, 3, 0, fmt_766, 0 }; static cilist io___550 = { 0, 6, 0, fmt_22, 0 }; static cilist io___551 = { 0, 3, 0, fmt_22, 0 }; static cilist io___552 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___553 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___566 = { 0, 3, 0, fmt_432, 0 }; static cilist io___567 = { 0, 6, 0, fmt_432, 0 }; static cilist io___568 = { 0, 3, 0, fmt_331, 0 }; static cilist io___569 = { 0, 6, 0, fmt_331, 0 }; static cilist io___572 = { 0, 6, 0, fmt_652, 0 }; static cilist io___574 = { 0, 3, 0, fmt_652, 0 }; static cilist io___575 = { 0, 6, 0, fmt_38, 0 }; static cilist io___576 = { 0, 3, 0, fmt_38, 0 }; static cilist io___577 = { 0, 6, 0, fmt_489, 0 }; static cilist io___578 = { 0, 3, 0, fmt_489, 0 }; /* PROGRAM BDAYTST */ /* A PROGRAM TO DO THE BIRTHDAY-SPACINGS TEST ON NBITS OF A UNI */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); /* read(4,766) (dum,j=1,0) */ s_rsfe(&io___540); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___543); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___544); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); lw = 32; nbits = 24; m = 512; nsampl = 500; /* Computing 3rd power */ r__1 = m + (float)0., r__2 = r__1; i__1 = nbits + 2; alam = r__2 * (r__1 * r__1) / pow_di(&c_b822, &i__1); s_wsfe(&io___550); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nbits, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&alam, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___551); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nbits, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&alam, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___552); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___553); do_fio(&c__1, filename, 25L); e_wsfe(); /* is=lw-nbits */ is = 8; i__1 = nbits - 1; i__2 = nbits - 1; mask = pow_ii(&c__2, &i__1) + pow_ii(&c__2, &i__2) - 1; for (kr = 32 - nbits; kr >= 0; --kr) { s = (float)0.; jkk = jkreset_(); i__1 = nsampl; for (j = 1; j <= i__1; ++j) { i__2 = m; for (i = 1; i <= i__2; ++i) { jb = jtbl_(); /* L2: */ b[i - 1] = jb >> kr & mask; } /* L9: */ isort_(b, &m); c[0] = b[0]; i__2 = m; for (i = 2; i <= i__2; ++i) { /* L3: */ c[i - 1] = b[i - 1] - b[i - 2]; } isort_(c, &m); l = 0; i__2 = m; for (i = 2; i <= i__2; ++i) { lk = 0; if (c[i - 1] != c[i - 2]) { goto L4; } ++lk; ++l; L4: ; } s += l; /* L1: */ mspace[j - 1] = l; } s_wsfe(&io___566); do_fio(&c__1, (char *)&nsampl, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___567); do_fio(&c__1, (char *)&nsampl, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___568); do_fio(&c__1, filename, 25L); i__1 = 33 - nbits - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); r__1 = s / nsampl; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___569); do_fio(&c__1, filename, 25L); i__1 = 33 - nbits - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); r__1 = s / nsampl; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); chsqts_(&alam, mspace, &nsampl, &pp); pks[9 - kr - 1] = pp; jkk = jkreset_(); /* L2001: */ } s_wsfe(&io___572); for (im = 1; im <= 9; ++im) { do_fio(&c__1, (char *)&pks[im - 1], (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___574); for (im = 1; im <= 9; ++im) { do_fio(&c__1, (char *)&pks[im - 1], (ftnlen)sizeof(real)); } e_wsfe(); kstest_(pks, &c__9, &pp); s_wsfe(&io___575); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___576); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___577); e_wsfe(); s_wsfe(&io___578); e_wsfe(); return 0; } /* cdbday_ */ /* A SUBROUTINE TO DO A CHISQUARE TEST ON N VALUES FROM */ /* A DISCRETE DISTRIBUTION. SET UP FOR POISSON. CHANGE P'S FOR OTHERS. */ /* REQUIRES ARRAY MSPACE(NSAMPL) THAT GIVES NO. OF DUPLICATE SPACINGS */ /* IN EACH OF NSAMPL YEARS. */ /* Subroutine */ int chsqts_(lambda, mspace, nsampl, pp) real *lambda; integer *mspace, *nsampl; real *pp; { /* Format strings */ static char fmt_28[] = "(\002 \002,i2,\002 to \002,i2,f13.0,f13.3)"; static char fmt_29[] = "(3x,i6,f13.0,f13.3)"; static char fmt_27[] = "(\002 \002,i2,\002 to INF\002,f12.0,f13.3)"; static char fmt_31[] = "(\002 Chisquare with \002,i2,\002 d.o.f. = \002,\ f8.2,\002 p-value= \002,f8.6)"; /* System generated locals */ integer i__1, i__2; real r__1; /* Builtin functions */ double sqrt(), exp(); integer s_wsle(), do_lio(), e_wsle(), s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ static integer i, j, k[501], l, m; static real p, s; extern doublereal chisq_(); static integer lb; static real ex[501]; static integer lt; static real ps[501], obs[501]; /* Fortran I/O blocks */ static cilist io___590 = { 0, 3, 0, 0, 0 }; static cilist io___591 = { 0, 3, 0, 0, 0 }; static cilist io___592 = { 0, 6, 0, 0, 0 }; static cilist io___593 = { 0, 6, 0, 0, 0 }; static cilist io___595 = { 0, 6, 0, fmt_28, 0 }; static cilist io___596 = { 0, 3, 0, fmt_28, 0 }; static cilist io___597 = { 0, 6, 0, fmt_29, 0 }; static cilist io___598 = { 0, 3, 0, fmt_29, 0 }; static cilist io___599 = { 0, 6, 0, fmt_27, 0 }; static cilist io___600 = { 0, 3, 0, fmt_27, 0 }; static cilist io___601 = { 0, 6, 0, fmt_31, 0 }; static cilist io___602 = { 0, 3, 0, fmt_31, 0 }; static cilist io___603 = { 0, 3, 0, 0, 0 }; static cilist io___604 = { 0, 6, 0, 0, 0 }; /* Parameter adjustments */ --mspace; /* Function Body */ i__1 = *lambda + sqrt(*lambda) * 4; for (i = 0; i <= i__1; ++i) { ex[i] = (float)0.; k[i] = 0; /* L18: */ ps[i] = (float)0.; } p = exp(-(doublereal)(*lambda)); ps[0] = p * *nsampl; k[0] = 0; j = 0; s = p * *nsampl; if (s > (float)5.) { j = 1; ex[0] = s; s = (float)0.; } i__1 = *lambda + sqrt(*lambda) * 4; for (i = 1; i <= i__1; ++i) { p = *lambda * p / i; ps[i] = ps[i - 1] + p * *nsampl; s += p * *nsampl; k[i] = j; if (ps[i] > (real) (*nsampl - 5)) { ex[j] = s + *nsampl - ps[i]; i__2 = *nsampl; for (l = i + 1; l <= i__2; ++l) { /* L874: */ k[l] = j; } goto L12; } if (s < (float)5.) { goto L2; } ex[j] = s; ++j; s = (float)0.; L2: ; } L12: for (i = 0; i <= 100; ++i) { /* L42: */ obs[i] = (float)0.; } i__1 = *nsampl; for (i = 1; i <= i__1; ++i) { l = k[mspace[i]]; /* L43: */ obs[l] += 1; } s = (float)0.; i__1 = j; for (m = 0; m <= i__1; ++m) { /* L44: */ /* Computing 2nd power */ r__1 = obs[m] - ex[m]; s += r__1 * r__1 / ex[m]; } lb = 0; m = k[0]; s_wsle(&io___590); do_lio(&c__9, &c__1, " duplicate ", 11L); do_lio(&c__9, &c__1, " number number ", 26L); e_wsle(); s_wsle(&io___591); do_lio(&c__9, &c__1, " spacings ", 11L); do_lio(&c__9, &c__1, " observed expected", 26L); e_wsle(); s_wsle(&io___592); do_lio(&c__9, &c__1, " duplicate ", 11L); do_lio(&c__9, &c__1, " number number ", 26L); e_wsle(); s_wsle(&io___593); do_lio(&c__9, &c__1, " spacings ", 11L); do_lio(&c__9, &c__1, " observed expected", 26L); e_wsle(); for (i = 1; i <= 100; ++i) { if (k[i] == m) { goto L62; } lt = i - 1; if (lb != lt) { s_wsfe(&io___595); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)<, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb != lt) { s_wsfe(&io___596); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)<, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb == lt) { s_wsfe(&io___597); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb == lt) { s_wsfe(&io___598); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } m = k[i]; lb = i; if (m == j) { goto L63; } L62: ; } L63: s_wsfe(&io___599); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___600); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); *pp = chisq_(&s, &j); s_wsfe(&io___601); do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&(*pp), (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___602); do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&(*pp), (ftnlen)sizeof(real)); e_wsfe(); s_wsle(&io___603); do_lio(&c__9, &c__1, " :::::::::::::::::::::::::::::::::::::::::", 42L); e_wsle(); s_wsle(&io___604); do_lio(&c__9, &c__1, " :::::::::::::::::::::::::::::::::::::::::", 42L); e_wsle(); /* print 32,pp */ /* write(3,32) pp */ /* 32 format(' UNI = ',f8.5,' (Probability of a better fit.)') */ return 0; } /* chsqts_ */ /* Subroutine */ int cdosum_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real f[101] = { (float)0.,(float).0017,(float).0132,(float).027,( float).0406,(float).0538,(float).0665,(float).0787,(float).0905,( float).102,(float).1133,(float).1242,(float).1349,(float).1454,( float).1557,(float).1659,(float).176,(float).1859,(float).1957,( float).2054,(float).215,(float).2246,(float).2341,(float).2436,( float).253,(float).2623,(float).2716,(float).2809,(float).2902,( float).2995,(float).3087,(float).318,(float).3273,(float).3366,( float).3459,(float).3552,(float).3645,(float).3739,(float).3833,( float).3928,(float).4023,(float).4118,(float).4213,(float).4309,( float).4406,(float).4504,(float).4602,(float).4701,(float).48,( float).49,(float).5,(float).51,(float).5199,(float).5299,(float) .5397,(float).5495,(float).5593,(float).569,(float).5787,(float) .5882,(float).5978,(float).6073,(float).6167,(float).626,(float) .6354,(float).6447,(float).654,(float).6632,(float).6724,(float) .6817,(float).691,(float).7003,(float).7096,(float).7189,(float) .7282,(float).7375,(float).7468,(float).7562,(float).7657,(float) .7752,(float).7848,(float).7944,(float).8041,(float).814,(float) .8239,(float).834,(float).8442,(float).8545,(float).865,(float) .8757,(float).8867,(float).898,(float).9095,(float).9214,(float) .9337,(float).9464,(float).9595,(float).9731,(float).9868,(float) .9983,(float)1. }; /* Format strings */ static char fmt_766[] = "(a78)"; static char fmt_39[] = "(15x,\002 Test no. \002,i2,\002 p-value \ \002,2f8.6)"; static char fmt_2345[] = "(\002 Results of the OSUM test for \002,a15)"; static char fmt_27[] = "(7x,\002 KSTEST on the above 10 p-values: \002,2\ f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(); /* Local variables */ extern integer jtbl_(); static real qmax; static char text[80*11]; static real a, b, h; static integer i, j, m; static real p, s, t[199], u[100], w[10], x[100], y[100]; static integer ij, ik; static real pk, qq; extern /* Subroutine */ int kstest_(); static integer jkk; extern doublereal phi_(); static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___608 = { 0, 4, 0, fmt_766, 0 }; static cilist io___611 = { 0, 4, 0, fmt_766, 0 }; static cilist io___613 = { 0, 6, 0, fmt_766, 0 }; static cilist io___614 = { 0, 3, 0, fmt_766, 0 }; static cilist io___631 = { 0, 6, 0, fmt_39, 0 }; static cilist io___632 = { 0, 3, 0, fmt_39, 0 }; static cilist io___633 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___634 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___635 = { 0, 3, 0, fmt_27, 0 }; static cilist io___636 = { 0, 6, 0, fmt_27, 0 }; static cilist io___637 = { 0, 6, 0, fmt_489, 0 }; static cilist io___638 = { 0, 3, 0, fmt_489, 0 }; m = 100; jkk = jkreset_(); o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___608); for (j = 1; j <= 208; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___611); for (j = 1; j <= 11; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___613); for (j = 1; j <= 11; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___614); for (j = 1; j <= 11; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /* L11: */ for (ik = 1; ik <= 10; ++ik) { qmax = (float)0.; for (ij = 1; ij <= 100; ++ij) { s = (float)0.; for (i = 1; i <= 199; ++i) { t[i - 1] = jtbl_() * (float)8.06549e-10; /* L2: */ if (i <= m) { s += t[i - 1]; } } y[0] = s; i__1 = m; for (j = 2; j <= i__1; ++j) { /* L3: */ y[j - 1] = y[j - 2] - t[j - 2] + t[m + j - 2]; } /* ***now y(j)=z(j)+...+z(99+j) */ /* *** They are virtually normal, mean 0, variance 100, but correl ated. */ /* **** Now a matrix transformation of the y's: x=yM, will make th e */ /* *** x's independent normal. */ /* ***The y's covariance matrix T is Toeplitz with diagonals 100,9 9,...2,1 */ /* ***A Cholesky factorization of T: V'V=T provides M=V^(-1). The */ /* ***covariance of x=yM is M'TM=I. */ /* *** The columns of M have at most 3 non-zero elements. */ x[0] = y[0] / sqrt(m + (float)0.); x[1] = -(doublereal)(m - (float)1.) * y[0] / sqrt(m * (m + m - ( float)1.)) + y[1] * sqrt(m / (m + m - (float)1.)); /* Computing 2nd power */ r__1 = x[0]; /* Computing 2nd power */ r__2 = x[1]; qq = r__1 * r__1 + r__2 * r__2; i__1 = m; for (i = 3; i <= i__1; ++i) { a = (real) (m + m + 2 - i); b = (real) ((m << 2) + 2 - i - i); x[i - 1] = y[0] / sqrt(a * b) - sqrt((a - (float)1.) / (b + ( float)2.)) * y[i - 2] + sqrt(a / b) * y[i - 1]; /* L4: */ /* Computing 2nd power */ r__1 = x[i - 1]; qq += r__1 * r__1; } /* ****now the x's are a bunch of iid rnors with mean 0, variance 1. */ /* ***Does sum(x(i)^2) behave as chisquare with m deg. freedom? */ /* ****now convert x(1),...,x(m) to uni's. */ i__1 = m; for (i = 1; i <= i__1; ++i) { p = phi_(&x[i - 1]); h = p * (float)100.; j = h; /* L7: */ x[i - 1] = f[j] + (h - j) * (f[j + 1] - f[j]); } /* ***test to see if the transformed x's are uniforms. */ kstest_(x, &m, &p); /* L88: */ u[ij - 1] = p; } /* ***Now do a KSTEST on the 100 p's from the tests for normality. */ kstest_(u, &c__100, &pk); /* ***And a KSTEST on the 100 p's from the chisquare tests. */ /* call kstest(uu,100,pq) */ w[ik - 1] = pk; /* uq(ik)=pq */ s_wsfe(&io___631); do_fio(&c__1, (char *)&ik, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&pk, (ftnlen)sizeof(real)); e_wsfe(); /* L89: */ s_wsfe(&io___632); do_fio(&c__1, (char *)&ik, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&pk, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___633); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___634); do_fio(&c__1, filename, 25L); e_wsfe(); /* &' Q p-value ',f8.6) */ kstest_(w, &c__10, &p); /* call kstest(uq,10,pq) */ s_wsfe(&io___635); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___636); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___637); e_wsfe(); s_wsfe(&io___638); e_wsfe(); return 0; } /* cdosum_ */ /* ********dummy line */ /* ********dummy line */ /* ********dummy line */ /* Subroutine */ int asort_(list, n) real *list; integer *n; { static integer i, j, k, l, m; static real t; static integer ij, il[33], iu[33]; static real tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* asort_ */ /* Subroutine */ int isort_(list, n) integer *list, *n; { static integer i, j, k, l, m, t, ij, il[33], iu[33], tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* isort_ */ /* Subroutine */ int dsort_(list, n) doublereal *list; integer *n; { static integer i, j, k, l, m; static doublereal t; static integer ij, il[33], iu[33]; static doublereal tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* dsort_ */ /* Subroutine */ int kstest_(y, n, p) real *y; integer *n; real *p; { /* Initialized data */ static integer l[80] /* was [8][10] */ = { 40,46,37,34,27,24,20,20, 88,59,43,37,29,27,20,22,92,63,48,41,30,30,25,24,82,59,42,37,26,28, 26,22,62,48,33,30,23,23,22,18,49,34,22,20,16,17,17,12,17,17,7,8,4, 7,5,1,40,18,19,14,16,13,10,9,59,20,10,4,1,1,0,-1,41,43,36,112,15, 95,32,58 }; /* System generated locals */ integer i__1; /* Builtin functions */ double log(), exp(), sqrt(); /* Local variables */ static real a, e; static integer i, j, m; static real t, z; extern /* Subroutine */ int asort_(); extern doublereal sp_(); /* TO TEST WHETHER A SET OF N REAL NUMBERS IS DRAWN */ /* FROM A UNIFORM DISTRIBUTION (KOLMOROGOV-SMIRNOV METHOD) */ /* THE TEST IS BASED ON THE DISTANCE BETWEEN THE EMPIRICAL */ /* AND THEORETICAL DISTRIBUTION FUNCTIONS */ /* USAGE: CALL KSTEST(Y,N,P) */ /* Y ... ARRAY OF REAL NUMBERS HYPOTHETICALLY DRAWN */ /* FROM A UNIFORM DISTRIBUTION ON (0,1) */ /* N ... NUMBER OF ELEMENTS IN 'Y' */ /* P IS THE PROBABILITY ASSOCIATED WITH THE OBSERVED VALUE */ /* OF THE ANDERSON-DARLING STATISTIC: N TIMES THE INTEGRAL */ /* OF (FN(X)-X)**2/(X*(1-X)) */ /* Parameter adjustments */ --y; /* Function Body */ asort_(&y[1], n); z = -(*n) * (*n + (float)0.); i__1 = *n; for (i = 1; i <= i__1; ++i) { t = y[i] * ((float)1. - y[*n + 1 - i]); if (t < (float)1e-20) { t = (float)1e-20; } /* L2: */ z -= (i + i - 1) * log(t); } z /= *n; *p = (float)0.; if (z < (float).01) { goto L5; } if (z > (float)2.) { goto L3; } *p = exp((float)-1.2337 / z) * (float)2. * (z / (float)8. + (float)1. - z * (float).04958 * z / (z + (float)1.325)) / sqrt(z); goto L5; L3: if (z > (float)4.) { goto L4; } *p = (float)1. - exp(z * (float)-1.091638) * (float).6621361 - exp(z * ( float)-2.005138) * (float).95059; goto L5; L4: *p = (float)1. - exp(z * (float)-1.050321) * (float).4938691 - exp(z * ( float)-1.527198) * (float).5946335; L5: /* Computing MIN */ i__1 = *n - 2; m = min(i__1,8); e = (float)0.; for (j = 1; j <= 10; ++j) { /* L6: */ e += l[m + (j << 3) - 9] * sp_(p, &j) * (float)1e-4; } if (*n > 10) { e = e * (float)10. / *n; } a = *p + e; return 0; } /* kstest_ */ doublereal sp_(x, i) real *x; integer *i; { /* System generated locals */ real ret_val, r__1; /* Local variables */ static real t; ret_val = (float)0.; switch ((int)*i) { case 1: goto L7; case 2: goto L7; case 3: goto L7; case 4: goto L7; case 5: goto L7; case 6: goto L7; case 7: goto L7; case 8: goto L8; case 9: goto L9; case 10: goto L10; } L7: t = (r__1 = *x * (float)10. - (float).5 - *i, dabs(r__1)); if (t > (float)1.5) { return ret_val; } if (t <= (float).5) { ret_val = (float)1.5 - t * (float)2. * t; } else { ret_val = (float)2.25 - t * ((float)3. - t); } return ret_val; L8: if (*x <= (float).8 || *x >= (float)1.) { return ret_val; } /* Computing 2nd power */ r__1 = *x - (float).9; ret_val = r__1 * r__1 * (float)100. - (float)1.; return ret_val; L9: if (*x <= (float)0. || *x >= (float).05) { return ret_val; } if (*x <= (float).01) { ret_val = *x * (float)-100.; } else { ret_val = (*x - (float).05) * (float)25.; } return ret_val; L10: if (*x <= (float).98 || *x >= (float)1.) { return ret_val; } ret_val = (float).1 - (r__1 = *x - (float).99, dabs(r__1)) * (float)10.; return ret_val; } /* sp_ */ doublereal phi_(x) real *x; { /* Initialized data */ static doublereal v[15] = { 1.2533141373155,.6556795424187985, .4213692292880545,.3045902987101033,.2366523829135607, .1928081047153158,.1623776608968675,.1401041834530502, .1231319632579329,.1097872825783083,.09902859647173193, .09017567550106468,.08276628650136917,.0764757610162485, .07106958053885211 }; /* System generated locals */ integer i__1; real ret_val; doublereal d__1; /* Builtin functions */ double r_sign(), d_sign(), exp(); /* Local variables */ static doublereal cphi, a, b, h; static integer i, j; static doublereal z, sum, pwr; ret_val = r_sign(&c_b1029, x) + (float).5; if (dabs(*x) > (float)7.) { return ret_val; } d__1 = *x; cphi = .5 - d_sign(&c_b1030, &d__1); j = (integer) (dabs(*x) + .5); j = min(j,14); z = (doublereal) j; h = dabs(*x) - z; a = v[j]; b = z * a - 1.; pwr = 1.; sum = a + h * b; i__1 = 24 - j; for (i = 2; i <= i__1; i += 2) { a = (a + z * b) / i; b = (b + z * a) / (i + 1); /* Computing 2nd power */ d__1 = h; pwr *= d__1 * d__1; /* L2: */ sum += pwr * (a + h * b); } cphi = sum * exp(*x * -.5 * *x - .918938533204672); ret_val = 1. - cphi; if (*x < 0.) { ret_val = cphi; } return ret_val; } /* phi_ */ doublereal chisq_(x, n) real *x; integer *n; { /* System generated locals */ integer i__1, i__2; real ret_val, r__1, r__2; doublereal d__1; /* Builtin functions */ double pow_dd(), sqrt(), exp(); /* Local variables */ static real d; static integer i, l; static real s, t; extern doublereal phi_(); ret_val = (float)0.; if (*x <= (float)0.) { return ret_val; } if (*n > 20) { d__1 = (doublereal) (*x / *n); t = (pow_dd(&d__1, &c_b1033) - 1 + (float).22222 / *n) / sqrt((float) .22222 / *n); r__1 = dmin(t,(float)8.); ret_val = phi_(&r__1); return ret_val; } l = 4 - *n % 2; /* Computing MIN */ i__1 = 1, i__2 = *n / 3; d = (real) min(i__1,i__2); i__1 = *n; for (i = l; i <= i__1; i += 2) { d = d * *x / (i - 2); ret_val += d; /* L2: */ } if (l == 3) { /* Computing MIN */ r__1 = *x * (float).5; s = sqrt((dmin(r__1,(float)50.))); r__1 = s / (float).7071068; /* Computing MIN */ r__2 = *x * (float).5; ret_val = phi_(&r__1) - exp(-(doublereal)dmin(r__2,(float)50.)) * ( float).564189 * ret_val / s; return ret_val; } /* Computing MIN */ r__1 = *x * (float).5; ret_val = (float)1. - exp(-(doublereal)dmin(r__1,(float)50.)) * (ret_val + (float)1.); return ret_val; } /* chisq_ */ source/diequick.c100644 765 144 325201 6100243406 12535 0ustar geousers/* diequick.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static real c_b46 = (float)2.; static integer c__2 = 2; static integer c__20 = 20; static integer c__42 = 42; static real c_b150 = (float)100.; static integer c__10 = 10; static integer c__8000 = 8000; static integer c__4096 = 4096; static real c_b237 = (float).75; static real c_b238 = (float).72222222222222221; static real c_b239 = (float).69444444444444442; static integer c__5 = 5; static integer c__6 = 6; static integer c__8 = 8; static integer c__25 = 25; static integer c__3 = 3; static doublereal c_b513 = 2.; static integer c__100 = 100; static real c_b760 = (float).5; static doublereal c_b761 = .5; static doublereal c_b764 = .33333; static integer c__99 = 99; /* c************top of file */ /* allbrank.obj cdosum.obj cdoperm5.obj asort.obj kstest.obj phi.obj */ /* Main program */ MAIN__() { /* Format strings */ static char fmt_845[] = "(a25)"; static char fmt_399[] = "(\002------------------------------------------\ --------------------------------------\002)"; static char fmt_400[] = "(\002 Test completed. File \002,a15,/,\002:::\ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\ ::\002)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer s_wsle(), do_lio(), e_wsle(), s_rsfe(), do_fio(), e_rsfe(), f_open(), s_wsfe(), e_wsfe(); /* Local variables */ static char filename[25]; extern /* Subroutine */ int cdbinrnk_(), craptest_(), sqeez_(), sknt1s_(), cdbday_(), wknt1s_(), rank3132_(), cdpark_(), cdosum_(), cdbitst_(); static char fileout[25]; extern /* Subroutine */ int mindist_(), runtest_(), d3sphere_(), cdoperm5_(); /* Fortran I/O blocks */ static cilist io___1 = { 0, 6, 0, 0, 0 }; static cilist io___2 = { 0, 6, 0, 0, 0 }; static cilist io___3 = { 0, 6, 0, 0, 0 }; static cilist io___4 = { 0, 5, 0, fmt_845, 0 }; static cilist io___6 = { 0, 6, 0, 0, 0 }; static cilist io___7 = { 0, 5, 0, fmt_845, 0 }; static cilist io___9 = { 0, 3, 0, fmt_399, 0 }; static cilist io___10 = { 0, 6, 0, fmt_399, 0 }; static cilist io___11 = { 0, 3, 0, fmt_399, 0 }; static cilist io___12 = { 0, 6, 0, fmt_399, 0 }; static cilist io___13 = { 0, 3, 0, fmt_399, 0 }; static cilist io___14 = { 0, 6, 0, fmt_399, 0 }; static cilist io___15 = { 0, 3, 0, fmt_399, 0 }; static cilist io___16 = { 0, 6, 0, fmt_399, 0 }; static cilist io___17 = { 0, 3, 0, fmt_399, 0 }; static cilist io___18 = { 0, 6, 0, fmt_399, 0 }; static cilist io___19 = { 0, 3, 0, fmt_399, 0 }; static cilist io___20 = { 0, 6, 0, fmt_399, 0 }; static cilist io___21 = { 0, 3, 0, fmt_399, 0 }; static cilist io___22 = { 0, 6, 0, fmt_399, 0 }; static cilist io___23 = { 0, 3, 0, fmt_399, 0 }; static cilist io___24 = { 0, 6, 0, fmt_399, 0 }; static cilist io___25 = { 0, 3, 0, fmt_399, 0 }; static cilist io___26 = { 0, 6, 0, fmt_399, 0 }; static cilist io___27 = { 0, 3, 0, fmt_399, 0 }; static cilist io___28 = { 0, 6, 0, fmt_399, 0 }; static cilist io___29 = { 0, 3, 0, fmt_399, 0 }; static cilist io___30 = { 0, 6, 0, fmt_399, 0 }; static cilist io___31 = { 0, 3, 0, fmt_399, 0 }; static cilist io___32 = { 0, 6, 0, fmt_399, 0 }; static cilist io___33 = { 0, 3, 0, fmt_399, 0 }; static cilist io___34 = { 0, 6, 0, fmt_399, 0 }; static cilist io___35 = { 0, 3, 0, fmt_399, 0 }; static cilist io___36 = { 0, 6, 0, fmt_399, 0 }; static cilist io___37 = { 0, 6, 0, fmt_400, 0 }; static cilist io___38 = { 0, 3, 0, fmt_400, 0 }; s_wsle(&io___1); do_lio(&c__9, &c__1, " This program runs the full DIEHARD battery of t\ ests,", 55L); e_wsle(); s_wsle(&io___2); do_lio(&c__9, &c__1, " giving the p-values but little explanation. ", 45L) ; e_wsle(); s_wsle(&io___3); do_lio(&c__9, &c__1, " Enter name of file to be tested:", 33L); e_wsle(); s_rsfe(&io___4); do_fio(&c__1, filename, 25L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 25; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___6); do_lio(&c__9, &c__1, " Enter name of output file:", 27L); e_wsle(); s_rsfe(&io___7); do_fio(&c__1, fileout, 25L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 3; o__1.ofnmlen = 25; o__1.ofnm = fileout; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); cdbday_(filename, 25L); s_wsfe(&io___9); e_wsfe(); s_wsfe(&io___10); e_wsfe(); cdoperm5_(filename, 25L); s_wsfe(&io___11); e_wsfe(); s_wsfe(&io___12); e_wsfe(); rank3132_(filename, 25L); s_wsfe(&io___13); e_wsfe(); s_wsfe(&io___14); e_wsfe(); cdbinrnk_(filename, 25L); s_wsfe(&io___15); e_wsfe(); s_wsfe(&io___16); e_wsfe(); cdbitst_(filename, 25L); s_wsfe(&io___17); e_wsfe(); s_wsfe(&io___18); e_wsfe(); s_wsfe(&io___19); e_wsfe(); s_wsfe(&io___20); e_wsfe(); sknt1s_(filename, 25L); s_wsfe(&io___21); e_wsfe(); s_wsfe(&io___22); e_wsfe(); wknt1s_(filename, 25L); s_wsfe(&io___23); e_wsfe(); s_wsfe(&io___24); e_wsfe(); cdpark_(filename, 25L); s_wsfe(&io___25); e_wsfe(); s_wsfe(&io___26); e_wsfe(); mindist_(filename, 25L); s_wsfe(&io___27); e_wsfe(); s_wsfe(&io___28); e_wsfe(); d3sphere_(filename, 25L); s_wsfe(&io___29); e_wsfe(); s_wsfe(&io___30); e_wsfe(); sqeez_(filename, 25L); s_wsfe(&io___31); e_wsfe(); s_wsfe(&io___32); e_wsfe(); cdosum_(filename, 25L); s_wsfe(&io___33); e_wsfe(); s_wsfe(&io___34); e_wsfe(); runtest_(filename, 25L); s_wsfe(&io___35); e_wsfe(); s_wsfe(&io___36); e_wsfe(); craptest_(filename, 25L); s_wsfe(&io___37); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___38); do_fio(&c__1, filename, 25L); e_wsfe(); /* L88: */ } /* MAIN__ */ /* Subroutine */ int cdbitst_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_2511[] = "(\002 No. missing words should average\002,f9\ .0,\002 with sigma=\002,f4.0,/,\002----------------------------------- \ ---------------\002)"; static char fmt_2345[] = "(\002 BITSTREAM test results for\002,a15)"; static char fmt_22[] = "(\002 tst no \002,i2,\002: \002,i7,\002 missing \ words, \002,f7.2,\002 sigmas from mean, p-value=\002,f7.5)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3; real r__1; /* Builtin functions */ integer s_wsle(), do_lio(), e_wsle(); double pow_ri(), exp(); integer s_wsfe(), do_fio(), e_wsfe(), pow_ii(); /* Local variables */ static integer mbit[32]; extern integer jtbl_(); static integer nint, kpow, i, j, k, l, n; static real s; static integer w[32768]; static real x, sigma; static integer kount, ib, ic; static real mu; static integer nt; static real ss; static integer ntries, jkk; extern doublereal phi_(); static integer num; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___46 = { 0, 3, 0, 0, 0 }; static cilist io___47 = { 0, 3, 0, 0, 0 }; static cilist io___48 = { 0, 6, 0, 0, 0 }; static cilist io___49 = { 0, 6, 0, 0, 0 }; static cilist io___50 = { 0, 3, 0, 0, 0 }; static cilist io___51 = { 0, 6, 0, 0, 0 }; static cilist io___53 = { 0, 3, 0, fmt_2511, 0 }; static cilist io___54 = { 0, 6, 0, fmt_2511, 0 }; static cilist io___59 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___69 = { 0, 3, 0, fmt_22, 0 }; static cilist io___70 = { 0, 6, 0, fmt_22, 0 }; static cilist io___71 = { 0, 6, 0, fmt_489, 0 }; static cilist io___72 = { 0, 3, 0, fmt_489, 0 }; /* THE OVERLAPPING 20-tuples TEST BITSTREAM, 20 BITS PER WORD, N words */ /* If n=2^22, should be 19205.3 missing 20-letter words, sigma 167. */ /* If n=2^21, should be 141909 missing 20-letter words, sigma 428. */ /* If n=2^20, should be 385750 missing 20-letter words, sigma 512 */ jkk = jkreset_(); n = 20; kpow = 21; ntries = 20; sigma = (float)428.; /* **** SET MASK BITS*************** */ mbit[0] = 1; for (i = 1; i <= 31; ++i) { /* L8: */ mbit[i] = mbit[i - 1] << 1; } /* ***********INITIALIZE***************** */ s_wsle(&io___46); do_lio(&c__9, &c__1, " THE OVERLAPPING 20-tuples BITSTREAM TEST,", 47L); e_wsle(); s_wsle(&io___47); do_lio(&c__9, &c__1, " 20 BITS PER WORD, 2^21 words.", 40L); e_wsle(); s_wsle(&io___48); do_lio(&c__9, &c__1, " THE OVERLAPPING 20-tuples BITSTREAM TEST,", 47L); e_wsle(); s_wsle(&io___49); do_lio(&c__9, &c__1, " 20 BITS PER WORD, 2^21 words.", 40L); e_wsle(); s_wsle(&io___50); do_lio(&c__9, &c__1, " This test samples the bitstream 20 times.", 44L); e_wsle(); s_wsle(&io___51); do_lio(&c__9, &c__1, " This test samples the bitstream 20 times.", 44L); e_wsle(); i__1 = kpow - 20; mu = exp(-(doublereal)pow_ri(&c_b46, &i__1)) * 1048576; s_wsfe(&io___53); do_fio(&c__1, (char *)&mu, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sigma, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___54); do_fio(&c__1, (char *)&mu, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sigma, (ftnlen)sizeof(real)); e_wsfe(); /* *****MAIN LOOP********* */ /* **** GET INITIAL WORD */ j = jtbl_(); j &= 1048575; s = (float)0.; ss = (float)0.; nint = 1024; s_wsfe(&io___59); do_fio(&c__1, filename, 25L); e_wsfe(); i__1 = ntries; for (nt = 1; nt <= i__1; ++nt) { /* ********SET W-TABLE TO ZEROS******* */ for (i = 0; i <= 32767; ++i) { /* L9: */ w[i] = 0; } /* **** GENERATE 2**kpow OVERLAPPING WORDS********** */ i__3 = kpow - 5; i__2 = pow_ii(&c__2, &i__3); for (ic = 1; ic <= i__2; ++ic) { num = jtbl_(); for (ib = 1; ib <= 32; ++ib) { /* *** GET NEW J ***** */ j = ((j & 524287) << 1) + (num & 1); num = num >> 1; /* *** GET BIT INDEX FROM LAST 5 BITS OF J *** */ l = j & 31; /* *** GET TABLE INDEX FROM LEADING 15 BITS OF J*** */ k = j >> 5; /* *** SET BIT L IN W(K) *** */ /* L3: */ w[k] |= mbit[l]; } } /* ********** COUNT NUMBER OF EMPTY CELLS ******* */ kount = 0; for (k = 0; k <= 32767; ++k) { for (l = 0; l <= 31; ++l) { /* L4: */ if ((w[k] & mbit[l]) == 0) { ++kount; } } } /* ****END OF MAIN LOOP**** */ x = (kount - mu) / sigma; s_wsfe(&io___69); do_fio(&c__1, (char *)&nt, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L2: */ s_wsfe(&io___70); do_fio(&c__1, (char *)&nt, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); } jkk = jkreset_(); s_wsfe(&io___71); e_wsfe(); s_wsfe(&io___72); e_wsfe(); return 0; } /* cdbitst_ */ /* Subroutine */ int d3sphere_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_841[] = "(\002 The 3DSPHERES test for fi\ le \002,a15)"; static char fmt_28[] = "(\002 sample no: \002,i2,4x,\002 r^3= \002,f7.3,\ 4x,\002 p-value=\002,f7.5)"; static char fmt_22[] = "(\002 A KS test is applied to those 20 p-valu\ es.\002,/,\002---------------------------------------------------------\002)"; static char fmt_25[] = "(6x,\002 3DSPHERES test for file \002,a15,\002 \ p-value=\002,f8.6,/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); double sqrt(), exp(); /* Local variables */ static real dmin__; extern integer jtbl_(); static real d; static integer i, j, n; static real p[20], u, v, w, x[4000], y[4000], z[4000]; extern /* Subroutine */ int asort_(); static real r3; static integer ij; static real pv; extern /* Subroutine */ int kstest_(); static integer jkk; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___75 = { 0, 3, 0, fmt_841, 0 }; static cilist io___76 = { 0, 6, 0, fmt_841, 0 }; static cilist io___90 = { 0, 3, 0, fmt_28, 0 }; static cilist io___91 = { 0, 6, 0, fmt_28, 0 }; static cilist io___92 = { 0, 3, 0, fmt_22, 0 }; static cilist io___93 = { 0, 6, 0, fmt_22, 0 }; static cilist io___95 = { 0, 6, 0, fmt_25, 0 }; static cilist io___96 = { 0, 3, 0, fmt_25, 0 }; n = 4000; jkk = jkreset_(); s_wsfe(&io___75); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___76); do_fio(&c__1, filename, 25L); e_wsfe(); for (ij = 1; ij <= 20; ++ij) { dmin__ = (float)1e7; i__1 = n; for (i = 1; i <= i__1; ++i) { /* L2: */ x[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; } asort_(x, &n); i__1 = n; for (i = 1; i <= i__1; ++i) { y[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; /* L3: */ z[i - 1] = jtbl_() * (float)2.328306e-7 + (float)500.; } i__1 = n; for (i = 1; i <= i__1; ++i) { u = x[i - 1]; v = y[i - 1]; w = z[i - 1]; i__2 = n; for (j = i + 1; j <= i__2; ++j) { /* Computing 2nd power */ r__1 = u - x[j - 1]; d = r__1 * r__1; if (d >= dmin__) { goto L4; } /* Computing 2nd power */ r__1 = v - y[j - 1]; /* Computing 2nd power */ r__2 = w - z[j - 1]; d = d + r__1 * r__1 + r__2 * r__2; /* L5: */ if (d < dmin__) { dmin__ = d; } } L4: ; } r3 = dmin__ * sqrt(dmin__); p[ij - 1] = 1 - exp(-(doublereal)r3 / (float)30.); s_wsfe(&io___90); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&r3, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&p[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); /* L6: */ s_wsfe(&io___91); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&r3, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&p[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___92); e_wsfe(); s_wsfe(&io___93); e_wsfe(); kstest_(p, &c__20, &pv); s_wsfe(&io___95); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&pv, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___96); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&pv, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); return 0; } /* d3sphere_ */ /* Subroutine */ int sqeez_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real ex[43] = { (float)21.03,(float)57.79,(float)175.54,(float) 467.32,(float)1107.83,(float)2367.84,(float)4609.44,(float) 8241.16,(float)13627.81,(float)20968.49,(float)30176.12,(float) 40801.97,(float)52042.03,(float)62838.28,(float)72056.37,(float) 78694.51,(float)82067.55,(float)81919.35,(float)78440.08,(float) 72194.12,(float)63986.79,(float)54709.31,(float)45198.52,(float) 36136.61,(float)28000.28,(float)21055.67,(float)15386.52,(float) 10940.2,(float)7577.96,(float)5119.56,(float)3377.26,(float) 2177.87,(float)1374.39,(float)849.7,(float)515.18,(float)306.66,( float)179.39,(float)103.24,(float)58.51,(float)32.69,(float)18.03, (float)9.82,(float)11.21 }; /* Format strings */ static char fmt_345[] = "(\002 RESULTS OF SQUEEZE TEST FOR\ \002,a15)"; static char fmt_348[] = "(\002 Table of standardized frequency c\ ounts\002,/,\002 ( (obs-exp)/sqrt(exp) )^2\002,/,\002 for j takin\ g values <=6,7,8,...,47,>=48:\002)"; static char fmt_25[] = "(6f8.1)"; static char fmt_71[] = "(8x,\002 Chi-square with 42 degrees of freed\ om:\002,f7.3)"; static char fmt_72[] = "(8x,\002 z-score=\002,f7.3,\002 p-value\ =\002,f8.6,/,\002___________________________________________________________\ ___\002)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; /* Builtin functions */ double sqrt(); integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ extern integer jtbl_(); static real chsq; static integer i, j, k; extern doublereal chisq_(); static integer jkk; static real tbl[43], sig; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___105 = { 0, 3, 0, fmt_345, 0 }; static cilist io___106 = { 0, 6, 0, fmt_345, 0 }; static cilist io___107 = { 0, 3, 0, fmt_348, 0 }; static cilist io___108 = { 0, 6, 0, fmt_348, 0 }; static cilist io___109 = { 0, 3, 0, fmt_25, 0 }; static cilist io___110 = { 0, 6, 0, fmt_25, 0 }; static cilist io___111 = { 0, 3, 0, fmt_71, 0 }; static cilist io___112 = { 0, 6, 0, fmt_71, 0 }; static cilist io___113 = { 0, 6, 0, fmt_72, 0 }; static cilist io___114 = { 0, 3, 0, fmt_72, 0 }; static cilist io___115 = { 0, 6, 0, fmt_489, 0 }; static cilist io___116 = { 0, 3, 0, fmt_489, 0 }; /* SQUEEZE TEST. How many iterations of k=k*uni()+1 are required */ /* to squeeze k down to 1, starting with k=2147483647=2^31-1. */ /* The exact distribution of the required j is used, with */ /* a chi-square test based on 100,000 tries. */ /* The mean of j is 23.064779, with variance 23.70971151. */ /* Put a one-line function here to provide the uni being tested: */ jkk = jkreset_(); /* L1: */ for (i = 6; i <= 48; ++i) { /* L7: */ tbl[i - 6] = (float)0.; } for (i = 1; i <= 100000; ++i) { j = 0; k = 2147483647; L11: k = k * (jtbl_() * (float)2.3283064365386963e-10 + (float).5) + 1; ++j; if (k > 1) { goto L11; } /* Computing MIN */ i__1 = max(j,6); j = min(i__1,48); /* L2: */ tbl[j - 6] += (float)1.; } chsq = (float)0.; for (i = 6; i <= 48; ++i) { /* L3: */ /* Computing 2nd power */ r__1 = tbl[i - 6] - ex[i - 6] * (float).1; chsq += r__1 * r__1 / (ex[i - 6] * (float).1); } sig = sqrt((float)84.); s_wsfe(&io___105); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___106); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___107); e_wsfe(); s_wsfe(&io___108); e_wsfe(); s_wsfe(&io___109); for (i = 6; i <= 48; ++i) { r__1 = (tbl[i - 6] - ex[i - 6] * (float).1) / sqrt(ex[i - 6] * (float) .1); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___110); for (i = 6; i <= 48; ++i) { r__1 = (tbl[i - 6] - ex[i - 6] * (float).1) / sqrt(ex[i - 6] * (float) .1); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___111); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___112); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___113); r__1 = (chsq - (float)42.) / sig; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); r__2 = chisq_(&chsq, &c__42); do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___114); r__1 = (chsq - (float)42.) / sig; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); r__2 = chisq_(&chsq, &c__42); do_fio(&c__1, (char *)&r__2, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___115); e_wsfe(); s_wsfe(&io___116); e_wsfe(); return 0; } /* sqeez_ */ /* Subroutine */ int cdpark_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_2345[] = "(10x,\002 CDPARK: result of ten tests on file\ \002,a15,/,10x,\002 Of 12,000 tries, the average no. of successes\002,/,15\ x,\002 should be 3523 with sigma=21.9\002)"; static char fmt_27[] = "(10x,\002 Successes:\002,i5,\002 z-score:\ \002,f7.3,\002 p-value:\002,f8.6)"; static char fmt_25[] = "(10x,\002 square size avg. no. parked sampl\ e sigma\002,/,10x,f7.0,f20.3,f13.3)"; static char fmt_26[] = "(\002 KSTEST for the above 10: p= \ \002,f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(), s_wsle(), e_wsle(); double sqrt(); /* Local variables */ extern integer jtbl_(); static real g[10]; static integer i, k, n; static real s, w, x[4000], y[4000], z; static integer ij; static real av, pp, ss; extern /* Subroutine */ int kstest_(); static integer jkk; extern doublereal phi_(); static real sig; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___120 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___121 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___131 = { 0, 6, 0, fmt_27, 0 }; static cilist io___132 = { 0, 3, 0, fmt_27, 0 }; static cilist io___135 = { 0, 3, 0, 0, 0 }; static cilist io___136 = { 0, 6, 0, fmt_25, 0 }; static cilist io___137 = { 0, 3, 0, fmt_25, 0 }; static cilist io___139 = { 0, 6, 0, fmt_26, 0 }; static cilist io___140 = { 0, 3, 0, fmt_26, 0 }; static cilist io___141 = { 0, 6, 0, fmt_489, 0 }; static cilist io___142 = { 0, 3, 0, fmt_489, 0 }; jkk = jkreset_(); s = (float)0.; ss = (float)0.; s_wsfe(&io___120); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___121); do_fio(&c__1, filename, 25L); e_wsfe(); for (ij = 1; ij <= 10; ++ij) { x[0] = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float) 100.; y[0] = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float) 100.; k = 1; for (n = 1; n <= 12000; ++n) { z = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * ( float)100.; w = (jtbl_() * (float)2.3283064365386963e-10 + (float).5) * ( float)100.; i__1 = k; for (i = 1; i <= i__1; ++i) { /* L5: */ if ((r__1 = x[i - 1] - z, dabs(r__1)) <= (float)1. && (r__2 = y[i - 1] - w, dabs(r__2)) <= (float)1.) { goto L3; } } ++k; x[k - 1] = z; y[k - 1] = w; L3: ; } s += k; ss += k * k; z = (k - (float)3523.) / (float)21.9; g[ij - 1] = phi_(&z); s_wsfe(&io___131); do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___132); do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); /* L8: */ } av = s / 10; /* Computing 2nd power */ r__1 = av; sig = ss / 10 - r__1 * r__1; s_wsle(&io___135); e_wsle(); s_wsfe(&io___136); do_fio(&c__1, (char *)&c_b150, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); r__1 = sqrt(sig); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___137); do_fio(&c__1, (char *)&c_b150, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); r__1 = sqrt(sig); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); kstest_(g, &c__10, &pp); s_wsfe(&io___139); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___140); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___141); e_wsfe(); s_wsfe(&io___142); e_wsfe(); return 0; } /* cdpark_ */ /* Subroutine */ int mindist_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_441[] = "(\002 This is the MINIMUM DISTANC\ E test\002,/,\002 for random integers in the file \002,a15,/,4x,\ \002 Sample no. d^2 avg equiv uni \002)"; static char fmt_23[] = "(i12,f10.4,f9.4,f12.6)"; static char fmt_35[] = "(\002 MINIMUM DISTANCE TEST for \002,a15)"; static char fmt_445[] = "(10x,\002Result of KS test on 20 transformed mi\ ndist^2's:\002)"; static char fmt_31[] = "(10x,\002 p-value=\002,f8\ .6)"; static char fmt_409[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$$$ \002,/)"; /* System generated locals */ integer i__1; real r__1; static doublereal equiv_0[8000]; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); double exp(); /* Local variables */ static real dmin__; extern integer jtbl_(); static real d, g[100]; static integer i, j, n; static real p, u, v; extern /* Subroutine */ int dsort_(); static integer ij, ns; #define qq (equiv_0) #define xy ((real *)equiv_0) extern /* Subroutine */ int kstest_(); static integer jkk; static real sum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___148 = { 0, 6, 0, fmt_441, 0 }; static cilist io___149 = { 0, 3, 0, fmt_441, 0 }; static cilist io___159 = { 0, 3, 0, fmt_23, 0 }; static cilist io___160 = { 0, 6, 0, fmt_23, 0 }; static cilist io___161 = { 0, 3, 0, fmt_35, 0 }; static cilist io___162 = { 0, 6, 0, fmt_35, 0 }; static cilist io___163 = { 0, 3, 0, fmt_445, 0 }; static cilist io___164 = { 0, 6, 0, fmt_445, 0 }; static cilist io___166 = { 0, 3, 0, fmt_31, 0 }; static cilist io___167 = { 0, 6, 0, fmt_31, 0 }; static cilist io___168 = { 0, 3, 0, fmt_409, 0 }; static cilist io___169 = { 0, 6, 0, fmt_409, 0 }; /* minimum distance^2 between n random points(x(i),y(i)). */ /* mean is about .64 for 4000 points in a square of side 1000. */ /* and .995 for 8000 points in a square of side 10000. */ /* Since distance^2 is approximately exponential with mean .04, */ /* 1.-exp(-d^2/.04) should be uniform on [0,1). Thus a KS test. */ /* ***** one line function to generate a random coordinate in [0,1000). */ n = 8000; ns = 100; jkk = jkreset_(); s_wsfe(&io___148); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___149); do_fio(&c__1, filename, 25L); e_wsfe(); i__1 = ns; for (ij = 1; ij <= i__1; ++ij) { dmin__ = (float)1e7; for (i = 1; i <= 16000; ++i) { /* L2: */ xy[i - 1] = jtbl_() * (float)2.328306e-6 + (float)5e3; } dsort_(qq, &c__8000); for (i = 2; i <= 16000; i += 2) { u = xy[i - 1]; v = xy[i - 2]; for (j = i + 2; j <= 16000; j += 2) { /* Computing 2nd power */ r__1 = u - xy[j - 1]; d = r__1 * r__1; if (d >= dmin__) { goto L4; } /* Computing 2nd power */ r__1 = v - xy[j - 2]; d += r__1 * r__1; if (d < dmin__) { dmin__ = d; } /* L5: */ } L4: ; } d = dmin__; sum += d; g[ij - 1] = (float)1. - exp(-(doublereal)dmin__ / (float).995); if (ij % 5 == 0) { /* L9: */ s_wsfe(&io___159); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); r__1 = sum / ij; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___160); do_fio(&c__1, (char *)&ij, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); r__1 = sum / ij; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&g[ij - 1], (ftnlen)sizeof(real)); e_wsfe(); } /* L345: */ } s_wsfe(&io___161); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___162); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___163); e_wsfe(); s_wsfe(&io___164); e_wsfe(); kstest_(g, &ns, &p); s_wsfe(&io___166); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___167); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___168); e_wsfe(); s_wsfe(&io___169); e_wsfe(); jkk = jkreset_(); return 0; } /* mindist_ */ #undef xy #undef qq integer jtbl_0_(n__) int n__; { /* Initialized data */ static integer j = 4097; static integer jk = 1; /* System generated locals */ integer ret_val; /* Builtin functions */ integer s_rdue(), do_uio(), e_rdue(); /* Local variables */ static integer b[4096]; /* Fortran I/O blocks */ static cilist io___172 = { 0, 1, 0, 0, 0 }; switch(n__) { case 1: goto L_jkreset; } if (j > 4096) { io___172.cirec = jk; s_rdue(&io___172); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); j = 1; ++jk; } ret_val = b[j - 1]; ++j; return ret_val; L_jkreset: jk = 1; ret_val = 1; return ret_val; } /* jtbl_ */ integer jtbl_() { return jtbl_0_(0); } integer jkreset_() { return jtbl_0_(1); } /* Subroutine */ int runtest_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_2181[] = "(\002 The RUNS test for file \002,a1\ 5,/,\002 Up and down runs in a sample of 10000\002,/,\002_______________\ __________________________________ \002)"; static char fmt_234[] = "(15x\002 Run test for \002,a15,\002:\002)"; static char fmt_812[] = "(4x,\002 runs up; ks test for 10 p's:\002,f8.\ 6)"; static char fmt_813[] = "(4x,\002 runs down; ks test for 10 p's:\002,f8.\ 6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); double exp(); /* Local variables */ static integer ijkn; extern integer jtbl_(); static integer i; static real p, x[10000], dn[100]; static integer ij; static real dv; static integer ns; static real up[100], uv; static integer ifault; extern /* Subroutine */ int kstest_(), udruns_(); static integer jkk, nxs; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___177 = { 0, 3, 0, fmt_2181, 0 }; static cilist io___178 = { 0, 6, 0, fmt_2181, 0 }; static cilist io___189 = { 0, 6, 0, fmt_234, 0 }; static cilist io___190 = { 0, 3, 0, fmt_234, 0 }; static cilist io___191 = { 0, 3, 0, fmt_812, 0 }; static cilist io___192 = { 0, 6, 0, fmt_812, 0 }; static cilist io___193 = { 0, 3, 0, fmt_813, 0 }; static cilist io___194 = { 0, 6, 0, fmt_813, 0 }; static cilist io___195 = { 0, 6, 0, fmt_489, 0 }; static cilist io___196 = { 0, 3, 0, fmt_489, 0 }; /* **** up and down runs test****************** */ ns = 10; nxs = 10000; jkk = jkreset_(); s_wsfe(&io___177); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___178); do_fio(&c__1, filename, 25L); e_wsfe(); for (ijkn = 1; ijkn <= 2; ++ijkn) { /* L1: */ i__1 = ns; for (ij = 1; ij <= i__1; ++ij) { i__2 = nxs; for (i = 1; i <= i__2; ++i) { /* L2: */ x[i - 1] = jtbl_() * (float)2.328306e-10; } udruns_(x, &nxs, &uv, &dv, &ifault); /* Computing 2nd power */ r__1 = uv; up[ij - 1] = (float)1. - exp(uv * (float)-.5) * (uv * (float).5 + (float)1. + r__1 * r__1 * (float).125); /* Computing 2nd power */ r__1 = dv; dn[ij - 1] = (float)1. - exp(dv * (float)-.5) * (dv * (float).5 + (float)1. + r__1 * r__1 * (float).125); /* L3: */ } kstest_(up, &ns, &p); s_wsfe(&io___189); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___190); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___191); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___192); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); kstest_(dn, &ns, &p); s_wsfe(&io___193); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___194); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); /* L93: */ } jkk = jkreset_(); s_wsfe(&io___195); e_wsfe(); s_wsfe(&io___196); e_wsfe(); return 0; } /* runtest_ */ /* Subroutine */ int udruns_(x, n, uv, dv, ifault) real *x; integer *n; real *uv, *dv; integer *ifault; { /* Initialized data */ static struct { real e_1; integer fill_2[5]; real e_3[2]; integer fill_4[4]; real e_5[3]; integer fill_6[3]; real e_7[4]; integer fill_8[2]; real e_9[5]; integer fill_10[1]; real e_11[6]; } equiv_208 = { (float)4529.4, {0}, (float)9044.9, (float)18097., {0}, (float)13568., (float)27139., (float)40721., {0}, (float) 18091., (float)36187., (float)54281., (float)72414., {0}, ( float)22615., (float)45234., (float)67852., (float)90470., ( float)113262., {0}, (float)27892., (float)55789., (float) 83685., (float)111580., (float)139476., (float)172860. }; #define a ((real *)&equiv_208) /* System generated locals */ integer i__1; real r__1; /* Local variables */ static real b[6]; static integer i, j, j1, rd; static real rn; static integer ru, dcount[6], ucount[6]; static real uni; /* Algorithm AS 157 Appl. Statist. (1981) vol. 30, No. 1 */ /* The Runs-up and Runs-down test. */ /* Set up the A and B matrices. */ /* Parameter adjustments */ --x; /* Function Body */ *ifault = 0; if (*n < 4000) { goto L500; } for (j = 2; j <= 6; ++j) { j1 = j - 1; i__1 = j1; for (i = 1; i <= i__1; ++i) { a[j + i * 6 - 7] = a[i + j * 6 - 7]; /* L1: */ } } b[0] = (float).16666666666666666; b[1] = (float).20833333333333334; b[2] = (float).09166666666666666; b[3] = (float).026388888888888889; b[4] = (float).0057539682539682543; b[5] = (float).0011904761904761906; for (i = 1; i <= 6; ++i) { ucount[i - 1] = 0; dcount[i - 1] = 0; /* L100: */ } /* The loop that ends at line 300 determines the number of */ /* runs-up and runs-down of length i for i = 1(1)5 and the number */ /* of runs-up and runs-down of length greater than or equal to 6. */ ru = 1; rd = 1; i__1 = *n; for (j = 2; j <= i__1; ++j) { if ((r__1 = x[j] - x[j - 1]) < (float)0.) { goto L150; } else if (r__1 == 0) { goto L600; } else { goto L200; } L600: uni = (float).4; if (uni < (float).5) { goto L150; } else { goto L200; } L150: ++ucount[ru - 1]; ru = 1; if (rd < 6) { ++rd; } goto L300; L200: ++dcount[rd - 1]; rd = 1; if (ru < 6) { ++ru; } L300: ; } ++ucount[ru - 1]; ++dcount[rd - 1]; /* print 21,ucount,dcount */ /* L21: */ /* Calculate the test statistics uv and dv. */ *uv = (float)0.; *dv = (float)0.; rn = (real) (*n); for (i = 1; i <= 6; ++i) { for (j = 1; j <= 6; ++j) { *uv += ((real) ucount[i - 1] - rn * b[i - 1]) * ((real) ucount[j - 1] - rn * b[j - 1]) * a[i + j * 6 - 7]; *dv += ((real) dcount[i - 1] - rn * b[i - 1]) * ((real) dcount[j - 1] - rn * b[j - 1]) * a[i + j * 6 - 7]; /* L400: */ } } *uv /= rn; *dv /= rn; goto L700; L500: *ifault = *n; L700: return 0; } /* udruns_ */ #undef a /* Subroutine */ int craptest_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_2345[] = "(15x,\002 Results of craps test for \002,a15\ ,/,\002 No. of wins: Observed Expected\002)"; static char fmt_546[] = "(15x,\002 \002,i12,f12.2)"; static char fmt_25[] = "(15x,i8,\002= No. of wins, z-score=\002,f6.3,\ \002 pvalue=\002,f7.5,/,\002 Analysis of Throws-per-Game:\002)"; static char fmt_24[] = "(\002 Chisq=\002,f7.2,\002 for 20 degrees of fre\ edom, p=\002,f8.5,/,15x,\002Throws Observed Expected Chisq Sum\002)"; static char fmt_23[] = "(i19,i9,f11.1,f8.3,f9.3)"; static char fmt_2346[] = "(\002 SUMMARY FOR \002,a15)"; static char fmt_77[] = "(15x,\002 p-value for no. of wins:\002,f8.6)"; static char fmt_78[] = "(15x,\002 p-value for throws/game:\002,f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3; real r__1, r__2; /* Builtin functions */ double pow_ri(), sqrt(); integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ extern integer jtbl_(); static integer iwin; static real e[21]; static integer i, k, m; static real t; extern doublereal chisq_(); static integer nwins; static real pwins; static integer ng; static real av, sd; static integer lp; static real ex; static integer nt[21], jkk; extern doublereal phi_(); static real sum; extern integer jkreset_(); static integer nthrows; static real pthrows; /* Fortran I/O blocks */ static cilist io___224 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___225 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___226 = { 0, 6, 0, fmt_546, 0 }; static cilist io___227 = { 0, 3, 0, fmt_546, 0 }; static cilist io___229 = { 0, 6, 0, fmt_25, 0 }; static cilist io___230 = { 0, 3, 0, fmt_25, 0 }; static cilist io___233 = { 0, 3, 0, fmt_24, 0 }; static cilist io___234 = { 0, 6, 0, fmt_24, 0 }; static cilist io___235 = { 0, 3, 0, fmt_23, 0 }; static cilist io___236 = { 0, 6, 0, fmt_23, 0 }; static cilist io___237 = { 0, 3, 0, fmt_2346, 0 }; static cilist io___238 = { 0, 6, 0, fmt_2346, 0 }; static cilist io___239 = { 0, 3, 0, fmt_77, 0 }; static cilist io___240 = { 0, 6, 0, fmt_77, 0 }; static cilist io___241 = { 0, 3, 0, fmt_78, 0 }; static cilist io___242 = { 0, 6, 0, fmt_78, 0 }; static cilist io___243 = { 0, 6, 0, fmt_489, 0 }; static cilist io___244 = { 0, 3, 0, fmt_489, 0 }; jkk = jkreset_(); e[0] = (float).33333333333333331; sum = e[0]; for (k = 2; k <= 20; ++k) { i__1 = k - 2; i__2 = k - 2; i__3 = k - 2; e[k - 1] = (pow_ri(&c_b237, &i__1) * (float)27. + pow_ri(&c_b238, & i__2) * (float)40. + pow_ri(&c_b239, &i__3) * (float)55.) / ( float)648.; /* L3: */ sum += e[k - 1]; } e[20] = (float)1. - sum; ng = 200000; nwins = 0; for (i = 1; i <= 21; ++i) { /* L2: */ nt[i - 1] = 0; } i__1 = ng; for (i = 1; i <= i__1; ++i) { lp = (integer) (jtbl_() * (float)1.3969838619232178e-9 + (float)3.) + 2 + (integer) (jtbl_() * (float)1.3969838619232178e-9 + ( float)3.); nthrows = 1; if (lp == 7 || lp == 11) { iwin = 1; goto L444; } if (lp == 2 || lp == 3 || lp == 12) { iwin = 0; goto L444; } L4: k = (integer) (jtbl_() * (float)1.3969838619232178e-9 + (float)3.) + 2 + (integer) (jtbl_() * (float)1.3969838619232178e-9 + ( float)3.); ++nthrows; if (k == 7) { iwin = 0; goto L444; } if (k == lp) { iwin = 1; goto L444; } goto L4; L444: m = min(21,nthrows); ++nt[m - 1]; /* L7: */ nwins += iwin; } av = ng * (float)244. / (float)495.; sd = sqrt(av * (float)251. / (float)495.); t = (nwins - av) / sd; s_wsfe(&io___224); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___225); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___226); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___227); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&av, (ftnlen)sizeof(real)); e_wsfe(); pwins = phi_(&t); s_wsfe(&io___229); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&t, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___230); do_fio(&c__1, (char *)&nwins, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&t, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); sum = (float)0.; for (i = 1; i <= 21; ++i) { ex = ng * e[i - 1]; /* L8: */ /* Computing 2nd power */ r__1 = nt[i - 1] - ex; sum += r__1 * r__1 / ex; } pthrows = chisq_(&sum, &c__20); s_wsfe(&io___233); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___234); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); sum = (float)0.; for (i = 1; i <= 21; ++i) { ex = ng * e[i - 1]; /* Computing 2nd power */ r__1 = nt[i - 1] - ex; sum += r__1 * r__1 / ex; s_wsfe(&io___235); do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nt[i - 1], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&ex, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = nt[i - 1] - ex; r__1 = r__2 * r__2 / ex; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); e_wsfe(); /* L9: */ s_wsfe(&io___236); do_fio(&c__1, (char *)&i, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nt[i - 1], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&ex, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = nt[i - 1] - ex; r__1 = r__2 * r__2 / ex; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&sum, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___237); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___238); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___239); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___240); do_fio(&c__1, (char *)&pwins, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___241); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___242); do_fio(&c__1, (char *)&pthrows, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___243); e_wsfe(); s_wsfe(&io___244); e_wsfe(); return 0; } /* craptest_ */ /* Subroutine */ int cdomso_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static char ctest[4*3+1] = "OPSOOQSO DNA"; static real sigs[3] = { (float)290.,(float)295.,(float)339. }; /* Format strings */ static char fmt_22[] = "(a8,\002 for \002,a15,\002 using bits \002,i2\ ,\002 to \002,i2,i14,f7.3,f7.4)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2, i__3, i__4; real r__1; /* Builtin functions */ integer s_wsle(), do_lio(), e_wsle(), pow_ii(); double pow_ri(), exp(); integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ static integer mbit[32]; extern integer jtbl_(); static real true; static integer kpow, i, j, k, l, w[32768]; static real x; static integer index, kount, ic, jk, kk, lk, mk, kr, nt, ntries, kij, jkk; extern doublereal phi_(); static integer mkk, krk; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___252 = { 0, 6, 0, 0, 0 }; static cilist io___253 = { 0, 6, 0, 0, 0 }; static cilist io___254 = { 0, 6, 0, 0, 0 }; static cilist io___255 = { 0, 3, 0, 0, 0 }; static cilist io___256 = { 0, 3, 0, 0, 0 }; static cilist io___257 = { 0, 3, 0, 0, 0 }; static cilist io___276 = { 0, 3, 0, fmt_22, 0 }; static cilist io___277 = { 0, 6, 0, fmt_22, 0 }; static cilist io___278 = { 0, 6, 0, fmt_489, 0 }; static cilist io___279 = { 0, 3, 0, fmt_489, 0 }; /* ***** NUMBER OF MISSING WORDS IN A STRING OF 2**21 k-LETTER WORDS,**** */ /****** EACH LETTER 20/k BITS. THERE ARE 2**20 POSSIBLE WORDS************ ***/ /* ***** EACH OF THE 32 BITS IN THE 2**15 W-TABLE IDENTIFIES A WORD******* */ /* ******** mean should be 141,909 with sigma=290 */ /* ** ONE-LINE FUNCTION TO GENERATE 5-BIT LETTER IN CONVENIENT POSITION */ j = 1232456789; for (i = 1; i <= 1000000; ++i) { /* L879: */ j *= 69069; } for (jk = 1; jk <= 3; ++jk) { k = jk << 1; if (jk == 3) { k = 10; } /* Computing 2nd power */ i__1 = k - 9; index = (73 - i__1 * i__1) / 24; s_wsle(&io___252); do_lio(&c__9, &c__1, ctest + (index - 1 << 2), 4L); do_lio(&c__9, &c__1, " test for generator ", 20L); do_lio(&c__9, &c__1, filename, 25L); e_wsle(); s_wsle(&io___253); do_lio(&c__9, &c__1, " Output: No. missing words (mw), equiv normal \ variate (z), p-value (p)", 70L); e_wsle(); s_wsle(&io___254); do_lio(&c__9, &c__1, " \ mw z p", 72L); e_wsle(); s_wsle(&io___255); do_lio(&c__9, &c__1, ctest + (index - 1 << 2), 4L); do_lio(&c__9, &c__1, " test for generator ", 20L); do_lio(&c__9, &c__1, filename, 25L); e_wsle(); s_wsle(&io___256); do_lio(&c__9, &c__1, " Output: No. missing words (mw), equiv normal \ variate (z), p-value (p)", 70L); e_wsle(); s_wsle(&io___257); do_lio(&c__9, &c__1, " \ mw z p", 72L); e_wsle(); ntries = 1; kpow = 21; for (krk = 33 - 20 / k; krk >= 1; --krk) { jkk = jkreset_(); kr = 33 - 20 / k - krk; i__1 = 20 / k; mk = pow_ii(&c__2, &i__1) - 1; i__1 = 20 - 20 / k; mkk = pow_ii(&c__2, &i__1) - 1; lk = 20 / k; i__1 = ntries; for (kij = 1; kij <= i__1; ++kij) { kpow = 21; /* ****SET MASK BITS******** ******* */ mbit[0] = 1; for (i = 1; i <= 31; ++i) { /* L8: */ mbit[i] = mbit[i - 1] << 1; } /* *********** INITIALIZE***************** */ i__2 = kpow - 20; true = exp(-(doublereal)pow_ri(&c_b46, &i__2)) * 1048576; /* *****MAIN LOOP********* */ i__2 = ntries; for (nt = 1; nt <= i__2; ++nt) { /* ********SET W-TABLE TO ZEROS******* */ for (i = 0; i <= 32767; ++i) { /* L9: */ w[i] = 0; } /* **** GET INITIAL WORD */ j = jtbl_() >> kr & mk; i__3 = k - 1; for (i = 1; i <= i__3; ++i) { /* L46: */ i__4 = 20 / k; j = pow_ii(&c__2, &i__4) * j + (jtbl_() >> kr & mk); } /* **** GENERATE 2**kpow OVERLAPPING WORDS******** */ i__4 = pow_ii(&c__2, &kpow); for (ic = 1; ic <= i__4; ++ic) { /* *** GET NEW J ***** */ j = ((j & mkk) << lk) + (jtbl_() >> kr & mk); /* *** GET BIT INDEX FROM LAST 5 BITS OF J * ** */ l = j & 31; /* *** GET TABLE INDEX FROM LEADING 15 BITS OF J*** */ kk = j >> 5; /* *** SET BIT L IN W(Kk) *** */ /* L3: */ w[kk] |= mbit[l]; } /* ********** COUNT NUMBER OF EMPTY CEL LS ******* */ kount = 0; for (kk = 0; kk <= 32767; ++kk) { for (l = 0; l <= 31; ++l) { /* L4: */ if ((w[kk] & mbit[l]) == 0) { ++kount; } } } /* ****END OF MAIN LOOP**** */ x = (kount - true) / sigs[jk - 1]; s_wsfe(&io___276); do_fio(&c__1, ctest + (index - 1 << 2), 4L); do_fio(&c__1, filename, 25L); i__4 = 33 - 20 / k - kr; do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer)); i__3 = 32 - kr; do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L2: */ s_wsfe(&io___277); do_fio(&c__1, ctest + (index - 1 << 2), 4L); do_fio(&c__1, filename, 25L); i__4 = 33 - 20 / k - kr; do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer)); i__3 = 32 - kr; do_fio(&c__1, (char *)&i__3, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&kount, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&x, (ftnlen)sizeof(real)); r__1 = phi_(&x); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); } jkk = jkreset_(); /* L2001: */ } } } s_wsfe(&io___278); e_wsfe(); s_wsfe(&io___279); e_wsfe(); return 0; } /* cdomso_ */ /* Subroutine */ int base5_(w) integer *w; { /* Format strings */ static char fmt_21[] = "(i12,i3,4i1)"; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ static integer i, j, l[5]; /* Fortran I/O blocks */ static cilist io___283 = { 0, 6, 0, fmt_21, 0 }; j = *w; for (i = 4; i >= 0; --i) { l[i] = j % 5; /* L2: */ j /= 5; } s_wsfe(&io___283); do_fio(&c__1, (char *)&(*w), (ftnlen)sizeof(integer)); do_fio(&c__5, (char *)&l[0], (ftnlen)sizeof(integer)); e_wsfe(); return 0; } /* base5_ */ /* Subroutine */ int wknt1s_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static integer p[5] = { 37,56,70,56,37 }; static integer k[256] = { 0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,2,0,0,0,1,0,1,1,2, 0,1,1,2,1,2,2,3,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1, 2,2,3,2,3,3,4,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1,2, 2,3,2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3, 4,3,4,4,4,0,0,0,1,0,1,1,2,0,1,1,2,1,2,2,3,0,1,1,2,1,2,2,3,1,2,2,3, 2,3,3,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3, 4,4,4,0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4, 4,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,4,2,3,3,4,3,4,4,4,3,4,4,4,4,4,4, 4 }; /* Format strings */ static char fmt_2345[] = "(\002 Test results for \002,a15)"; static char fmt_819[] = "(\002 Chi-square with 5^5-5^4=2500 d.of f. for \ sample size:\002,i7,/,9x,\002 chisquare equiv normal p valu\ e\002)"; static char fmt_821[] = "(\002 bits \002,i2,\002 to \002,i2,f9\ .2,f11.3,f13.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); double sqrt(); integer s_wsle(), do_lio(), e_wsle(); /* Local variables */ extern integer jtbl_(); static real chsq, e; static integer i, j, n, s[625], t[3125], w; static real z; static integer i1, i2; static real q4, q5; static integer ii, jk, jkk; extern doublereal phi_(); extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___287 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___303 = { 0, 3, 0, fmt_819, 0 }; static cilist io___304 = { 0, 6, 0, fmt_819, 0 }; static cilist io___305 = { 0, 6, 0, 0, 0 }; static cilist io___306 = { 0, 3, 0, 0, 0 }; static cilist io___307 = { 0, 3, 0, fmt_821, 0 }; static cilist io___308 = { 0, 6, 0, fmt_821, 0 }; static cilist io___309 = { 0, 6, 0, fmt_489, 0 }; static cilist io___310 = { 0, 3, 0, fmt_489, 0 }; /* OBC: overlapping-bit-count in specified bytes */ /* ******one-line function to return no. of 1's in 8 random bits */ /* ******that is, this function provides a random keystoke, unequal p's. */ n = 10; s_wsfe(&io___287); do_fio(&c__1, filename, 25L); e_wsfe(); for (jk = 1; jk <= 25; ++jk) { jkk = jkreset_(); for (i = 0; i <= 624; ++i) { /* L64: */ s[i] = 0; } for (i = 0; i <= 3124; ++i) { /* L65: */ t[i] = 0; } /* ***** generate initial word with 5 random keystrokes: */ /* L127: */ w = k[jtbl_() >> 25 - jk & 255] * 625 + k[jtbl_() >> 25 - jk & 255] * 125 + k[jtbl_() >> 25 - jk & 255] * 25 + k[jtbl_() >> 25 - jk & 255] * 5 + k[jtbl_() >> 25 - jk & 255]; for (i1 = 1; i1 <= 25600; ++i1) { i__1 = n; for (i2 = 1; i2 <= i__1; ++i2) { /* ******Erase leftmost letter of w: */ w %= 625; /* ******Boost count for that 4-letter word: */ ++s[w]; /* ******Shift w left, add new letter, boost 5-letter word cou nt: */ w = w * 5 + k[jtbl_() >> 25 - jk & 255]; ++t[w]; /* L2: */ } } /* **** Find q4: sum(obs-exp)**2/exp for 4-letter words */ q4 = (float)0.; for (ii = 0; ii <= 624; ++ii) { i = ii; e = (real) (n * 25600); for (j = 1; j <= 4; ++j) { e = e * p[i % 5] * (float).00390625; /* L41: */ i /= 5; } /* L4: */ /* Computing 2nd power */ r__1 = s[ii] - e; q4 += r__1 * r__1 / e; } /* **** Find q5: sum(obs-exp)**2/exp for 5-letter words */ q5 = (float)0.; for (ii = 0; ii <= 3124; ++ii) { i = ii; e = (real) (n * 25600); for (j = 1; j <= 5; ++j) { e = e * p[i % 5] * (float).00390625; /* L51: */ i /= 5; } /* L5: */ /* Computing 2nd power */ r__1 = t[ii] - e; q5 += r__1 * r__1 / e; } chsq = q5 - q4; z = (chsq - (float)2500.) / sqrt((float)5e3); if (jk == 1) { s_wsfe(&io___303); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___304); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsle(&io___305); do_lio(&c__9, &c__1, " Results for COUNT-THE 1's in specified b\ ytes:", 47L); e_wsle(); s_wsle(&io___306); do_lio(&c__9, &c__1, " Results for COUNT-THE-1's in specified by\ tes:", 46L); e_wsle(); } s_wsfe(&io___307); do_fio(&c__1, (char *)&jk, (ftnlen)sizeof(integer)); i__1 = jk + 7; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___308); do_fio(&c__1, (char *)&jk, (ftnlen)sizeof(integer)); i__1 = jk + 7; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L888: */ jkk = jkreset_(); } s_wsfe(&io___309); e_wsfe(); s_wsfe(&io___310); e_wsfe(); return 0; } /* wknt1s_ */ /* Subroutine */ int cdbinrnk_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static char rk[6*3+1] = " r<=4 r =5 r =6 "; static real p[5] = { (float)1.49858e-7,(float)8.08926e-5,(float).00936197, (float).217439,(float).773118 }; /* Format strings */ static char fmt_37[] = "(\002 Binary Rank Test for \002,a15)"; static char fmt_371[] = "(\002 Rank of a 6x8 binary matrix,\002\ ,/,\002 rows formed from eight bits of the RNG \002,a15)"; static char fmt_27[] = "(\002 b-rank test for bits \002,i2,\002 to\ \002,i2)"; static char fmt_372[] = "(15x,\002 OBSERVED EXPECTED (O-E)^2/\ E SUM\002)"; static char fmt_29[] = "(6x,a9,i12,f12.1,f12.3,f12.3)"; static char fmt_23[] = "(12x,\002 p=1-exp(-SUM/2)=\002,f7.5)"; static char fmt_373[] = "(\002 TEST SUMMARY, 25 tests on 100,000 rando\ m 6x8 matrices\002,/,\002 These should be 25 uniform [0,1] random variables\ :\002)"; static char fmt_21[] = "(5f12.6)"; static char fmt_2345[] = "(\002 brank test summary for \002,a15,/,\002\ The KS test for those 25 supposed UNI's yields\002)"; static char fmt_31[] = "(\002 KS p-value=\002,f8.6)"; static char fmt_312[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); double exp(); /* Local variables */ extern integer jtbl_(); static real e; static integer i, k[5], l, r[6]; static real s, t; extern integer rankb_(); extern /* Subroutine */ int asort_(); static integer ij, kk, kr, mr; static real pp[26]; extern /* Subroutine */ int kstest_(); static integer jkk; static real pks; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___313 = { 0, 3, 0, fmt_37, 0 }; static cilist io___314 = { 0, 6, 0, fmt_37, 0 }; static cilist io___317 = { 0, 6, 0, fmt_371, 0 }; static cilist io___318 = { 0, 3, 0, fmt_371, 0 }; static cilist io___322 = { 0, 6, 0, fmt_27, 0 }; static cilist io___323 = { 0, 3, 0, fmt_27, 0 }; static cilist io___324 = { 0, 6, 0, fmt_372, 0 }; static cilist io___325 = { 0, 3, 0, fmt_372, 0 }; static cilist io___333 = { 0, 3, 0, fmt_29, 0 }; static cilist io___334 = { 0, 6, 0, fmt_29, 0 }; static cilist io___336 = { 0, 6, 0, fmt_23, 0 }; static cilist io___337 = { 0, 3, 0, fmt_23, 0 }; static cilist io___338 = { 0, 6, 0, fmt_373, 0 }; static cilist io___339 = { 0, 3, 0, fmt_373, 0 }; static cilist io___340 = { 0, 6, 0, fmt_21, 0 }; static cilist io___341 = { 0, 3, 0, fmt_21, 0 }; static cilist io___342 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___343 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___345 = { 0, 6, 0, fmt_31, 0 }; static cilist io___346 = { 0, 3, 0, fmt_31, 0 }; static cilist io___347 = { 0, 6, 0, fmt_312, 0 }; static cilist io___348 = { 0, 3, 0, fmt_312, 0 }; /* *******Test ranks of 100,000 6x8 binary matrices************** */ /* *******Each row a byte from a RNG, overlapping rows************* */ /* *** rank 2 to 6 with prob p(2),...,p(6); 2,3,4 pooled. */ /* ************ one-line function to get random byte:************* */ s_wsfe(&io___313); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___314); do_fio(&c__1, filename, 25L); e_wsfe(); /* L371: */ for (ij = 25; ij >= 1; --ij) { jkk = jkreset_(); s_wsfe(&io___317); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___318); do_fio(&c__1, filename, 25L); e_wsfe(); kr = ij - 1; for (kk = 2; kk <= 6; ++kk) { /* L88: */ k[kk - 2] = 0; } s_wsfe(&io___322); i__1 = 25 - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___323); i__1 = 25 - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___324); e_wsfe(); s_wsfe(&io___325); e_wsfe(); for (l = 1; l <= 100000; ++l) { for (i = 1; i <= 6; ++i) { /* L1: */ r[i - 1] = jtbl_() >> kr & 255; } /* Computing MAX */ i__1 = 4, i__2 = rankb_(r, &c__6, &c__8); mr = max(i__1,i__2); /* L2: */ ++k[mr - 2]; } s = (float)0.; for (l = 4; l <= 6; ++l) { if (l > 4) { e = p[l - 2] * 100000; } else { e = (p[0] + p[1] + p[2]) * 100000; } /* Computing 2nd power */ r__1 = k[l - 2] - e; t = r__1 * r__1 / e; s += t; s_wsfe(&io___333); do_fio(&c__1, rk + (l - 4) * 6, 6L); do_fio(&c__1, (char *)&k[l - 2], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = k[l - 2] - e; r__1 = r__2 * r__2 / e; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); /* L5: */ s_wsfe(&io___334); do_fio(&c__1, rk + (l - 4) * 6, 6L); do_fio(&c__1, (char *)&k[l - 2], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); /* Computing 2nd power */ r__2 = k[l - 2] - e; r__1 = r__2 * r__2 / e; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); } pp[kr] = (float)1. - exp(-(doublereal)s / 2); s_wsfe(&io___336); do_fio(&c__1, (char *)&pp[kr], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___337); do_fio(&c__1, (char *)&pp[kr], (ftnlen)sizeof(real)); e_wsfe(); /* L55: */ jkk = jkreset_(); } s_wsfe(&io___338); e_wsfe(); s_wsfe(&io___339); e_wsfe(); s_wsfe(&io___340); for (i = 24; i >= 0; --i) { do_fio(&c__1, (char *)&pp[i], (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___341); for (i = 24; i >= 0; --i) { do_fio(&c__1, (char *)&pp[i], (ftnlen)sizeof(real)); } e_wsfe(); asort_(pp, &c__25); s_wsfe(&io___342); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___343); do_fio(&c__1, filename, 25L); e_wsfe(); kstest_(pp, &c__25, &pks); s_wsfe(&io___345); do_fio(&c__1, (char *)&pks, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___346); do_fio(&c__1, (char *)&pks, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___347); e_wsfe(); s_wsfe(&io___348); e_wsfe(); return 0; } /* cdbinrnk_ */ integer rankb_(r, m, n) integer *r, *m, *n; { /* Initialized data */ static integer msk[31] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096, 8192,16384,32768,65536,131072,262144,524288,1048576,2097152, 4194304,8388608,16777216,33554432,67108864,134217728,268435456, 536870912,1073741824 }; /* System generated locals */ integer ret_val, i__1, i__2; /* Local variables */ static integer i, j, k, x, ii; /* Parameter adjustments */ --r; /* Function Body */ ret_val = 0; j = *n; i = 1; L33: i__1 = *m; for (ii = i; ii <= i__1; ++ii) { if ((r[ii] & msk[j - 1]) == msk[j - 1]) { x = r[ii]; r[ii] = r[i]; r[i] = x; i__2 = *m; for (k = i + 1; k <= i__2; ++k) { /* L13: */ if ((r[k] & msk[j - 1]) == msk[j - 1]) { r[k] ^= x; } } ++ret_val; if (i == *m || j == 1) { return ret_val; } --j; ++i; goto L33; } /* L3: */ } --j; if (j == 0) { return ret_val; } goto L33; } /* rankb_ */ /* Subroutine */ int rank3132_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real p[4] = { (float).2887880952,(float).5775761902,(float) .1283502644,(float).0052854502 }; /* Format strings */ static char fmt_2345[] = "(\002 Binary rank test for \002,a15)"; static char fmt_29[] = "(7x,\002 Rank test for \002,i2,\002x\002,i2,\ \002 binary matrices:\002)"; static char fmt_291[] = "(7x,\002 rows from leftmost \002,i2,\002 bits o\ f each 32-bit integer\002)"; static char fmt_2457[] = "(\002 rank observed expected (o-e)^2/e\ sum\002)"; static char fmt_22[] = "(2i10,f10.1,f10.6,f9.3)"; static char fmt_23[] = "(\002 chisquare=\002,f6.3,\002 for 3 d. of f.; \ p-value=\002,f8.6,/,\002----------------------------------------------------\ ----------\002)"; static char fmt_2348[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ extern integer rank_(), jtbl_(); static integer ntry; static real d, e; static integer i, k, m, n; static real s; extern doublereal chisq_(); static integer ij, ntries, jkk, tbl[4], row[32]; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___359 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___360 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___361 = { 0, 6, 0, fmt_29, 0 }; static cilist io___362 = { 0, 3, 0, fmt_29, 0 }; static cilist io___363 = { 0, 6, 0, fmt_291, 0 }; static cilist io___364 = { 0, 3, 0, fmt_291, 0 }; static cilist io___373 = { 0, 6, 0, fmt_2457, 0 }; static cilist io___374 = { 0, 3, 0, fmt_2457, 0 }; static cilist io___377 = { 0, 3, 0, fmt_22, 0 }; static cilist io___378 = { 0, 6, 0, fmt_22, 0 }; static cilist io___379 = { 0, 6, 0, fmt_23, 0 }; static cilist io___380 = { 0, 3, 0, fmt_23, 0 }; static cilist io___381 = { 0, 6, 0, fmt_2348, 0 }; static cilist io___382 = { 0, 3, 0, fmt_2348, 0 }; /* see original file \f\bprint.for that displays each step in the */ /* rank reduction. */ /* finds rank of 31x31 and 32x32 matrices. */ /* For the 31x31, uses 31 leftmost bits of a 32-bit integer */ /* to form a row of the binary matrix. */ /* For the 32x32, uses 32 full integer words for each of 32 rows */ /* function mrank(r,m,n) */ /* for nxn matrices, to at least 6 places, */ /* the probability of rank n-2,n-1,n are all virtually the same. */ /* r p */ /* <=29 .0052854502 */ /* 30 .1283502644 */ /* 31 .5775761902 */ /* 32 .2887880952 */ /* c**** Finds binary rank of m rows, n trailing bits each********** */ /* L11: */ for (m = 31; m <= 32; ++m) { jkk = jkreset_(); n = m; s_wsfe(&io___359); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___360); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___361); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___362); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___363); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___364); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); e_wsfe(); for (i = 0; i <= 3; ++i) { /* L71: */ tbl[i] = 0; } /* L9: */ ntries = 40000; i__1 = ntries; for (ij = 1; ij <= i__1; ++ij) { i__2 = m; for (i = 1; i <= i__2; ++i) { /* L42: */ row[i - 1] = jtbl_() >> 32 - m; } ++ntry; /* Computing MIN */ i__2 = n - rank_(row, &m, &n); k = min(i__2,3); ++tbl[k]; /* L888: */ } s = (float)0.; s_wsfe(&io___373); e_wsfe(); s_wsfe(&io___374); e_wsfe(); for (i = 3; i >= 0; --i) { e = p[i] * ntries; /* Computing 2nd power */ r__1 = tbl[i] - e; d = r__1 * r__1 / e; s += d; s_wsfe(&io___377); i__1 = n - i; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&tbl[i], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); /* L7: */ s_wsfe(&io___378); i__1 = n - i; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&tbl[i], (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&e, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&d, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___379); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); r__1 = chisq_(&s, &c__3); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___380); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); r__1 = chisq_(&s, &c__3); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); /* L999: */ } jkk = jkreset_(); jkk = jkreset_(); s_wsfe(&io___381); e_wsfe(); s_wsfe(&io___382); e_wsfe(); return 0; } /* rank3132_ */ integer rank_(r, m, n) integer *r, *m, *n; { /* Initialized data */ static integer msk[32] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096, 8192,16384,32768,65536,131072,262144,524288,1048576,2097152, 4194304,8388608,16777216,33554432,67108864,134217728,268435456, 536870912 }; /* System generated locals */ integer ret_val, i__1, i__2; /* Local variables */ static integer i, j, k, x, ii; /* Parameter adjustments */ --r; /* Function Body */ msk[30] = msk[29] << 1; msk[31] = -2147483648; ret_val = 0; j = *n; i = 1; L33: /* 33 call mprint(r,m,n) */ /* ***** find row that starts with a 1 in current column (33-j) */ i__1 = *m; for (ii = i; ii <= i__1; ++ii) { if ((r[ii] & msk[j - 1]) == msk[j - 1]) { x = r[ii]; r[ii] = r[i]; r[i] = x; i__2 = *m; for (k = i + 1; k <= i__2; ++k) { /* L13: */ if ((r[k] & msk[j - 1]) == msk[j - 1]) { r[k] ^= x; } } ++ret_val; /* print*,' good row',rank,i,x */ if (i == *m || j == 1) { return ret_val; } --j; ++i; goto L33; } /* L3: */ } --j; if (j == 0) { return ret_val; } goto L33; } /* rank_ */ /* Subroutine */ int cdbday_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_22[] = "(\002 BIRTHDAY SPACINGS TEST, M=\002,i4,\002 N=2\ **\002,i2,\002 LAMBDA=\002,f8.4)"; static char fmt_2345[] = "(\002 Results for \002,a15)"; static char fmt_432[] = "(17x,\002 For a sample of size\002,i4,\002: \ mean \002)"; static char fmt_331[] = "(10x,a16,\002 using bits \002,i2,\002 to \002,i\ 2,f8.3,f10.6)"; static char fmt_652[] = "(\002 The 9 p-values were\002,/,f15.6,4f10.6,\ /,f15.6,4f10.6)"; static char fmt_38[] = "(\002 A KSTEST for the 9 p-values yields \002,f\ 8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1, i__2; real r__1, r__2; /* Builtin functions */ double pow_di(); integer s_wsfe(), do_fio(), e_wsfe(), pow_ii(); /* Local variables */ static real alam; static integer mask; extern integer jtbl_(); static integer b[4096], c[4096], i, j, l, m; static real s; static integer nbits; extern /* Subroutine */ int isort_(); static integer jb, lk, im, is, kr; static real pp; static integer lw, mspace[1000], nsampl; extern /* Subroutine */ int chsqts_(), kstest_(); static integer jkk; static real pks[64]; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___394 = { 0, 6, 0, fmt_22, 0 }; static cilist io___395 = { 0, 3, 0, fmt_22, 0 }; static cilist io___396 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___397 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___411 = { 0, 3, 0, fmt_432, 0 }; static cilist io___412 = { 0, 6, 0, fmt_432, 0 }; static cilist io___413 = { 0, 3, 0, fmt_331, 0 }; static cilist io___414 = { 0, 6, 0, fmt_331, 0 }; static cilist io___417 = { 0, 6, 0, fmt_652, 0 }; static cilist io___419 = { 0, 3, 0, fmt_652, 0 }; static cilist io___420 = { 0, 6, 0, fmt_38, 0 }; static cilist io___421 = { 0, 3, 0, fmt_38, 0 }; static cilist io___422 = { 0, 6, 0, fmt_489, 0 }; static cilist io___423 = { 0, 3, 0, fmt_489, 0 }; /* PROGRAM BDAYTST */ /* A PROGRAM TO DO THE BIRTHDAY-SPACINGS TEST ON NBITS OF A UNI */ lw = 32; nbits = 24; m = 512; nsampl = 500; /* Computing 3rd power */ r__1 = m + (float)0., r__2 = r__1; i__1 = nbits + 2; alam = r__2 * (r__1 * r__1) / pow_di(&c_b513, &i__1); s_wsfe(&io___394); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nbits, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&alam, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___395); do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&nbits, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&alam, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___396); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___397); do_fio(&c__1, filename, 25L); e_wsfe(); /* is=lw-nbits */ is = 8; i__1 = nbits - 1; i__2 = nbits - 1; mask = pow_ii(&c__2, &i__1) + pow_ii(&c__2, &i__2) - 1; for (kr = 32 - nbits; kr >= 0; --kr) { s = (float)0.; jkk = jkreset_(); i__1 = nsampl; for (j = 1; j <= i__1; ++j) { i__2 = m; for (i = 1; i <= i__2; ++i) { jb = jtbl_(); /* L2: */ b[i - 1] = jb >> kr & mask; } /* L9: */ isort_(b, &m); c[0] = b[0]; i__2 = m; for (i = 2; i <= i__2; ++i) { /* L3: */ c[i - 1] = b[i - 1] - b[i - 2]; } isort_(c, &m); l = 0; i__2 = m; for (i = 2; i <= i__2; ++i) { lk = 0; if (c[i - 1] != c[i - 2]) { goto L4; } ++lk; ++l; L4: ; } s += l; /* L1: */ mspace[j - 1] = l; } s_wsfe(&io___411); do_fio(&c__1, (char *)&nsampl, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___412); do_fio(&c__1, (char *)&nsampl, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___413); do_fio(&c__1, filename, 25L); i__1 = 33 - nbits - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); r__1 = s / nsampl; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___414); do_fio(&c__1, filename, 25L); i__1 = 33 - nbits - kr; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); i__2 = 32 - kr; do_fio(&c__1, (char *)&i__2, (ftnlen)sizeof(integer)); r__1 = s / nsampl; do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); chsqts_(&alam, mspace, &nsampl, &pp); pks[9 - kr - 1] = pp; jkk = jkreset_(); /* L2001: */ } s_wsfe(&io___417); for (im = 1; im <= 9; ++im) { do_fio(&c__1, (char *)&pks[im - 1], (ftnlen)sizeof(real)); } e_wsfe(); s_wsfe(&io___419); for (im = 1; im <= 9; ++im) { do_fio(&c__1, (char *)&pks[im - 1], (ftnlen)sizeof(real)); } e_wsfe(); kstest_(pks, &c__9, &pp); s_wsfe(&io___420); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___421); do_fio(&c__1, (char *)&pp, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___422); e_wsfe(); s_wsfe(&io___423); e_wsfe(); return 0; } /* cdbday_ */ /* A SUBROUTINE TO DO A CHISQUARE TEST ON N VALUES FROM */ /* A DISCRETE DISTRIBUTION. SET UP FOR POISSON. CHANGE P'S FOR OTHERS. */ /* REQUIRES ARRAY MSPACE(NSAMPL) THAT GIVES NO. OF DUPLICATE SPACINGS */ /* IN EACH OF NSAMPL YEARS. */ /* Subroutine */ int chsqts_(lambda, mspace, nsampl, pp) real *lambda; integer *mspace, *nsampl; real *pp; { /* Format strings */ static char fmt_28[] = "(\002 \002,i2,\002 to \002,i2,f13.0,f13.3)"; static char fmt_29[] = "(3x,i6,f13.0,f13.3)"; static char fmt_27[] = "(\002 \002,i2,\002 to INF\002,f12.0,f13.3)"; static char fmt_31[] = "(\002 Chisquare with \002,i2,\002 d.o.f. = \002,\ f8.2,\002 p-value= \002,f8.6)"; /* System generated locals */ integer i__1, i__2; real r__1; /* Builtin functions */ double sqrt(), exp(); integer s_wsle(), do_lio(), e_wsle(), s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ static integer i, j, k[501], l, m; static real p, s; extern doublereal chisq_(); static integer lb; static real ex[501]; static integer lt; static real ps[501], obs[501]; /* Fortran I/O blocks */ static cilist io___435 = { 0, 3, 0, 0, 0 }; static cilist io___436 = { 0, 3, 0, 0, 0 }; static cilist io___437 = { 0, 6, 0, 0, 0 }; static cilist io___438 = { 0, 6, 0, 0, 0 }; static cilist io___440 = { 0, 6, 0, fmt_28, 0 }; static cilist io___441 = { 0, 3, 0, fmt_28, 0 }; static cilist io___442 = { 0, 6, 0, fmt_29, 0 }; static cilist io___443 = { 0, 3, 0, fmt_29, 0 }; static cilist io___444 = { 0, 6, 0, fmt_27, 0 }; static cilist io___445 = { 0, 3, 0, fmt_27, 0 }; static cilist io___446 = { 0, 6, 0, fmt_31, 0 }; static cilist io___447 = { 0, 3, 0, fmt_31, 0 }; static cilist io___448 = { 0, 3, 0, 0, 0 }; static cilist io___449 = { 0, 6, 0, 0, 0 }; /* Parameter adjustments */ --mspace; /* Function Body */ i__1 = *lambda + sqrt(*lambda) * 4; for (i = 0; i <= i__1; ++i) { ex[i] = (float)0.; k[i] = 0; /* L18: */ ps[i] = (float)0.; } p = exp(-(doublereal)(*lambda)); ps[0] = p * *nsampl; k[0] = 0; j = 0; s = p * *nsampl; if (s > (float)5.) { j = 1; ex[0] = s; s = (float)0.; } i__1 = *lambda + sqrt(*lambda) * 4; for (i = 1; i <= i__1; ++i) { p = *lambda * p / i; ps[i] = ps[i - 1] + p * *nsampl; s += p * *nsampl; k[i] = j; if (ps[i] > (real) (*nsampl - 5)) { ex[j] = s + *nsampl - ps[i]; i__2 = *nsampl; for (l = i + 1; l <= i__2; ++l) { /* L874: */ k[l] = j; } goto L12; } if (s < (float)5.) { goto L2; } ex[j] = s; ++j; s = (float)0.; L2: ; } L12: for (i = 0; i <= 100; ++i) { /* L42: */ obs[i] = (float)0.; } i__1 = *nsampl; for (i = 1; i <= i__1; ++i) { l = k[mspace[i]]; /* L43: */ obs[l] += 1; } s = (float)0.; i__1 = j; for (m = 0; m <= i__1; ++m) { /* L44: */ /* Computing 2nd power */ r__1 = obs[m] - ex[m]; s += r__1 * r__1 / ex[m]; } lb = 0; m = k[0]; s_wsle(&io___435); do_lio(&c__9, &c__1, " duplicate ", 11L); do_lio(&c__9, &c__1, " number number ", 26L); e_wsle(); s_wsle(&io___436); do_lio(&c__9, &c__1, " spacings ", 11L); do_lio(&c__9, &c__1, " observed expected", 26L); e_wsle(); s_wsle(&io___437); do_lio(&c__9, &c__1, " duplicate ", 11L); do_lio(&c__9, &c__1, " number number ", 26L); e_wsle(); s_wsle(&io___438); do_lio(&c__9, &c__1, " spacings ", 11L); do_lio(&c__9, &c__1, " observed expected", 26L); e_wsle(); for (i = 1; i <= 100; ++i) { if (k[i] == m) { goto L62; } lt = i - 1; if (lb != lt) { s_wsfe(&io___440); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)<, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb != lt) { s_wsfe(&io___441); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)<, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb == lt) { s_wsfe(&io___442); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } if (lb == lt) { s_wsfe(&io___443); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); } m = k[i]; lb = i; if (m == j) { goto L63; } L62: ; } L63: s_wsfe(&io___444); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___445); do_fio(&c__1, (char *)&lb, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&obs[m], (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&ex[m], (ftnlen)sizeof(real)); e_wsfe(); *pp = chisq_(&s, &j); s_wsfe(&io___446); do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&(*pp), (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___447); do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&(*pp), (ftnlen)sizeof(real)); e_wsfe(); s_wsle(&io___448); do_lio(&c__9, &c__1, " :::::::::::::::::::::::::::::::::::::::::", 42L); e_wsle(); s_wsle(&io___449); do_lio(&c__9, &c__1, " :::::::::::::::::::::::::::::::::::::::::", 42L); e_wsle(); /* print 32,pp */ /* write(3,32) pp */ /* 32 format(' UNI = ',f8.5,' (Probability of a better fit.)') */ return 0; } /* chsqts_ */ /* Subroutine */ int cdosum_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static real f[101] = { (float)0.,(float).0017,(float).0132,(float).027,( float).0406,(float).0538,(float).0665,(float).0787,(float).0905,( float).102,(float).1133,(float).1242,(float).1349,(float).1454,( float).1557,(float).1659,(float).176,(float).1859,(float).1957,( float).2054,(float).215,(float).2246,(float).2341,(float).2436,( float).253,(float).2623,(float).2716,(float).2809,(float).2902,( float).2995,(float).3087,(float).318,(float).3273,(float).3366,( float).3459,(float).3552,(float).3645,(float).3739,(float).3833,( float).3928,(float).4023,(float).4118,(float).4213,(float).4309,( float).4406,(float).4504,(float).4602,(float).4701,(float).48,( float).49,(float).5,(float).51,(float).5199,(float).5299,(float) .5397,(float).5495,(float).5593,(float).569,(float).5787,(float) .5882,(float).5978,(float).6073,(float).6167,(float).626,(float) .6354,(float).6447,(float).654,(float).6632,(float).6724,(float) .6817,(float).691,(float).7003,(float).7096,(float).7189,(float) .7282,(float).7375,(float).7468,(float).7562,(float).7657,(float) .7752,(float).7848,(float).7944,(float).8041,(float).814,(float) .8239,(float).834,(float).8442,(float).8545,(float).865,(float) .8757,(float).8867,(float).898,(float).9095,(float).9214,(float) .9337,(float).9464,(float).9595,(float).9731,(float).9868,(float) .9983,(float)1. }; /* Format strings */ static char fmt_39[] = "(15x,\002 Test no. \002,i2,\002 p-value \ \002,2f8.6)"; static char fmt_2345[] = "(\002 Results of the OSUM test for \002,a15)"; static char fmt_27[] = "(7x,\002 KSTEST on the above 10 p-values: \002,2\ f8.6)"; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1, r__2; /* Builtin functions */ double sqrt(); integer s_wsfe(), do_fio(), e_wsfe(); /* Local variables */ extern integer jtbl_(); static real qmax, a, b, h; static integer i, j, m; static real p, s, t[199], u[100], w[10], x[100], y[100]; static integer ij, ik; static real pk, qq; extern /* Subroutine */ int kstest_(); static integer jkk; extern doublereal phi_(); extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___470 = { 0, 6, 0, fmt_39, 0 }; static cilist io___471 = { 0, 3, 0, fmt_39, 0 }; static cilist io___472 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___473 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___474 = { 0, 3, 0, fmt_27, 0 }; static cilist io___475 = { 0, 6, 0, fmt_27, 0 }; static cilist io___476 = { 0, 6, 0, fmt_489, 0 }; static cilist io___477 = { 0, 3, 0, fmt_489, 0 }; m = 100; jkk = jkreset_(); /* L11: */ for (ik = 1; ik <= 10; ++ik) { qmax = (float)0.; for (ij = 1; ij <= 100; ++ij) { s = (float)0.; for (i = 1; i <= 199; ++i) { t[i - 1] = jtbl_() * (float)8.06549e-10; /* L2: */ if (i <= m) { s += t[i - 1]; } } y[0] = s; i__1 = m; for (j = 2; j <= i__1; ++j) { /* L3: */ y[j - 1] = y[j - 2] - t[j - 2] + t[m + j - 2]; } /* ***now y(j)=z(j)+...+z(99+j) */ /* *** They are virtually normal, mean 0, variance 100, but correl ated. */ /* **** Now a matrix transformation of the y's: x=yM, will make th e */ /* *** x's independent normal. */ /* ***The y's covariance matrix T is Toeplitz with diagonals 100,9 9,...2,1 */ /* ***A Cholesky factorization of T: V'V=T provides M=V^(-1). The */ /* ***covariance of x=yM is M'TM=I. */ /* *** The columns of M have at most 3 non-zero elements. */ x[0] = y[0] / sqrt(m + (float)0.); x[1] = -(doublereal)(m - (float)1.) * y[0] / sqrt(m * (m + m - ( float)1.)) + y[1] * sqrt(m / (m + m - (float)1.)); /* Computing 2nd power */ r__1 = x[0]; /* Computing 2nd power */ r__2 = x[1]; qq = r__1 * r__1 + r__2 * r__2; i__1 = m; for (i = 3; i <= i__1; ++i) { a = (real) (m + m + 2 - i); b = (real) ((m << 2) + 2 - i - i); x[i - 1] = y[0] / sqrt(a * b) - sqrt((a - (float)1.) / (b + ( float)2.)) * y[i - 2] + sqrt(a / b) * y[i - 1]; /* L4: */ /* Computing 2nd power */ r__1 = x[i - 1]; qq += r__1 * r__1; } /* ****now the x's are a bunch of iid rnors with mean 0, variance 1. */ /* ***Does sum(x(i)^2) behave as chisquare with m deg. freedom? */ /* ****now convert x(1),...,x(m) to uni's. */ i__1 = m; for (i = 1; i <= i__1; ++i) { p = phi_(&x[i - 1]); h = p * (float)100.; j = h; /* L7: */ x[i - 1] = f[j] + (h - j) * (f[j + 1] - f[j]); } /* ***test to see if the transformed x's are uniforms. */ kstest_(x, &m, &p); /* L88: */ u[ij - 1] = p; } /* ***Now do a KSTEST on the 100 p's from the tests for normality. */ kstest_(u, &c__100, &pk); /* ***And a KSTEST on the 100 p's from the chisquare tests. */ /* call kstest(uu,100,pq) */ w[ik - 1] = pk; /* uq(ik)=pq */ s_wsfe(&io___470); do_fio(&c__1, (char *)&ik, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&pk, (ftnlen)sizeof(real)); e_wsfe(); /* L89: */ s_wsfe(&io___471); do_fio(&c__1, (char *)&ik, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&pk, (ftnlen)sizeof(real)); e_wsfe(); } s_wsfe(&io___472); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___473); do_fio(&c__1, filename, 25L); e_wsfe(); /* &' Q p-value ',f8.6) */ kstest_(w, &c__10, &p); /* call kstest(uq,10,pq) */ s_wsfe(&io___474); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___475); do_fio(&c__1, (char *)&p, (ftnlen)sizeof(real)); e_wsfe(); jkk = jkreset_(); s_wsfe(&io___476); e_wsfe(); s_wsfe(&io___477); e_wsfe(); return 0; } /* cdosum_ */ /* ********dummy line */ /* ********dummy line */ /* ********dummy line */ integer jtbl8_() { /* Initialized data */ static integer j = 4097; static integer nleft = 0; static integer jk = 1; /* System generated locals */ integer ret_val; /* Builtin functions */ integer s_rdue(), do_uio(), e_rdue(); /* Local variables */ static integer b[4096], k; /* Fortran I/O blocks */ static cilist io___481 = { 0, 1, 0, 0, 0 }; if (j > 4096) { io___481.cirec = jk; s_rdue(&io___481); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); j = 1; ++jk; } if (nleft == 0) { k = b[j - 1]; ++j; nleft = 4; } ret_val = k >> 24 & 255; k <<= 8; --nleft; return ret_val; } /* jtbl8_ */ /* Subroutine */ int sknt1s_(filename, filename_len) char *filename; ftnlen filename_len; { /* Initialized data */ static integer p[5] = { 37,56,70,56,37 }; /* Format strings */ static char fmt_766[] = "(a80)"; static char fmt_2345[] = "(\002 Test results for \002,a15)"; static char fmt_819[] = "(\002 Chi-square with 5^5-5^4=2500 d.of f. for \ sample size:\002,i7,/,31x,\002chisquare equiv normal p-value\002)"; static char fmt_821[] = "(\002 byte stream for \002,a15,f9.2,f11.3,f13.6)" ; static char fmt_489[] = "(/,\002$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\ $$$$$$$$$$$$\002,/)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_clos(); double sqrt(); integer s_wsle(), do_lio(), e_wsle(); /* Local variables */ static real chsq; static char text[80*18]; extern integer jtbl8_(); static real e; static integer i, j, n, s[625], t[3125], w; static real z; static integer kbits[256], i1, i2; static real q4, q5; static integer ii, jj, jk, ks, jkk; extern doublereal phi_(); static real dum; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___485 = { 0, 4, 0, fmt_766, 0 }; static cilist io___488 = { 0, 4, 0, fmt_766, 0 }; static cilist io___490 = { 0, 6, 0, fmt_766, 0 }; static cilist io___491 = { 0, 3, 0, fmt_766, 0 }; static cilist io___498 = { 0, 3, 0, fmt_2345, 0 }; static cilist io___499 = { 0, 6, 0, fmt_2345, 0 }; static cilist io___512 = { 0, 6, 0, fmt_819, 0 }; static cilist io___513 = { 0, 3, 0, fmt_819, 0 }; static cilist io___514 = { 0, 6, 0, 0, 0 }; static cilist io___515 = { 0, 3, 0, 0, 0 }; static cilist io___516 = { 0, 3, 0, fmt_821, 0 }; static cilist io___517 = { 0, 6, 0, fmt_821, 0 }; static cilist io___518 = { 0, 6, 0, fmt_489, 0 }; static cilist io___519 = { 0, 3, 0, fmt_489, 0 }; /* OBC: overlapping-bit-count from stream of bytes */ /*******one-line function to return (truncated) no. of 1's in 8 random bit s*/ /* ******that is, this function provides a random keystoke, unequal p's. */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "tests.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___485); for (j = 1; j <= 113; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(real)); } e_rsfe(); s_rsfe(&io___488); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___490); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsfe(&io___491); for (j = 1; j <= 18; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); /*******Create kbits table: kbits(j)=truncated no of bits in j, -128<=j<=1 27*/ /*****Filename reads one byte at a time, as integer*1, so -128 to 127**** **/ for (jj = 0; jj <= 255; ++jj) { j = jj; ks = 0; for (i = 1; i <= 8; ++i) { ks += j & 1; /* L233: */ j = j >> 1; } if (ks < 2) { ks = 2; } if (ks > 6) { ks = 6; } /* L234: */ kbits[jj] = ks - 2; } n = 100; jkk = jkreset_(); s_wsfe(&io___498); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___499); do_fio(&c__1, filename, 25L); e_wsfe(); for (jk = 1; jk <= 2; ++jk) { for (i = 0; i <= 624; ++i) { /* L64: */ s[i] = 0; } for (i = 0; i <= 3124; ++i) { /* L65: */ t[i] = 0; } /* ***** generate initial word with 5 random keystrokes: */ /* L127: */ w = kbits[jtbl8_()] * 625 + kbits[jtbl8_()] * 125 + kbits[jtbl8_()] * 25 + kbits[jtbl8_()] * 5 + kbits[jtbl8_()]; i__1 = n; for (i2 = 1; i2 <= i__1; ++i2) { for (i1 = 1; i1 <= 25600; ++i1) { /* ******Erase leftmost letter of w: */ w %= 625; /* ******Boost count for that 4-letter word: */ ++s[w]; /* ******Shift w left, add new letter, boost 5-letter word cou nt: */ w = w * 5 + kbits[jtbl8_()]; ++t[w]; /* L2: */ } } /* **** Find q4: sum(obs-exp)^2/exp for 4-letter words */ q4 = (float)0.; for (ii = 0; ii <= 624; ++ii) { i = ii; e = (real) (n * 25600); for (j = 0; j <= 3; ++j) { e = e * p[i % 5] / (float)256.; /* L41: */ i /= 5; } /* L4: */ /* Computing 2nd power */ r__1 = s[ii] - e; q4 += r__1 * r__1 / e; } /* **** Find q5: sum(obs-exp)^2/exp for 5-letter words */ q5 = (float)0.; for (ii = 0; ii <= 3124; ++ii) { i = ii; e = (real) (n * 25600); for (j = 0; j <= 4; ++j) { e = e * p[i % 5] / (float)256.; /* L51: */ i /= 5; } /* L5: */ /* Computing 2nd power */ r__1 = t[ii] - e; q5 += r__1 * r__1 / e; } chsq = q5 - q4; z = (chsq - (float)2500.) / sqrt((float)5e3); if (jk == 1) { s_wsfe(&io___512); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsfe(&io___513); i__1 = n * 25600; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); s_wsle(&io___514); do_lio(&c__9, &c__1, " Results for COUNT-THE-1's in successive \ bytes:", 48L); e_wsle(); s_wsle(&io___515); do_lio(&c__9, &c__1, " Results fo COUNT-THE-1's in successive by\ tes:", 46L); e_wsle(); } s_wsfe(&io___516); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___517); do_fio(&c__1, filename, 25L); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&z, (ftnlen)sizeof(real)); r__1 = phi_(&z); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L888: */ } jkk = jkreset_(); s_wsfe(&io___518); e_wsfe(); s_wsfe(&io___519); e_wsfe(); return 0; } /* sknt1s_ */ /* Subroutine */ int asort_(list, n) real *list; integer *n; { static integer i, j, k, l, m; static real t; static integer ij, il[33], iu[33]; static real tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* asort_ */ /* Subroutine */ int isort_(list, n) integer *list, *n; { static integer i, j, k, l, m, t, ij, il[33], iu[33], tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* isort_ */ /* Subroutine */ int dsort_(list, n) doublereal *list; integer *n; { static integer i, j, k, l, m; static doublereal t; static integer ij, il[33], iu[33]; static doublereal tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* dsort_ */ /* Subroutine */ int kstest_(y, n, p) real *y; integer *n; real *p; { /* Initialized data */ static integer l[80] /* was [8][10] */ = { 40,46,37,34,27,24,20,20, 88,59,43,37,29,27,20,22,92,63,48,41,30,30,25,24,82,59,42,37,26,28, 26,22,62,48,33,30,23,23,22,18,49,34,22,20,16,17,17,12,17,17,7,8,4, 7,5,1,40,18,19,14,16,13,10,9,59,20,10,4,1,1,0,-1,41,43,36,112,15, 95,32,58 }; /* System generated locals */ integer i__1; /* Builtin functions */ double log(), exp(), sqrt(); /* Local variables */ static real a, e; static integer i, j, m; static real t, z; extern /* Subroutine */ int asort_(); extern doublereal sp_(); /* TO TEST WHETHER A SET OF N REAL NUMBERS IS DRAWN */ /* FROM A UNIFORM DISTRIBUTION (KOLMOROGOV-SMIRNOV METHOD) */ /* THE TEST IS BASED ON THE DISTANCE BETWEEN THE EMPIRICAL */ /* AND THEORETICAL DISTRIBUTION FUNCTIONS */ /* USAGE: CALL KSTEST(Y,N,P) */ /* Y ... ARRAY OF REAL NUMBERS HYPOTHETICALLY DRAWN */ /* FROM A UNIFORM DISTRIBUTION ON (0,1) */ /* N ... NUMBER OF ELEMENTS IN 'Y' */ /* P IS THE PROBABILITY ASSOCIATED WITH THE OBSERVED VALUE */ /* OF THE ANDERSON-DARLING STATISTIC: N TIMES THE INTEGRAL */ /* OF (FN(X)-X)**2/(X*(1-X)) */ /* Parameter adjustments */ --y; /* Function Body */ asort_(&y[1], n); z = -(*n) * (*n + (float)0.); i__1 = *n; for (i = 1; i <= i__1; ++i) { t = y[i] * ((float)1. - y[*n + 1 - i]); if (t < (float)1e-20) { t = (float)1e-20; } /* L2: */ z -= (i + i - 1) * log(t); } z /= *n; *p = (float)0.; if (z < (float).01) { goto L5; } if (z > (float)2.) { goto L3; } *p = exp((float)-1.2337 / z) * (float)2. * (z / (float)8. + (float)1. - z * (float).04958 * z / (z + (float)1.325)) / sqrt(z); goto L5; L3: if (z > (float)4.) { goto L4; } *p = (float)1. - exp(z * (float)-1.091638) * (float).6621361 - exp(z * ( float)-2.005138) * (float).95059; goto L5; L4: *p = (float)1. - exp(z * (float)-1.050321) * (float).4938691 - exp(z * ( float)-1.527198) * (float).5946335; L5: /* Computing MIN */ i__1 = *n - 2; m = min(i__1,8); e = (float)0.; for (j = 1; j <= 10; ++j) { /* L6: */ e += l[m + (j << 3) - 9] * sp_(p, &j) * (float)1e-4; } if (*n > 10) { e = e * (float)10. / *n; } a = *p + e; return 0; } /* kstest_ */ doublereal sp_(x, i) real *x; integer *i; { /* System generated locals */ real ret_val, r__1; /* Local variables */ static real t; ret_val = (float)0.; switch ((int)*i) { case 1: goto L7; case 2: goto L7; case 3: goto L7; case 4: goto L7; case 5: goto L7; case 6: goto L7; case 7: goto L7; case 8: goto L8; case 9: goto L9; case 10: goto L10; } L7: t = (r__1 = *x * (float)10. - (float).5 - *i, dabs(r__1)); if (t > (float)1.5) { return ret_val; } if (t <= (float).5) { ret_val = (float)1.5 - t * (float)2. * t; } else { ret_val = (float)2.25 - t * ((float)3. - t); } return ret_val; L8: if (*x <= (float).8 || *x >= (float)1.) { return ret_val; } /* Computing 2nd power */ r__1 = *x - (float).9; ret_val = r__1 * r__1 * (float)100. - (float)1.; return ret_val; L9: if (*x <= (float)0. || *x >= (float).05) { return ret_val; } if (*x <= (float).01) { ret_val = *x * (float)-100.; } else { ret_val = (*x - (float).05) * (float)25.; } return ret_val; L10: if (*x <= (float).98 || *x >= (float)1.) { return ret_val; } ret_val = (float).1 - (r__1 = *x - (float).99, dabs(r__1)) * (float)10.; return ret_val; } /* sp_ */ doublereal phi_(x) real *x; { /* Initialized data */ static doublereal v[15] = { 1.2533141373155,.6556795424187985, .4213692292880545,.3045902987101033,.2366523829135607, .1928081047153158,.1623776608968675,.1401041834530502, .1231319632579329,.1097872825783083,.09902859647173193, .09017567550106468,.08276628650136917,.0764757610162485, .07106958053885211 }; /* System generated locals */ integer i__1; real ret_val; doublereal d__1; /* Builtin functions */ double r_sign(), d_sign(), exp(); /* Local variables */ static doublereal cphi, a, b, h; static integer i, j; static doublereal z, sum, pwr; ret_val = r_sign(&c_b760, x) + (float).5; if (dabs(*x) > (float)7.) { return ret_val; } d__1 = *x; cphi = .5 - d_sign(&c_b761, &d__1); j = (integer) (dabs(*x) + .5); j = min(j,14); z = (doublereal) j; h = dabs(*x) - z; a = v[j]; b = z * a - 1.; pwr = 1.; sum = a + h * b; i__1 = 24 - j; for (i = 2; i <= i__1; i += 2) { a = (a + z * b) / i; b = (b + z * a) / (i + 1); /* Computing 2nd power */ d__1 = h; pwr *= d__1 * d__1; /* L2: */ sum += pwr * (a + h * b); } cphi = sum * exp(*x * -.5 * *x - .918938533204672); ret_val = 1. - cphi; if (*x < 0.) { ret_val = cphi; } return ret_val; } /* phi_ */ doublereal chisq_(x, n) real *x; integer *n; { /* System generated locals */ integer i__1, i__2; real ret_val, r__1, r__2; doublereal d__1; /* Builtin functions */ double pow_dd(), sqrt(), exp(); /* Local variables */ static real d; static integer i, l; static real s, t; extern doublereal phi_(); ret_val = (float)0.; if (*x <= (float)0.) { return ret_val; } if (*n > 20) { d__1 = (doublereal) (*x / *n); t = (pow_dd(&d__1, &c_b764) - 1 + (float).22222 / *n) / sqrt((float) .22222 / *n); r__1 = dmin(t,(float)8.); ret_val = phi_(&r__1); return ret_val; } l = 4 - *n % 2; /* Computing MIN */ i__1 = 1, i__2 = *n / 3; d = (real) min(i__1,i__2); i__1 = *n; for (i = l; i <= i__1; i += 2) { d = d * *x / (i - 2); ret_val += d; /* L2: */ } if (l == 3) { /* Computing MIN */ r__1 = *x * (float).5; s = sqrt((dmin(r__1,(float)50.))); r__1 = s / (float).7071068; /* Computing MIN */ r__2 = *x * (float).5; ret_val = phi_(&r__1) - exp(-(doublereal)dmin(r__2,(float)50.)) * ( float).564189 * ret_val / s; return ret_val; } /* Computing MIN */ r__1 = *x * (float).5; ret_val = (float)1. - exp(-(doublereal)dmin(r__1,(float)50.)) * (ret_val + (float)1.); return ret_val; } /* chisq_ */ /* Subroutine */ int cdoperm5_(filename, filename_len) char *filename; ftnlen filename_len; { /* Format strings */ static char fmt_212[] = "(8i10)"; static char fmt_271[] = "(\002 OPERM5 test for file \002,a15\ ,/,\002 For a sample of 1,000,000 consecutive 5-tuples,\002)"; static char fmt_273[] = "(\002 chisquare for 99 degrees of freedom=\002,\ f7.3,\002; p-value=\002,f8.6)"; /* System generated locals */ integer i__1; real r__1; olist o__1; cllist cl__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), f_clos(), s_wsfe(), e_wsfe(); /* Local variables */ static integer ijkm; extern integer jtbl_(); static real chsq; static integer i, j, k, n, r[3600] /* was [60][60] */, s[3600] /* was [60][60] */, t[120], u[1005]; static real x, y; extern doublereal chisq_(); static real av; extern integer kp_(); static integer jkk; extern integer jkreset_(); /* Fortran I/O blocks */ static cilist io___574 = { 0, 4, 0, fmt_212, 0 }; static cilist io___578 = { 0, 4, 0, fmt_212, 0 }; static cilist io___590 = { 0, 3, 0, fmt_271, 0 }; static cilist io___591 = { 0, 6, 0, fmt_271, 0 }; static cilist io___592 = { 0, 3, 0, fmt_273, 0 }; static cilist io___593 = { 0, 6, 0, fmt_273, 0 }; /* *** overlapping 5-permutations. Uses 120x120 weak inverse ******* */ /* *** of covariance matrix (in 60x60 blocks). */ /* *** 69069 passes, Randu fails, Weyl fails, SR(15,17),SR(13,18) fail. */ /* *** F(2,1,*) and F(3,1,*) pass */ /* **** divide r and s elements by (200000*n) for proper cov. inverse */ /* **** the rank is 99=50+49. */ o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 11; o__1.ofnm = "operm5d.ata"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___574); for (i = 1; i <= 60; ++i) { for (j = i; j <= 60; ++j) { do_fio(&c__1, (char *)&r[i + j * 60 - 61], (ftnlen)sizeof(integer) ); } } e_rsfe(); s_rsfe(&io___578); for (i = 1; i <= 60; ++i) { for (j = i; j <= 60; ++j) { do_fio(&c__1, (char *)&s[i + j * 60 - 61], (ftnlen)sizeof(integer) ); } } e_rsfe(); cl__1.cerr = 0; cl__1.cunit = 4; cl__1.csta = 0; f_clos(&cl__1); jkk = jkreset_(); for (ijkm = 1; ijkm <= 2; ++ijkm) { for (i = 1; i <= 59; ++i) { for (j = i + 1; j <= 60; ++j) { r[j + i * 60 - 61] = r[i + j * 60 - 61]; /* L2: */ s[j + i * 60 - 61] = s[i + j * 60 - 61]; } } /* **********************get counts t(1),...,t(120)****************** */ n = 1000; for (i = 1; i <= 120; ++i) { /* L11: */ t[i - 1] = 0; } for (i = 1001; i <= 1005; ++i) { /* L4: */ u[i - 1] = jtbl_(); } i__1 = n; for (i = 1; i <= i__1; ++i) { for (j = 1; j <= 5; ++j) { /* L6: */ u[j - 1] = u[j + 999]; } for (j = 1; j <= 1000; ++j) { k = kp_(&u[j - 1]) + 1; ++t[k - 1]; /* L7: */ u[j + 4] = jtbl_(); } /* L5: */ } /* *********************evalute quadratic form in weak inverse******* */ chsq = (float)0.; av = n * (float)2e3 / (float)120.; for (i = 1; i <= 60; ++i) { x = t[i - 1] + t[i + 59] - av; y = (real) (t[i - 1] - t[i + 59]); for (j = 1; j <= 60; ++j) { /* L3: */ chsq = chsq + x * r[i + j * 60 - 61] * (t[j - 1] + t[j + 59] - av) + y * s[i + j * 60 - 61] * (t[j - 1] - t[j + 59] ); } } chsq /= n * (float)2e8; s_wsfe(&io___590); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___591); do_fio(&c__1, filename, 25L); e_wsfe(); s_wsfe(&io___592); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); r__1 = chisq_(&chsq, &c__99); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); s_wsfe(&io___593); do_fio(&c__1, (char *)&chsq, (ftnlen)sizeof(real)); r__1 = chisq_(&chsq, &c__99); do_fio(&c__1, (char *)&r__1, (ftnlen)sizeof(real)); e_wsfe(); /* L8888: */ } jkk = jkreset_(); return 0; } /* cdoperm5_ */ integer kp_(c) integer *c; { /* Initialized data */ static integer map[60] = { 39,38,37,36,41,40,54,55,56,57,58,59,49,48,52, 53,50,51,42,43,44,45,46,47,33,32,31,30,35,34,12,13,14,15,16,17,29, 28,24,25,27,26,21,20,19,18,23,22,2,3,5,4,1,0,10,11,9,8,6,7 }; /* System generated locals */ integer ret_val, i__1; /* Local variables */ static integer b[5], i, j, l; static real s, t; /* real b(5),c(5) */ /* Parameter adjustments */ --c; /* Function Body */ for (i = 1; i <= 5; ++i) { /* L7: */ b[i - 1] = c[i]; } ret_val = 0; for (i = 5; i >= 2; --i) { t = (real) b[0]; l = 1; i__1 = i; for (j = 2; j <= i__1; ++j) { if ((real) b[j - 1] < t) { goto L3; } t = (real) b[j - 1]; l = j; L3: ; } ret_val = i * ret_val + l - 1; s = (real) b[i - 1]; b[i - 1] = b[l - 1]; /* L2: */ b[l - 1] = s; } if (ret_val < 60) { ret_val = map[ret_val]; } return ret_val; } /* kp_ */ source/getrnor.c100644 765 144 16604 6077246056 12424 0ustar geousers/* getrnor.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static integer c__3 = 3; static integer c__1000 = 1000; static integer c__4096 = 4096; /* Main program */ MAIN__() { /* Format strings */ static char fmt_12345[] = "(10x,\002This program will read a binary file\ of\002,/,10x,\00232-bit random integers and write a binary file\002,/,10x\ ,\002of standard normal random variables, using the\002,/,10x,\002ziggurat m\ ethod of Marsaglia and Tsang, \002,/,10x,\002SIAM J. Scient. and Stat. Compu\ ting, v5, 349-359, 1984\002,/)"; static char fmt_20[] = "(a15)"; static char fmt_25[] = "(i10,\002000 standard normal random variables\ \002,/,\002 have been written to the file \002,a15)"; /* System generated locals */ integer i__1; olist o__1; cllist cl__1; /* Builtin functions */ integer s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsfe(), do_fio(), e_rsfe(), f_open(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(), f_clos(); /* Local variables */ static char filename[15]; static integer i, k, n; static real x[1000]; static integer jk; extern doublereal zignor_(); static char fileout[15]; /* Fortran I/O blocks */ static cilist io___1 = { 0, 6, 0, fmt_12345, 0 }; static cilist io___2 = { 0, 6, 0, 0, 0 }; static cilist io___3 = { 0, 5, 0, fmt_20, 0 }; static cilist io___5 = { 0, 6, 0, 0, 0 }; static cilist io___6 = { 0, 5, 0, fmt_20, 0 }; static cilist io___8 = { 0, 6, 0, 0, 0 }; static cilist io___9 = { 0, 5, 0, 0, 0 }; static cilist io___11 = { 0, 6, 0, 0, 0 }; static cilist io___16 = { 0, 2, 0, 0, 0 }; static cilist io___17 = { 0, 6, 0, 0, 0 }; static cilist io___18 = { 0, 6, 0, fmt_25, 0 }; static cilist io___19 = { 0, 6, 0, 0, 0 }; /* **** converts binary file of 32-bit integers to */ /* **** single precision standard normal variables. */ s_wsfe(&io___1); e_wsfe(); s_wsle(&io___2); do_lio(&c__9, &c__1, " Enter name of source file ( binary, 32-bit intege\ rs):", 54L); e_wsle(); s_rsfe(&io___3); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___5); do_lio(&c__9, &c__1, " Enter name of output file:", 27L); e_wsle(); s_rsfe(&io___6); do_fio(&c__1, fileout, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 15; o__1.ofnm = fileout; o__1.orl = 4000; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___8); do_lio(&c__9, &c__1, " Enter n for output of RNOR'S (in thousands):", 45L) ; e_wsle(); s_rsle(&io___9); do_lio(&c__3, &c__1, (char *)&n, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___11); do_lio(&c__9, &c__1, " Please wait ...............", 38L); e_wsle(); jk = 0; i__1 = n; for (i = 1; i <= i__1; ++i) { for (k = 1; k <= 1000; ++k) { /* L3: */ x[k - 1] = zignor_(); } ++jk; /* L2: */ io___16.cirec = jk; s_wdue(&io___16); do_uio(&c__1000, (char *)&x[0], (ftnlen)sizeof(real)); e_wdue(); } cl__1.cerr = 0; cl__1.cunit = 2; cl__1.csta = 0; f_clos(&cl__1); s_wsle(&io___17); do_lio(&c__9, &c__1, " Finished", 19L); e_wsle(); s_wsfe(&io___18); do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer)); do_fio(&c__1, fileout, 15L); e_wsfe(); goto L123; /* L11111: */ s_wsle(&io___19); do_lio(&c__9, &c__1, " ERROR: not enough integers in source file", 44L); e_wsle(); L123: ; } /* MAIN__ */ integer jtbl_() { /* Initialized data */ static integer j = 4097; static integer jk = 1; /* System generated locals */ integer ret_val; /* Builtin functions */ integer s_rdue(), do_uio(), e_rdue(); /* Local variables */ static integer b[4096]; /* Fortran I/O blocks */ static cilist io___22 = { 0, 1, 0, 0, 0 }; if (j > 4096) { io___22.cirec = jk; s_rdue(&io___22); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); j = 1; ++jk; } ret_val = b[j - 1]; ++j; return ret_val; } /* jtbl_ */ /* ***Ziggurat rnor. Takes 2.2 microsecs(Microsoft, 5.9 in Lahey) */ /* **************** takes 2.0 if jsr is only rng, 2.2 if jsr+icng */ /* *** mpynor takes 3.1, rnor92 takes 3.8 */ doublereal zignor_() { /* Initialized data */ static real v[65] = { (float).340945,(float).4573146,(float).5397793,( float).6062427,(float).6631691,(float).7136975,(float).7596125,( float).8020356,(float).8417227,(float).8792102,(float).9148948,( float).9490791,(float).9820005,(float)1.0138492,(float)1.044781,( float)1.0749254,(float)1.1043917,(float)1.1332738,(float)1.161653, (float)1.189601,(float)1.2171815,(float)1.2444516,(float) 1.2714635,(float)1.298265,(float)1.3249008,(float)1.3514125,( float)1.3778399,(float)1.4042211,(float)1.4305929,(float) 1.4569915,(float)1.4834527,(float)1.5100122,(float)1.5367061,( float)1.5635712,(float)1.5906454,(float)1.617968,(float)1.6455802, (float)1.6735255,(float)1.7018503,(float)1.7306045,(float) 1.7598422,(float)1.7896223,(float)1.8200099,(float)1.851077,( float)1.8829044,(float)1.9155831,(float)1.9492166,(float) 1.9839239,(float)2.0198431,(float)2.0571356,(float)2.095993,( float)2.136645,(float)2.1793713,(float)2.2245175,(float)2.2725186, (float)2.3239338,(float)2.3795008,(float)2.4402218,(float) 2.5075117,(float)2.5834658,(float)2.6713916,(float)2.7769942,( float)2.7769942,(float)2.7769942,(float)2.7769942 }; /* System generated locals */ real ret_val, r__1, r__2; /* Builtin functions */ double exp(), log(), r_sign(); /* Local variables */ extern integer jtbl_(); static integer i, j; static real s, x, y; /* --FAST PART */ i = jtbl_(); j = i & 63; ret_val = i * (float)4.656613e-10 * v[j + 1]; if (dabs(ret_val) <= v[j]) { return ret_val; } /* -------SLOW PART; aa is a*f(0) */ y = jtbl_() * (float)2.3283064365386963e-10 + (float).5; s = x + y; if (s > (float)1.301198) { goto L11; } if (s <= (float).9689279) { return ret_val; } /* Computing 2nd power */ r__1 = (float).4878992 - x * (float).4878992; if (y > (float)12.67706 - exp(r__1 * r__1 * (float)-.5) * (float)12.37586) { goto L11; } /* Computing 2nd power */ r__1 = v[j + 1]; /* Computing 2nd power */ r__2 = ret_val; if (exp(r__1 * r__1 * (float)-.5) + y * (float).01958303 / v[j + 1] <= exp(r__2 * r__2 * (float)-.5)) { return ret_val; } /* ---------------TAIL PART; .3601016 is 1/xn */ L22: x = log(jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float) .3601016; if (log(jtbl_() * (float)2.3283064365386963e-10 + (float).5) * (float)-2. <= x * x) { goto L22; } /* L33: */ r__1 = (float)2.776994 - x; ret_val = r_sign(&r__1, &ret_val); return ret_val; L11: r__1 = (float).4878992 - x * (float).4878992; ret_val = r_sign(&r__1, &ret_val); return ret_val; } /* zignor_ */ source/makewhat.c100644 765 144 323621 6077261427 12564 0ustar geousers/* makewhat.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static integer c__3 = 3; static integer c__22 = 22; static integer c__5 = 5; static integer c__4096 = 4096; static integer c__27 = 27; static integer c__23 = 23; static integer c__16 = 16; static integer c__15 = 15; static integer c__17 = 17; static doublereal c_b389 = 4294967291.; static doublereal c_b392 = 34359737519.; static doublereal c_b393 = 34359736739.; static integer c__20 = 20; static integer c__13 = 13; static doublereal c_b546 = 2.; static integer c__54 = 54; static integer c__12 = 12; static integer c__18 = 18; static doublereal c_b842 = 4294967296.; /* ****Makewhat.f: program to make random number files for DIEHARD */ /* Main program */ MAIN__() { /* Format strings */ static char fmt_123[] = "(\002 This program makes a file of random integ\ ers \002,/,\002 for tests by DIEHARD. Select one from this list:\002,/)"; static char fmt_124[] = "(\002 1. A multiply-with-carry (MWC) generato\ r x(n)=a*x(n-1)+carry mod 2^32\002,/,\002 2. A MWC generator on pairs of \ 16 bits\002,/,\002 3. The \"Mother of all random number generators\"\002,/,\ \002 4. The KISS generator\002,/,\002 5. The simple but very good gener\ ator COMBO\002,/,\002 6. The lagged Fibonacci-MWC combination ULTRA\002,/\ ,\002 7. A combination MWC/subtract-with-borrow (SWB) generator, period ~ \ 10^364\002,/,\002 8. An extended congruential generator\002,/,\002 9. Th\ e Super-Duper generator\002,/,\002 10. A subtract-with-borrow generator\002\ ,/,\002 11. Any specified congruential generator\002,/,\002 12. The 31-bit\ generator ran2 from Numerical Recipes\002,/,\002 13. Any specified shift-r\ egister generator, 31 or 32 bits\002,/,\002 14. The system generator in Sun\ Fortran f77\002,/,\002 15. Any lagged-Fibonacci generator, x(n)=x(n-r) op\ x(n-s)\002,/,\002 16. An inverse congruential generator\002,/)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer s_wsfe(), e_wsfe(), f_open(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(); /* Local variables */ extern /* Subroutine */ int makefibo_(), makecmbo_(), makesbmc_(), makecong_(), makexcng_(), makeinvc_(), makeltra_(), makeshrg_(), makekiss_(), makemthr_(), makesunr_(), makesupr_(), make1616_(); static integer jch; extern /* Subroutine */ int makeswb_(), makeran2_(), makemwc1_(); /* Fortran I/O blocks */ static cilist io___1 = { 0, 6, 0, fmt_123, 0 }; static cilist io___2 = { 0, 6, 0, fmt_124, 0 }; static cilist io___3 = { 0, 6, 0, 0, 0 }; static cilist io___4 = { 0, 5, 0, 0, 0 }; s_wsfe(&io___1); e_wsfe(); s_wsfe(&io___2); e_wsfe(); o__1.oerr = 0; o__1.ounit = 4; o__1.ofnmlen = 9; o__1.ofnm = "makef.txt"; o__1.orl = 0; o__1.osta = 0; o__1.oacc = 0; o__1.ofm = 0; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___3); do_lio(&c__9, &c__1, " Enter your choice, 1 to 16:", 29L); e_wsle(); s_rsle(&io___4); do_lio(&c__3, &c__1, (char *)&jch, (ftnlen)sizeof(integer)); e_rsle(); if (jch == 1) { makemwc1_(); } if (jch == 2) { make1616_(); } if (jch == 3) { makemthr_(); } if (jch == 4) { makekiss_(); } if (jch == 5) { makecmbo_(); } if (jch == 6) { makeltra_(); } if (jch == 7) { makesbmc_(); } if (jch == 8) { makexcng_(); } if (jch == 9) { makesupr_(); } if (jch == 10) { makeswb_(); } if (jch == 11) { makecong_(); } if (jch == 12) { makeran2_(); } if (jch == 13) { makeshrg_(); } if (jch == 14) { makesunr_(); } if (jch == 15) { makefibo_(); } if (jch == 16) { makeinvc_(); } } /* MAIN__ */ /* Subroutine */ int makemwc1_() { /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_679[] = "(a1)"; static char fmt_2991[] = "(a15)"; static char fmt_281[] = "(\002 (In general, for any choice of `a`, let m\ =a*2^32-1. If both m\002,/,\002 and (m-1)/2 are prime then the period will b\ e (m-1)/2).\002)"; static char fmt_602[] = "(\002 2,867,200 32-bit random integers (11,468\ ,800 bytes)\002,/,\002 have been written to the file \002,a15)"; /* System generated locals */ integer i__1; doublereal d__1; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), f_open(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char filename[15]; extern /* Subroutine */ int prod_(); static char text[80*22]; static integer a[2], c[4], i, j, n[4096], w[4], x[2], z[4]; static doublereal aa; static integer cc, jk; static char op[1]; static integer xx; extern /* Subroutine */ int sum_(); /* Fortran I/O blocks */ static cilist io___6 = { 0, 4, 0, fmt_845, 0 }; static cilist io___8 = { 0, 6, 0, fmt_845, 0 }; static cilist io___9 = { 0, 6, 0, 0, 0 }; static cilist io___10 = { 0, 5, 0, fmt_679, 0 }; static cilist io___12 = { 0, 6, 0, 0, 0 }; static cilist io___13 = { 0, 5, 0, fmt_2991, 0 }; static cilist io___15 = { 0, 6, 0, 0, 0 }; static cilist io___16 = { 0, 6, 0, 0, 0 }; static cilist io___17 = { 0, 6, 0, 0, 0 }; static cilist io___18 = { 0, 6, 0, 0, 0 }; static cilist io___19 = { 0, 6, 0, 0, 0 }; static cilist io___20 = { 0, 6, 0, 0, 0 }; static cilist io___21 = { 0, 6, 0, 0, 0 }; static cilist io___22 = { 0, 6, 0, fmt_281, 0 }; static cilist io___23 = { 0, 6, 0, 0, 0 }; static cilist io___24 = { 0, 5, 0, 0, 0 }; static cilist io___26 = { 0, 6, 0, 0, 0 }; static cilist io___27 = { 0, 5, 0, 0, 0 }; static cilist io___30 = { 0, 6, 0, 0, 0 }; static cilist io___40 = { 0, 2, 0, 0, 0 }; static cilist io___41 = { 0, 6, 0, 0, 0 }; static cilist io___42 = { 0, 6, 0, fmt_602, 0 }; static cilist io___43 = { 0, 6, 0, 0, 0 }; s_rsfe(&io___6); do_fio(&c__22, text, 80L); e_rsfe(); s_wsfe(&io___8); do_fio(&c__22, text, 80L); e_wsfe(); s_wsle(&io___9); do_lio(&c__9, &c__1, " Pause: enter any letter or number key to contin\ ue:", 53L); e_wsle(); /* L679: */ s_rsfe(&io___10); do_fio(&c__1, op, 1L); e_rsfe(); s_wsle(&io___12); do_lio(&c__9, &c__1, " Enter filename (<=15 characters) for output:", 46L); e_wsle(); s_rsfe(&io___13); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___15); do_lio(&c__9, &c__1, " Select multiplier `a` from this list:", 43L); e_wsle(); s_wsle(&io___16); do_lio(&c__9, &c__1, "--------------------------------------------------\ -----", 55L); e_wsle(); s_wsle(&io___17); do_lio(&c__9, &c__1, " 1791398085 1929682203 1683268614 1965537969 16753\ 93560", 55L); e_wsle(); s_wsle(&io___18); do_lio(&c__9, &c__1, " 1967773755 1517746329 1447497129 1655692410 16062\ 18150", 55L); e_wsle(); s_wsle(&io___19); do_lio(&c__9, &c__1, " 2051013963 1075433238 1557985959 1781943330 18935\ 13180", 55L); e_wsle(); s_wsle(&io___20); do_lio(&c__9, &c__1, " 1631296680 2131995753 2083801278 1873196400 15541\ 15554", 55L); e_wsle(); s_wsle(&io___21); do_lio(&c__9, &c__1, "--------------------------------------------------\ -----", 55L); e_wsle(); s_wsfe(&io___22); e_wsfe(); s_wsle(&io___23); do_lio(&c__9, &c__1, " Enter multiplier a:", 22L); e_wsle(); s_rsle(&io___24); do_lio(&c__5, &c__1, (char *)&aa, (ftnlen)sizeof(doublereal)); e_rsle(); s_wsle(&io___26); do_lio(&c__9, &c__1, " Enter a seed integer x and initial carry c:", 45L) ; e_wsle(); s_rsle(&io___27); do_lio(&c__3, &c__1, (char *)&xx, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&cc, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___30); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); x[0] = xx & 65535; x[1] = xx >> 16; c[0] = cc & 65535; c[1] = cc >> 16; c[2] = 0; c[3] = 0; i__1 = (integer) aa; a[0] = i__1 & 65535; i__1 = (integer) aa; a[1] = i__1 >> 16; jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { prod_(x, a, z); sum_(z, c, w); x[0] = w[0]; x[1] = w[1]; c[0] = w[2]; c[1] = w[3]; n[j - 1] = (x[1] << 16) + x[0]; /* L3: */ } /* L2: */ io___40.cirec = jk; s_wdue(&io___40); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___41); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsfe(&io___42); do_fio(&c__1, filename, 15L); e_wsfe(); s_wsle(&io___43); do_lio(&c__9, &c__1, " The period is", 15L); d__1 = aa * 2147483648. - 1.; do_lio(&c__5, &c__1, (char *)&d__1, (ftnlen)sizeof(doublereal)); e_wsle(); } /* makemwc1_ */ /* Subroutine */ int make1616_() { /* Format strings */ static char fmt_846[] = "(a78)"; static char fmt_800[] = "(f40.0)"; static char fmt_801[] = "(\002 The correct last 4 digits are\002,i8)"; /* System generated locals */ integer i__1; doublereal d__1; olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(); /* Subroutine */ int s_paus(); integer s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*27]; static integer a, b, i, j, n[4096], x, y, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___44 = { 0, 4, 0, fmt_846, 0 }; static cilist io___47 = { 0, 4, 0, fmt_846, 0 }; static cilist io___49 = { 0, 6, 0, fmt_846, 0 }; static cilist io___50 = { 0, 6, 0, fmt_846, 0 }; static cilist io___51 = { 0, 6, 0, 0, 0 }; static cilist io___52 = { 0, 4, 0, fmt_846, 0 }; static cilist io___53 = { 0, 6, 0, fmt_846, 0 }; static cilist io___54 = { 0, 6, 0, 0, 0 }; static cilist io___55 = { 0, 5, 0, 0, 0 }; static cilist io___58 = { 0, 6, 0, 0, 0 }; static cilist io___59 = { 0, 5, 0, 0, 0 }; static cilist io___62 = { 0, 6, 0, 0, 0 }; static cilist io___66 = { 0, 2, 0, 0, 0 }; static cilist io___67 = { 0, 6, 0, 0, 0 }; static cilist io___68 = { 0, 6, 0, 0, 0 }; static cilist io___69 = { 0, 6, 0, 0, 0 }; static cilist io___70 = { 0, 6, 0, 0, 0 }; static cilist io___71 = { 0, 6, 0, 0, 0 }; static cilist io___72 = { 0, 6, 0, fmt_800, 0 }; static cilist io___73 = { 0, 6, 0, 0, 0 }; static cilist io___74 = { 0, 6, 0, fmt_801, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 10; o__1.ofnm = "mwc1616.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___44); for (j = 1; j <= 22; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___47); do_fio(&c__27, text, 80L); e_rsfe(); s_wsfe(&io___49); for (j = 1; j <= 21; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_paus("", 0L); s_wsfe(&io___50); for (j = 22; j <= 27; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsle(&io___51); do_lio(&c__9, &c__1, " Select multipliers a and b, a<>b, from this \ list:", 55L); e_wsle(); s_rsfe(&io___52); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_rsfe(); s_wsfe(&io___53); for (j = 1; j <= 10; ++j) { do_fio(&c__1, text + (j - 1) * 80, 80L); } e_wsfe(); s_wsle(&io___54); do_lio(&c__9, &c__1, " Enter a and b: (my favorites are 18000 and 3\ 0903)", 55L); e_wsle(); s_rsle(&io___55); do_lio(&c__3, &c__1, (char *)&a, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&b, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___58); do_lio(&c__9, &c__1, " Enter two (<=31 bit) seed integers, not zero", 45L) ; e_wsle(); s_rsle(&io___59); do_lio(&c__3, &c__1, (char *)&x, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&y, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___62); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { x = a * (x & 65535) + (x >> 16); y = b * (y & 65535) + (y >> 16); /* L3: */ n[j - 1] = (x << 16) + (y & 65535); } /* L2: */ io___66.cirec = jk; s_wdue(&io___66); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___67); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___68); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___69); do_lio(&c__9, &c__1, " have been written to the file mwc1616.32 \ ", 52L); e_wsle(); s_wsle(&io___70); do_lio(&c__9, &c__1, " They are the concatenated output of two 16-bit", 48L); e_wsle(); s_wsle(&io___71); do_lio(&c__9, &c__1, " multiply-with-carry generators. The period is", 48L); e_wsle(); s_wsfe(&io___72); d__1 = (a * 32768. - 1.) * (b * 32768. - 1.); do_fio(&c__1, (char *)&d__1, (ftnlen)sizeof(doublereal)); e_wsfe(); s_wsle(&io___73); do_lio(&c__9, &c__1, " (the last 4 digits may be lost to roundoff).", 46L); e_wsle(); /* L801: */ s_wsfe(&io___74); i__1 = ((a << 15) - 1) % 10000 * (((b << 15) - 1) % 10000) % 10000; do_fio(&c__1, (char *)&i__1, (ftnlen)sizeof(integer)); e_wsfe(); return 0; } /* make1616_ */ /* Subroutine */ int makemthr_() { /* Initialized data */ static integer a = 2111111111; static integer b = 1492; static integer c = 1776; static integer d = 5115; static doublereal da = 2111111111.; static doublereal db = 1492.; static doublereal dc = 1776.; static doublereal dd = 5115.; /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_602[] = "(\002 2,867,200 32-bit random integers (11,468\ ,800 bytes)\002,/,\002 have been written to the file \002,a15)"; /* System generated locals */ doublereal d__1; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_open(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(); double d_int(); integer s_wdue(), do_uio(), e_wdue(); /* Local variables */ static doublereal filename; static char text[80*23]; static integer i, j, n[4096], v, w, x, y, z, carry, ij, jk; static doublereal dv, dw, dx, dy, dz; static char dum[80]; /* Fortran I/O blocks */ static cilist io___83 = { 0, 4, 0, fmt_845, 0 }; static cilist io___86 = { 0, 4, 0, fmt_845, 0 }; static cilist io___88 = { 0, 6, 0, fmt_845, 0 }; static cilist io___89 = { 0, 6, 0, 0, 0 }; static cilist io___90 = { 0, 5, 0, 0, 0 }; static cilist io___95 = { 0, 6, 0, 0, 0 }; static cilist io___107 = { 0, 2, 0, 0, 0 }; static cilist io___108 = { 0, 6, 0, 0, 0 }; static cilist io___109 = { 0, 6, 0, 0, 0 }; static cilist io___110 = { 0, 6, 0, fmt_602, 0 }; static cilist io___112 = { 0, 6, 0, 0, 0 }; s_rsfe(&io___83); for (j = 1; j <= 59; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___86); do_fio(&c__23, text, 80L); e_rsfe(); s_wsfe(&io___88); do_fio(&c__23, text, 80L); e_wsfe(); /* L745: */ o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 7; o__1.ofnm = "mthr.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___89); do_lio(&c__9, &c__1, " Enter four seed integers:", 26L); e_wsle(); s_rsle(&io___90); do_lio(&c__3, &c__1, (char *)&x, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&y, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&z, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&w, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___95); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); jk = 0; for (ij = 1; ij <= 700; ++ij) { ++jk; for (i = 1; i <= 4096; ++i) { if (x < 0) { dx = x + 4294967296.; } else { dx = (doublereal) x; } if (y < 0) { dy = y + 4294967296.; } else { dy = (doublereal) y; } if (z < 0) { dz = z + 4294967296.; } else { dz = (doublereal) z; } if (w < 0) { dw = w + 4294967296.; } else { dw = (doublereal) w; } v = a * x + b * y + c * z + d * w + carry; x = y; y = z; z = w; w = v; dv = da * dx + db * dy + dc * dz + dd * dw + carry; d__1 = dv / 4294967296.; carry = (integer) d_int(&d__1); /* L2: */ n[i - 1] = w; } /* L3: */ io___107.cirec = jk; s_wdue(&io___107); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___108); do_lio(&c__9, &c__1, " ", 14L); e_wsle(); s_wsle(&io___109); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsfe(&io___110); do_fio(&c__1, (char *)&filename, (ftnlen)sizeof(doublereal)); e_wsfe(); s_wsle(&io___112); do_lio(&c__9, &c__1, " The period is about 2^158.97", 30L); e_wsle(); return 0; } /* makemthr_ */ /* Subroutine */ int makekiss_() { /* Format strings */ static char fmt_845[] = "(a78)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*22]; static integer b[4096], i, j, k, m, w, x, y, z, carry, jj, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___113 = { 0, 4, 0, fmt_845, 0 }; static cilist io___116 = { 0, 4, 0, fmt_845, 0 }; static cilist io___118 = { 0, 6, 0, fmt_845, 0 }; static cilist io___119 = { 0, 6, 0, 0, 0 }; static cilist io___120 = { 0, 5, 0, 0, 0 }; static cilist io___126 = { 0, 6, 0, 0, 0 }; static cilist io___133 = { 0, 2, 0, 0, 0 }; static cilist io___134 = { 0, 6, 0, 0, 0 }; static cilist io___135 = { 0, 6, 0, 0, 0 }; static cilist io___136 = { 0, 6, 0, 0, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 7; o__1.ofnm = "kiss.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___113); for (j = 1; j <= 82; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___116); do_fio(&c__22, text, 80L); e_rsfe(); s_wsfe(&io___118); do_fio(&c__22, text, 80L); e_wsfe(); s_wsle(&io___119); do_lio(&c__9, &c__1, " Enter four seed integers, not zero", 35L); e_wsle(); s_rsle(&io___120); do_lio(&c__3, &c__1, (char *)&x, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&y, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&z, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&w, (ftnlen)sizeof(integer)); e_rsle(); carry = 0; s_wsle(&io___126); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (jj = 1; jj <= 4096; ++jj) { x = x * 69069 + 1; y ^= y << 13; y ^= y >> 17; y ^= y << 5; k = (z >> 2) + (w >> 3) + (carry >> 2); m = w + w + z + carry; z = w; w = m; carry = k >> 30; /* L33: */ b[jj - 1] = x + y + w; } /* L2: */ io___133.cirec = jk; s_wdue(&io___133); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___134); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___135); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___136); do_lio(&c__9, &c__1, " have been written to the file kiss.32 ", 49L); e_wsle(); return 0; } /* makekiss_ */ /* Subroutine */ int makecmbo_() { /* Format strings */ static char fmt_845[] = "(a78)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), f_open(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*16]; static integer b[4096], i, j, v, x, y, z, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___137 = { 0, 4, 0, fmt_845, 0 }; static cilist io___140 = { 0, 4, 0, fmt_845, 0 }; static cilist io___142 = { 0, 6, 0, fmt_845, 0 }; static cilist io___143 = { 0, 6, 0, 0, 0 }; static cilist io___144 = { 0, 6, 0, 0, 0 }; static cilist io___145 = { 0, 5, 0, 0, 0 }; static cilist io___149 = { 0, 6, 0, 0, 0 }; static cilist io___154 = { 0, 1, 0, 0, 0 }; static cilist io___155 = { 0, 6, 0, 0, 0 }; static cilist io___156 = { 0, 6, 0, 0, 0 }; static cilist io___157 = { 0, 6, 0, 0, 0 }; /* ****Simple combo, period> 2^60.5 */ /* ***x(n)=x(n-1)*x(n-2) mod 2^32 added to */ /******period of x(n)=x(n-1)*x(n-2) is 3*2^29 if seeds odd, and one is +or -3 mod*/ /* *****easy to ensure: replace seed x with 3*x*x. */ /* ****mwc z=30903*iand(z,65535)+ishft(z,-16) */ s_rsfe(&io___137); for (j = 1; j <= 104; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___140); do_fio(&c__16, text, 80L); e_rsfe(); s_wsfe(&io___142); do_fio(&c__16, text, 80L); e_wsfe(); s_wsle(&io___143); do_lio(&c__9, &c__1, " ", 14L); e_wsle(); s_wsle(&io___144); do_lio(&c__9, &c__1, " Enter three seed integers:", 28L); e_wsle(); s_rsle(&io___145); do_lio(&c__3, &c__1, (char *)&x, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&y, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&z, (ftnlen)sizeof(integer)); e_rsle(); x = x + x + 1; x = x * 3 * x; y = y + y + 1; o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 8; o__1.ofnm = "combo.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___149); do_lio(&c__9, &c__1, " Please wait..................", 32L); e_wsle(); jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { v = x * y; x = y; y = v; z = (z & 65535) * 30903 + (z >> 16); /* L2: */ b[j - 1] = y + z; } /* L3: */ io___154.cirec = jk; s_wdue(&io___154); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___155); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___156); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___157); do_lio(&c__9, &c__1, " have been written to the file combo.32 ", 50L); e_wsle(); return 0; } /* makecmbo_ */ /* Subroutine */ int makeltra_() { /* Initialized data */ static integer r = 99; static integer s = 33; /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_25[] = "(5i12)"; static char fmt_271[] = "(\002 p-value for KSTEST on uniformity of seeds\ : \002,f8.6)"; /* System generated locals */ integer i__1; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), f_open(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static integer juni, mwcs; static char text[80*15]; static integer i, j, k, l, bb[4096], ig, ii, jk, ip, jp, js, ju[99]; static real px, xx[607]; extern /* Subroutine */ int kstest_(); static char dum[80]; /* Fortran I/O blocks */ static cilist io___160 = { 0, 4, 0, fmt_845, 0 }; static cilist io___163 = { 0, 4, 0, fmt_845, 0 }; static cilist io___165 = { 0, 6, 0, fmt_845, 0 }; static cilist io___166 = { 0, 6, 0, 0, 0 }; static cilist io___167 = { 0, 5, 0, 0, 0 }; static cilist io___176 = { 0, 6, 0, 0, 0 }; static cilist io___177 = { 0, 6, 0, fmt_25, 0 }; static cilist io___180 = { 0, 6, 0, fmt_271, 0 }; static cilist io___181 = { 0, 6, 0, 0, 0 }; static cilist io___187 = { 0, 1, 0, 0, 0 }; static cilist io___188 = { 0, 6, 0, 0, 0 }; static cilist io___189 = { 0, 6, 0, 0, 0 }; static cilist io___190 = { 0, 6, 0, 0, 0 }; static cilist io___191 = { 0, 6, 0, 0, 0 }; static cilist io___192 = { 0, 6, 0, 0, 0 }; s_rsfe(&io___160); for (j = 1; j <= 120; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___163); do_fio(&c__15, text, 80L); e_rsfe(); s_wsfe(&io___165); do_fio(&c__15, text, 80L); e_wsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 8; o__1.ofnm = "ultra.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___166); do_lio(&c__9, &c__1, " Enter four positive integers for seeds:", 42L); e_wsle(); s_rsle(&io___167); do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); e_rsle(); mwcs = i + j + k + l; i__1 = r; for (ii = 1; ii <= i__1; ++ii) { i = (i & 65535) * 18273 + (i >> 16); j = (j & 65535) * 23163 + (j >> 16); k = (k & 65535) * 24984 + (k >> 16); l = (l & 65535) * 28854 + (l >> 16); js = (i << 16) + (j & 65535) + (k << 16) + (l & 65535); js |= 1; xx[ii - 1] = js * (float)2.3283064365386963e-10 + (float).5; /* L92: */ ju[ii - 1] = js; } s_wsle(&io___176); do_lio(&c__9, &c__1, " The seed table:", 19L); e_wsle(); s_wsfe(&io___177); i__1 = r; for (ig = 1; ig <= i__1; ++ig) { do_fio(&c__1, (char *)&ju[ig - 1], (ftnlen)sizeof(integer)); } e_wsfe(); kstest_(xx, &r, &px); s_wsfe(&io___180); do_fio(&c__1, (char *)&px, (ftnlen)sizeof(real)); e_wsfe(); s_wsle(&io___181); do_lio(&c__9, &c__1, " Please wait................", 31L); e_wsle(); ip = r; jp = s; jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { juni = ju[ip - 1] * ju[jp - 1]; ju[ip - 1] = juni; --ip; if (ip == 0) { ip = 97; } --jp; if (jp == 0) { jp = 97; } mwcs = (mwcs & 65535) * 30903 + (mwcs >> 16); /* L3: */ bb[j - 1] = juni + mwcs; } /* L2: */ io___187.cirec = jk; s_wdue(&io___187); do_uio(&c__4096, (char *)&bb[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___188); do_lio(&c__9, &c__1, " ", 5L); e_wsle(); s_wsle(&io___189); do_lio(&c__9, &c__1, " FINISHED", 13L); e_wsle(); s_wsle(&io___190); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___191); do_lio(&c__9, &c__1, " have been written to the file ultra.32 ", 42L); e_wsle(); s_wsle(&io___192); do_lio(&c__9, &c__1, "::::::::::::::::::::::::::::::::::::::::::::::", 46L); e_wsle(); return 0; } /* makeltra_ */ /* Subroutine */ int makesbmc_() { /* Initialized data */ static integer r = 37; static integer s = 24; /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_25[] = "(5i12)"; static char fmt_271[] = "(\002 p-value for KSTEST on uniformity of seeds\ : \002,f8.6)"; static char fmt_349[] = "(\002 The binary file swbmwc.32\002/,\002 \ has been created with 32-bit integers\002,/,\002 from the subtract-wi\ th-borrow sequence\002,/,\002 x(n)=x(n-24)-x(n-37)-borrow mod 2^32\002,/\ ,\002 combined with the multiply-with-carry sequence\002,/,\002 y(n)=309\ 03*y(n-1)+carry mod 2^16,\002,/,\002 the overall sequence having period abo\ ut 10^364.\002)"; /* System generated locals */ integer i__1; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), f_open(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static integer juni, mwcs; static char text[80*9]; static integer i, j, k, l, m, x, y, bb[4096], ig, ii, jj, jk, ip, jp, js, ju[37]; static real px, xx[37]; extern /* Subroutine */ int kstest_(); static char dum[80]; /* Fortran I/O blocks */ static cilist io___195 = { 0, 4, 0, fmt_845, 0 }; static cilist io___198 = { 0, 4, 0, fmt_845, 0 }; static cilist io___200 = { 0, 6, 0, fmt_845, 0 }; static cilist io___201 = { 0, 6, 0, 0, 0 }; static cilist io___202 = { 0, 5, 0, 0, 0 }; static cilist io___206 = { 0, 6, 0, 0, 0 }; static cilist io___214 = { 0, 6, 0, 0, 0 }; static cilist io___215 = { 0, 6, 0, fmt_25, 0 }; static cilist io___218 = { 0, 6, 0, fmt_271, 0 }; static cilist io___226 = { 0, 1, 0, 0, 0 }; static cilist io___227 = { 0, 6, 0, 0, 0 }; static cilist io___228 = { 0, 6, 0, 0, 0 }; static cilist io___229 = { 0, 6, 0, fmt_349, 0 }; s_rsfe(&io___195); for (j = 1; j <= 135; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___198); do_fio(&c__9, text, 80L); e_rsfe(); s_wsfe(&io___200); do_fio(&c__9, text, 80L); e_wsfe(); s_wsle(&io___201); do_lio(&c__9, &c__1, " Enter four positive integers for seeds:", 43L); e_wsle(); s_rsle(&io___202); do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); e_rsle(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 9; o__1.ofnm = "swbmwc.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___206); do_lio(&c__9, &c__1, " Please wait................", 31L); e_wsle(); mwcs = i + j + k + l; i__1 = r; for (ii = 1; ii <= i__1; ++ii) { js = (float)0.; for (jj = 1; jj <= 32; ++jj) { m = i * j % 179 * k % 179; i = j; j = k; k = m; l = (l * 53 + 1) % 169; js <<= 1; if (l * m % 64 >= 32) { ++js; } /* L93: */ } xx[ii - 1] = js * (float)2.3283064365386963e-10 + (float).5; /* L92: */ ju[ii - 1] = js; } s_wsle(&io___214); do_lio(&c__9, &c__1, " The seed table:", 19L); e_wsle(); s_wsfe(&io___215); i__1 = r; for (ig = 1; ig <= i__1; ++ig) { do_fio(&c__1, (char *)&ju[ig - 1], (ftnlen)sizeof(integer)); } e_wsfe(); kstest_(xx, &r, &px); s_wsfe(&io___218); do_fio(&c__1, (char *)&px, (ftnlen)sizeof(real)); e_wsfe(); ip = r; jp = s; jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { x = ju[ip - 1]; y = ju[jp - 1]; juni = x - y; if (x >> 1 > y >> 1) { --juni; } ju[ip - 1] = juni; --ip; if (ip == 0) { ip = r; } --jp; if (jp == 0) { jp = r; } mwcs = (mwcs & 65535) * 30903 + (mwcs >> 16); /* L3: */ bb[j - 1] = mwcs + juni; } /* L2: */ io___226.cirec = jk; s_wdue(&io___226); do_uio(&c__4096, (char *)&bb[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___227); do_lio(&c__9, &c__1, " ", 5L); e_wsle(); s_wsle(&io___228); do_lio(&c__9, &c__1, " FINISHED", 13L); e_wsle(); s_wsfe(&io___229); e_wsfe(); return 0; } /* makesbmc_ */ /* Subroutine */ int makexcng_() { /* Format strings */ static char fmt_845[] = "(a78)"; /* System generated locals */ doublereal d__1; olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(); double d_mod(); integer s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*17]; static doublereal a, b, c; static integer i, j, n[4096]; static doublereal x; static real r3, r4; static integer ij, jk, jch; static char dum[80]; /* Fortran I/O blocks */ static cilist io___230 = { 0, 4, 0, fmt_845, 0 }; static cilist io___233 = { 0, 4, 0, fmt_845, 0 }; static cilist io___235 = { 0, 6, 0, fmt_845, 0 }; static cilist io___236 = { 0, 6, 0, 0, 0 }; static cilist io___237 = { 0, 5, 0, 0, 0 }; static cilist io___241 = { 0, 6, 0, 0, 0 }; static cilist io___250 = { 0, 2, 0, 0, 0 }; static cilist io___251 = { 0, 6, 0, 0, 0 }; static cilist io___252 = { 0, 6, 0, 0, 0 }; static cilist io___253 = { 0, 6, 0, 0, 0 }; static cilist io___254 = { 0, 6, 0, 0, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 9; o__1.ofnm = "excong.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___230); for (j = 1; j <= 144; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___233); do_fio(&c__17, text, 80L); e_rsfe(); s_wsfe(&io___235); do_fio(&c__17, text, 80L); e_wsfe(); s_wsle(&io___236); do_lio(&c__9, &c__1, " Enter three seed integers, not all zero:", 41L); e_wsle(); s_rsle(&io___237); do_lio(&c__5, &c__1, (char *)&a, (ftnlen)sizeof(doublereal)); do_lio(&c__5, &c__1, (char *)&b, (ftnlen)sizeof(doublereal)); do_lio(&c__5, &c__1, (char *)&c, (ftnlen)sizeof(doublereal)); e_rsle(); s_wsle(&io___241); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); r3 = (float).12500000308864409; r4 = (float).12500000592626775; jk = 0; for (ij = 1; ij <= 700; ++ij) { ++jk; for (i = 1; i <= 4096; ++i) { switch ((int)jch) { case 1: goto L51; case 2: goto L52; case 3: goto L53; case 4: goto L54; } L51: d__1 = a * 1776. + b * 1476. + c * 1176.; x = d_mod(&d__1, &c_b389); goto L166; L52: d__1 = (a + b + c) * 8192; x = d_mod(&d__1, &c_b389); goto L166; L53: d__1 = a * 2001. + b * 1998. + c * 1995.; x = d_mod(&d__1, &c_b392); x *= r3; goto L166; L54: d__1 = (a + b + c) * 524288.; x = d_mod(&d__1, &c_b393); x *= r4; L166: a = b; b = c; c = x; if (x < (float)2147483648.) { n[i - 1] = (integer) x; } else { n[i - 1] = (integer) (x - 4294967296.); } /* L2: */ } /* L3: */ io___250.cirec = jk; s_wdue(&io___250); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___251); do_lio(&c__9, &c__1, " ", 14L); e_wsle(); s_wsle(&io___252); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___253); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___254); do_lio(&c__9, &c__1, " have been written to the file excong.32 " , 51L); e_wsle(); return 0; } /* makexcng_ */ /* Subroutine */ int makesupr_() { /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_821[] = "(a1)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*20]; static integer i, j, n[4096], x, y, jk; static char op[1], dum[80]; /* Fortran I/O blocks */ static cilist io___255 = { 0, 4, 0, fmt_845, 0 }; static cilist io___258 = { 0, 4, 0, fmt_845, 0 }; static cilist io___260 = { 0, 6, 0, fmt_845, 0 }; static cilist io___261 = { 0, 6, 0, 0, 0 }; static cilist io___262 = { 0, 5, 0, 0, 0 }; static cilist io___265 = { 0, 6, 0, 0, 0 }; static cilist io___266 = { 0, 6, 0, 0, 0 }; static cilist io___267 = { 0, 5, 0, fmt_821, 0 }; static cilist io___269 = { 0, 6, 0, 0, 0 }; static cilist io___273 = { 0, 2, 0, 0, 0 }; static cilist io___274 = { 0, 2, 0, 0, 0 }; static cilist io___275 = { 0, 6, 0, 0, 0 }; static cilist io___276 = { 0, 6, 0, 0, 0 }; static cilist io___277 = { 0, 6, 0, 0, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 11; o__1.ofnm = "suprdupr.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___255); for (j = 1; j <= 161; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___258); do_fio(&c__20, text, 80L); e_rsfe(); s_wsfe(&io___260); do_fio(&c__20, text, 80L); e_wsfe(); s_wsle(&io___261); do_lio(&c__9, &c__1, " Enter two seed integers, the second not zero:", 47L); e_wsle(); s_rsle(&io___262); do_lio(&c__3, &c__1, (char *)&x, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&y, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___265); do_lio(&c__9, &c__1, " Choose your method of combination,", 36L); e_wsle(); s_wsle(&io___266); do_lio(&c__9, &c__1, " + for addition, x for exclusive-or, in column 1:", 50L); e_wsle(); s_rsfe(&io___267); do_fio(&c__1, op, 1L); e_rsfe(); s_wsle(&io___269); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); jk = 0; if (*(unsigned char *)op == '+') { for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { x = x * 69069 + 1; y ^= y << 13; y ^= y >> 17; y ^= y << 5; /* L3: */ n[j - 1] = x + y; } /* L2: */ io___273.cirec = jk; s_wdue(&io___273); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } } if (*(unsigned char *)op == 'x') { for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { x = x * 69069 + 1; y ^= y << 13; y ^= y >> 17; y ^= y << 5; /* L73: */ n[j - 1] = x ^ y; } /* L72: */ io___274.cirec = jk; s_wdue(&io___274); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } } s_wsle(&io___275); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___276); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___277); do_lio(&c__9, &c__1, " have been written to the file suprdupr.32 ", 45L) ; e_wsle(); return 0; } /* makesupr_ */ /* Subroutine */ int makeswb_() { /* Initialized data */ static integer rc[5] = { 43,37,24,21,48 }; static integer sc[5] = { 22,24,19,6,8 }; static integer jix[5] = { -6,0,0,0,2147483647 }; static char swb[42*5+1] = " 1: x(n)=x(n-43)-x(n-22)-c mod 2^32-5 \ 2: x(n)=x(n-37)-x(n-24)-c mod 2^32 3: x(n)=x(n-24)-x(n-19)-c mod 2^\ 32 4: x(n)=x(n-21)-x(n- 6)-c mod 2^32 5: x(n)=x(n-48)-x(n- 8)-\ c mod 2^31 "; static char period[42*5+1] = " (2^32-5)^43 - (2^32-5)^22, about 10^414 \ 2^1178 - 2^762, about 10^354 (2^759 - 2^599)/3, about 10^228 \ (2^666 - 2^186)/3, about 10^200 (2^1478 - 2^247)/105, ab\ out 10^445 "; /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_945[] = "(10x,a42)"; static char fmt_645[] = "(a15)"; static char fmt_348[] = "(\002 Enter four positive integers for see\ ds:\002)"; static char fmt_349[] = "(\002 The binary file \002,a15,/,\002 h\ as been created with 32-bit integers\002,/,\002 from the subtract-with-b\ orrow sequence\002,/,a41)"; static char fmt_350[] = "(15x,\002The period is\002,/,a41)"; /* System generated locals */ integer i__1; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), f_open(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char filename[15]; static integer juni; static char text[80*17]; static integer i, j, k, l, m, r, s, x, y, bb[4096], ii, jj, jk, ip, jp, js, ju[48], ijk, jjn, jchoice; static char dum[80]; /* Fortran I/O blocks */ static cilist io___281 = { 0, 4, 0, fmt_845, 0 }; static cilist io___284 = { 0, 4, 0, fmt_845, 0 }; static cilist io___286 = { 0, 6, 0, fmt_845, 0 }; static cilist io___287 = { 0, 6, 0, 0, 0 }; static cilist io___288 = { 0, 6, 0, fmt_945, 0 }; static cilist io___290 = { 0, 6, 0, 0, 0 }; static cilist io___291 = { 0, 6, 0, 0, 0 }; static cilist io___292 = { 0, 5, 0, 0, 0 }; static cilist io___296 = { 0, 6, 0, 0, 0 }; static cilist io___297 = { 0, 5, 0, fmt_645, 0 }; static cilist io___299 = { 0, 6, 0, fmt_348, 0 }; static cilist io___300 = { 0, 5, 0, 0, 0 }; static cilist io___304 = { 0, 6, 0, 0, 0 }; static cilist io___319 = { 0, 1, 0, 0, 0 }; static cilist io___320 = { 0, 6, 0, 0, 0 }; static cilist io___321 = { 0, 6, 0, 0, 0 }; static cilist io___322 = { 0, 6, 0, fmt_349, 0 }; static cilist io___323 = { 0, 6, 0, fmt_350, 0 }; static cilist io___325 = { 0, 6, 0, 0, 0 }; s_rsfe(&io___281); for (j = 1; j <= 181; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___284); do_fio(&c__17, text, 80L); e_rsfe(); s_wsfe(&io___286); do_fio(&c__17, text, 80L); e_wsfe(); s_wsle(&io___287); do_lio(&c__9, &c__1, " Choose your generator from this list:", 41L); e_wsle(); s_wsfe(&io___288); do_fio(&c__5, swb, 42L); e_wsfe(); s_wsle(&io___290); do_lio(&c__9, &c__1, "(Choice 5 provides 31-bit integers that are left-j\ ustified.)", 60L); e_wsle(); s_wsle(&io___291); do_lio(&c__9, &c__1, " enter 1,2,3,4 or 5:", 20L); e_wsle(); s_rsle(&io___292); do_lio(&c__3, &c__1, (char *)&jchoice, (ftnlen)sizeof(integer)); e_rsle(); r = rc[jchoice - 1]; s = sc[jchoice - 1]; s_wsle(&io___296); do_lio(&c__9, &c__1, " Enter output file name (<=15 characters):", 46L); e_wsle(); s_rsfe(&io___297); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsfe(&io___299); e_wsfe(); s_rsle(&io___300); do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___304); do_lio(&c__9, &c__1, " Please wait................", 31L); e_wsle(); i__1 = i; for (ijk = 1; ijk <= i__1; ++ijk) { /* L90: */ jjn = 1; } /* 90 jjn=irand(1) */ i__1 = r; for (ii = 1; ii <= i__1; ++ii) { js = (float)0.; for (jj = 1; jj <= 32; ++jj) { m = i * j % 179 * k % 179; i = j; j = k; k = m; l = (l * 53 + 1) % 169; js <<= 1; if (l * m % 64 >= 32) { ++js; } /* L93: */ } if (jchoice == 5) { js ^= 1; } /* L92: */ ju[ii - 1] = js; } ip = r; jp = s; jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { x = ju[ip - 1]; y = ju[jp - 1]; juni = x - y; if (x >> 1 < y >> 1) { juni += jix[jchoice - 1]; } ju[ip - 1] = juni; --ip; if (ip == 0) { ip = r; } --jp; if (jp == 0) { jp = r; } if (jchoice == 5) { juni += juni; } /* L3: */ bb[j - 1] = juni; } /* L2: */ io___319.cirec = jk; s_wdue(&io___319); do_uio(&c__4096, (char *)&bb[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___320); do_lio(&c__9, &c__1, " ", 5L); e_wsle(); s_wsle(&io___321); do_lio(&c__9, &c__1, " FINISHED", 13L); e_wsle(); s_wsfe(&io___322); do_fio(&c__1, filename, 15L); do_fio(&c__1, swb + (jchoice - 1) * 42, 42L); e_wsfe(); s_wsfe(&io___323); do_fio(&c__1, period + (jchoice - 1) * 42, 42L); e_wsfe(); s_wsle(&io___325); do_lio(&c__9, &c__1, "++++++++++++++++++++++++++++++++++++++++++++++++++\ +++++", 55L); e_wsle(); return 0; } /* makeswb_ */ /* Subroutine */ int makecong_() { /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_645[] = "(a15)"; static char fmt_221[] = "(\002 2,867,200 32-bit random integers (11,468\ ,800 bytes)\002,/,\002 have been written to the file \002,a15)"; static char fmt_983[] = "(a1)"; /* System generated locals */ integer i__1, i__2; doublereal d__1, d__2; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(); double pow_di(); integer f_open(); double d_mod(); integer s_wdue(), do_uio(), e_wdue(); /* Local variables */ static integer jlat, klim; static char filename[15], text[80*13]; extern /* Subroutine */ int plot1_(); static integer a, b, i, j, k, r, s; static real x[2000], y[2000]; static integer jseed, j1, j2, kount, bb[4096]; static doublereal da, db, dj, dl, dm; static integer jk; static doublereal dr, dx; static char op[1]; static doublereal yy, dum; /* Fortran I/O blocks */ static cilist io___326 = { 0, 4, 0, fmt_845, 0 }; static cilist io___329 = { 0, 4, 0, fmt_845, 0 }; static cilist io___331 = { 0, 6, 0, fmt_845, 0 }; static cilist io___332 = { 0, 6, 0, 0, 0 }; static cilist io___333 = { 0, 6, 0, 0, 0 }; static cilist io___334 = { 0, 6, 0, 0, 0 }; static cilist io___335 = { 0, 5, 0, 0, 0 }; static cilist io___340 = { 0, 6, 0, 0, 0 }; static cilist io___341 = { 0, 5, 0, 0, 0 }; static cilist io___346 = { 0, 6, 0, 0, 0 }; static cilist io___347 = { 0, 6, 0, 0, 0 }; static cilist io___348 = { 0, 6, 0, 0, 0 }; static cilist io___349 = { 0, 5, 0, 0, 0 }; static cilist io___351 = { 0, 6, 0, 0, 0 }; static cilist io___352 = { 0, 5, 0, fmt_645, 0 }; static cilist io___354 = { 0, 6, 0, 0, 0 }; static cilist io___361 = { 0, 1, 0, 0, 0 }; static cilist io___362 = { 0, 6, 0, fmt_221, 0 }; static cilist io___363 = { 0, 6, 0, 0, 0 }; static cilist io___364 = { 0, 6, 0, 0, 0 }; static cilist io___365 = { 0, 5, 0, fmt_983, 0 }; s_rsfe(&io___326); for (j = 1; j <= 198; ++j) { do_fio(&c__1, (char *)&dum, (ftnlen)sizeof(doublereal)); } e_rsfe(); s_rsfe(&io___329); do_fio(&c__13, text, 80L); e_rsfe(); s_wsfe(&io___331); do_fio(&c__13, text, 80L); e_wsfe(); s_wsle(&io___332); do_lio(&c__9, &c__1, " Enter a,b,r and s for the generator", 36L); e_wsle(); s_wsle(&io___333); do_lio(&c__9, &c__1, " x(n)=a*x(n-1)+b mod 2^r+s", 27L); e_wsle(); s_wsle(&io___334); do_lio(&c__9, &c__1, " To avoid overflow, make sure a*2^r < 2^53) ", 44L); e_wsle(); s_rsle(&io___335); do_lio(&c__3, &c__1, (char *)&a, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&b, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&r, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&s, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___340); do_lio(&c__9, &c__1, " Enter a seed integer:", 22L); e_wsle(); s_rsle(&io___341); do_lio(&c__3, &c__1, (char *)&jseed, (ftnlen)sizeof(integer)); e_rsle(); da = (doublereal) a; db = (doublereal) b; dm = pow_di(&c_b546, &r) + s; s_wsle(&io___346); do_lio(&c__9, &c__1, " If you want the 2-lattice without generating", 45L) ; e_wsle(); s_wsle(&io___347); do_lio(&c__9, &c__1, " the binary file, enter 0, else enter 1:", 40L); e_wsle(); s_wsle(&io___348); do_lio(&c__9, &c__1, " Create binary file? 0 for NO, 1 for YES:", 43L); e_wsle(); s_rsle(&io___349); do_lio(&c__3, &c__1, (char *)&jlat, (ftnlen)sizeof(integer)); e_rsle(); if (jlat == 1) { s_wsle(&io___351); do_lio(&c__9, &c__1, " Enter output file name (<=15 characters):", 46L); e_wsle(); s_rsfe(&io___352); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___354); do_lio(&c__9, &c__1, " Please wait................", 30L); e_wsle(); dj = (doublereal) jseed; i__1 = 32 - r; dr = pow_di(&c_b546, &i__1); jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { d__1 = da * dj + db; dj = d_mod(&d__1, &dm); dx = dr * dj; if (dx < 2147483648.) { bb[j - 1] = (integer) dx; } else { bb[j - 1] = (integer) (dx - 4294967296.); } /* L3: */ } /* L2: */ io___361.cirec = jk; s_wdue(&io___361); do_uio(&c__4096, (char *)&bb[0], (ftnlen)sizeof(integer)); e_wdue(); } } s_wsfe(&io___362); do_fio(&c__1, filename, 15L); e_wsfe(); s_wsle(&io___363); do_lio(&c__9, &c__1, " To display the 2-lattice of this generator, ", 45L) ; e_wsle(); s_wsle(&io___364); do_lio(&c__9, &c__1, " hit any letter or number key:", 31L); e_wsle(); s_rsfe(&io___365); do_fio(&c__1, op, 1L); e_rsfe(); i__1 = r - 12; dl = pow_di(&c_b546, &i__1); kount = 0; klim = (integer) (da * dl / dm); i__1 = klim; for (k = 1; k <= i__1; ++k) { /* Computing MAX */ d__1 = 0., d__2 = (k * dm - b) / da; j1 = (integer) max(d__1,d__2); j2 = (integer) ((k * dm - b + dl) / da); i__2 = j2; for (j = j1; j <= i__2; ++j) { d__1 = da * j + db; yy = d_mod(&d__1, &dm); if (yy < dl) { ++kount; x[kount - 1] = j / dm; y[kount - 1] = yy / dm; } /* L39: */ } /* L29: */ } plot1_(x, y, &kount, &c__54); return 0; } /* makecong_ */ /* Subroutine */ int makeran2_() { /* Format strings */ static char fmt_845[] = "(a78)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static integer idum; static char text[80*16]; extern integer iran2_(); static integer b[4096], i, j, jseed, ij, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___376 = { 0, 4, 0, fmt_845, 0 }; static cilist io___379 = { 0, 4, 0, fmt_845, 0 }; static cilist io___381 = { 0, 6, 0, fmt_845, 0 }; static cilist io___382 = { 0, 6, 0, 0, 0 }; static cilist io___383 = { 0, 5, 0, 0, 0 }; static cilist io___390 = { 0, 2, 0, 0, 0 }; static cilist io___391 = { 0, 6, 0, 0, 0 }; static cilist io___392 = { 0, 6, 0, 0, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 7; o__1.ofnm = "ran2.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___376); for (j = 1; j <= 211; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___379); do_fio(&c__16, text, 80L); e_rsfe(); s_wsfe(&io___381); do_fio(&c__16, text, 80L); e_wsfe(); s_wsle(&io___382); do_lio(&c__9, &c__1, " enter a seed integer", 21L); e_wsle(); s_rsle(&io___383); do_lio(&c__3, &c__1, (char *)&jseed, (ftnlen)sizeof(integer)); e_rsle(); idum = -abs(jseed); jk = 0; for (ij = 1; ij <= 700; ++ij) { ++jk; for (i = 1; i <= 4096; ++i) { /* L2: */ b[i - 1] = iran2_(&idum) << 1; } /* L3: */ io___390.cirec = jk; s_wdue(&io___390); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___391); do_lio(&c__9, &c__1, " Now 2,867,200 left-adjusted integers from ran2", 48L); e_wsle(); s_wsle(&io___392); do_lio(&c__9, &c__1, " (11,486,800 bytes) have been written to ran2.32", 49L); e_wsle(); return 0; } /* makeran2_ */ integer iran2_(idum) integer *idum; { /* Initialized data */ static integer idum2 = 123456789; static integer iv[32] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0 }; static integer iy = 0; /* System generated locals */ integer ret_val, i__1; /* Local variables */ static integer j, k; if (*idum <= 0) { /* Computing MAX */ i__1 = -(*idum); *idum = max(i__1,1); idum2 = *idum; for (j = 40; j >= 1; --j) { k = *idum / 53668; *idum = (*idum - k * 53668) * 40014 - k * 12211; if (*idum < 0) { *idum += 2147483563; } if (j <= 32) { iv[j - 1] = *idum; } /* L11: */ } iy = iv[0]; } k = *idum / 53668; *idum = (*idum - k * 53668) * 40014 - k * 12211; if (*idum < 0) { *idum += 2147483563; } k = idum2 / 52774; idum2 = (idum2 - k * 52774) * 40692 - k * 3791; if (idum2 < 0) { idum2 += 2147483399; } j = iy / 67108862 + 1; iy = iv[j - 1] - idum2; iv[j - 1] = *idum; if (iy < 1) { iy += 2147483562; } ret_val = iy; /* ran2=min(AM*iy,RNMX) */ return ret_val; } /* iran2_ */ /* Subroutine */ int makeshrg_() { /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_645[] = "(a15)"; static char fmt_221[] = "(\002 2,867,200 32-bit random integers (11,468\ ,800 bytes)\002,/,\002 have been written to the file \002,a15)"; static char fmt_225[] = "(\002 The period of your generator is 2^\002,\ i2,\002-1.\002)"; static char fmt_226[] = "(\002 The period of your generator is 2^32-2^21\ -2^11+1.\002)"; /* System generated locals */ integer i__1, i__2; olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), f_open(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static integer mask; static char filename[15], text[80*12]; static integer b[4096], i, j, l, r, nbits, i1, l2, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___398 = { 0, 4, 0, fmt_845, 0 }; static cilist io___401 = { 0, 4, 0, fmt_845, 0 }; static cilist io___403 = { 0, 6, 0, fmt_845, 0 }; static cilist io___404 = { 0, 6, 0, 0, 0 }; static cilist io___405 = { 0, 5, 0, fmt_645, 0 }; static cilist io___407 = { 0, 6, 0, 0, 0 }; static cilist io___408 = { 0, 5, 0, 0, 0 }; static cilist io___411 = { 0, 6, 0, 0, 0 }; static cilist io___412 = { 0, 6, 0, 0, 0 }; static cilist io___413 = { 0, 6, 0, 0, 0 }; static cilist io___414 = { 0, 5, 0, 0, 0 }; static cilist io___418 = { 0, 6, 0, 0, 0 }; static cilist io___419 = { 0, 5, 0, 0, 0 }; static cilist io___420 = { 0, 6, 0, 0, 0 }; static cilist io___424 = { 0, 1, 0, 0, 0 }; static cilist io___425 = { 0, 6, 0, 0, 0 }; static cilist io___426 = { 0, 6, 0, 0, 0 }; static cilist io___427 = { 0, 6, 0, 0, 0 }; static cilist io___428 = { 0, 6, 0, 0, 0 }; static cilist io___429 = { 0, 5, 0, 0, 0 }; static cilist io___431 = { 0, 6, 0, 0, 0 }; static cilist io___432 = { 0, 5, 0, 0, 0 }; static cilist io___433 = { 0, 6, 0, 0, 0 }; static cilist io___434 = { 0, 1, 0, 0, 0 }; static cilist io___435 = { 0, 1, 0, 0, 0 }; static cilist io___436 = { 0, 6, 0, 0, 0 }; static cilist io___437 = { 0, 6, 0, fmt_221, 0 }; static cilist io___438 = { 0, 6, 0, fmt_225, 0 }; static cilist io___439 = { 0, 6, 0, fmt_226, 0 }; /* *** creates shift register random number file */ /* use 13,18 or 7,24 or 6,25 or 3,28 or reverse for 31 bits */ /* use 15,17 or 13,17,5 for 32 bits */ s_rsfe(&io___398); for (j = 1; j <= 227; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___401); do_fio(&c__12, text, 80L); e_rsfe(); s_wsfe(&io___403); do_fio(&c__12, text, 80L); e_wsfe(); s_wsle(&io___404); do_lio(&c__9, &c__1, " Enter output file name (<= 15 characters):", 44L); e_wsle(); s_rsfe(&io___405); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___407); do_lio(&c__9, &c__1, " Choose number of bits, 31 or 32:", 35L); e_wsle(); s_rsle(&io___408); do_lio(&c__3, &c__1, (char *)&nbits, (ftnlen)sizeof(integer)); e_rsle(); jk = 0; if (nbits == 31) { s_wsle(&io___411); do_lio(&c__9, &c__1, " Choose Left,Right shifts from these choices:", 46L); e_wsle(); s_wsle(&io___412); do_lio(&c__9, &c__1, " 13,18 18,13 24,7 7,24 6,25 25,6 28,3 \ 3,28", 51L); e_wsle(); s_wsle(&io___413); do_lio(&c__9, &c__1, " enter two integers, L and R, in free format:", 46L); e_wsle(); s_rsle(&io___414); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&r, (ftnlen)sizeof(integer)); e_rsle(); mask = 2147483647; s_wsle(&io___418); do_lio(&c__9, &c__1, " Enter seed integer, not zero:", 30L); e_wsle(); s_rsle(&io___419); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___420); do_lio(&c__9, &c__1, " Please wait..............", 27L); e_wsle(); for (i1 = 1; i1 <= 700; ++i1) { ++jk; for (i = 1; i <= 4096; ++i) { i__1 = (j ^ j << l) & mask; j = i__1 ^ i__1 >> r; /* L3: */ b[i - 1] = j + j; } /* L2: */ io___424.cirec = jk; s_wdue(&io___424); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } } if (nbits == 32) { s_wsle(&io___425); do_lio(&c__9, &c__1, " For 32 bit integers, you have three choices.", 45L); e_wsle(); s_wsle(&io___426); do_lio(&c__9, &c__1, " two shifts: (L,R)=(17,15) or (15,17) and", 42L); e_wsle(); s_wsle(&io___427); do_lio(&c__9, &c__1, " three shifts (L1,R,L2)=(13,17,5).", 35L); e_wsle(); s_wsle(&io___428); do_lio(&c__9, &c__1, " Enter three integers, 17 15 0 or 15 17 0 or 1\ 3 17 5:", 53L); e_wsle(); s_rsle(&io___429); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&r, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&l2, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___431); do_lio(&c__9, &c__1, " Enter seed integer, not zero:", 30L); e_wsle(); s_rsle(&io___432); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___433); do_lio(&c__9, &c__1, " Please wait..............", 27L); e_wsle(); if (l2 == 0) { for (i1 = 1; i1 <= 700; ++i1) { ++jk; for (i = 1; i <= 4096; ++i) { i__1 = j ^ j << l; j = i__1 ^ i__1 >> r; /* L5: */ b[i - 1] = j; } /* L4: */ io___434.cirec = jk; s_wdue(&io___434); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } } else if (l2 == 5) { for (i1 = 1; i1 <= 700; ++i1) { ++jk; for (i = 1; i <= 4096; ++i) { i__1 = j ^ j << l; i__2 = i__1 ^ i__1 >> r; j = i__2 ^ i__2 << l2; /* L7: */ b[i - 1] = j; } /* L6: */ io___435.cirec = jk; s_wdue(&io___435); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } } } s_wsle(&io___436); do_lio(&c__9, &c__1, " FINISHED", 14L); e_wsle(); s_wsfe(&io___437); do_fio(&c__1, filename, 15L); e_wsfe(); if (nbits == 31 || l2 == 5) { s_wsfe(&io___438); do_fio(&c__1, (char *)&nbits, (ftnlen)sizeof(integer)); e_wsfe(); } if (l == 15 || l == 17) { s_wsfe(&io___439); e_wsfe(); } return 0; } /* makeshrg_ */ /* Subroutine */ int makesunr_() { /* Format strings */ static char fmt_845[] = "(a78)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(), s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*18]; static integer b[4096], i, j, jseed, jk, ijk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___440 = { 0, 4, 0, fmt_845, 0 }; static cilist io___443 = { 0, 4, 0, fmt_845, 0 }; static cilist io___445 = { 0, 6, 0, fmt_845, 0 }; static cilist io___446 = { 0, 6, 0, 0, 0 }; static cilist io___447 = { 0, 5, 0, 0, 0 }; static cilist io___449 = { 0, 6, 0, 0, 0 }; static cilist io___454 = { 0, 2, 0, 0, 0 }; static cilist io___455 = { 0, 6, 0, 0, 0 }; static cilist io___456 = { 0, 6, 0, 0, 0 }; static cilist io___457 = { 0, 6, 0, 0, 0 }; static cilist io___458 = { 0, 6, 0, 0, 0 }; o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 9; o__1.ofnm = "sunran.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___440); for (j = 1; j <= 239; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___443); do_fio(&c__18, text, 80L); e_rsfe(); s_wsfe(&io___445); do_fio(&c__18, text, 80L); e_wsfe(); s_wsle(&io___446); do_lio(&c__9, &c__1, " Enter one seed integer:", 25L); e_wsle(); s_rsle(&io___447); do_lio(&c__3, &c__1, (char *)&jseed, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___449); do_lio(&c__9, &c__1, " Please wait..............", 32L); e_wsle(); /* ijk=irand(jseed) */ ijk = 1; jk = 0; for (j = 1; j <= 700; ++j) { ++jk; for (i = 1; i <= 4096; ++i) { /* L2: */ b[i - 1] = 1; } /* 2 b(i)=irand(1) */ /* L3: */ io___454.cirec = jk; s_wdue(&io___454); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsle(&io___455); do_lio(&c__9, &c__1, " FINISHED", 20L); e_wsle(); s_wsle(&io___456); do_lio(&c__9, &c__1, " 2,867,200 32-bit random integers (11,468,800 byt\ es)", 53L); e_wsle(); s_wsle(&io___457); do_lio(&c__9, &c__1, " have been written to the file sunran.32 ", 43L); e_wsle(); s_wsle(&io___458); do_lio(&c__9, &c__1, " Note: the rightmost bit is always 0", 37L); e_wsle(); return 0; } /* makesunr_ */ /* Subroutine */ int makefibo_() { /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_346[] = "(\002 Enter lags r and s from this list:\002,/\ ,\002 17,5 33,13 39,14 55,24 63,31 73,25 97,33 607,273\002,/,\002 \ and op code: 1 for + , 2 for -, 3 for *, 4 for xor:\002)"; static char fmt_645[] = "(a15)"; static char fmt_348[] = "(\002 Enter four positive integers for see\ ds:\002)"; static char fmt_349[] = "(\002 The binary file \002,a15,/,\002 h\ as been created with 32-bit integers\002,/,\002 from the lagged-Fibonacc\ i sequence\002)"; static char fmt_351[] = "(15x,\002x(n) = x(n-\002,i3,\002) + x(n-\002,\ i3,\002) mod 2^32\002)"; static char fmt_352[] = "(15x,\002x(n) = x(n-\002,i3,\002) - x(n-\002,\ i3,\002) mod 2^32\002)"; static char fmt_353[] = "(15x,\002x(n) = x(n-\002,i3,\002) * x(n-\002,\ i3,\002) mod 2^32\002)"; static char fmt_354[] = "(15x,\002x(n) = x(n-\002,i3,\002) xor x(n-\002,\ i3,\002)\002)"; static char fmt_355[] = "(\002 The period of the sequence is \002)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_rsle(), do_lio(), e_rsle(), s_wsle(), e_wsle(), f_open(), s_wdue(), do_uio(), e_wdue(); double pow_di(); /* Local variables */ static char filename[15]; static integer juni; static char text[80*9]; static integer i, j, k, l, m, r, s, bb[4096], ii, jj, jk, ip, jp, js, op, ju[607]; static doublereal period; static char dum[80]; /* Fortran I/O blocks */ static cilist io___459 = { 0, 4, 0, fmt_845, 0 }; static cilist io___462 = { 0, 4, 0, fmt_845, 0 }; static cilist io___464 = { 0, 6, 0, fmt_845, 0 }; static cilist io___465 = { 0, 6, 0, fmt_346, 0 }; static cilist io___466 = { 0, 5, 0, 0, 0 }; static cilist io___470 = { 0, 6, 0, 0, 0 }; static cilist io___471 = { 0, 5, 0, fmt_645, 0 }; static cilist io___473 = { 0, 6, 0, fmt_348, 0 }; static cilist io___474 = { 0, 5, 0, 0, 0 }; static cilist io___478 = { 0, 6, 0, 0, 0 }; static cilist io___489 = { 0, 1, 0, 0, 0 }; static cilist io___491 = { 0, 6, 0, 0, 0 }; static cilist io___492 = { 0, 6, 0, 0, 0 }; static cilist io___493 = { 0, 6, 0, fmt_349, 0 }; static cilist io___494 = { 0, 6, 0, 0, 0 }; static cilist io___495 = { 0, 6, 0, fmt_351, 0 }; static cilist io___496 = { 0, 6, 0, fmt_352, 0 }; static cilist io___497 = { 0, 6, 0, fmt_353, 0 }; static cilist io___498 = { 0, 6, 0, fmt_354, 0 }; static cilist io___499 = { 0, 6, 0, fmt_355, 0 }; static cilist io___500 = { 0, 6, 0, 0, 0 }; s_rsfe(&io___459); for (j = 1; j <= 257; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___462); do_fio(&c__9, text, 80L); e_rsfe(); s_wsfe(&io___464); do_fio(&c__9, text, 80L); e_wsfe(); s_wsfe(&io___465); e_wsfe(); s_rsle(&io___466); do_lio(&c__3, &c__1, (char *)&r, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&s, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&op, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___470); do_lio(&c__9, &c__1, " Enter output file name (<=15 characters):", 46L); e_wsle(); s_rsfe(&io___471); do_fio(&c__1, filename, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = filename; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsfe(&io___473); e_wsfe(); s_rsle(&io___474); do_lio(&c__3, &c__1, (char *)&i, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&j, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&k, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&l, (ftnlen)sizeof(integer)); e_rsle(); s_wsle(&io___478); do_lio(&c__9, &c__1, " Please wait................", 31L); e_wsle(); /* do 90 ijk=1,i */ /* 90 jjn=irand(1) */ for (ii = 1; ii <= 97; ++ii) { js = (float)0.; for (jj = 1; jj <= 32; ++jj) { m = i * j % 179 * k % 179; i = j; j = k; k = m; l = (l * 53 + 1) % 169; js <<= 1; if (l * m % 64 >= 32) { ++js; } /* L93: */ } if (op == 3) { js ^= 1; } /* L92: */ ju[ii - 1] = js; } ip = r; jp = s; jk = 0; for (i = 1; i <= 700; ++i) { ++jk; for (j = 1; j <= 4096; ++j) { if (op == 1) { juni = ju[ip - 1] + ju[jp - 1]; } else if (op == 2) { juni = ju[ip - 1] - ju[jp - 1]; } else if (op == 3) { juni = ju[ip - 1] * ju[jp - 1]; } else { juni = ju[ip - 1] ^ ju[jp - 1]; } ju[ip - 1] = juni; --ip; if (ip == 0) { ip = 97; } --jp; if (jp == 0) { jp = 97; } /* L3: */ bb[j - 1] = juni; } /* L2: */ io___489.cirec = jk; s_wdue(&io___489); do_uio(&c__4096, (char *)&bb[0], (ftnlen)sizeof(integer)); e_wdue(); } period = (pow_di(&c_b546, &r) - 1) * 4294967296.; if (op == 3) { period *= (float).25; } if (op == 4) { period = pow_di(&c_b546, &r) - 1; } s_wsle(&io___491); do_lio(&c__9, &c__1, " ", 5L); e_wsle(); s_wsle(&io___492); do_lio(&c__9, &c__1, " FINISHED", 13L); e_wsle(); s_wsfe(&io___493); do_fio(&c__1, filename, 15L); e_wsfe(); if (op == 1) { s_wsle(&io___494); do_lio(&c__9, &c__1, "++++++++++++++++++++++++++++++++++++++++++++++\ +++++++++", 55L); e_wsle(); s_wsfe(&io___495); do_fio(&c__1, (char *)&r, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(integer)); e_wsfe(); } else if (op == 2) { s_wsfe(&io___496); do_fio(&c__1, (char *)&r, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(integer)); e_wsfe(); } else if (op == 3) { s_wsfe(&io___497); do_fio(&c__1, (char *)&r, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(integer)); e_wsfe(); } else { s_wsfe(&io___498); do_fio(&c__1, (char *)&r, (ftnlen)sizeof(integer)); do_fio(&c__1, (char *)&s, (ftnlen)sizeof(integer)); e_wsfe(); } s_wsfe(&io___499); e_wsfe(); s_wsle(&io___500); do_lio(&c__9, &c__1, " ", 5L); do_lio(&c__5, &c__1, (char *)&period, (ftnlen)sizeof(doublereal)); e_wsle(); return 0; } /* makefibo_ */ /* Subroutine */ int prod_(x, y, z) integer *x, *y, *z; { static integer d, r[4], s[4]; /* Parameter adjustments */ --z; --y; --x; /* Function Body */ d = x[1] * y[1]; z[1] = d & 65535; d = (d >> 16) + x[1] * y[2]; r[1] = d & 65535; r[2] = d >> 16; d = x[2] * y[1]; s[1] = d & 65535; d = (d >> 16) + x[2] * y[2]; s[2] = d & 65535; s[3] = d >> 16; d = r[1] + s[1]; z[2] = d & 65535; d = (d >> 16) + r[2] + s[2]; z[3] = d & 65535; z[4] = (d >> 16) + s[3]; return 0; } /* prod_ */ /* Subroutine */ int sum_(x, y, z) integer *x, *y, *z; { static integer d; /* Parameter adjustments */ --z; --y; --x; /* Function Body */ d = x[1] + y[1]; z[1] = d & 65535; d = (d >> 16) + x[2] + y[2]; z[2] = d & 65535; d = (d >> 16) + x[3] + y[3]; z[3] = d & 65535; d = (d >> 16) + x[4] + y[4]; z[4] = d & 65535; return 0; } /* sum_ */ /* Subroutine */ int makeinvc_() { /* Initialized data */ static integer a = 69069; static integer b = 362436069; static doublereal dz = 123456789.; /* Format strings */ static char fmt_845[] = "(a78)"; static char fmt_471[] = "(\002 The file invcong.32 now contains 11,428,8\ 00 bytes of 32-bit\002,/,\002 integers from the inverse congruential generat\ or.\002)"; /* System generated locals */ doublereal d__1; olist o__1; /* Builtin functions */ integer f_open(), s_rsfe(), do_fio(), e_rsfe(), s_wsfe(), e_wsfe(), s_wsle(), do_lio(), e_wsle(), s_rsle(), e_rsle(); double d_mod(); integer s_wdue(), do_uio(), e_wdue(); /* Local variables */ static char text[80*15]; static integer i, j, n[4096], icong; static doublereal a0, b0, b1, b2, a1, a2; static integer ij, jk; static char dum[80]; /* Fortran I/O blocks */ static cilist io___509 = { 0, 4, 0, fmt_845, 0 }; static cilist io___512 = { 0, 4, 0, fmt_845, 0 }; static cilist io___514 = { 0, 6, 0, fmt_845, 0 }; static cilist io___515 = { 0, 6, 0, 0, 0 }; static cilist io___516 = { 0, 5, 0, 0, 0 }; static cilist io___517 = { 0, 6, 0, 0, 0 }; static cilist io___518 = { 0, 6, 0, 0, 0 }; static cilist io___529 = { 0, 1, 0, 0, 0 }; static cilist io___530 = { 0, 6, 0, fmt_471, 0 }; b0 = 4294967296.; o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 10; o__1.ofnm = "invcong.32"; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_rsfe(&io___509); for (j = 1; j <= 266; ++j) { do_fio(&c__1, dum, 80L); } e_rsfe(); s_rsfe(&io___512); do_fio(&c__15, text, 80L); e_rsfe(); s_wsfe(&io___514); do_fio(&c__15, text, 80L); e_wsfe(); s_wsle(&io___515); do_lio(&c__9, &c__1, " Enter a and b and seed integer, free format:", 46L); e_wsle(); s_rsle(&io___516); do_lio(&c__3, &c__1, (char *)&a, (ftnlen)sizeof(integer)); do_lio(&c__3, &c__1, (char *)&b, (ftnlen)sizeof(integer)); do_lio(&c__5, &c__1, (char *)&dz, (ftnlen)sizeof(doublereal)); e_rsle(); s_wsle(&io___517); do_lio(&c__9, &c__1, " This may take a long time, as this is a very", 48L); e_wsle(); s_wsle(&io___518); do_lio(&c__9, &c__1, " very slow generator. Please wait ...........", 49L); e_wsle(); jk = 0; for (ij = 1; ij <= 700; ++ij) { ++jk; for (i = 1; i <= 4096; ++i) { b1 = dz; a0 = 0.; a1 = 1.; b0 = 4294967296.; while(b1 > 0.) { b2 = d_mod(&b0, &b1); a2 = a0 - a1 * ((b0 - b2) / b1); b0 = b1; b1 = b2; a0 = a1; a1 = a2; } d__1 = a * b0 * a0 + b; dz = d_mod(&d__1, &c_b842); if (dz < 0.) { dz += 4294967296.; } if (dz > 2147483648.) { icong = (integer) (dz - 4294967296.); } else { icong = (integer) dz; } /* L2: */ n[i - 1] = icong; } /* L3: */ io___529.cirec = jk; s_wdue(&io___529); do_uio(&c__4096, (char *)&n[0], (ftnlen)sizeof(integer)); e_wdue(); } s_wsfe(&io___530); e_wsfe(); } /* makeinvc_ */ /* Subroutine */ int asort_(list, n) real *list; integer *n; { static integer i, j, k, l, m; static real t; static integer ij, il[33], iu[33]; static real tt; /* Parameter adjustments */ --list; /* Function Body */ m = 1; i = 1; j = *n; L5: if (i >= j) { goto L70; } L10: k = i; ij = (i + j) / 2; t = list[ij]; if (list[i] <= t) { goto L20; } list[ij] = list[i]; list[i] = t; t = list[ij]; L20: l = j; if (list[j] >= t) { goto L40; } list[ij] = list[j]; list[j] = t; t = list[ij]; if (list[i] <= t) { goto L40; } list[ij] = list[i]; list[i] = t; t = list[ij]; goto L40; L30: list[l] = list[k]; list[k] = tt; L40: --l; if (list[l] > t) { goto L40; } tt = list[l]; L50: ++k; if (list[k] < t) { goto L50; } if (k <= l) { goto L30; } if (l - i <= j - k) { goto L60; } il[m - 1] = i; iu[m - 1] = l; i = k; ++m; goto L80; L60: il[m - 1] = k; iu[m - 1] = j; j = l; ++m; goto L80; L70: --m; if (m <= 0) { return 0; } i = il[m - 1]; j = iu[m - 1]; L80: if (j - i >= 11) { goto L10; } if (i == 1) { goto L5; } --i; L90: ++i; if (i == j) { goto L70; } t = list[i + 1]; if (list[i] <= t) { goto L90; } k = i; L100: list[k + 1] = list[k]; --k; if (t < list[k]) { goto L100; } list[k + 1] = t; goto L90; } /* asort_ */ /* Subroutine */ int kstest_(y, n, p) real *y; integer *n; real *p; { /* Initialized data */ static integer l[80] /* was [8][10] */ = { 40,46,37,34,27,24,20,20, 88,59,43,37,29,27,20,22,92,63,48,41,30,30,25,24,82,59,42,37,26,28, 26,22,62,48,33,30,23,23,22,18,49,34,22,20,16,17,17,12,17,17,7,8,4, 7,5,1,40,18,19,14,16,13,10,9,59,20,10,4,1,1,0,-1,41,43,36,112,15, 95,32,58 }; /* System generated locals */ integer i__1; /* Builtin functions */ double log(), exp(), sqrt(); /* Local variables */ static real a, e; static integer i, j, m; static real t, z; extern /* Subroutine */ int asort_(); extern doublereal sp_(); /* TO TEST WHETHER A SET OF N REAL NUMBERS IS DRAWN */ /* FROM A UNIFORM DISTRIBUTION (KOLMOROGOV-SMIRNOV METHOD) */ /* THE TEST IS BASED ON THE DISTANCE BETWEEN THE EMPIRICAL */ /* AND THEORETICAL DISTRIBUTION FUNCTIONS */ /* USAGE: CALL KSTEST(Y,N,P) */ /* Y ... ARRAY OF REAL NUMBERS HYPOTHETICALLY DRAWN */ /* FROM A UNIFORM DISTRIBUTION ON (0,1) */ /* N ... NUMBER OF ELEMENTS IN 'Y' */ /* P IS THE PROBABILITY ASSOCIATED WITH THE OBSERVED VALUE */ /* OF THE ANDERSON-DARLING STATISTIC: N TIMES THE INTEGRAL */ /* OF (FN(X)-X)**2/(X*(1-X)) */ /* Parameter adjustments */ --y; /* Function Body */ asort_(&y[1], n); z = -(*n) * (*n + (float)0.); i__1 = *n; for (i = 1; i <= i__1; ++i) { t = y[i] * ((float)1. - y[*n + 1 - i]); if (t < (float)1e-20) { t = (float)1e-20; } /* L2: */ z -= (i + i - 1) * log(t); } z /= *n; *p = (float)0.; if (z < (float).01) { goto L5; } if (z > (float)2.) { goto L3; } *p = exp((float)-1.2337 / z) * (float)2. * (z / (float)8. + (float)1. - z * (float).04958 * z / (z + (float)1.325)) / sqrt(z); goto L5; L3: if (z > (float)4.) { goto L4; } *p = (float)1. - exp(z * (float)-1.091638) * (float).6621361 - exp(z * ( float)-2.005138) * (float).95059; goto L5; L4: *p = (float)1. - exp(z * (float)-1.050321) * (float).4938691 - exp(z * ( float)-1.527198) * (float).5946335; L5: /* Computing MIN */ i__1 = *n - 2; m = min(i__1,8); e = (float)0.; for (j = 1; j <= 10; ++j) { /* L6: */ e += l[m + (j << 3) - 9] * sp_(p, &j) * (float)1e-4; } if (*n > 10) { e = e * (float)10. / *n; } a = *p + e; return 0; } /* kstest_ */ doublereal sp_(x, i) real *x; integer *i; { /* System generated locals */ real ret_val, r__1; /* Local variables */ static real t; ret_val = (float)0.; switch ((int)*i) { case 1: goto L7; case 2: goto L7; case 3: goto L7; case 4: goto L7; case 5: goto L7; case 6: goto L7; case 7: goto L7; case 8: goto L8; case 9: goto L9; case 10: goto L10; } L7: t = (r__1 = *x * (float)10. - (float).5 - *i, dabs(r__1)); if (t > (float)1.5) { return ret_val; } if (t <= (float).5) { ret_val = (float)1.5 - t * (float)2. * t; } else { ret_val = (float)2.25 - t * ((float)3. - t); } return ret_val; L8: if (*x <= (float).8 || *x >= (float)1.) { return ret_val; } /* Computing 2nd power */ r__1 = *x - (float).9; ret_val = r__1 * r__1 * (float)100. - (float)1.; return ret_val; L9: if (*x <= (float)0. || *x >= (float).05) { return ret_val; } if (*x <= (float).01) { ret_val = *x * (float)-100.; } else { ret_val = (*x - (float).05) * (float)25.; } return ret_val; L10: if (*x <= (float).98 || *x >= (float)1.) { return ret_val; } ret_val = (float).1 - (r__1 = *x - (float).99, dabs(r__1)) * (float)10.; return ret_val; } /* sp_ */ /* Subroutine */ int plot1_0_(n__, x, y, n, nc, z) int n__; real *x, *y; integer *n, *nc; real *z; { /* Initialized data */ static struct { char e_1[4860]; } equiv_1 = { {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '} }; /* Format strings */ static char fmt_22[] = "(\002 X RANGE:\002,g12.3,\002 TO \002,g12.3\ ,\002 Y,Z RANGE:\002,g12.3,\002 TO \002,g12.3)"; static char fmt_21[] = "(10x,90a1)"; /* System generated locals */ integer i__1; real r__1, r__2; static char equiv_0[4860]; /* Builtin functions */ integer s_wsfe(), do_fio(), e_wsfe(); /* Subroutine */ int s_copy(); /* Local variables */ #define c_ (equiv_0) #define d_ (equiv_0) #define e ((char *)&equiv_1) #define f ((char *)&equiv_1) static integer i, j, k, m; static logical p2; static real yb, xd, yd; static integer nr; static real xl, xr, yt; /* Fortran I/O blocks */ static cilist io___561 = { 0, 6, 0, fmt_22, 0 }; static cilist io___567 = { 0, 6, 0, fmt_21, 0 }; /* Parameter adjustments */ --x; --y; if (z) { --z; } /* Function Body */ switch(n__) { case 1: goto L_plot2; } p2 = FALSE_; goto L1; L_plot2: p2 = TRUE_; L1: nr = *nc * 48 / 100; if (*nc > 60) { nr = *nc * 6 / 10; } xl = x[1]; xr = xl; yb = y[1]; yt = yb; i__1 = *n; for (i = 1; i <= i__1; ++i) { /* Computing MIN */ r__1 = xl, r__2 = x[i]; xl = dmin(r__1,r__2); /* Computing MAX */ r__1 = xr, r__2 = x[i]; xr = dmax(r__1,r__2); if (p2) { /* Computing MIN */ r__1 = yb, r__2 = z[i]; yb = dmin(r__1,r__2); } if (p2) { /* Computing MAX */ r__1 = yt, r__2 = z[i]; yt = dmax(r__1,r__2); } /* Computing MIN */ r__1 = yb, r__2 = y[i]; yb = dmin(r__1,r__2); /* L2: */ /* Computing MAX */ r__1 = yt, r__2 = y[i]; yt = dmax(r__1,r__2); } s_wsfe(&io___561); do_fio(&c__1, (char *)&xl, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&xr, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&yb, (ftnlen)sizeof(real)); do_fio(&c__1, (char *)&yt, (ftnlen)sizeof(real)); e_wsfe(); xd = (float)1.; if (xl != xr) { xd = *nc / (xr - xl); } yd = (float)1.; if (yb != yt) { yd = nr / (yt - yb); } s_copy(d_, e, 4860L, 4860L); i__1 = *n; for (m = 1; m <= i__1; ++m) { i = (x[m] - xl) * xd + (float)1.; j = (y[m] - yb) * yd + (float)1.; *(unsigned char *)&c_[i + j * 90 - 91] = '*'; if (! p2) { goto L4; } k = (z[m] - yb) * yd + (float)1.; *(unsigned char *)&c_[i + k * 90 - 91] = '+'; if (j == k) { *(unsigned char *)&c_[i + k * 90 - 91] = '0'; } L4: ; } for (j = nr; j >= 1; --j) { /* L5: */ s_wsfe(&io___567); i__1 = *nc; for (i = 1; i <= i__1; ++i) { do_fio(&c__1, c_ + (i + j * 90 - 91), 1L); } e_wsfe(); } return 0; } /* plot1_ */ #undef f #undef e #undef d_ #undef c_ /* Subroutine */ int plot1_(x, y, n, nc) real *x, *y; integer *n, *nc; { return plot1_0_(0, x, y, n, nc, (real *)0); } /* Subroutine */ int plot2_(x, y, z, n, nc) real *x, *y, *z; integer *n, *nc; { return plot1_0_(1, x, y, n, nc, z); } source/meld.c100644 765 144 11671 6077246035 11661 0ustar geousers/* meld.f -- translated by f2c (version 19950110). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include "f2c.h" /* Table of constant values */ static integer c__9 = 9; static integer c__1 = 1; static integer c__4096 = 4096; /* Main program */ MAIN__() { /* Format strings */ static char fmt_845[] = "(a15)"; static char fmt_35[] = "(a1)"; static char fmt_99[] = "(\002 The files \002,a15,\002 and \002,a15,\002\ have been merged\002,/,\002 and 9,994,240 bytes have been written to file \ \002,a15)"; /* System generated locals */ olist o__1; /* Builtin functions */ integer s_wsle(), do_lio(), e_wsle(), s_rsfe(), do_fio(), e_rsfe(), f_open(), s_rdue(), do_uio(), e_rdue(), s_wdue(), e_wdue(), s_wsfe(), e_wsfe(); /* Local variables */ static char file1[15], file2[15], file3[15]; static integer a[4096], b[4096], c[4096], i, k, jk; static char op[1]; /* Fortran I/O blocks */ static cilist io___1 = { 0, 6, 0, 0, 0 }; static cilist io___2 = { 0, 6, 0, 0, 0 }; static cilist io___3 = { 0, 6, 0, 0, 0 }; static cilist io___4 = { 0, 5, 0, fmt_845, 0 }; static cilist io___6 = { 0, 6, 0, 0, 0 }; static cilist io___7 = { 0, 5, 0, fmt_845, 0 }; static cilist io___9 = { 0, 6, 0, 0, 0 }; static cilist io___10 = { 0, 5, 0, fmt_845, 0 }; static cilist io___12 = { 0, 6, 0, 0, 0 }; static cilist io___13 = { 0, 6, 0, 0, 0 }; static cilist io___14 = { 0, 5, 0, fmt_35, 0 }; static cilist io___16 = { 0, 6, 0, 0, 0 }; static cilist io___19 = { 0, 1, 0, 0, 0 }; static cilist io___21 = { 0, 2, 0, 0, 0 }; static cilist io___25 = { 0, 3, 0, 0, 0 }; static cilist io___26 = { 0, 1, 0, 0, 0 }; static cilist io___27 = { 0, 2, 0, 0, 0 }; static cilist io___28 = { 0, 3, 0, 0, 0 }; static cilist io___29 = { 0, 6, 0, fmt_99, 0 }; /* L1: */ s_wsle(&io___1); do_lio(&c__9, &c__1, " This program merges, via addition mod 2^32 or", 46L); e_wsle(); s_wsle(&io___2); do_lio(&c__9, &c__1, " exclusive-or, the 32-bit integers in two binary \ files", 55L); e_wsle(); s_wsle(&io___3); do_lio(&c__9, &c__1, " Enter first file name (<= 15 characters):", 42L); e_wsle(); s_rsfe(&io___4); do_fio(&c__1, file1, 15L); e_rsfe(); s_wsle(&io___6); do_lio(&c__9, &c__1, " Enter second file name (<= 15 characters):", 43L); e_wsle(); s_rsfe(&io___7); do_fio(&c__1, file2, 15L); e_rsfe(); s_wsle(&io___9); do_lio(&c__9, &c__1, " Now choose a name for your output file:", 41L); e_wsle(); s_rsfe(&io___10); do_fio(&c__1, file3, 15L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 1; o__1.ofnmlen = 15; o__1.ofnm = file1; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); o__1.oerr = 0; o__1.ounit = 2; o__1.ofnmlen = 15; o__1.ofnm = file2; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___12); do_lio(&c__9, &c__1, " Choose your operation, + for add, x for exclusive\ -or:", 54L); e_wsle(); s_wsle(&io___13); do_lio(&c__9, &c__1, " Enter choice in column 1:", 26L); e_wsle(); s_rsfe(&io___14); do_fio(&c__1, op, 1L); e_rsfe(); o__1.oerr = 0; o__1.ounit = 3; o__1.ofnmlen = 15; o__1.ofnm = file3; o__1.orl = 16384; o__1.osta = 0; o__1.oacc = "direct"; o__1.ofm = "unformatted"; o__1.oblnk = 0; f_open(&o__1); s_wsle(&io___16); do_lio(&c__9, &c__1, " Please wait...............", 28L); e_wsle(); jk = 0; if (*(unsigned char *)op == '+') { for (i = 1; i <= 610; ++i) { ++jk; io___19.cirec = jk; s_rdue(&io___19); do_uio(&c__4096, (char *)&a[0], (ftnlen)sizeof(integer)); e_rdue(); io___21.cirec = jk; s_rdue(&io___21); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); for (k = 1; k <= 4096; ++k) { /* L3: */ c[k - 1] = a[k - 1] + b[k - 1]; } /* L2: */ io___25.cirec = jk; s_wdue(&io___25); do_uio(&c__4096, (char *)&c[0], (ftnlen)sizeof(integer)); e_wdue(); } } else if (*(unsigned char *)op == 'x') { for (i = 1; i <= 610; ++i) { ++jk; io___26.cirec = jk; s_rdue(&io___26); do_uio(&c__4096, (char *)&a[0], (ftnlen)sizeof(integer)); e_rdue(); io___27.cirec = jk; s_rdue(&io___27); do_uio(&c__4096, (char *)&b[0], (ftnlen)sizeof(integer)); e_rdue(); for (k = 1; k <= 4096; ++k) { /* L93: */ c[k - 1] = a[k - 1] ^ b[k - 1]; } /* L92: */ io___28.cirec = jk; s_wdue(&io___28); do_uio(&c__4096, (char *)&c[0], (ftnlen)sizeof(integer)); e_wdue(); } } s_wsfe(&io___29); do_fio(&c__1, file1, 15L); do_fio(&c__1, file2, 15L); do_fio(&c__1, file3, 15L); e_wsfe(); } /* MAIN__ */ source/operm5d.ata100644 765 144 111217 6066304106 12643 0ustar geousers 5817257 -6873271 -5128747 -5402629 777663 980677 2407731 2347927 2954082 2749952 2512448 3103860 2631372 1019585 5833700 -1609797 -136098 14746 4199803 15820046 15661640 5888319 -3837421 -1317810 -375269 -496546 149397 21483 -341148 314595 2772502 843578 8843654 -1211426 2341534 3013752 1250340 -699051 -654566 961558 -2338987 -2621631 2873613 1261792 8000951 -1746067 6638 -47636 -5088578 -5013620 -3253847 -3180615 2711412 3844202 880534 -1042552 6946781 -3015244 406795 1147260 5940872 -5186478 -5307926 773214 938192 2462991 2185748 2756969 2860993 2501911 3080424 2695718 1101077 7899915 -3833937 -175045 -54950 6072206 13434946 15661640 5768163 -3875391 -1169953 -292941 -536013 124632 45505 -337415 265604 2721922 823928 8523149 -1017852 2281795 2999166 1218871 -700064 -634661 957048 -2629675 -2235002 2733295 1136430 7885100 -1626583 -58766 124832 -4795309 -5249849 -3154841 -3094350 2642865 3795316 872576 -1015702 6779035 -2926770 386412 1127795 12208259 1266547 -1384963 -1449671 -3169754 -1595651 -1946939 -1940155 -3378061 -3782485 -1922633 -1103400 -4529238 1922627 67943 -594084 -4436559 -10716612 -12948181 -3099354 3086687 741196 127286 909813 551771 418521 -174949 -545067 -1869313 -876135 -7345496 178672 -2378999 -2769171 -1090475 331067 236296 -551403 2892697 2810799 -2367546 -1617469 -4838379 1451362 -568191 978772 574172 2759542 386836 3123220 -1235398 -2188412 -119033 987303 -5601207 1946655 -583034 -1102184 12576469 -1912105 -1491496 -1977361 -3787433 -3866431 -3931068 -2169174 -2042830 -2367628 -1217010 -5574861 2386416 -567819 399012 -5292193 -13303845 -13360923 -5639180 3651213 1466137 880935 -148585 -363477 -353888 618037 631948 -2599440 -1019748 -8865897 687501 -2968293 -3124000 -1089813 119334 419444 -786927 3367082 3316348 -2961598 -1738843 -6050705 1707414 789397 -308316 1178460 3734616 3617835 1360963 -2307922 -2689133 -407480 1067944 -6848988 2699162 -925197 -1068995 11788007 1145706 1193936 968826 3495027 3575638 1116536 3617330 3145167 110228 7883910 -2325769 103020 -580856 7068780 17106824 17369039 5744570 -6152687 -983990 -364426 -482051 205432 171091 -512242 192023 3244057 1864653 11153794 -125218 2622003 3388711 1601939 -856517 -817212 825017 -3038222 -2961270 3416768 2474327 8116870 -1917663 572557 -258900 -3200854 -5353978 -3054952 -4014445 410478 3983005 1088413 -1375640 8044077 -3289536 441887 1325474 12630118 3156565 3488013 1910767 1992878 2735849 1745194 2635085 1072076 9179053 -2371600 -331321 -726418 7681229 19285416 19432752 6482845 -4523253 -3272693 -597204 -336131 -60141 313513 -626813 170991 4236377 1050429 11461421 -1234081 3788310 4585317 1236864 -894703 -1197329 1736061 -3427987 -3398261 5012230 1426003 9463295 -1841304 154862 -198796 -3804025 -5955104 -4195634 -4485277 2898985 1978361 1142239 -988737 9409193 -3205744 894517 1606478 7707161 -3210627 -1751105 -1898045 -4862023 -3470391 -2214791 -164614 -5625407 1704720 -162789 1058901 -4040265 -11094051 -11240782 -4277352 3075254 1065447 234919 -912108 650889 150505 89522 -509848 -1766909 277069 -7775749 1180521 -1906123 -2596068 -578000 357487 367605 -646039 2484350 2560723 -2311007 -195134 -5880504 1481832 -645252 765355 2637470 2458334 907216 2880116 -2988096 -1995274 -783123 393286 -5564831 1655303 -297358 -1033184 7473799 -3528010 -3376497 -3304459 -1503292 -2411204 89031 -5943125 1917870 1311823 -122953 -4332928 -11706073 -11653524 -3963993 3185910 1308114 -1090325 -48253 -510843 -290876 1024800 623728 -1974078 169173 -6030119 -477907 -2291701 -2499215 -533396 449148 352872 -885457 2684378 2523291 -2661828 -154622 -6156614 1638839 973738 -705099 2787313 2932584 3357426 1068284 -3746916 -2087932 -673963 -44993 -5854907 2108010 -584389 -737864 7674168 -5061376 -1170678 -3391201 -1173129 -624707 -4576847 1695880 476307 -158287 -3332444 -9534973 -9589812 -3359207 2586819 946168 852391 -121459 -417820 -187145 -994183 727155 -1116115 -339665 -5873899 366444 -529818 -3127321 -861888 762433 675088 -804551 2122875 2007541 -1390150 -899468 -4708544 1257097 336976 -271853 2382850 2263714 2150539 755793 -943518 -3487005 -942169 853872 -5023503 1542516 -396522 -857101 7676071 -1157770 -3401474 -1256009 -647207 -4486485 1690858 608305 -257057 -3350870 -9555891 -9589812 -3250732 2572294 948690 646779 76395 -432195 -170690 1147802 -1408811 -1083128 -383340 -5876692 381082 -2650521 -978117 -962546 746717 749606 -760829 2024721 2095214 -1355683 -815464 -5012953 1493020 421631 -389564 2325617 2413194 2271141 678383 -1024047 -3555556 -851184 779183 -4684921 1214615 -415255 -854396 8064414 -3701394 -2310077 287117 -5317816 1555682 130010 978906 -4169702 -11195194 -11240782 -4157808 3204649 1299856 130348 1033123 -1142203 701920 -27570 -660547 -1635451 -1672910 -5915594 1031074 -1979946 -2368771 -664404 614133 645425 -1082134 2441715 2443669 -2964969 -100626 -5598599 1199646 -218183 621491 2897493 2894383 1396294 3009586 -3031303 -2134450 -403409 839727 -5502336 1239352 -1319653 -1327582 7209204 -664777 -850019 -3914508 1380687 -396598 882119 -3458436 -9122862 -9177070 -3454519 2713532 1139070 -9605 1098575 766756 -1302001 -282375 -582102 -2863014 -392040 -5742588 66937 -664050 -1225271 -1034744 544433 606184 -476333 2033048 2032012 -1039768 -1543121 -4192878 1227365 -664222 753326 2349673 2331917 192786 2496085 -814587 -3847450 -315744 1314137 -4125681 1287673 -515796 -1501943 9788325 207618 816655 -768078 -1874570 -1613116 235288 1694932 1621948 377883 -507902 -243766 773939 679052 391398 78143 70943 516176 -2961954 104444 936801 186178 -971859 -1257559 238423 462669 670075 314213 -672481 -566615 -1309880 -1073728 1594210 361560 472243 414552 -597724 -260047 -772016 -887315 216603 1073384 -1323896 -231085 509060 -359227 499417 197952 9689335 704290 -2495107 -343154 -545326 1594815 4764261 4694945 1741823 -997869 -298676 -333203 -157564 218154 283497 127218 -147690 764431 -2838739 1284848 -1411175 796176 1142228 598938 -102712 48775 1098536 -1137672 -1030484 -190599 -1133802 2347281 -484327 960682 908055 -1281146 -997818 -1308632 -1286716 1401975 747166 -70699 -1684165 2374406 -334264 -130586 172260 12856576 -3650442 -153223 -509349 2984690 6258554 6402344 758796 -1671327 -526914 472 -173308 381688 -160284 71948 598991 1047898 -1081349 5230227 283473 949081 1517248 1102581 -184126 -184437 1235250 -2015041 -1859118 2256388 834088 2086134 -801538 -649920 1155134 -692225 -1974792 -1934348 -2169637 884616 1606568 60140 -2105033 4180691 -919229 -60329 382106 16061715 284740 738712 -15990290 -39765302 -39992484 -13609368 9753282 2972046 156313 398252 -793746 -90924 240150 -692225 -6722501 -3772274 -23064086 2458558 -6920292 -7778422 -2161491 1501233 1325224 -2446757 7918006 7606452 -6908594 -2985205 -19436137 4164401 147843 -1345055 8477804 9636350 9222882 9766063 -6790882 -8657391 -2361496 460093 -18777173 6979470 -2385573 -3107404 8943975 -1726046 -4422865 -11965780 -11979204 -4298851 3162346 1105638 -1701684 969212 -119091 -9373 -1028843 -1922549 -3197247 -773590 -6887291 370210 -890213 -1733307 -744361 921020 773952 -860450 2177367 2171512 -1578001 82087 -6649715 2701955 -2078191 -154198 2614010 2515825 2606238 3755822 -2042299 -3216470 -2271286 202674 -5822175 1364777 91778 -759997 9279076 -4122768 -12397404 -12391946 -4508748 3316732 1261182 601366 -1733920 -1652447 -1685738 458865 205135 -3458419 -842673 -6972261 527616 -1230943 -1544141 -784368 985452 885839 -1107901 2315732 2157857 -1772253 29449 -5009984 946688 -309783 -1779855 2773685 2303574 3556282 2884208 -2088659 -2834284 -2541311 179041 -5926123 1727548 -243610 -508396 -169515 -28616431 -28456656 -8272206 5944023 1391497 485357 302324 -110825 -524670 -196731 -977499 -4449426 -1278290 -17503766 1839778 -4409581 -5168434 -1911570 1277831 1087315 -2245147 5878400 5664632 -5254766 -2052598 -12525819 2249452 -760678 -200644 5096033 7585065 6981948 5551021 -4598968 -6184469 -1312378 1910194 -14358844 4952535 -1312334 -2111121 30614535 17938173 6069703 -5141440 -2452230 -103399 -496191 122684 393306 -3324 566726 3441613 1599877 10965699 -524256 3387788 3919040 1422213 -446145 -526119 1510412 -3928170 -3932323 3871650 1934802 8916034 -2690702 481386 192736 -4163786 -3890368 -6141496 -4425174 3039163 4071256 1008284 -859215 8542837 -2865634 1060847 1616493 17938173 996719 -2434152 932374 -96427 -220179 -58991 238588 118573 324122 1231670 777902 3346342 -205884 1209513 1379528 452829 -128851 99329 589815 -1361698 -1180023 1389694 949257 2644065 -1080600 338992 -127446 -1231583 -2950726 -956807 -1519733 628094 1443407 427124 -92232 2537576 -990861 413479 652123 -471422 6195991 1113967 149453 586130 -240462 -399150 -155398 -961888 -4449688 -1287357 -15294819 -325756 -4396733 -5152212 -2127711 1175047 1191243 -2026174 5763885 5756828 -5394757 -2209287 -15074258 4780945 -306775 -304869 6116930 5044574 5755905 5855058 -3347241 -5023645 -1292896 1911983 -12155731 2753977 -1306931 -2119034 30596457 5128965 754357 967489 -977486 -1008316 643303 -1400440 -12958386 -4650101 -44458241 1661554 -12902311 -14956077 -5499032 2838837 2653009 -5547818 15749833 15441678 -14780057 -6668242 -36591537 9732117 -1394283 -684778 17053686 16846975 16925457 17740069 -10816408 -17150081 -3704620 4622406 -35229968 10987703 -3590848 -5669752 17938173 654583 1067326 -996386 -996386 654583 -1409128 -13004611 -4694945 -44687429 1707399 -12946569 -15010281 -5549450 2760215 2760215 -5549450 15661640 15661640 -14868401 -6558735 -36722790 9672038 -1267248 -854505 17073993 17073993 17227159 17639902 -13090061 -15153773 -3685660 4624005 -35368479 11026349 -3627619 -5691331 9631898 -1482633 54818 -22922 -3162578 -1646591 -1985126 -1181733 -7097260 453277 -3345419 -1996393 -812280 784881 857171 -502614 2435906 2422919 -1673523 -1532476 -5928779 1352122 -1765015 288456 2407858 2242905 2337000 3499857 -1642341 -2653975 -104749 1590181 -6486955 2704544 -2191444 -860476 9131652 -1750631 -1402232 -1529487 433940 -1873892 -1577241 -7430724 775874 -3809289 -1785056 -851404 930039 885092 -756411 2516119 2516287 -1981708 -1520743 -6312272 1579176 443212 -1765501 2589914 2723308 3868037 2631217 -2338451 -2857429 -336626 1456269 -4733684 1188362 -2559537 -533359 9635236 -3480355 234715 -1713339 -1786009 -942300 -6582053 567358 -1268897 -3199024 94337 278625 223866 -1227 1998075 1954983 -1882173 -989347 -4837419 1501913 -378133 -1579650 2169282 1939921 2835185 2284326 -1471866 -2331364 603310 774412 -4564306 1649815 546095 -3560514 9133055 576931 -1838090 -1575644 -546667 -5974924 102294 -1609096 -3954897 245672 84620 174242 69164 2035174 2040868 -2039600 -666835 -5288842 1679362 -63614 -1983947 2125508 2331261 3175056 2199594 -1918560 -2327297 474751 231166 -5196035 1875155 -931648 -1133053 9773489 -1862392 -1398658 -521372 -7079075 102521 -4088987 -2503670 -646979 958975 915398 -912326 2433740 2400479 -2163102 -1113484 -6239150 1369007 -1551509 -55720 2828224 2821130 3000805 3768919 -2097824 -2821885 -223074 -602973 -4947020 2564102 -2223357 -901689 8706420 -1366175 -519201 -5818939 115095 -1601087 -4568129 257121 -40389 -142522 367959 2032813 1977819 -1731039 -1039554 -4723662 1379294 -2100472 68686 2239639 2209012 1929147 3196402 -1858975 -2543681 -956770 713196 -4624084 1609316 1105386 -1561099 9977044 -10005 738692 -243966 -1685611 -1277420 613866 998578 -1141612 274748 -398265 -403453 -1280821 1087012 1393099 592586 376394 72343 -801939 -841500 -544546 -895294 -133277 916054 -1535713 -471115 418431 -500743 23010 169846 10057852 1115332 -1483870 684017 102058 1144549 128732 125507 -700360 -851573 -849399 1747805 -1125075 2181772 -307616 882249 761661 -1217332 -1182985 -1419944 -1535269 1248311 347458 -226997 -1943992 1859797 -501906 59397 -138990 19603777 -3093355 2705916 3198213 1279848 -89116 -147602 1323054 -2640907 -4821370 3326828 26654 9292167 -2513710 -56919 -250815 -4451120 -3165932 -3434306 -3564544 3493641 3467468 724596 -622178 6745180 -2739488 752126 1361112 10734403 -5132425 -6004834 -2452839 1523012 1570478 -2067370 5007404 7163899 -6403237 -4721012 -15151743 5283223 -625742 -179878 7573329 6289278 6598196 7073180 -3058860 -5889436 -1742525 2385418 -14706099 3413449 -1547209 -2557578 9429030 -1579437 323947 -1105324 1021651 613824 -400720 -407706 -1344265 -157865 297588 -536963 876120 576127 -238217 -239680 -462730 -697919 368196 1243333 216098 769755 1283325 568448 -1851094 -247410 9563652 -146178 -106418 -81968 1318504 -838181 -809205 -1197217 321988 1677085 -495026 393228 642730 -913139 -910948 -1384543 -1249486 527322 1555940 1777437 -318896 1831454 -476864 1224177 -662168 8838223 129822 106460 -3781000 978397 950268 -2389032 -686959 -3009043 548512 -1637754 -1939260 1143706 1010841 1661983 1453029 -1245950 -1105731 -1908689 -872500 -2607359 887605 -2120318 -762565 9407258 -3329207 -543404 495433 481935 -639390 -1645077 -2949971 -1125543 -437749 -331550 723091 653061 720077 769009 -491982 -982378 -1366743 -1520225 -2789582 -1051088 760491 -358717 9412838 -543963 529994 533542 -878505 -1815960 -2987879 -1027427 -342803 -215904 671108 727978 768631 578377 -543201 -699854 759555 -1492685 -2966777 -947133 -1393669 -375174 9322729 990421 993122 -2766044 -920818 -3085722 719448 -1609236 -1539816 1326448 1448740 981107 1344461 -797117 -1314329 -1795929 1202468 -3038978 843359 -1429736 -3222343 5600698 -7094995 3505347 1677739 8777107 -3043075 174980 -6288 -5704747 -5414472 -5816802 -5963228 1298304 2336971 941672 -922438 7623462 -1994802 918570 1451741 5669038 3381247 1560351 8618204 -2849997 119959 158191 -5430756 -5669979 -5805779 -5828349 1234328 2315406 937305 -900239 9610408 -4033535 902614 1438372 9684432 119461 1491972 -864527 -1862235 -1619349 -650694 -930447 -1076932 -1168424 832989 -74466 856824 741985 1744852 -825050 859086 695081 9760389 1434945 -2639535 -197156 -543339 -1300570 -1619230 -1579874 -1620101 27263 1559717 1159568 218374 3651176 -685618 106377 630957 13873087 -3395506 344530 -88120 -2871807 -2466149 -2305917 -2707507 1670567 2475144 1381304 -88777 5538967 -1315201 127143 743682 14738568 -577570 -177486 8031699 7662445 9117774 9535613 -6246703 -8146638 -1076730 2607313 -18135663 7145410 -2145377 -2919021 8948369 -1764389 2088085 2503927 2545236 1574731 -1638344 -2525936 -59661 1356156 -5360968 1502987 392027 -368960 9130925 2218720 2309016 1411297 2630133 -1528201 -2222238 -340818 1438399 -5296828 1729061 115197 -229295 5288782 -2468150 -3178646 -3176211 1064242 1810760 357359 -1230268 7368719 -2040753 949232 1171497 5337396 -5819478 -6125576 3533536 4354519 428621 -1309456 9322395 -3447675 1028222 1316063 11962726 1120471 -1276353 -2407025 -519383 544834 -4922921 2040958 -357661 -999724 11932308 -1257381 -1942319 -740746 603229 -4828882 2181421 -504243 -933866 12468168 2467027 616024 -1458923 8802460 -2560956 999619 1240917 13625898 957609 -1467811 10212037 -2432498 1187653 1760262 8529162 44483 -3881070 914013 -2915631 -1377678 9139606 -4197005 -1086105 333347 -1196056 13337711 -3610183 1073383 753978 15732413 -1189288 -2921216 8409697 -1554249 10842338 10073848 3548639 1815793 2027614 -685064 -713206 384210 194997 191338 774290 1003453 1017050 428633 322923 -1075530 -1055311 -226724 -360063 650127 627888 752097 1429091 -891206 -370811 166955 8517 33001 539591 829982 893382 591068 749604 412098 710846 531854 617418 569381 421819 209795 -187607 38855 -246742 -70665 323680 -306626 1313064 252035 359595 -641626 2146670 450372 544572 974197 970167 685179 842290 413805 710415 641225 672422 10109758 -781009 -1010509 1890047 1859624 -299404 -48150 110393 -321309 127888 150481 109738 99866 -792513 -769672 -356709 265956 1027277 1009222 -627888 -966020 1015023 752628 -50284 88982 246951 -55014 416996 477553 506287 854074 533805 582544 518398 603574 429213 350288 319924 -131064 -573935 203417 -175601 277745 1142629 -511495 690957 138430 2249771 -274693 1168420 548042 122162 114411 353241 701754 276705 324816 359546 404334 9318628 -1465214 -379577 -296717 1548855 -163448 87398 -322720 1992691 2059199 238076 323387 -1182750 -150896 -217083 -646361 -70697 -792513 1075530 -745609 237041 -138673 -107528 1139783 952412 617749 381368 -50541 582857 529005 542286 938840 513432 132373 88577 360837 -140940 31598 -46372 703250 141432 -364301 1327432 507491 749677 -736067 2283835 1289791 -918231 322981 -300697 -201852 1011354 579317 689558 740063 583661 198558 9525899 183886 -140179 -84488 1425603 1019961 2102675 728989 322404 533201 303846 -1327432 -749565 -841902 -383446 -258563 -1142629 -306626 1424693 -669550 410595 845735 -615335 -616139 407036 1719820 1739733 1324835 657335 948123 847509 823198 760491 497749 181639 -417041 -56122 392609 386226 -168048 -173909 1374468 970448 -591665 869959 2296097 844298 354274 -922605 676732 304912 939640 672190 1029280 1270876 797609 837817 10101791 -599126 -1495326 -2131242 -279534 1027681 -154979 1905806 544527 -956896 -542286 -1603695 137 -554735 -1478096 -533805 412098 412702 253606 -248690 -94879 -219182 -368662 1098949 1375467 1374865 929543 2028437 2357544 2194488 1035746 1188443 626950 511997 248938 -647454 338658 -504181 -14801 -645026 948123 1809872 271102 733117 1180007 2040804 -141671 817507 -51641 1658234 930437 789454 1116057 1017334 1088753 1137943 9965406 294915 161409 -1978734 -677810 1716065 -476988 -829956 301167 -689558 -1725934 169475 -703750 -1423594 -276705 413805 609164 -1355668 1616180 136776 -415582 -548725 522508 1238487 1090973 2236917 723124 1116057 1080690 2301594 1985767 456349 211711 -643329 -61929 883541 40312 -831300 92752 1029280 1870930 5936 922600 1163360 2033501 -237440 274819 1555024 -306251 1265237 970157 1398089 1304994 1267008 1050572 9455411 -1510944 187219 422146 -3251745 -1430459 -48777 567080 -323387 -105601 194867 -838816 227594 -99866 322923 -173581 -332767 187293 -246330 1006617 -787936 -338903 -72859 314167 30318 903463 -956896 566500 -207989 255058 -218289 138051 62055 235340 358754 -456209 142003 -705946 303846 8141 -458522 938283 202993 -548420 1327027 -168721 -1411301 412784 192453 33840 301167 -228004 -296438 171784 9555644 -634455 -2024743 -2028703 201659 -374435 705946 -364301 460877 -1033368 880317 388391 277745 -323680 -314696 420677 -209682 907772 598427 822447 -259416 -1374481 -1367602 -539048 619100 645026 -1382240 -441739 -433341 -341831 -34570 219882 375144 33921 -120954 556038 -912101 173909 -589699 1282467 -938397 120165 -76721 -194366 1320694 -2384819 -48471 -6903 195461 -92752 -672308 -514031 -479562 10364621 -3811053 -288635 -2003496 427109 -62055 -140940 914305 -1178850 477785 383068 319924 -209795 -363388 750164 -808159 -1001478 740730 1013772 -491691 599275 -1262478 387159 -248832 -248938 -398738 595298 -1301930 -327223 -150855 79658 459105 225110 9644 -566398 219882 417041 -959827 990976 -468241 215172 21883 16527 1064643 -163042 -1897300 -205594 280188 643329 -809582 -1050403 -802084 10304892 1097416 -584577 903583 138051 -360837 -655599 -766294 -565518 -389124 -350288 421819 492429 -369929 474565 -358107 -184581 -741037 377647 -13578 1592741 1253222 354489 511997 582183 -68465 1508451 444122 -114401 150855 -330718 628580 -369675 -928995 34570 181639 801390 786908 478109 705838 -296006 -333894 2034273 1029649 -705664 457864 85076 211711 848831 1505096 928627 10807115 23060 345938 903463 -529005 -777043 -16402 -1329038 -525818 -854074 749604 471151 -805745 813652 -73160 -1480632 658381 31428 1379093 1573128 1038572 -88151 2028437 1701283 1063674 1204145 500478 354489 248832 -298841 268741 -568994 -504155 -619100 657335 958289 184137 1419884 1026456 183407 2045993 729610 -207553 1608578 851797 791284 723124 1084875 1815967 1553990 10318773 1130957 33840 -579317 -1014476 199622 -1538324 -372173 -701754 842290 570996 -259915 534694 138873 -1626163 -1655486 1580957 1336998 1170942 259178 791284 789454 579841 2181651 2056497 318584 85076 -280188 -56984 787054 -37089 -974697 -195461 672190 1067415 -77371 1592128 975058 116100 2021029 214989 1689816 -650727 1127444 933159 970157 1412675 1649898 1903783 9639653 -246330 107528 310149 -1153983 -1478699 217415 50284 166955 161601 -116650 520787 -140804 -170314 -59720 531510 681783 463749 -3190405 -73160 -94879 106964 -1379009 -1337772 612300 -358107 1001478 -305639 -40156 36680 1280885 -907772 845735 977959 -88136 -37750 93016 -12792 50568 361937 133113 819885 -1541056 138873 136776 296474 220882 225128 9455411 -1548855 -1327027 194867 458522 548420 299404 384210 202993 456209 358754 -48777 -142003 -235340 -218289 30318 192453 -72859 -3251745 -1495326 -1411301 -207989 -296438 -338903 422146 -187219 787936 187293 332767 -1006617 1510944 -84488 -168721 838816 938283 -173581 -227594 105601 8141 566500 -228004 314167 -1430459 294915 412784 255058 171784 9318628 -918231 217083 749677 1289791 -781009 -1815793 -2283835 703250 46372 -238076 141432 31598 -88577 -582857 -1011354 -381368 -1992691 379577 300697 -513432 -583661 -617749 322720 87398 952412 138673 237041 1139783 -163448 1465214 -322981 -646361 736067 745609 -70697 -150896 -507491 -938840 -740063 50541 -2059199 296717 201852 -132373 -198558 9366725 239427 274854 -875466 1168420 -450372 -36916 -901303 -1778168 -50568 202880 654659 -886936 -380586 -931771 -382382 -2045993 141671 150298 -714527 -912445 -724395 333894 16527 1131648 71139 419516 1400473 -194366 -354274 1370158 983080 -1185154 -497648 826358 -315612 -637431 -861221 -617974 62102 -2021029 237440 240868 -282551 -466279 9107636 -1618486 49667 356709 -226724 91780 -38746 332565 -1153983 264787 47924 381604 -1683014 -1583360 -1683014 -16402 137 109289 605001 376413 381604 -766294 1178850 -47924 332565 38746 -264787 1033368 -841902 932180 1618486 -89570 91780 -49667 -239427 932180 109289 -14748 -1583360 199622 169475 -14748 376413 121534 9430347 575005 690957 -252035 -349451 564728 -556792 88136 -1011186 -991207 -2015366 -457171 113147 -1662370 -184137 -271102 -615937 -88030 90307 46323 -786908 990976 377848 176847 324349 -180275 1282467 591665 -1186711 -144650 1369689 -156305 160001 983080 -553694 -52848 -628708 -2205485 77371 -5936 -27911 -266108 -47895 9892701 -274693 -2146670 -40627 -464886 -2184399 12792 555681 549076 -548474 -1037168 -881541 -487307 -183407 -2040804 -174626 -837310 -684086 -12117 296006 21883 446862 -822442 1193708 339025 -76721 -844298 1159232 160001 -294770 -280012 1929874 826358 -1375351 -385767 -328489 -390691 -116100 -2033501 -145880 -715354 -596881 10109758 -3548639 -2249771 203417 573935 -109738 -175601 -131064 -429213 -506287 -353241 -416996 -127888 -1890047 -122162 -518398 -359546 55014 321309 110393 246951 -752628 1015023 88982 -48150 1010509 -548042 265956 -138430 966020 1027277 -769672 511495 -582544 -324816 -477553 -150481 -1859624 -114411 -603574 -404334 10073848 -641626 246742 38855 428633 70665 187607 569381 591068 685179 829982 1003453 -685064 974197 531854 641225 539591 774290 -191338 -33001 -370811 891206 -8517 -194997 2027614 544572 360063 359595 1429091 -650127 1055311 1313064 710846 710415 893382 1017050 -713206 970167 617418 672422 9650591 -2226103 -437370 93016 -398116 -448790 703575 1063106 1164234 928398 1026456 1180007 -673360 858688 947959 687597 705838 -215172 -133451 1224544 -787254 -75243 -120165 2296097 395949 156305 623743 463232 280012 497648 645482 1460686 1662689 818541 975058 1163360 -715348 727388 876663 10356582 -3801323 -36680 862962 779507 -497956 -681434 -550179 -54047 568994 504181 -1874509 -1011857 -881387 20373 369675 9644 365017 742391 -260763 540989 -120954 -386226 987068 324349 -345743 787254 1193708 419516 -160927 240058 -1369583 -235428 37089 -40312 -1793762 -569944 -464691 10332390 -40156 -460565 -648252 698431 635757 765957 506720 268741 338658 -690022 1030479 1154656 555644 628580 -225110 -132479 1275419 -742391 -230549 -33921 392609 1990107 -176847 778274 1224544 822442 -71139 917099 -232520 1625911 691823 787054 883541 -767926 590846 728966 9639653 -1280885 305639 612300 -3190405 -1541056 681783 345938 544527 133113 -1379009 220882 531510 903583 -427109 59720 520787 116650 170314 374435 533201 361937 1478699 -37750 161601 -217415 -310149 977959 106964 296474 463749 1130957 -829956 819885 -1337772 225128 9542197 -732676 -1843811 -1881039 193856 383027 504155 14801 -361836 -2081210 -34398 148093 928995 -566398 434800 230549 540989 260646 556038 168048 106704 -180275 1314085 75243 339025 1400473 -753093 -446150 -677944 -130918 974697 831300 -1001736 -1999405 53151 10596548 -3717806 -213986 -1969096 390699 298841 647454 -316040 -278950 -2001203 942609 330718 459105 -349051 132479 365017 434800 375144 56122 -243208 377848 1285755 133451 446862 1131648 -496044 -304459 -452499 928749 56984 61929 -222468 688033 -3160187 10038127 1202708 -947943 1054012 500478 626950 1084874 1475487 -643142 1630193 444122 327223 -942609 555644 -20373 -148093 341831 497749 969010 -46323 2392480 687597 12117 724395 514498 1120123 576540 1739931 318584 456349 971353 416500 431676 10884697 -43244 1220232 1038572 929543 1420834 491978 1803583 1054012 1253222 -387159 -390699 506720 54047 -383027 539048 1324835 1076200 1662370 529993 928398 487307 382382 1797057 1573000 1419422 1537872 259178 2236917 1935230 -233522 1382550 9924096 1537872 851797 930437 1377257 2088435 -171109 1739931 457864 205594 -928749 691823 235428 130918 6903 939640 893440 2205485 560846 818541 390691 -62102 1773876 1450482 1195850 1056306 1127444 1265237 1164000 3110960 570357 10884697 1379093 1375467 1573000 491978 -233522 1202708 -13578 -599275 213986 635757 681434 1881039 1374481 1719820 1797057 457171 529993 1063106 1037168 380586 1076200 1420834 1935230 -43244 1336998 1238487 1419422 1803583 1382550 10807115 -154979 -207553 1063674 1815967 31428 1097416 288635 -658381 813652 805745 1480632 2028703 728989 729610 1329038 1419884 471151 525818 777043 958289 1701283 1084875 1573128 23060 1716065 1608578 1204145 1553990 10101791 -51641 1035746 1088753 1098949 1027681 279534 368662 -248690 -253606 219182 2131242 183886 817507 554735 733117 412702 1478096 1603695 1809872 2194488 1017334 1374865 1905806 -599126 1658234 1188443 1137943 10316742 1354558 1382532 1120123 1029649 163042 304459 -232520 -240058 446150 2384819 676732 428854 52848 838622 1460686 385767 861221 941340 3181394 2126928 1450482 1689816 1555024 -302301 1262477 1399098 10629882 -201757 1475487 -68465 -595298 278950 1030479 1011857 2081210 441739 823198 980270 88030 836672 858688 837310 714527 980270 1354558 2449803 2088435 2181651 2301594 2449803 -201757 1772669 10232054 416500 1505096 1050403 -688033 590846 569944 1999405 514031 797609 1149437 266108 512340 727388 715354 282551 976350 1262477 2210810 3110960 1649898 1267008 1617815 3201103 921690 10038127 377647 491691 3717806 698431 497956 1843811 259416 407036 514498 2015366 2392480 703575 548474 886936 969010 1084874 971353 -947943 1580957 522508 576540 -643142 431676 10304892 3811053 741037 474565 369929 184581 2024743 2102675 2034273 565518 478109 492429 389124 655599 801390 582183 848831 1592741 -584577 -677810 -705664 1508451 928627 10364621 1013772 808159 750164 740730 -634455 -1019961 -1064643 477785 468241 363388 383068 914305 959827 398738 809582 1262478 2003496 1978734 1897300 1301930 802084 10596548 648252 779507 -732676 822447 616139 496044 -991207 -1285755 448790 549076 654659 243208 316040 222468 1969096 1655486 548725 452499 2001203 3160187 10332390 3801323 460565 209682 410595 917099 556792 778274 -437370 2184399 1778168 1990107 -690022 -767926 765957 534694 1616180 1625911 1154656 728966 10356582 862962 420677 669550 160927 564728 345743 2226103 -464886 -901303 -987068 1874509 1793762 550179 259915 1355668 1369583 881387 464691 9542197 598427 615335 753093 -1011186 -1314085 398116 555681 202880 -106704 361836 1001736 -193856 1626163 415582 677944 34398 -53151 9555644 -1425603 -1320694 880317 938397 314696 388391 460877 589699 1382240 672308 1367602 -201659 -161409 48471 433341 479562 9525899 -922605 383446 869959 1424693 258563 749565 970448 847509 1270876 1739733 322404 -140179 304912 760491 837817 9636580 553694 534719 645482 1375351 637431 991478 941340 1371723 1773876 214989 274819 -87262 976350 1060836 9430347 -1369689 349451 575005 274854 1186711 615937 27911 -113147 1538324 703750 628708 -90307 47895 9863218 623743 294770 1185154 534719 838622 630744 560846 1592128 922600 630744 512340 241465 9650591 40627 36916 395949 -673360 -715348 1164234 570996 609164 1662689 947959 876663 9892701 -875466 -1159232 174626 145880 881541 372173 1423594 328489 684086 596881 9366725 -1370158 -150298 -240868 931771 1014476 1725934 617974 912445 466279 9636580 428854 -87262 893440 1067415 1870930 1371723 1149437 1060836 10316742 -302301 1377257 579841 1080690 2126928 1382532 1399098 9973937 1164000 1412675 1304994 2348652 1617815 1274290 9924096 1170942 1090973 1195850 -171109 570357 10318773 -476988 -650727 2056497 1903783 9965406 -306251 1985767 1050572 9973937 2210810 1274290 10232054 921690 12691094 source/tests.txt100755 765 144 44441 6075020552 12473 0ustar geousers ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: 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. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 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". source/makef.txt100644 765 144 50144 6077257040 12414 0ustar geousers ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file containing 11+ megabytes :: :: of 32-bit integers from a multiply-with-carry generator :: :: x(n)=a*x(n-1)+carry mod 2^32 :: :: You choose the multiplier from a list and specify the name of :: :: the file to be created. The period of the generator will be :: :: a*2^31-1. This class of generators is particularly well sui- :: :: ted for implementation in machine language, and I predict :: :: that many system generators in the future will be of this :: :: class rather than the linear congruential generators for mo- :: :: dulus 2^32 that are common today. :: :: To illustrate how the `carry' works, suppose from the :: :: current (32-bit) x and (30 bit) c, one forms a*x+c. This may :: :: be done in a 64-(or double 32-) bit register in most modern :: :: CPU's. Then the new random x is the lower 32 bits, the new :: :: carry the upper 32. To see how well such a simple and fast :: :: generator performs on tests of randomness, this program makes :: :: a large file with the multiply-with-carry generator implemen- :: :: ted in 16-bit integer arithmetic. Those finding it suitable :: :: may wish to make an assembler version for their system. :: :: It seems to pass all tests. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates the binary file mwc1616.32, containing :: :: 11+ megabytes of integers made by concatenating two 16-bit :: :: multiply-with-carry generators. :: :: The two generators have the form :: :: x(n)=a*x(n-1)+carry mod 2^16 and :: :: y(n)=b*y(n-1)+carry mod 2^16, :: :: with suggested choices for multipliers `a' and `b'. :: :: The `carry' c works as follows: If a and x are 16-bit and :: :: c at most 14 bits, then forming a*x+c produces an at-most 31- :: :: bit result. That result mod 2^16 (the rightmost 16 bits) is :: :: the new x and the topmost 16 bits the new carry c. The sequ- :: :: ence of resulting x's has period the order of 2^16 in the :: :: group of residues relatively prime to m=a*2^16-1, which will :: :: be a*2^15-1 for the multipliers suggested here. :: :: You will be prompted to choose a and b and two seeds. Output :: :: is a 32-bit integer, the pair x,y side by side. :: :: This multiply-with-carry generator is best done in assembler, :: :: where it takes about 200 nanosecs with a Pentium 120. A Fort- :: :: ran version takes about 300 ns. It seems to pass all tests :: :: and is highly recommended for speed and simplicity. :: :: The essence of a version in C requires only two statements: :: :: x=a*(x&65535)+(x>>16); y=b*(y&65535)+(y>>16); :: :: if x and y are 32-bit integers with carry in the top and out- :: :: put in the bottom half. The 32-bit integer returned is :: :: (x<<16)+(y&65525); :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: ----------------------------------------------------------- :: :: 18000 18030 18273 18513 18879 19074 19098 19164 19215 19584 :: :: 19599 19950 20088 20508 20544 20664 20814 20970 21153 21243 :: :: 21423 21723 21954 22125 22188 22293 22860 22938 22965 22974 :: :: 23109 23124 23163 23208 23508 23520 23553 23658 23865 24114 :: :: 24219 24660 24699 24864 24948 25023 25308 25443 26004 26088 :: :: 26154 26550 26679 26838 27183 27258 27753 27795 27810 27834 :: :: 27960 28320 28380 28689 28710 28794 28854 28959 28980 29013 :: :: 29379 29889 30135 30345 30459 30714 30903 30963 31059 31083 :: :: ----------------------------------------------------------- :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file containing 11+ megabytes :: :: of 32-bit integers from the multiply-with-carry generator :: x(n)=2111111111x(n-4)+1492x(n-3)+1776x(n-2)+5115x(n-1)+carry mod 2^32. :: The period of this generator is about 2^160. It is one of :: :: what I called "The Mother of All Random Number Generators", :: :: a few years ago when use of `Mother of All...' was topical :: :: and could be used for showing bombast, defiance or derision.:: :: All apply to the usage here. The `carry' part, c, is the :: :: multiple of the modulus b=2^32 dropped in the reduction; for:: :: example, if the linear combination with the current four x's :: :: and carry c produced the result 125*b+3621, then the new x :: :: becomes 3621 and the new carry 125. The big advantage of this:: :: and other multiply-with-carry generators is that they allow :: :: use of modulus 2^16 & 2^32 without the trailing-bits regular-:: :: ities encountered in congruential sequences for such moduli. :: :: But that advantage has to be gained through assembly language:: :: if b=2^32, as no common high level language seems to allow :: :: access to the top 32 bits of the 64-bit product of two 32-bit:: :: integers. See also the file make1616.exe and makemwc1.exe :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates the binary file kiss.32, containing :: :: 11+ megabytes of integers from the generator KISS, which com- :: :: bines three simple generators. The acronym KISS means :: :: Keep It Simple Stupid :: :: and the idea is to use simple, fast, individually promising :: :: generators to get a composite that will be fast, easy to code :: :: have a very long period and pass all the tests put to it. :: :: The three components of KISS are :: :: x(n)=a*x(n-1)+1 mod 2^32 :: :: y(n)=y(n-1)(I+L^13)(I+R^17)(I+L^5), :: :: z(n)=2*z(n-1)+z(n-2) +carry mod 2^32 :: :: The y's are a shift register sequence on 32bit binary vectors :: :: period 2^32-1; see the description in executing makesupr.exe. :: :: The z's are a simple multiply-with-carry sequence with period :: :: 2^63+2^32-1. The period of KISS is thus :: :: 2^32*(2^32-1)*(2^63+2^32-1) > 2^127 :: :: KISS is particularly well suited for assembler programming, :: :: where it takes about 200 nanosecs with a Pentium 120. :: :: It seems to pass all tests and is highly recommended for :: :: speed and simplicity (for generators with that long a period) :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates the binary file combo.32, containing :: :: 11+ megabytes of integers from a simple but very good combi- :: :: nation generator. It combines, by addition mod 2^32, :: :: x(n)=x(n-1)*x(n-2) mod 2^32 :: :: and :: :: y(n)=30903*y(n-1) + carry mod 2^16 :: :: The period of the first is 3*2^29, on odd integers, and the :: :: period of the second, a multiply-with-carry generator, is :: :: 30903*2^15-1=1012629503, so the period of combo exceeds 2^60. :: :: This generator is simple to program in Fortran or C and quite :: :: fast. It seems to pass all tests in DIEHARD. Try it. :: :: You will be prompted for three seed integers. The x's of the :: :: seeds x1,x2,y must be 3 or 5 mod 8, which is ensured by repla-:: :: cing x1 by 3*(x1+x1+1)^2 and x2 by 2*x2+1. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file of integers from a version :: :: of ULTRA, a generator we posted on the net a few years ago. :: :: It combines the lagged Fibonacci generator :: :: x(n)=x(n-99)*x(n-33) mod 2^32, x's odd :: :: with the multiply-with-carry generator :: :: y(n)=30903*y(n-1)+carry mod 2^16, :: :: returning x(n)+y(n) mod 2^32. :: :: By itself, the lagged Fibonacci generator using multiplication :: :: passes all tests except those dependent on the last bit, since :: :: the output integers are always odd. Adding the MWC sequence :: :: provides a proper mix of trailing bits. The resulting combinat- :: :: ion in ULTRA seems to pass all tests and has a very long period.:: :: That period is 3*2^96*(30903*2^15-1), about 2^127.5 :: :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file of integers from the :: :: subtract-with-borrow random number generator :: :: x(n)=x(n-24)-x(n-37) - borrow mod 2^32 :: :: combined with the multiply-with-carry generator :: :: y(n)=30903*y(n-1) + carry mod 2^16. :: :: The period of the composite is :: :: (2^1178-2^762)(30903*2^15-1), about 2^1208 or 10^364.:: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates the binary file EXCONG?.32 containing :: :: 11+ megabytes of 32-bit integers from an extended congruent- :: :: generator. You have your choice of four: :: :: 1: x(n)=65065*x(n-1)+67067*x(n-2)+69069*x(n-3) mod 2^32-5 :: :: 2: x(n)=2**10*[x(n-1)+x(n-2)+x(n-3)] mod 2^32-5 :: :: 3: x(n)=2000*x(n-1)+1950*x(n-2)+1900*x(n-3) mod 2^32-209 :: :: 4: x(n)=2**20*[x(n-1)+x(n-2)+x(n-3)] mod 2^32-209 :: :: The period of these generators is the modulus cubed minus 1, :: :: about 2^96, for any 3 seeds not all zero. The recursion is :: :: implemented in double precision, with the result converted :: :: to a 32-bit integer. Notice that choices 2 and 4 are well :: :: suited for implementations that avoid multiplication: adding :: :: 10 or 20 to the exponent of a double precision sum. Since :: :: all four choices seem to pass all tests, 2) and 4) may be :: :: preferable. Try them yourself. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: The random number generator SUPERDUPER :: :: This program creates the binary file SUPRDUPR.32, containing :: :: 11+ megabytes of integers made by adding the results of two :: :: random number generators, congruential and shift register. :: :: The two generators are :: :: x <--- 69069*x+oddconstant mod 2^32 and :: :: y <--- y(I+L^13)(I+R^17)(I+L^5), :: :: where y is viewed as a binary vector. The transformation is :: :: y <-- yT, with T the 32x32 binary matrix :: :: T=(I+L^13)(I+R^17)(I+L^5) and L, R are matrices that effect a :: :: shift of 1 left or 1 right. The transformation is readily :: :: done with shifts and exclusive or's. The period of the x's :: :: is 2^32 for any initial seed and that for the y's is 2^32-1 :: :: for any seed not zero. So the period of SUPERDUPER is :: :: 2^64-2^32 = 18,446,744,069,414,584,320. :: :: You will be prompted for two seeds. :: :: You will also be prompted to choose the method for combining :: :: the two sequences: addition (enter +), exclusive-or (enter x) :: :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file of integers from a specified :: :: subtract-with-borrow random number generator. Structures of :: :: such generators are much like those of lagged Fibonacci generat-:: :: ors x(n)=x(n-r)-x(n-s) mod m, except that one forms :: :: x(n)=x(n-r)-x(n-s)-c mod m, where c is the `borrow': 0 if the :: :: subtraction produced a positive result, and 1 if an m had to be :: :: borrowed and added to the difference to make a positive result. :: :: With proper choice of the lags, tremendously long periods can :: :: be attained. But performance on tests is much the same as for :: :: lagged Fibonacci, as SWB sequences behave locally much like lag-:: :: ged Fibonacci using subtraction. There are also add-with-carry :: :: generators x(n)=x(n-r)+x(n-s)+carry mod m that use addition, :: :: with the `carry' set to 1 or 0, depending on whether m had to be:: :: subtracted to give a positive result mod m. For a full descript-:: :: tion, see Marsaglia and Zaman, Ann. Applied Prob., v1, no3 1991 :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :: This program creates a binary file containing 11+ megabytes :: :: of 32-bit random integers from a congruential generator, :: :: x(n)=a*x(n-1)+b mod m :: :: You will be prompted to choose a,b and m, the latter in the :: :: form m=2^r+s. If r<=31 then r-bit integers will be left- :: :: justified (shifted left) to meet DIEHARD requirements. :: :: If r>32 then the recursion is carried out in double precision :: :: and the result sent to the file as the integer part of c*x, :: :: where c is the ratio 2.^32/m. In addition, this program will :: :: display a (line-printer) plot of the 2-lattice of the chosen :: :: congruential generator. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates the binary file ran2.32 containing some :: :: 11 megabytes of integers from the generator RAN2 in Numerical :: :: Recipes. See Press and Teukolsky, "Portable Random Number :: :: Generators", Computers in Physics, v 6, n 2, 522:524 1992. :: :: See also "Some portable very-long-period random number gener- :: :: ators", v 8 n 1, 1994 by Marsaglia and Zaman, that points out :: :: shortcomings, suggested improvements and alternatives to RAN2. :: :: The Numerical Recipes version produces only 31 bit integers. :: :: They are left-adjusted, that is, shifted left 1, before being :: :: written to the binary file ran2.32, as several DIEHARD tests :: :: emphasize the leading bits. But that means that all integers :: :: in ran2.32 have trailing bit=0, so that tests that use bit 32 :: :: (DIEHARD numbers bits from left to right, 1 to 32) will yield :: :: spectacular failures. :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :: This program creates a binary file with 11+ megabytes of 32- :: :: bit integers from a specified shift register generator. You :: :: will be prompted to choose the shifts and whether to generate :: :: 31- or 32-bit integers. If 31 bits are chosen, the resulting :: :: integers will be left-justified (shifted left 1) before being :: :: written to the output file you name, since many of DIEHARD's :: :: tests emphasize leading bits of random integers. That means, :: :: of course, that the generator is likely to fail tests that :: :: depend, in any significant way, on the rightmost bit of a 32- :: :: bit random integer. :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: The system generator in Sun Fortran f77 :: :: This program creates the binary file sunran.32, containing :: :: 11+ megabytes of 31-bit integers made from the generator in :: :: Sun Fortran f77. It is not a congruential generator. :: :: I do not have a manual that tells what it is. But whatever it:: :: is, it is not a very good generator. Try it for yourself. :: :: A cryptic f77 manual describes its use. It has a desirable :: :: feature of providing either reals on [0,1) or 31-bit integers :: :: (32-bit would be preferable). The Fortran assignment x=rand(0):: :: will provide the next real in the sequence, which can be re- :: :: seeded with x=rand(iseed). Similarly, 31-bit integers come :: :: from successive assignments j=irand(0), with a new seed from :: :: j=irand(iseed). That calling procedure seems better than that:: :: of Microsoft Fortran, which uses call random(x) to get a :: :: random real x; a nuisance for those wanting to use a random :: :: variable in an expression. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: This program creates a binary file of integers from a specified :: :: lagged Fibonacci generator, x(n)=x(n-r) op x(n-s), with op one :: :: of the four operations +,-,*,xor. The user is prompted to en- :: :: ter integers r and s from a list of lags that provide long pe- :: :: riods, and a choice of the operation +,-,*,xor. For simpler :: :: program logic, choice of operation is indicated by an integer: :: :: 1 for +, 2 for -, 3 for *, 4 for xor. :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :: This program creates a file, INVCONG.32, with 11+ megabytes :: :: of 32-bit integers from an `inverse congruential' generator, :: :: described by Eichenauer-Herrmann in International Statist. :: :: Review v60, 167-176 and earlier papers. :: :: The attraction of this generator seems to be the theory be- :: :: hind it; as a random number generator it is not very good. :: :: It takes from twenty to fifty times as long as much better :: :: generators and fails many of the tests in DIEHARD. The first :: :: 12-16 bits seem to be good, but trailing bits are as bad or :: :: worse than those from an ordinary congruential RNG mod 2^32. :: :: Try it yourself. You will be prompted for parameters a and b :: :: and a seed. Make sure `a' mod 4 is 1 and `b' is odd. :: :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: source/diehard.doc100755 765 144 25046 6074021671 12661 0ustar geousersVersion: Source C Files, Jan 3, 1996 Instructions for using DIEHARD: a battery of tests of randomness. I hope you will inform me of results, good or bad, of new kinds of generators you have tested, particularly deterministic generators, but also the output of physical devices. (I have found none of the latter that get past DIEHARD, and would like to learn of any that do.) Since, in my opinion, there is no true randomness, collective experience in finding sequences that depart from the theoretical ideal in a significant way can perhaps lead to better ways for finding those that do not. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1. How To Use DIEHARD. This set of files contains examples of some tests (15) from the DIEHARD battery of tests I have developed over many years and found effective. It also contains some utility files that are described at the end of this text file. ----------------------------------------------------------| |The source code is in C. It comes from an f2c translation| |of many Fortran files that have suffered countless patches| |over their long development, some going back thirty years.| |So while the melange in C might seems to run and give good| |results, you might find it difficult to try to figure out | |or modify the translated code. | |----------------------------------------------------------| To run DIEHARD, you will need to compile the *.c files on your platform. As indicated in the *.c listings, you must link the resulting object file with the libraries: -lf2c -lm (in that order). You will also need files tests.txt, makef.txt and operm5d.ata. To be safe, copy all the files to your working directory.) For this discussion, assume the executable files that come from compiling and linking the *.c files have the same root name. Thus diehard is the exec file from diehard.c and makewhat is the exec file from makewhat.c. The tests in DIEHARD require that you provide a large binary file of random integers to be tested. The makewhat exec file is used to create such binary files, and the exec file asc2bin is used for transforming an ascii file into the kind of file that DIEHARD expects. With the exception of the RUNS test, which is a `standard' test and the only one of the standard tests I have found to be very effective, all tests here are those I have developed. General versions of the tests call for various parameters that specify sample size, bit patterns to be tested, and so on. To avoid complications, I have chosen to fix the parameters of the tests on this disk. For each test, a description is provided, from which interested users may fashion their own versions with variable parameters. 2. Providing Input Files For DIEHARD. The executable file diehard will prompt you to name the file you want to be tested and ask you to select any or all of the 15 tests. You must provide the binary file that DIEHARD expects---a file of 10 to 11 megabytes, that is, a file of at least 80 million bits. DIEHARD will do the best it can with shorter binary files, then give up on the test under way, give an END OF FILE message and go to the next test. 3. Some Examples. Imagine, (as is probably the case), you have just got this disk (or diehard.zip, diehard.tar.gz via ftp and have unzipped it), have compiled all the files in your current directory and are ready to try DIEHARD. If you merely invoked it with the DOS command diehard you would be prompted to give the name of the file you want tested. But of course you have no such file. So you must first create one. You may use the makewhat exec file to create files of the form that DIEHARD expects. Suppose you try it and when prompted, choose option 4: make a KISS file. That creates a binary file of integers from the generator KISS, which stands for Keep It Simple Stupid, a generator that combines three simple generators of the form x <-- f(x) for 32 bit integers x. (You will find that KISS, among several others, passes all tests.) Then the makewhat exec program will create the binary file kiss.32. After displaying details of the KISS generator, the program will ask you to enter four seed integers, after which it will create a binary file of some 11 megabytes. Having finished creating the file that will test KISS, enter diehard and you will be prompted to enter the name of the file to be tested. You will of course enter the name of your only file so far, say kiss.32 You will then be asked to enter the name of an output file, since DIEHARD displays results both to the screen and to a specified output file. You might, as I do, choose kiss.out for the name of your output file. You will then be asked, with a crude menu, to choose the tests you want run. This is done with a sequence of 15 1's or 0's. For example: 111111111111111 selects all the tests, while 010101010101010 selects only the even numbered menu items. For a fast PC, DIEHARD may take perhaps 10 minutes for the entire battery of tests (but an early 386 I tested it on took 203 minutes). You will see the output on the screen and, when the tests are completed, you may examine results in detail by displaying the file kiss.out. Next, you may want to test some other generators. The makewhat exec program provides for creating binary files for generic Congruential Generators Shift Register Generators Lagged Fibonacci Generators Multiply-with-carry Generators on 32 bits: x(n)=ax(n-1)+carry mod 2^32 There are also choices for specific generators: A version of the mother-of-all RNG's KISS Two multiply-with-carry on 16 bits A simple but good combination generator COMBO The super-duper generator A subtract-with-borrow generator The system generator in Microsoft or Sun Fortran An extended congruential generator The ran2 generator from Numerical Recipes An inverse congruential generator There is also a file that will combine, by addition mod 2^32 or exclusive-or, any two binary files that have already been created. The file is meld, from meld.c, and of course by repeated invocations you can create a mixture of as many binary files as you wish. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: OK, those are some of the ways you can create and test files with programs on this disk. But what if you want to test your own---or some other---generator? And it is only available through some program or procedure in Fortran, C, Pascal etc.? There are at least two ways: 1) Write a main program in the language of your procedure, in which you open a binary file and send your random integers to it. But if your language can't---or you don't know how to---create a binary file of the form required by DIEHARD, then 2) Write a main program that sends the (hex) output of your random number procedure to an ordinary ascii file. Then invoke the exec file asc2bin that will prompt for the names of your input and output files and do the conversion. Your random number generator should produce 32-bit integers. (If 31 bits, left justify by shift-left-one, as some of the tests in DIEHARD favor leading bits.) You should send them to your ascii file in hex form, 8 hex 'digits' per integer, 10 integers per line, no intervening spaces. The ascii file will be twice as big as the binary file it is reduced to. You can see that DIEHARD requires large test files. But they need only be created one at a time, then deleted. The CDROM I will soon be distributing contains some 60 ten-meg binary files of random numbers for use in serious Monte Carlo calculations as well as for input to DIEHARD. Most of those files combine several of the best deterministic generators with white noise and black noise, (the latter from a CD of rap music). Some of the files contain only random bits from physical devices. They fail many of the tests in DIEHARD. When you absolutely, positively have to have an unassailable source of random bits, you should, in my opinion, use a combination of the output from a physical device(s) with some of the best deterministic random number generators. As you can see from applying DIEHARD, many of the latter may well be suitable by themselves. George Marsaglia geo@stat.fsu.edu Addendum: You will also find a postscript file mwc1.ps that, when processed, describes what I think are the RNG's of the future: multiply-with-carry. You will find they pass all tests, have very long periods and are particularly well suited for computer implementation. I predict a version with base b=2^32 will be the generator of choice in future systems. That file mwc1.ps is extracted from a summary description of RNG's, tests and the theory behind them im a TeX file that I may or may not ever complete. I have also included the postscript file keynote.ps. It is taken from the Keynote Address of a national meeting 11 years ago, and describes some of the ideas behind the tests. Many have reported difficulty in finding Proceedings of the Meeting in their libraries. A another postscript file is cdmake.ps. It describes the coming CDROM. Another potentially useful file is getrnor (compile from getrnor.c). It will transform a binary file of random bits into a (binary) file of real standard normal random variables using my ziggurat method. Files on this version of DIEHARD: diehard.doc diehard (.c) The diehard exec file diequick (.c) A terse version of diehard makewhat (.c) The exec file for making random number files tests.txt Descriptions of the tests. Read by diehard (exec) makef.txt Descriptions of RNG's. Read by makewhat (exec) asc2bin (.c) Converts an ascii integer file to a binary file getrnor (.c) Converts a random bit file to normal random variables meld (.c) Makes a new binary bit file by merging two others operm5d.ata The covariance matrix read by the OPERM5 test mwc1.ps A postscript file describing multiply-with-carry RNG's monkey.ps Describes the difficult-to-pass monkey tests. keynote.ps Descripion of tests and RNG's cdmake.ps Early version of postscript file for the CDROM source/cdmake.ps100644 765 144 203320 6073560314 12371 0ustar geousers%!PS-Adobe-2.0 %%Creator: dvipsk 5.58a Copyright 1986, 1994 Radical Eye Software %%Title: cdmake.dvi %%Pages: 4 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentPaperSizes: a4 %%EndComments %DVIPSCommandLine: dvips cdmake %DVIPSParameters: dpi=300, compressed, comments removed %DVIPSSource: TeX output 1996.01.06:1551 %%BeginProcSet: texc.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} {adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] }if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict /eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (cdmake.dvi) @start /Fa 3 26 df0 D<1203A4EAC30CEAE31CEA7338EA1FE0 EA0780A2EA1FE0EA7338EAE31CEAC30CEA0300A40E127D9215>3 D25 D E /Fb 1 1 df0 D E /Fc 2 111 df<121E12065AA45A1338135C139CEA3118EA36001238EA3F80EA61C0 EA60C8A3EAC0D013600E147F9312>107 D110 D E /Fd 42 122 df<127812FCA212FEA212 7A1202A21204A21208A212101260070E7D9C0D>39 D<13201340EA018012031300120612 0E5AA2123C1238A21278A312F85AA97E1278A31238A2123C121CA27E12067E13801201EA 004013200B297C9E13>I<7E12401230123812187E120E7EA213801203A213C0A313E012 01A9120313C0A31380A212071300A2120E120C5A1238123012405A0B297D9E13>I<1270 12F812FCA3127C1204A21208A3121012201240060E7D850D>44 DI<1360EA01E0120F12FF12F31203B3A2387FFF80A2111B7D9A18>49 DI< EA07F8EA1FFEEA3C1FEB0F80387C07C0127E127C123838000F80A2EB1E005BEA03F8EA00 1EEB0F80EB07C0A214E01230127812FCA214C038780F80EB1F00EA1FFEEA07F8131B7E9A 18>I<137EEA03FF38078180380F03C0EA1E07123C387C03800078C7FCA212F813F8EAFB 0E38FA0780EAFC0314C000F813E0A41278A214C0123CEB0780381E0F00EA07FEEA03F813 1B7E9A18>54 D65 D<90381FE0209038FFF8E03803F80F3807C003380F800148C7FC123E1560127E 127C00FC1400A8007C1460127E123E15C07E390F8001803907C003003803F80E3800FFFC EB1FE01B1C7D9B22>67 D69 D<90380FF00890387FFE383901FC07F83807E001390F80007848C7FC481438123E007E14 18127C00FC1400A6EC7FFFA2007CEB01F8127E123E123F7EEA0F80EA07E03801FC073900 7FFE7890380FF818201C7D9B26>71 D73 D<39FFFC07FFA2390FC000E04A5A4A5A0206C7FC5C14385C5CEBC1C013C3EBC7E0EBCFF0 13FBEBF1F8EBE0FC497E147E806E7E81140F6E7E816E7E3AFFFC1FFF80A2211C7E9B25> 75 D77 D<39FFE003FFA2390FF000307FEA0DFCEA0CFE137E7FEB1F8014C0EB0FE0 EB07F01303EB01F814FCEB00FE147F143FEC1FB015F0140F1407140314011400A2D8FFC0 13701530201C7E9B25>I82 D<3807F820381FFEE0EA3C07EA7801EA700012F01460A26C130012FEEAFFE0EA7FFE6C7E 1480000F13C06C13E0EA007FEB03F01301130012C0A214E07E38F001C0EAFC0338EFFF00 EA83FC141C7D9B1B>I<007FB512E0A238781F81007013800060146000E0147000C01430 A400001400B03807FFFEA21C1C7E9B21>I<3BFFF87FFE0FFCA23B0FC007E000C081D9E0 03130100071680EC07F801F014030003D90FFC1300140CD801F81406EC1CFE9039FC187E 0E0000150CEC303F01FE141CD97E701398EC601F013F14B002E013F0ECC00F011F5CEC80 07A2010F5CEC00036D5CA22E1C7F9B31>87 D97 DIIII<137F3801E3803803C7C0EA0787120FEB8380EB8000A5EAFFF8A2 EA0F80AEEA7FF0A2121D809C0F>I<3803F0F0380E1F38EA3C0F3838073000781380A400 381300EA3C0FEA1E1CEA33F00030C7FCA3EA3FFF14C06C13E014F0387801F838F00078A3 00701370007813F0381E03C03807FF00151B7F9118>II<121E123FA4121EC7FCA6127FA2121F AEEAFFC0A20A1E7F9D0E>I108 D<39FF0FC07E903831E18F3A1F40F20780D980FC13C0A2EB00F8AB3AFFE7FF3FF8A22512 7F9128>I<38FF0FC0EB31E0381F40F0EB80F8A21300AB38FFE7FFA218127F911B>II<38FF3F80EBE1E0381F80F0EB0078147C143C143EA6 143C147C1478EB80F0EBC1E0EB3F0090C7FCA6EAFFE0A2171A7F911B>I114 DI<1203A45AA25AA2EA3FFC12FFEA1F00A9130CA4EA0F08EA0798EA03F00E1A 7F9913>I<38FF07F8A2EA1F00AC1301120F380786FFEA01F818127F911B>I<39FF8FF8FE A2391F03E030A3390F87F06013869038C6F8E03907CC78C0A23903FC7D80EBF83D143F39 01F01F00A20000131EEBE00EA21F127F9122>119 D<38FFC7FCA2381F81C0380F838038 07C700EA03EEEA01FC5B1200137C13FEEA01DF38039F80EA070F380607C0380C03E038FF 07FCA216127F9119>I<38FFC1FCA2381F00601380000F13C0A23807C180A23803E300A2 13F7EA01F613FE6C5AA21378A21330A25B1270EAF8E05BEAF9800073C7FC123E161A7F91 19>I E /Fe 40 122 df38 D<13E01201EA0380EA0700120E5AA25AA25AA35AA91270A37EA27EA2 7E7EEA0380EA01E012000B217A9C16>40 D<12C07E12707E7E7EA27EA2EA0380A3EA01C0 A9EA0380A3EA0700A2120EA25A5A5A5A5A0A217B9C16>II<13E0A8B512 E0A33800E000A813137F9516>I<1238127C127EA2123E120E121E121C127812F0126007 0B798416>I<127012F8A312700505788416>46 D48 D<12035AA25A5AB4FCA212E71207AEEAFFF8A30D197B9816>III53 D<13F8EA03FC487EEA0F07EA1C0F1238EA78060070C7FCA2EAE3F8EAEFFCB47EEAF80F48 7EEB038012E0A21270A2130700381300EA3C1EEA1FFC6C5AEA03E011197E9816>I57 D<1238127CA312381200A812381278127CA2123C121CA21238127012F012400618799116 >59 D<387FFFC0B512E0A2C8FCA5B512E0A26C13C0130B7F9116>61 D<12C012F012FC123EEA0F806C7EEA01F06C7E133EEB1F801307131FEB3E0013F8485AEA 07C0485A003EC7FC12FC12F012C011157E9616>II97 D<12FCA3121CA4137CEA1DFEEA1FFFEB0780381E03C0EA1C01 EB00E0A6EB01C0EA1E03381F0780EBFF00EA1DFEEA0C7813197F9816>II<133FA31307A4EA03C7EA0FF748B4FCEA3C1F487EEA700712E0A6EA700F12786C5A 381FFFE0EA0FF7EA07C713197F9816>II<131E 137F3801FF8013C7380383001380A2EA7FFFB5FCA2EA0380ACEA7FFC487E6C5A11197F98 16>I<3803E3C03807F7E0EA0FFF381C1CC038380E00A56C5AEA0FF8485AEA1BE00038C7 FC1218EA1FFC13FF481380387003C038E000E0A4387001C0EA7C07383FFF80380FFE00EA 03F8131C7F9116>I<12FCA3121CA41378EA1DFCEA1FFE130FEA1E07121CAA38FF8FE013 9F138F13197F9816>I<1203EA0780A2EA0300C7FCA4EAFF80A31203ACEAFFFC13FE13FC 0F1A7C9916>I<127E12FE127E120EA4EB7FE0A3EB0F00131E5B5B5B120F7F13BC131EEA 0E0E7F1480387F87F0EAFFCFEA7F871419809816>107 DI<38F9C38038FFEFC0EBFFE0EA3C78A2EA3870AA38FE7C F8A31512809116>IIII<387F0FC038FF3FE0EA7F7F3807F040EBC0005BA290C7FCA8EA7FFC12FF127F13127F 9116>114 DI<12035AA4EA7FFFB5FCA200 07C7FCA75BEB0380A3EB8700EA03FE6C5A6C5A11177F9616>II<38FF1FE0A338380380A4EA39F3A20019130013 B3A3EA1DB71317EA1F1FEA0F1EEA0E0E13127F9116>119 D<387F1FC0133F131F380F1E 006C5AEA03B813F012016C5A12017FEA03B8EA073C131CEA0E0E387F1FC038FF3FE0387F 1FC013127F9116>I<387F1FC038FF9FE0387F1FC0381C0700120E130EA212075BA2EA03 9CA21398EA01B8A2EA00F0A35BA3485A1279127BEA7F8090C7FC123C131B7F9116>I E /Ff 10 58 df<120FEA30C0EA6060A2EA4020EAC030A9EA4020EA6060A2EA30C0EA0F 000C137E9211>48 D<120C121C12EC120CAFEAFFC00A137D9211>I<121FEA60C01360EA F07013301260EA0070A2136013C012011380EA02005AEA08101210EA2020EA7FE012FF0C 137E9211>II<136013E0A2EA016012021206120C1208 12101220126012C0EAFFFCEA0060A5EA03FC0E137F9211>III<1240EA7FFC13F8EA4010EA80301320EA004013 80EA0100A25A12021206A2120EA512040E147E9311>II<120FEA3080EA6040EA4060EAC0201330A31240EA6070EA30B0EA0F3012001320 1360EAE0401380EA4100123E0C137E9211>I E /Fg 18 123 df<126012F0A212600404 7C830C>58 D<126012F0A212701210A41220A212401280040C7C830C>II<130113031306A3130CA313 18A31330A31360A213C0A3EA0180A3EA0300A31206A25AA35AA35AA35AA35AA210297E9E 15>I<12E01278121EEA0780EA01E0EA0078131EEB0780EB01E0EB0078141EEC0780A2EC 1E001478EB01E0EB0780011EC7FC1378EA01E0EA0780001EC8FC127812E019187D9520> I<3801FFC038003C001338A45BA45BA4485AA4485AA448C7FCA45AEAFFE0121C7E9B12> 73 D<3801FFE038003C001338A45BA45BA4485AA438038002A31404EA0700140C141814 38000E13F0B5FC171C7E9B1C>76 D<3801FFFE39003C03C090383800E015F01570A24913 F0A3EC01E001E013C0EC0780EC1E00EBFFF03801C038140C140EA2EA0380A43807001E15 08A2151048130FD8FFE01320C7EA03C01D1D7E9B20>82 D97 D<123F1207A2120EA45AA4EA39E0EA3A30EA3C1812381270131CA3EAE038A31330137013 6013C01261EA2300121E0E1D7E9C12>II107 D<39381F81F0394E20C618394640E81CEB80 F0EA8F00008E13E0120EA2391C01C038A315703938038071A215E115E23970070064D830 03133820127E9124>109 DI<380787803809C8 603808D03013E0EA11C014381201A238038070A31460380700E014C0EB0180EB8300EA0E 86137890C7FCA25AA4123CB4FC151A819115>112 D<380787803808C8403810F0C03820 F1E0EBE3C03840E1803800E000A2485AA43863808012F3EB810012E5EA84C6EA78781312 7E9118>120 D<001C13C0EA27011247A238870380A2120EA2381C0700A4EA180EA3EA1C 1EEA0C3CEA07DCEA001C1318EA6038EAF0305B485AEA4180003EC7FC121A7E9114>II E /Fh 38 122 df<130C131C137CEA07FC12FF 12F81200B3ADB512FCA216277BA621>49 DII<141C143CA2147C14FC1301A213031307130E130C131813381370136013C01201 EA038013001206120E5A12185A12705AB612F0A2C7EAFC00A990383FFFF0A21C277EA621 >I<00181306381F803EEBFFFC5C5C5C148049C7FC0018C8FCA7EB7F803819FFF0381B80 F8381E007E00187FC7FCEC1F80A215C0A3127C12FEA315805A0078133F006014006C133E 001C5B380F01F83807FFE0C690C7FC1A277DA621>I66 D<91387FE002903907FFF80690391FE01E0E90397F00039E01FCEB 01FE4848EB007ED807F0143E5B4848141E001F150E485AA21606127F90C8FC16005AA97E A26D1406123FA36C6C140C120F6C6C14186D1438D801F814306C6C14E0017FEB03C09039 1FE00F00903807FFFC9038007FE027297CA830>II70 D<91387FE002903907FFF80690391FE01E0E90397F00039E 01FCEB01FE4848EB007ED807F0143E5B4848141E001F150E485AA21606127F90C8FC93C7 FC5AA892B512E07E923800FE007F123FA27F121F120F6C7E7FEA01F86C6C1301017FEB03 BE90391FF00F1E903907FFFC0E9039007FE0022B297CA834>II77 DI<903801FFC0010F13F890383F80 FE9039FE003F80D801F8EB0FC048486D7E48486D7E000F8148486D7EA248486D7EA2007F 8190C87EA3481680AA6C16006D5CA2003F5DA26C6C495AA26C6C495A6C6C495A00035D6C 6C495AD800FEEB3F8090263F80FEC7FC90380FFFF8010113C029297CA832>II 82 D<9038FF80200003EBF060390F8078E0381E001D4813071403481301A200F81300A2 15607EA26C1400EA7F8013F013FF6C13F06C13FC6C7F6C7F00011480D8003F13C0010113 E0EB001FEC0FF01407140312C01401A37E15E07E6CEB03C07EB4EB078039E3E01F0038C1 FFFC38801FF01C297CA825>I<007FB7FCA29039007F007F007C151F00701507A2006081 00E01680A2481501A5C791C7FCB3A790B67EA229297EA82E>I87 D<3803FF80000F13E0381F01F8383F80FC147EA280EA1F00C7FCA4EB3FFF3801FE3FEA0F E0EA1F80EA3F005A12FE150CA3145F007F139F393F831FF8391FFE0FF03903F807C01E1B 7E9A21>97 DIIIII<9038FF01E00003EBC7F8390F81FC78 381F00F8003EEB7C701500007E137EA6003E137CA26C5B380F81F0380BFFC0001890C7FC 0010C8FC1238A2123C381FFFF014FE6CEBFF806C14C0001F14E0383C000F007CEB03F012 7800F81301A4007CEB03E0A2003FEB0FC0390FC03F003807FFFE38007FE01D287E9A21> II<120FEA1F8013C0123FA2121F1380EA0F00C7FCA8EA FFC0A2120FB3A5EAFFF8A20D2B7EAA13>I 108 D<26FFC0FEEB3F80903AC3FF80FFE03B0FC60FC183F0903AC807E201F89039D003E4 0001F001FC7F01E05BA201C05BB13CFFFC3FFF0FFFC0A2321B7E9A37>I<38FFC0FE9038 C3FF80390FC60FC09038C807E0EBD00301F013F013E0A213C0B139FFFC3FFFA2201B7E9A 25>II<38FF83E0EB8FF8380F8C7CEB98FE13B013A0A2EBE07CEBC000B1EAFFFEA2 171B7E9A1B>114 D<3803FC60381FFFE0EA3C03EA7801EA700000F01360A300FC1300B4 7EEA7FFC13FF6C13C0000F13E0000313F0EA003FEB03F8EAC00014787EA27E14706C13E0 EAFE0338E7FF803881FE00151B7E9A1A>I<1360A413E0A21201A212031207121FB512E0 A23807E000AE1430A73803F0603801F8C03800FF80EB3F0014267FA51A>I<39FFC03FF0 A2000F1303B21407A2140F0007131B3803E0333901FFE3FF38007F83201B7E9A25>I<3B FFF8FFF81FF8A23B0FC00FC00180A22607E007EB030015E0A2D803F01406EC0FF0D9F80D 130E0001ECF80C1418D800FC5C15FC9039FE307C38017EEB7E30147090393F603E60153F 9138C01FE0011F5CA26D486C5AA2EC00076D91C7FCA22D1B7F9A30>119 D<39FFF801FFA2390FC000707F000714606D13E0000314C07F0001EB0180A23900FC0300 A26D5AEB7E06EB7F0EEB3F0C148CEB1F98A2EB0FF0A36D5AA26D5AA26D5AA249C7FCA25B EA3006EAFC0E130C5B1338EA7870EA3FE0EA1F8020277F9A23>121 D E /Fi 21 122 df<12181238127812381208A21210A212201240A21280050C7D830D> 44 D<1230127812F0126005047C830D>46 D<903803F02090381E0C6090383002E09038 E003C03801C001EA038048C7FC000E1480121E121C123C15005AA35AA2903801FF809038 001E00141CA400705BA27E001813786C139038070710D801F8C7FC1B1E7A9C20>71 D97 D<123F1207A2120EA45AA4EA39E0EA3A18EA3C0C12381270130EA3EAE0 1CA31318133813301360EA60C0EA3180EA1E000F1D7C9C13>I<13F8EA0304120EEA1C0E EA181CEA30001270A25AA51304EA60081310EA3060EA0F800F127C9113>II<13F8EA0704120CEA1802EA38041230EA7008EA7FF0 EAE000A5EA60041308EA30101360EA0F800F127C9113>II105 D108 D<391C1E078039266318C0394683A0E0384703C0008E1380 A2120EA2391C0701C0A3EC0380D8380E1388A2EC0708151039701C032039300C01C01D12 7C9122>II<13F8EA030CEA0E06487E1218123000701380 A238E00700A3130EA25BEA60185BEA30E0EA0F8011127C9115>I113 DII<12035AA3120EA4EAFFE0 EA1C00A35AA45AA4EAE080A2EAE100A2126612380B1A7C990E>I<381C0180EA2E03124E A2388E0700A2121CA2EA380EA438301C80A3EA383C38184D00EA0F8611127C9116>II<381C0180EA2E03124EA2388E0700A2121CA2EA380EA4EA301CA3EA383C EA1878EA0FB8EA003813301370EAE0605BEA81800043C7FC123C111A7C9114>121 D E /Fj 81 125 df11 D<137E3801C180EA0301380703C0120E EB018090C7FCA5B512C0EA0E01B0387F87F8151D809C17>I<90383F07E03901C09C1838 0380F0D80701133C000E13E00100131892C7FCA5B612FC390E00E01CB03A7FC7FCFF8021 1D809C23>14 D34 D<1380A2EA07E0EA1898EA3084EA6082EA4081EAC087138FA21386EAE0 801270127EEA3FC0EA1FF0EA0FF8EA03FCEA00BE138E13871260EAF083A212E0EA808212 401384EA2088EA1890EA07E0EA0080A210217E9E15>36 D<126012F012F812681208A312 10A2122012401280050C7C9C0C>39 D<1380EA0100120212065AA25AA25AA35AA412E0AC 1260A47EA37EA27EA27E12027EEA0080092A7C9E10>I<7E12407E12307EA27EA27EA37E A41380AC1300A41206A35AA25AA25A12205A5A092A7E9E10>I<1306ADB612E0A2D80006 C7FCAD1B1C7E9720>43 D<126012F0A212701210A41220A212401280040C7C830C>II<126012F0A2126004047C830C>I48 D<5A1207123F12C71207B3A5EAFFF80D1C7C9B15>III<130CA2131C133CA2135C13DC139CEA01 1C120312021204120C1208121012301220124012C0B512C038001C00A73801FFC0121C7F 9B15>II<13F0EA030CEA 0404EA0C0EEA181E1230130CEA7000A21260EAE3E0EAE430EAE818EAF00C130EEAE00613 07A51260A2EA7006EA300E130CEA1818EA0C30EA03E0101D7E9B15>I<1240387FFF8014 00A2EA4002485AA25B485AA25B1360134013C0A212015BA21203A41207A66CC7FC111D7E 9B15>III<126012F0A212601200AA126012F0A2126004127C910C>I<007FB512C0B612 E0C9FCA8B612E06C14C01B0C7E8F20>61 D63 D<1306A3130FA3EB1780A2EB37C01323A2EB43E01341A2EB80F0A338010078A2EBFFF838 02003CA3487FA2000C131F80001E5BB4EBFFF01C1D7F9C1F>65 DI<90381F8080EBE0613801801938070007000E13035A14015A00781300A212 7000F01400A8007014801278A212386CEB0100A26C13026C5B380180083800E030EB1FC0 191E7E9C1E>IIII<90381F8080EBE0613801801938070007000E13035A14015A007813 00A2127000F01400A6ECFFF0EC0F80007013071278A212387EA27E6C130B380180113800 E06090381F80001C1E7E9C21>I<39FFF0FFF0390F000F00AC90B5FCEB000FAD39FFF0FF F01C1C7F9B1F>II<3807FF8038007C00133CB3 127012F8A21338EA7078EA4070EA30E0EA0F80111D7F9B15>I<39FFF01FE0390F000780 EC060014045C5C5C5C5C49C7FC13021306130FEB17801327EB43C0EB81E013016D7E1478 A280143E141E80158015C039FFF03FF01C1C7F9B20>IIIIII82 D<3807E080EA1C19EA30051303EA600112E01300 A36C13007E127CEA7FC0EA3FF8EA1FFEEA07FFC61380130FEB07C0130313011280A300C0 1380A238E00300EAD002EACC0CEA83F8121E7E9C17>I<007FB512C038700F0100601300 00401440A200C014201280A300001400B1497E3803FFFC1B1C7F9B1E>I<39FFF01FF039 0F000380EC0100B3A26C1302138000035BEA01C03800E018EB7060EB0F801C1D7F9B1F> I<39FFE00FF0391F0003C0EC01806C1400A238078002A213C000035BA2EBE00C00011308 A26C6C5AA213F8EB7820A26D5AA36D5AA2131F6DC7FCA21306A31C1D7F9B1F>I<3AFFE1 FFC0FF3A1F003E003C001E013C13186C6D1310A32607801F1320A33A03C0278040A33A01 E043C080A33A00F081E100A39038F900F3017913F2A2017E137E013E137CA2013C133C01 1C1338A20118131801081310281D7F9B2B>I<39FFF07FC0390FC01E003807800CEBC008 00035B6C6C5A13F000005BEB7880137C013DC7FC133E7F7F80A2EB13C0EB23E01321EB40 F0497E14783801007C00027F141E0006131F001F148039FF807FF01C1C7F9B1F>I<39FF F003FC390F8001E00007EB00C06D13800003EB01006D5A000113026C6C5A13F8EB7808EB 7C18EB3C10EB3E20131F6D5A14C06D5AABEB7FF81E1C809B1F>I<12FEA212C0B3B312FE A207297C9E0C>91 DI<12FEA21206B3B312FEA20729809E0C>I<1208121012201240A21280 A312B012F812781230050C7D9C0C>96 DI<12FC121CAA 137CEA1D87381E0180381C00C014E014601470A6146014E014C0381E018038190700EA10 FC141D7F9C17>IIII<13F8EA018CEA071E1206EA0E0C1300A6EAFFE0EA0E00B0EA7FE00F1D809C0D> II<12FC121CAA137C1387EA1D03001E1380121CAD38FF9FF0141D7F9C 17>I<1218123CA21218C7FCA712FC121CB0EAFF80091D7F9C0C>I<13C0EA01E0A2EA00C0 1300A7EA07E01200B3A21260EAF0C012F1EA6180EA3E000B25839C0D>I<12FC121CAAEB 0FE0EB0780EB06005B13105B5B13E0121DEA1E70EA1C781338133C131C7F130F148038FF 9FE0131D7F9C16>I<12FC121CB3A9EAFF80091D7F9C0C>I<39FC7E07E0391C838838391D 019018001EEBE01C001C13C0AD3AFF8FF8FF8021127F9124>IIII<3803E080EA0E19EA1805EA3807EA7003A212E0A61270A2EA3807 1218EA0E1BEA03E3EA0003A7EB1FF0141A7F9116>III<1204A4120CA2 121C123CEAFFE0EA1C00A91310A5120CEA0E20EA03C00C1A7F9910>I<38FC1F80EA1C03 AD1307120CEA0E1B3803E3F014127F9117>I<38FF07E0383C0380381C0100A2EA0E02A2 EA0F06EA0704A2EA0388A213C8EA01D0A2EA00E0A3134013127F9116>I<39FF3FC7E039 3C0703C0001CEB01801500130B000E1382A21311000713C4A213203803A0E8A2EBC06800 011370A2EB8030000013201B127F911E>I<38FF0FE0381E0700EA1C06EA0E046C5AEA03 9013B0EA01E012007F12011338EA021C1204EA0C0E487E003C138038FE1FF014127F9116 >I<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA0388A213C8EA01D0A2 EA00E0A31340A25BA212F000F1C7FC12F312661238131A7F9116>IIII E /Fk 16 86 df<1403A34A7EA24A7EA3EC17E01413A2EC23F01421A2EC40F8A3EC807C A2903801007E153EA20102133F81A2496D7EA3496D7EA2011880011FB5FCA29039200003 F01501A2496D7EA349147CA20001157E90C8123EA248153F825AD81F80EC3F80D8FFE090 3801FFFCA22E327EB132>65 DI<91383FE001903901FFF803903807F01E90391F800307 013EC712870178144F49142F4848141F4848140F485A000F150790C8FC481503121E123E 003C1501127CA30078150012F8AB1278127C1601A2123C123E121E001F15027E6D140600 0715046C6C14086C7E6C6C141001781420013E14C090391F800380903907F00F00903801 FFFC9038003FE028337CB130>III71 DII76 DIII82 D<90387F80203801FFE03907C07860380F001C001EEB06E0481303 00381301007813001270156012F0A21520A37E1500127C127E7E13C0EA1FF86CB47E6C13 F06C13FCC613FF010F1380010013C0EC1FE01407EC03F01401140015F8A26C1478A57E15 706C14F015E07E6CEB01C000ECEB038000C7EB070038C1F01E38807FFCEB0FF01D337CB1 25>I<007FB712E0A23A7E000F800700781501007015000060166000401620A200C01630 A2481610A6C71500B3AC4A7E010FB57EA22C317EB030>II E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: a4 %%BeginPaperSize: a4 a4 %%EndPaperSize %%EndSetup %%Page: 1 1 1 0 bop 160 133 a Fk(THE)21 b(MARSA)n(GLIA)g(RANDOM)f(NUMBER)h(CDR)n (OM)2 -65 y Fj(Not)n(hin)o(g)14 b(i)q(s)g(ran)o(dom,)d(only)i(u)o (ncert)o(ain.)20 b Fi(Gail)14 b(Gasr)n(am)2 332 y Fj(Thi)q(s)k(CDR)o (OM)f(con)o(t)o(ains)h(4.8)e(billion)g(ran)o(dom)g(bit)o(s,)j(in)f(s)q (ixt)o(y)f(10-m)o(ega)o(b)o(yt)o(e)f(\014le)q(s.)30 b(Th)o(ey)19 b(w)o(ere)g(pro)q(d)o(u)o(ce)q(d)g(b)o(y)e(a)-60 382 y(com)n(bin)o(a)o(t)o(ion)f(of)h(s)q(ev)o(eral)i(of)f(t)n(h)o(e)h(b)q (e)q(st)g(d)o(et)o(ermini)q(st)o(ic)e(ran)o(dom)g(n)n(u)o(m)n(b)q(er)h (gen)o(era)o(t)o(ors)i(\(RNG's\),)e(t)o(oget)n(h)o(er)i(wit)n(h)e(t)n (hree)-60 432 y(source)q(s)f(of)d(whit)o(e)h(noi)q(s)q(e,)g(as)g(w)o (ell)f(as)h(blac)o(k)g(noi)q(s)q(e.)21 b(My)15 b(in)o(t)o(en)o(t)f(i)q (s)h(t)o(o)g(pro)o(vid)o(e)g(an)g(u)o(n)o(assaila)o(ble)g(source)h(for) f(t)n(h)o(os)q(e)h(wh)o(o)-60 482 y(a)o(bsolu)o(t)o(ely)10 b(p)q(os)q(it)o(iv)o(ely)g(h)o(a)o(v)o(e)g(t)o(o)h(h)o(a)o(v)o(e)f(a)g (large,)h(relia)o(ble)e(s)q(et)j(of)e(ran)o(dom)e(n)n(u)o(m)n(b)q(ers)j (for)f(s)q(er)q(ious)h(s)q(im)n(ula)o(t)o(ion)d(\(Mon)o(t)o(e)j (Carlo\))-60 531 y(st)o(udie)q(s.)19 b(Det)o(ails)13 b(of)h(t)n(h)o(e)g(pro)q(d)o(u)o(ct)o(ion)g(m)o(et)n(h)o(o)q(d)f(are)h (b)q(elo)o(w.)2 581 y(Thi)q(s)c(CDR)o(OM)f(also)g(con)o(t)o(ains)h (\014le)q(s)h(for)e(DIEHARD:)g(a)h(ba)o(t)n(t)o(ery)h(of)e(t)o(e)q(st)o (s)j(of)e(ran)o(domn)o(e)q(ss.)16 b(Th)o(e)q(s)q(e)c(\014le)q(s)e(are)g (in)g(v)n(ar)q(ious)-60 631 y(v)o(ers)q(ions:)16 b(DOS,)9 b(UNIX,)h(an)o(d)f(\(i486+\)LINUX,)g(wit)n(h)h(exec)h(\014le)q(s)f(as)g (w)o(ell)e(as)i(C)g(co)q(d)o(e)h(f)q(rom)c(whic)o(h)i(t)n(h)o(e)i (DIEHARD)e(ba)o(t)n(t)o(ery)-60 681 y(can)14 b(b)q(e)g(compile)q(d.)2 731 y(Also)g(includ)o(e)q(d)i(are)e(\014le)q(s)h(for)f(programs)g(t)n (h)o(a)o(t)g(will)f(crea)o(t)o(e)j(t)o(e)q(st)g(\014le)q(s)f(f)q(rom)d (most)i(of)g(t)n(h)o(e)h(common)d(ran)o(dom)g(RNG's,)-60 781 y(as)i(w)o(ell)f(as)h(s)q(ev)o(eral)g(n)o(ew)o(er)h(an)o(d)f(d)o (emonstra)o(bly)f(b)q(et)n(t)o(er)i(on)o(e)q(s.)-60 918 y Fh(1)66 b(Pro)r(d)n(u)n(cin)o(g)21 b(t)m(h)n(e)h(Ran)n(dom)f(Nu)o(m)m (b)q(ers)-60 1009 y Fj(Th)o(e)11 b(s)q(ixt)o(y)f(10-m)o(ega)o(b)o(yt)o (e)e(\014le)q(s)j(of)f(ran)o(dom)f(n)n(u)o(m)n(b)q(ers)i(are)g(pro)q(d) o(u)o(ce)q(d)g(b)o(y)g(com)n(binin)o(g)d(t)o(w)o(o)i(or)h(more)e(of)h (t)n(h)o(e)i(most)e(promi)q(s)q(in)o(g)-60 1059 y(d)o(et)o(ermini)q(st) o(ic)16 b(gen)o(era)o(t)o(ors)i(wit)n(h)f(source)q(s)h(of)e(ran)o(dom)f (noi)q(s)q(e)i(f)q(rom)d(t)n(hree)k(ph)o(ys)q(ical)e(d)o(evice)q(s)i (\(whit)o(e)f(noi)q(s)q(e\),)f(for)h(t)n(h)o(os)q(e)-60 1108 y(wh)o(o)g(feel)g(t)n(h)o(a)o(t)g(ph)o(ys)q(ical)f(source)q(s)j (of)e(ran)o(domn)o(e)q(ss)g(are)g(b)q(et)n(t)o(er)i(t)n(h)o(an)e(d)o (et)o(ermini)q(st)o(ic)f(source)q(s.)30 b(Som)o(e)15 b(of)i(t)n(h)o(e)h(\014le)q(s)f(h)o(ad)-60 1158 y(whit)o(e)c(noi)q(s)q (e)g(com)n(bin)o(e)q(d)f(wit)n(h)h(blac)o(k)f(noi)q(s)q(e,)h(t)n(h)o(e) g(la)o(t)n(t)o(er)h(f)q(rom)d(digit)o(al)h(recordin)o(gs)i(of)f(rap)g (m)n(us)q(ic.)j(An)o(d)e(a)f(few)g(of)g(t)n(h)o(e)g(\014le)q(s)-60 1208 y(ev)o(en)k(h)o(ad)f(n)o(ak)o(e)q(d)g(ladie)q(s)g(t)n(hro)o(wn)h (in)o(t)o(o)e(t)n(h)o(e)i(mix,)e(f)q(rom)f(pixel)h(\014le)q(s)i(on)f(t) n(h)o(e)h(n)o(et)o(w)o(or)o(k.)25 b(Th)o(e)17 b(last)f(t)o(w)o(o,)g (digit)o(ize)q(d)f(m)n(us)q(ic)-60 1258 y(an)o(d)g(pict)o(ure)q(s,)i (are)g(t)n(hro)o(wn)f(in)f(t)o(o)h(illustra)o(t)o(e)f(t)n(h)o(e)i(pr)q (inciple)e(t)n(h)o(a)o(t)h(a)f(sa)o(t)o(i)q(sf)q(act)o(ory)h(stream)f (of)h(ran)o(dom)e(bit)o(s)i(rem)o(ains)f(so)-60 1308 y(aft)o(er)f(com)n(bin)o(a)o(t)o(ion)d(wit)n(h)j(t)n(h)o(e)h(bit)o(s)f (of)f(an)o(y)h(\014le)g(.)2 1357 y(Th)o(a)o(t)g(imp)q(ort)o(an)o(t)e (pr)q(inciple)h(i)q(s)g(t)n(hi)q(s:)18 b(if)790 1407 y Fg(x)814 1413 y Ff(1)833 1407 y Fg(;)7 b(x)876 1413 y Ff(2)894 1407 y Fg(;)g(x)937 1413 y Ff(3)954 1407 y Fg(;)g(:)g(:)g(:)e(;)-60 1482 y Fj(i)q(s)13 b(a)h(truly)g(ran)o(dom)e (s)q(equence)k(of)d(in)o(d)o(ep)q(en)o(d)o(en)o(t)i(bit)o(s)f(t)o(akin) o(g)f(v)n(alue)q(s)h(0)g(an)o(d)f(1)h(wit)n(h)g(equal)f(proba)o(bilit)o (ie)q(s,)g(an)o(d)g(if)805 1573 y Fg(y)825 1579 y Ff(1)844 1573 y Fg(;)7 b(y)883 1579 y Ff(2)901 1573 y Fg(;)g(y)940 1579 y Ff(3)958 1573 y Fg(;)g(:)g(:)g(:)-60 1665 y Fj(i)q(s)13 b(an)o(y)h(s)q(equence)i(of)d Fi(c)n(onstant)h Fj(or)g Fi(r)n(andom)g Fj(bit)o(s,)g(t)n(h)o(en)h(t)n(h)o(e)g(s)q(equence)466 1756 y Fg(x)490 1762 y Ff(1)518 1756 y Fj(+)9 b Fg(y)579 1762 y Ff(1)610 1756 y Fj(mo)q(d)h(2)p Fg(;)20 b(x)778 1762 y Ff(2)805 1756 y Fj(+)10 b Fg(y)867 1762 y Ff(2)897 1756 y Fj(mo)q(d)h(2)p Fg(;)20 b(x)1066 1762 y Ff(3)1093 1756 y Fj(+)10 b Fg(y)1155 1762 y Ff(3)1185 1756 y Fj(mo)q(d)g(2)p Fg(;)d(:)g(:)g(:)-60 1847 y Fj(i)q(s)13 b(also)h(a)f(truly)h(ran)o(dom) e(s)q(equence)k(of)d(in)o(d)o(ep)q(en)o(d)o(en)o(t)i(bit)o(s.)2 1897 y(Th)n(us)k(if)e(w)o(e)i(are)f(con\014d)o(en)o(t)h(t)n(h)o(a)o(t)f (a)g(ph)o(ys)q(ical)f(d)o(evice,)j(carefully)d(constru)o(ct)o(e)q(d)k (t)o(o)d(pro)q(d)o(u)o(ce)h(ran)o(domn)o(e)q(ss)f(\(say)g(b)o(y)-60 1947 y(m)o(eans)12 b(of)f(Johnson)h(noi)q(s)q(e,)g(as)g(wit)n(h)g(on)o (e)g(of)g(our)g(inpu)o(t)o(s\),)h(really)f(do)q(e)q(s)g(pro)q(d)o(u)o (ce)q(s)i(ran)o(dom)c(bit)o(s,)i(t)n(h)o(en)h(com)n(binin)o(g)d(it)i (wit)n(h)-60 1997 y(t)n(h)o(e)k(ou)o(t)o(pu)o(t)g(of)e(a)h(d)o(et)o (ermini)q(st)o(ic)f(gen)o(era)o(t)o(or\(s\))j(will)c(m)o(ain)o(t)o(ain) f(t)n(h)o(a)o(t)j(p)q(erfect)i(ran)o(domn)o(e)q(ss,)d(an)o(d)h(st)o (ill)f(m)o(ain)o(t)o(ain)e(it)j(if)f(w)o(e)-60 2047 y(t)n(hro)o(w)g(in) g(som)o(e)e(blac)o(k)h(noi)q(s)q(e.)2 2096 y(It)i(t)o(ur)q(ns)f(ou)o (t,)h(h)o(o)o(w)o(ev)o(er,)f(t)n(h)o(a)o(t)g(no)h(ph)o(ys)q(ical)e(d)o (evice)q(s)i(I)g(h)o(a)o(v)o(e)f(cons)q(id)o(ere)q(d)i(pass)f(t)n(h)o (e)g(str)q(in)o(gen)o(t)g(ran)o(domn)o(e)q(ss)f(require-)-60 2146 y(m)o(en)o(t)o(s)f(of)f(m)o(y)f(DIEHARD)i(ba)o(t)n(t)o(ery)h(of)e (t)o(e)q(st)o(s.)20 b(Bu)o(t)14 b(t)n(h)o(e)g(d)o(et)o(ermini)q(st)o (ic)e(m)o(et)n(h)o(o)q(ds)h(do.)k(So,)c(in)f(e\013ect,)j(I)e(am)e(assu) o(min)o(g)i(our)-60 2196 y(d)o(et)o(ermini)q(st)o(ic)h(ran)o(dom)f(bit) o(s)i(are)g(t)n(h)o(e)h(truly)e(ran)o(dom)f(on)o(e)q(s,)i(t)n(h)o(e)h Fg(x)p Fj('s.)k(An)o(d)15 b(t)n(h)o(e)g(p)q(ert)o(urbin)o(g)h(on)o(e)q (s,)f(t)n(h)o(e)g Fg(y)q Fj('s,)g(are)g(comin)o(g)-60 2246 y(f)q(rom)d(ph)o(ys)q(ical)h(d)o(evice)q(s,)h(us)q(e)q(d)h(in)f (com)n(bin)o(a)o(t)o(ion)d(wit)n(h)j(t)n(h)o(e)g Fg(x)p Fj('s)g(t)o(o)g(m)o(ak)o(e)e(pre)q(dict)o(ion)i(virt)o(ually)e(imp)q (oss)q(ible.)2 2296 y(On)o(e)j(can)f(d)o(e\014n)o(e)h(a)f(T)m(ruly)f (Ran)o(dom)e(Sequence)16 b(Of)e(Bit)o(s)g(\(TRSOB\))h(recurs)q(iv)o (ely:)537 2387 y Fg(x)561 2393 y Ff(1)579 2387 y Fg(;)7 b(x)622 2393 y Ff(2)640 2387 y Fg(;)g(x)683 2393 y Ff(3)701 2387 y Fg(;)g(:)g(:)g(:)t Fi(is)15 b(a)g Fj(TRSOB)42 b Fi(if)14 b(and)i(only)f(if)364 2478 y Fg(x)388 2484 y Ff(1)415 2478 y Fj(+)10 b Fg(y)477 2484 y Ff(1)507 2478 y Fj(mo)q(d)g(2)p Fg(;)d(x)662 2484 y Ff(2)689 2478 y Fj(+)j Fg(y)751 2484 y Ff(2)781 2478 y Fj(mo)q(d)g(2)p Fg(;)d(x)936 2484 y Ff(3)963 2478 y Fj(+)i Fg(y)1024 2484 y Ff(3)1055 2478 y Fj(mo)q(d)h(2)p Fg(;)d(:)g(:)g(:)e Fi(is)14 b(a)h Fj(TRSOB)-60 2553 y Fi(for)f(every)h(se)n(quenc)n(e)h (of)f(bits)f Fg(y)431 2559 y Ff(1)450 2553 y Fg(;)7 b(y)489 2559 y Ff(2)507 2553 y Fg(;)g(y)546 2559 y Ff(3)565 2553 y Fg(;)g(:)g(:)g(:)n Fi(,)14 b(c)n(onstant)i(or)e(r)n(andom.)905 2742 y Fj(1)p eop %%Page: 2 2 2 1 bop 2 -41 a Fj(Thi)q(s)13 b(i)q(s)g(cert)o(ainly)h(not)f(a)h (constru)o(ct)o(iv)o(e)h(d)o(e\014nit)o(ion|bu)o(t)e(h)o(o)o(w)g(can)h (t)n(h)o(e)g(u)o(n)o(d)o(e\014n)o(a)o(ble)g(b)q(e)g(d)o(e\014n)o(e)q (d?)19 b(Not)n(hin)o(g)14 b(i)q(s)f(truly)-60 9 y(ran)o(dom.)i(A)o(t)c (b)q(e)q(st,)h(w)o(e)e(can)h(t)o(ak)o(e)g(adv)n(an)o(t)o(age)e(of)h(t)n (hi)q(s)h(id)o(ea)g(b)o(y)f(h)o(o)o(pin)o(g)g(t)n(h)o(a)o(t)h(on)o(e)g (of)f(t)n(h)o(e)h(comp)q(on)o(en)o(t)o(s)f(of)g(our)h(com)n(bin)o(a)o (t)o(ion,)-60 59 y(d)o(et)o(ermini)q(st)o(ic\(s\))j(+)g(noi)q(s)q (e\(s\),)f(pro)q(d)o(u)o(ce)q(s)j(som)o(et)n(hin)o(g)d(ad)o(equa)o(t)o (ely)h(clos)q(e)g(t)o(o)h(a)e(TRSOB.)2 108 y(As)j(DIEHARD)f(sh)o(o)o (ws,)g(t)n(h)o(e)h(bit)o(s)g(on)f(t)n(hi)q(s)h(CDR)o(OM)e(s)q(eem)h(t)o (o)h(b)q(e)f(truly)g(ran)o(dom)f(SOB's.)23 b(Bu)o(t)16 b(t)n(h)o(ey)g(are)g(not,)f(nor)-60 158 y(can)e(t)n(h)o(ey)g(or)f(an)o (y)g(ot)n(h)o(ers)i(ev)o(er)g(b)q(e.)j(A)o(t)c(b)q(e)q(st)g(I)g(can)g (only)e(quan)o(t)o(ify)g(t)n(h)o(e)j(u)o(ncert)o(ain)o(t)o(y)f(b)o(y)f (b)q(et)n(t)o(in)o(g,)h(wit)n(h)f(h)o(ea)o(vy)h(o)q(dds,)g(t)n(h)o(a)o (t)-60 208 y(t)n(h)o(e)j(bit)o(s)g(on)f(t)n(hi)q(s)h(CDR)o(OM)e(will)g (pro)q(d)o(u)o(ce)j(re)q(sul)o(t)o(s)g(cons)q(i)q(st)o(en)o(t)f(wit)n (h)f(proba)o(bilit)o(y)f(t)n(h)o(eory|t)n(h)o(a)o(t)h(m)o(a)o(t)n(h)o (em)o(a)o(t)o(ical)d(\014ct)o(ion)-60 258 y(w)o(e)i(us)q(e)h(t)o(o)f (quan)o(t)o(ify)e(d)o(egree)q(s)k(of)e(u)o(ncert)o(ain)o(t)o(y)m(.)2 308 y(Th)o(e)q(ir)j(p)q(ot)o(en)o(t)o(ial)f(us)q(e)q(s)i(ran)o(ge)f(f)q (rom)e(ela)o(b)q(ora)o(t)o(e)i(scien)o(t)o(i\014c)g(s)q(im)n(ula)o(t)o (ions)d(t)o(o)j(us)q(e)g(in)g(gam)o(e)q(s:)22 b(sh)o(o)q(ot)17 b(craps,)i(wit)n(h)d(t)n(h)o(e)-60 357 y(n)n(u)o(m)n(b)q(er)i(of)g(t)n (hro)o(ws)i(an)o(d)e(n)n(u)o(m)n(b)q(er)g(of)g(winnin)o(g)g(gam)o(e)q (s)g(almost)f(surely)i(wit)n(hin)f(t)n(h)o(e)i(limit)o(s)c(pro)o(vid)o (e)q(d)j(b)o(y)g(proba)o(bilit)o(y)-60 407 y(t)n(h)o(eory{an)o(d)c (just)g(as)g(surely)m(,)g(o)q(ccas)q(ion)o(al)f(re)q(sul)o(t)o(s)j(ou)o (t)o(s)q(id)o(e)f(t)n(h)o(os)q(e)g(limit)o(s,)c(wit)n(h)j(pre)q(dict)o (e)q(d)h(rar)q(it)o(y)m(.)k(Th)o(ey)15 b(could)g(ru)o(n)g(t)n(h)o(e)-60 457 y(gam)o(e)q(s)e(in)g(Las)h(V)m(egas)g(for)f(a)g(t)n(h)o(ousan)o(d)i (y)o(ears,)f(wit)n(h)g(no)f(on)o(e)h(t)n(h)o(e)h(wi)q(s)q(er.)j (\(Except)d(t)n(h)o(os)q(e)g(wh)o(o)e(h)o(a)o(v)o(e)h(t)n(hi)q(s)g(CD.) f(Act)o(ually)m(,)-60 507 y(t)n(h)o(e)g(most)e(proli\014c)g(consu)o(m)o (ers)h(of)g(ran)o(dom)e(n)n(u)o(m)n(b)q(ers)i(are)g(slot)f(m)o(ac)o (hin)o(e)q(s,)g(an)o(d)h(m)o(an)o(y)e(of)h(t)n(h)o(em)g(h)o(a)o(v)o(e)g (in)o(t)o(er)q(n)o(al)g(gen)o(era)o(t)o(ors)-60 557 y(bas)q(e)q(d)g(on) g(d)o(et)o(ermini)q(st)o(ic)e(m)o(et)n(h)o(o)q(ds)h(I)h(h)o(a)o(v)o(e)f (d)o(ev)o(elo)o(p)q(e)q(d.)18 b(Wh)o(et)n(h)o(er)11 b(t)n(h)o(os)q(e)h (gen)o(era)o(t)o(ors)g(are)f(p)q(ert)o(urb)q(e)q(d)h(wit)n(h)f(som)o(e) e(ph)o(ys)q(ical)-60 606 y(inpu)o(t,)14 b(I)f(h)o(a)o(v)o(e)h(not)g(b)q (een)g(t)o(old.\))2 656 y(Th)o(e)h(CDR)o(OM)e(can)h(pro)o(vid)o(e)g(t)n (h)o(e)h(ran)o(dom)d(k)o(eystrok)o(e)q(s)j(of)f(a)f(monk)o(ey)g(a)o(t)h (a)f(t)o(yp)q(ewr)q(it)o(er)h(an)o(d)g(pro)q(d)o(u)o(ce)h(t)n(h)o(e)g (exp)q(ect)o(e)q(d)-60 706 y(n)n(u)o(m)n(b)q(er)f(of)f(part)o(icular)h (four-let)n(t)o(er)h(w)o(ords,)f(or)g(t)o(ot)o(al)f(n)n(u)o(m)n(b)q(er) h(of)g(di\013eren)o(t)h(w)o(ords,)f(et)o(c.|all)e(wit)n(hin)i(t)n(h)o (e)h(t)n(h)o(e)g(pre)q(dict)o(e)q(d)-60 756 y(limit)o(s)d(most)h(of)h (t)n(h)o(e)g(t)o(im)o(e,)e(an)o(d)i(ou)o(t)o(s)q(id)o(e)h(wit)n(h)e(t)n (h)o(e)i(rar)q(it)o(y)e(pre)q(dict)o(e)q(d)i(b)o(y)f(t)n(h)o(eory)m(.)2 806 y(An)o(d,)k(most)f(imp)q(ort)o(an)o(t)n(ly)m(,)f(t)n(h)o(ey)i(can)g (pro)o(vid)o(e)f(t)n(h)o(e)i(source)f(of)f(ran)o(domn)o(e)q(ss)h(n)o (ece)q(ssary)i(for)d(s)q(er)q(ious)h(Mon)o(t)o(e)g(Carlo)-60 856 y(st)o(udie)q(s,)13 b(ran)o(gin)o(g)f(f)q(rom)e(ran)o(dom)g(knot)n (t)o(in)o(g)j(of)e(prot)o(e)q(in)h(molecule)q(s)f(t)o(o)h(t)n(h)o(e)h (form)o(a)o(t)o(ion)d(of)h(galaxie)q(s.)17 b(In)12 b(su)o(c)o(h)g(st)o (udie)q(s,)h(an)o(y)-60 905 y(di)q(sco)o(v)o(ery)h(rai)q(s)q(e)q(s)h(t) n(h)o(e)h(que)q(st)o(ion:)j(Is)c(t)n(h)o(e)h(re)q(sul)o(t)f(a)g(pro)o (p)q(ert)o(y)g(of)f(t)n(h)o(e)h(ph)o(ys)q(ical)e(syst)o(em)h(w)o(e)h (are)g(s)q(im)n(ula)o(t)o(in)o(g,)d(or)i(i)q(s)g(it)h(just)-60 955 y(b)q(eca)n(us)q(e)g(of)f(bad)f(ran)o(dom)f(n)n(u)o(m)n(b)q(ers?)2 1005 y(Wit)n(h)i(t)n(h)o(e)i(m)o(an)o(y)c(d)o(et)o(ermini)q(st)o(ic)i (RNG's)g(t)n(h)o(a)o(t)h(h)o(a)o(v)o(e)f(b)q(een)h(d)o(ev)o(elo)o(p)q (e)q(d,)g(on)o(e)f(can)h(usually)f(answ)o(er)h(t)n(h)o(a)o(t)g(que)q (st)o(ion.)20 b(If)-60 1055 y(t)n(h)o(e)e(re)q(sul)o(t)g(h)o(olds)f (for)f(a)h(v)n(ar)q(iet)o(y)g(of)f(di\013eren)o(t)i(kin)o(ds)f(of)g (RNG's,)f(t)n(h)o(en)i(t)n(h)o(e)g(re)q(sul)o(t)g(can)g(b)q(e)f (con\014d)o(en)o(t)n(ly)h(said)f(t)o(o)g(com)o(e)-60 1105 y(f)q(rom)c(t)n(h)o(e)k(assu)o(mpt)o(ions)e(a)o(b)q(ou)o(t)g(t)n (h)o(e)h(ph)o(ys)q(ical)f(syst)o(em)g(an)o(d)g(not)g(f)q(rom)f(d)o (epart)o(ure)j(f)q(rom)c(t)n(h)o(e)j(assu)o(m)o(e)q(d)g(u)o(niformit)o (y)d(an)o(d)-60 1154 y(in)o(d)o(ep)q(en)o(d)o(ence)j(of)d(t)n(h)o(e)i (ran)o(dom)d(inpu)o(t.)2 1204 y(Thi)q(s)j(di)q(sk)g(pro)o(vid)o(e)q(s)h (a)f(v)n(ar)q(iet)o(y)f(of)h(som)o(e)f(of)h(t)n(h)o(e)h(b)q(e)q(st)g(d) o(et)o(ermini)q(st)o(ic)f(m)o(et)n(h)o(o)q(ds)g(for)g(su)o(c)o(h)g (compar)q(i)q(sons,)f(as)h(w)o(ell)g(as)-60 1254 y(t)n(h)o(e)g(purp)q (ort)o(e)q(d)g(TRSOB's)f(t)n(h)o(a)o(t)g(sh)o(ould)f(b)q(e)h(t)n(h)o(e) h(\014rst)g(recours)q(e.)-60 1391 y Fh(2)66 b(Ph)n(ys)q(ical)20 b(Source)r(s)i(of)g(Ran)n(domn)n(e)r(s)q(s)-60 1482 y Fj(I)14 b(h)o(a)o(v)o(e)f(an)h(ela)o(b)q(ora)o(t)o(e)g(bro)q(c)o(h)n (ure)h(f)q(rom)d(a)i(compan)o(y)e(t)n(h)o(a)o(t)i(us)q(e)q(s)106 1565 y(\\a)h(pro)o(pr)q(iet)o(ary)h(t)o(ec)o(hnology)f(t)o(o)h(crea)o (t)o(e)i(truly)e(ran)o(dom)e(n)n(u)o(m)n(b)q(ers.)25 b(Since)16 b(t)n(h)o(e)h([d)o(evice])f(i)q(s)f(bas)q(e)q(d)i(on)e(a)44 1615 y(n)o(a)o(t)o(urally)h(o)q(ccurr)q(in)o(g)i(ran)o(dom)e(ph)o(enom) o(enon)h(\(Johnson)h(Noi)q(s)q(e\))f(ra)o(t)n(h)o(er)i(t)n(h)o(an)e(a)g (digit)o(al)f(logic)g(circuit)i(or)44 1665 y(compu)o(t)o(er)d(program,) e(it)i(require)q(s)h(no)f(init)o(ial)e(st)o(art)o(in)o(g)i(v)n(alue)g (an)o(d)g(eac)o(h)h(n)o(ew)f(v)n(alue)f(i)q(s)h(in)o(d)o(ep)q(en)o(d)o (en)o(t)h(of)e(all)44 1715 y(previous)g(v)n(alue)q(s.")-60 1798 y(Sou)o(n)o(ds)g(grea)o(t.)19 b(Su)o(c)o(h)14 b(a)g(d)o(evice)h (sh)o(ould)e(solv)o(e)h(t)n(h)o(e)g(problem)e(of)i(pro)o(vidin)o(g)f (TRSOB's.)2 1848 y(In)f(plannin)o(g)f(for)g(t)n(hi)q(s)h(CDR)o(OM,)f(I) g(b)q(ough)o(t)h(on)o(e)g(of)f(t)n(h)o(os)q(e)i(d)o(evice)q(s,)g(\(a)o (b)q(ou)o(t)f($400)f(US\))h(f)q(rom)e(Can)o(ad)o(a.)17 b(I)12 b(also)f(b)q(ough)o(t)-60 1897 y(an)17 b(equally)f(impre)q(ss)q (iv)o(ely)f(do)q(cu)o(m)o(en)o(t)o(e)q(d)i(d)o(evice,)i(promi)q(s)q(in) o(g)14 b(true)k(ran)o(domn)o(e)q(ss,)f(f)q(rom)e(Germ)o(an)o(y)g(\(a)o (b)q(ou)o(t)i($300\))f(an)o(d)-60 1947 y(h)o(ad)e(acce)q(ss)i(t)o(o)e (t)n(h)o(e)h(`ran)o(dom)c(ou)o(t)o(pu)o(t')k(f)q(rom)d(a)h(d)o(evice)i (f)q(rom)d(Califor)q(nia.)2 1997 y(So)i(I)g(h)o(ad)g(purp)q(ort)o(e)q (d)h(TRSOB's)f(f)q(rom)e(Can)o(ad)o(a,)h(Germ)o(an)o(y)g(an)o(d)h (Califor)q(nia.)i(W)m(ere)e(t)n(h)o(ey)h(T)m(ruly)e(Ran)o(dom)f(SOB's?) -60 2047 y(No,)h(not)f(a)o(t)h(all.)k(All)12 b(t)n(hree)i(f)q(aile)q(d) e(sp)q(ect)o(acularly)h(on)g(t)n(h)o(e)g(monk)o(ey)f(t)o(e)q(st)o(s,)i (whic)o(h)f(emph)o(as)q(ize)f(t)o(e)q(st)o(in)o(g)i(for)e(in)o(d)o(ep)q (en)o(d)o(ence.)2 2097 y(Example)q(s)h(of)g(t)n(h)o(e)i(ou)o(t)o(pu)o (t)g(f)q(rom)c(t)n(h)o(e)q(s)q(e)16 b(d)o(evice)q(s)f(are)f(in)g(t)n(h) o(e)g(\014le)q(s)294 2146 y(can)o(ad)o(a.bit)83 b(germ)o(an)o(y)m(.bit) e(califor)q(n.bit)-60 2196 y(for)14 b(t)n(h)o(os)q(e)h(wh)o(o)e(w)o(an) o(t)h(t)o(o)g(try)g(t)n(h)o(em)f(wit)n(h)h(t)n(h)o(e)h(DIEHARD)e(ba)o (t)n(t)o(ery)m(.)2 2246 y(I)f(h)o(a)o(v)o(e)f(us)q(e)q(d)i(ou)o(t)o(pu) o(t)f(f)q(rom)e(t)n(h)o(e)q(s)q(e)j(d)o(evice)q(s)g(in)e(formin)o(g)f (t)n(h)o(e)i(ran)o(dom)e(bit)i(\014le)q(s)g(in)f(t)n(hi)q(s)h(CDR)o (OM,)e(bu)o(t)i(in)g(com)n(bin)o(a)o(t)o(ion)-60 2296 y(wit)n(h)f(som)o(e)f(of)g(t)n(h)o(e)i(most)f(promi)q(s)q(in)o(g)d(d)o (et)o(ermini)q(st)o(ic)i(RNG's,)h(d)o(e)q(scr)q(ib)q(e)q(d)h(n)o(ext.) 17 b(Th)o(e)12 b(la)o(t)n(t)o(er)f(pass)i(all)c(t)o(e)q(st)o(s)k(in)e (DIEHARD,)-60 2346 y(an)o(d)g(I)g(view)f(t)n(h)o(em)h(as)g(t)n(h)o(e)h (more)e(imp)q(ort)o(an)o(t)f(part)i(of)f(t)n(h)o(e)i(com)n(bin)o(a)o(t) o(ion|t)n(h)o(e)d Fg(x)p Fj('s)h(of)g(t)n(h)o(e)i(a)o(b)q(o)o(v)o(e)f (di)q(scuss)q(ion.)17 b(Th)o(e)11 b(ph)o(ys)q(ical)-60 2395 y(d)o(evice)j(bit)o(s,)g(t)n(h)o(e)g Fg(y)q Fj('s,)g(are)g(t)n(h)o (ere)h(t)o(o)f(prev)o(en)o(t)g(pre)q(dict)o(a)o(bilit)o(y)m(.)j(Th)o (ey)c(also)g(m)o(ak)o(e)f(t)n(h)o(e)i(p)q(er)q(io)q(ds)g(in\014nit)o (e,)f(bu)o(t)h(t)n(h)o(a)o(t)f(i)q(s)g(of)g(no)-60 2445 y(cons)q(equence,)i(as)e(t)n(h)o(e)h(p)q(er)q(io)q(d)f(of)g(t)n(h)o(e)g (d)o(et)o(ermini)q(st)o(ic)g(comp)q(on)o(en)o(t)f(i)q(s)g(so)i(h)n(uge) f(as)h(t)o(o)f(b)q(e)g(in\014nit)o(e)g(for)g(pract)o(ical)f(purp)q(os)q (e)q(s.)905 2742 y(2)p eop %%Page: 3 3 3 2 bop -60 -41 a Fh(3)66 b(Th)n(e)22 b(Det)n(ermini)q(st)n(i)o(c)e (Gen)n(era)n(t)o(ors)-60 50 y Fj(As)15 b(y)o(ou)f(will)f(lear)q(n)h(f)q (rom)f(t)n(h)o(e)i Fe(makewhat)e Fj(execu)o(t)o(a)o(ble)i(\014le)q(s)g (on)f(t)n(hi)q(s)h(di)q(sk,)e(t)n(h)o(ere)j(are)f(m)o(an)o(y)e(d)o(et)o (ermini)q(st)o(ic)g(RNG's)h(t)n(h)o(a)o(t)-60 100 y(pass)k(all)f(t)n(h) o(e)h(t)o(e)q(st)o(s)h(in)e(DIEHARD)g(an)o(d)g(h)o(a)o(v)o(e)g(extrem)o (ely)g(lon)o(g)g(p)q(er)q(io)q(ds.)28 b(F)m(urt)n(h)o(ermore,)18 b(t)n(h)o(ey)g(s)q(eem)f(t)o(o)h(pass)g(for)f(all)-60 149 y(su)n(bstr)q(in)o(gs)f(of)d(bit)o(s,)h(trailin)o(g)f(as)h(w)o(ell) f(as)h(leadin)o(g,)f(f)q(rom)f(t)n(h)o(e)q(ir)j(32-bit)e(ou)o(t)o(pu)o (t.)19 b(Som)o(e)12 b(of)i(t)n(h)o(em)f(are:)-60 232 y Fd(32-bit)h(m)n(ul)o(t)o(ip)o(ly-wi)o(t)n(h-)o(carry)f(\(MW)o(C\))j (gen)o(era)o(t)o(ors,)j Fg(x)951 238 y Fc(n)985 232 y Fj(=)12 b Fg(ax)1075 238 y Fc(n)p Fb(\000)p Ff(1)1149 232 y Fj(+)d(carry)k(mo)q(d)d Fg(b)h Fj(=)h(2)1481 217 y Ff(32)1516 232 y Fj(.)44 278 y(F)m(orm)f Fg(ax)c Fj(+)g Fg(c)13 b Fj(in)f(adjoinin)o(g)f(regi)q(st)o(ers)k(\(64)d(bit)o(s\).)18 b(Th)o(e)13 b(n)o(ew)h Fg(c)e Fj(i)q(s)g(t)n(h)o(e)i(t)o(o)o(p)f(32)f (bit)o(s,)h(t)n(h)o(e)h(n)o(ew)f Fg(x)44 328 y Fj(t)n(h)o(e)i(b)q(ot)n (t)o(om)f(32.)20 b(If)14 b Fg(a)g Fj(i)q(s)h(c)o(h)o(os)q(en)g(so)g(t)n (h)o(a)o(t)g Fg(m)e Fj(=)g Fg(ab)c Fa(\000)h Fj(1)15 b(i)q(s)f(a)g(safepr)q(im)o(e,)f(t)n(h)o(e)i(p)q(er)q(io)q(d)g(will)e (b)q(e)44 378 y(\()p Fg(m)5 b Fa(\000)g Fj(1\))p Fg(=)p Fj(2,)11 b(an)o(d)g(t)n(h)o(e)i(gen)o(era)o(t)o(or)g(s)q(eems)e(t)o(o)h (pass)h(all)d(t)o(e)q(st)o(s.)19 b(See)13 b(t)n(h)o(e)f(p)q(ost)o(scr)q (ipt)i(\014le)d(m)o(wc1.ps.)-60 454 y Fd(Th)o(e)k(Mot)n(h)o(er)g(of)g (all)g(RNG's,)32 534 y Fg(x)56 540 y Fc(n)89 534 y Fj(=)d(2111111111)p Fg(x)367 540 y Fc(n)p Fb(\000)p Ff(4)439 534 y Fj(+)d(1492)p Fg(x)588 540 y Fc(n)p Fb(\000)p Ff(3)661 534 y Fj(+)h(1776)p Fg(x)811 540 y Fc(n)p Fb(\000)p Ff(2)884 534 y Fj(+)g(5115)p Fg(x)1034 540 y Fc(n)p Fb(\000)p Ff(1)1107 534 y Fj(+)f(carry)j(mo)q(d) e Fg(b)i Fj(=)g(2)1439 518 y Ff(32)32 583 y Fj(T)m(o)f(implem)n(en)o (t,)e(form)i(t)n(h)o(e)h(lin)o(ear)g(com)n(bin)o(a)o(t)o(ion)e(in)h (adjoinin)o(g)g(regi)q(st)o(ers)i(\(64)f(bit)o(s\).)18 b(Th)o(e)12 b(n)o(ew)32 633 y Fg(c)h Fj(i)q(s)g(t)n(h)o(e)h(t)o(o)o(p)g (32)f(bit)o(s,)g(t)n(h)o(e)h(n)o(ew)g Fg(x)f Fj(t)n(h)o(e)h(b)q(ot)n(t) o(om)f(32.)k(Th)o(e)d(p)q(er)q(io)q(d)f(i)q(s)g(a)o(b)q(ou)o(t)h(2)1256 618 y Ff(158)1307 633 y Fj(.)k(See)c(t)n(h)o(e)h(\014le)32 683 y(m)o(wc1.ps.)-60 757 y Fd(Conca)o(t)o(en)o(a)o(t)o(e)q(d)e(16-bit) h(MW)o(C)j(gen)o(era)o(t)o(ors)45 831 y Fj(While)g(32-bit)g(m)n(ul)o(t) o(iply-wit)n(h-carry)f(gen)o(era)o(t)o(ors)j(are)f(more)f(d)o(e)q(s)q (ira)o(ble,)h(t)n(h)o(ey)g(can)g(only)f(b)q(e)45 881 y(fully)12 b(exploit)o(e)q(d)h(if)f(on)o(e)h(h)o(as)g(m)o(eans)g(t)o(o) g(form)e(t)n(h)o(e)j(64-bit)e(pro)q(d)o(u)o(ct)i(of)e(32-bit)g(in)o(t)o (egers,)i(whic)o(h)45 931 y(usually)h(require)q(s)h(ass)q(em)n(bler.)22 b(Bu)o(t)16 b(v)o(ers)q(ions)f(for)g(bas)q(e)h Fg(b)d Fj(=)h(2)1056 916 y Ff(16)1106 931 y Fj(are)h(readily)g(implem)o(en)o (t)o(e)q(d)45 981 y(in)i(C)f(or)h(F)m(ortran:)23 b(Ch)o(o)q(os)q(e)18 b(t)n(h)o(e)f(m)n(ul)o(t)o(iplier)e Fg(a)h Fj(so)h(t)n(h)o(a)o(t)g Fg(m)f Fj(=)h Fg(ab)11 b Fa(\000)g Fj(1)16 b(i)q(s)g(a)h(safepr)q(im)o (e.)25 b(F)m(or)45 1031 y(16-bit)15 b(s)q(ee)q(d)i(v)n(alue)q(s)f Fg(x)f Fj(an)o(d)h Fg(c)p Fj(\()p Fg(<)f(a)p Fj(\),)h(form)e Fg(ax)c Fj(+)h Fg(c)k Fj(in)h(32)f(bit)o(s.)24 b(Th)o(e)16 b(n)o(ew)g Fg(c)g Fj(i)q(s)f(t)n(h)o(e)h(t)o(o)o(p)g(16,)45 1081 y(t)n(h)o(e)e(n)o(ew)e Fg(x)g Fj(t)n(h)o(e)i(b)q(ot)n(t)o(om)d (16.)17 b(F)m(or)c(example,)d(in)i(C,)g Fe(w=a*\(w&65535\)+\(w>)o (>16\))d Fj(forms)i(a)h(n)o(ew)45 1130 y(32-bit)f(w)o(ord)g Fe(w)g Fj(wh)o(os)q(e)i(up)o(p)q(er,lo)o(w)o(er)e(part)o(s)h(are)g(t)n (h)o(e)g(n)o(ew)g Fg(c;)7 b(x)p Fj(.)16 b(Th)o(e)c(p)q(er)q(io)q(d)f(i) q(s)g Fg(ab=)p Fj(2)t Fa(\000)t Fj(1.)17 b(Tw)o(o)45 1180 y(su)o(c)o(h)e(16-bit)e(s)q(equence)q(s)k(can)d(b)q(e)g(conca)o(t) o(en)o(a)o(t)o(e)q(d)h(t)o(o)f(form)e(a)i(32-bit)f(s)q(equence)j(t)n(h) o(a)o(t)e(s)q(eems)g(t)o(o)45 1230 y(pass)h(all)e(t)o(e)q(st)o(s.)20 b(Th)o(e)14 b(p)q(er)q(io)q(d)g(i)q(s)f(arou)o(n)o(d)h(2)723 1215 y Ff(120)775 1230 y Fj(.)k(See)c(t)n(h)o(e)h Fe(makewhat)d Fj(exec)j(\014le.)-60 1304 y Fd(Th)o(e)g(KISS)h(Gen)o(era)o(t)o(or)45 1370 y Fj(Th)o(e)c(K)o(eep)g(It)f(Simple)d(St)o(upid)j(gen)o(era)o(t)o (or)h(com)n(bin)o(e)q(s)e(s)q(imple)f(gen)o(era)o(t)o(ors)j(t)o(o)f (get)h(a)e(f)q(ast,)h(eas)q(ily)45 1420 y(programm)o(e)q(d)i(comp)q(os) q(it)o(e)g(wit)n(h)i(v)o(ery)g(lon)o(g)g(p)q(er)q(io)q(d.)20 b(It)15 b(forms)e Fg(x)d Fj(+)g Fg(y)h Fj(+)f Fg(z)k Fj(mo)q(d)c(2)1364 1405 y Ff(32)1414 1420 y Fj(,)k(wh)o(ere)45 1470 y Fg(x;)7 b(y)q(;)g(z)16 b Fj(are)e(form)o(e)q(d)f(b)o(y)366 1517 y Fg(x)390 1523 y Fc(n)454 1517 y Fj(=)42 b(69069)p Fg(x)657 1523 y Fc(n)p Fb(\000)p Ff(1)730 1517 y Fj(+)9 b(1)i(mo)q(d)g(2)916 1502 y Ff(32)370 1567 y Fg(y)390 1573 y Fc(n)454 1567 y Fj(=)42 b Fg(y)548 1573 y Fc(n)p Fb(\000)p Ff(1)613 1567 y Fj(\()p Fg(I)13 b Fj(+)d Fg(L)730 1552 y Ff(13)765 1567 y Fj(\)\()p Fg(I)j Fj(+)d Fg(R)902 1552 y Ff(17)937 1567 y Fj(\)\()p Fg(I)j Fj(+)c Fg(L)1069 1552 y Ff(5)1088 1567 y Fj(\))371 1617 y Fg(z)390 1623 y Fc(n)454 1617 y Fj(=)42 b(2)p Fg(z)568 1623 y Fc(n)p Fb(\000)p Ff(1)642 1617 y Fj(+)10 b Fg(z)703 1623 y Fc(n)p Fb(\000)p Ff(2)777 1617 y Fj(+)g(carry)i(mo)q(d)e(2)1036 1602 y Ff(32)45 1670 y Fj(Th)o(e)15 b Fg(y)q Fj('s)g(are)g(a)f (\(3\)shift-regi)q(st)o(er)g(s)q(equence.)21 b(Th)o(e)15 b(p)q(er)q(io)q(d)f(of)f(KISS)i(i)q(s)f(a)o(b)q(ou)o(t)g(2)1334 1655 y Ff(127)1385 1670 y Fj(.)20 b(See)15 b(t)n(h)o(e)45 1719 y(m)o(ak)o(ewh)o(a)o(t)e(exec)i(\014le)f(as)g(w)o(ell)f(as)h(m)o (ak)o(e.txt.)-60 1786 y Fd(A)i(Simp)o(le)e(Com)n(bin)o(a)o(t)o(i)o(on)e (Gen)o(era)o(t)o(or)32 1860 y Fj(Th)o(e)i(t)o(w)o(o)f(s)q(equence)q(s)k (are)126 1910 y Fg(x)p Fj(\()p Fg(n)p Fj(\))12 b(=)f Fg(x)p Fj(\()p Fg(n)e Fa(\000)h Fj(1\))f Fa(\003)g Fg(x)p Fj(\()p Fg(n)g Fa(\000)h Fj(2\))h(mo)q(d)f(2)730 1895 y Ff(32)126 1960 y Fg(y)q Fj(\()p Fg(n)p Fj(\))j(=)f(30903)c Fa(\003)g Fg(y)q Fj(\()p Fg(n)j Fa(\000)e Fj(1\))g(+)h(carry)i(mo)q(d)e (2)822 1944 y Ff(16)857 1960 y Fg(;)32 2009 y Fj(Th)o(e)h(\014rst)i(i)q (s)e(a)g(lagge)q(d)g(Fib)q(on)o(acci)h(gen)o(era)o(t)o(or)h(us)q(in)o (g)e(m)n(ul)o(t)o(iplica)o(t)o(i)o(on)e(on)i(32-bit)g(o)q(dd)g(in)o(t)o (egers,)32 2059 y(t)n(h)o(e)20 b(s)q(econ)o(d)f(a)g(m)n(ul)o(t)o (iply-wit)n(h-carry)e(gen)o(era)o(t)o(or)k(for)e(16-bit)f(in)o(t)o (egers.)34 b(Wit)n(h)19 b(addit)o(ion)f(of)32 2109 y(t)n(h)o(e)i(t)o(w) o(o,)f(mo)q(d)o(ulo)f(2)377 2094 y Ff(32)411 2109 y Fj(,)j(t)n(h)o(e)f (re)q(sul)o(t)o(in)o(g)g(gen)o(era)o(t)o(or,)i(calle)q(d)d(COMBO,)h(h)o (as)f(p)q(er)q(io)q(d)g Fg(>)h Fj(2)1497 2094 y Ff(60)32 2159 y Fj(an)o(d)15 b(s)q(eems)h(t)o(o)g(pass)g(all)f(t)o(e)q(st)o(s.) 26 b(Th)o(e)16 b Fg(x)p Fj('s)f(t)n(h)o(ems)q(elv)o(e)q(s)h(pass)h (almost)d(all)g(t)o(e)q(st)o(s)k(except)f(t)n(h)o(os)q(e)32 2209 y(d)o(ep)q(en)o(d)o(en)o(t)d(on)f(t)n(h)o(e)h(r)q(igh)o(t)o(most)d (bit,)h(whic)o(h)h(will)e(alw)o(ays)i(b)q(e)g(1.)k(Th)o(e)c Fg(y)q Fj('s)h(are)f(an)g(easy)h(w)o(ay)e(t)o(o)32 2258 y(m)o(ak)o(e)i(t)n(h)o(e)i(r)q(igh)o(t)o(most)e(16)h(bit)o(s)h(as)g(go) q(o)q(d)f(as)h(t)n(h)o(e)g(left.)23 b(COMBO)16 b(i)q(s)f(eas)q(ily)h (implem)n(en)o(t)o(e)q(d)d(in)32 2308 y(F)m(ortran)i(or)g(C.)g(In)h(C,) f(t)n(h)o(e)h Fg(y)q Fj('s)g(are)g(t)n(h)o(e)h(r)q(igh)o(t)d(h)o(alf)h (of)g(an)g(in)o(t)o(eger)h Fe(w)f Fj(gen)o(era)o(t)o(e)q(d)i(recurs)q (iv)o(ely)32 2358 y(b)o(y)c Fe(w=30903*\(w&65535\)+\()o(w>>16)o(\);)905 2742 y Fj(3)p eop %%Page: 4 4 4 3 bop -60 -41 a Fd(Ext)o(en)o(d)o(e)q(d)14 b(Con)o(gruen)o(t)o(ial)e (Gen)o(era)o(t)o(ors)32 33 y Fj(Ordin)o(ary)j(con)o(gruen)o(t)o(ial)g (gen)o(era)o(t)o(ors)i(mo)q(d)o(ulo)c(a)j(pr)q(im)o(e)d(h)o(a)o(v)o(e)i (t)o(o)q(o)h(sh)o(ort)g(a)f(p)q(er)q(io)q(d)g(an)o(d)g(are)32 83 y(a)i(n)n(ui)q(sance)g(t)o(o)h(implem)n(en)o(t.)25 b(Th)o(ey)18 b(do)f(b)q(e)o(h)o(a)o(v)o(e)g(v)o(ery)g(w)o(ell)g(on)g (all)f(t)o(e)q(st)o(s.)30 b(As)18 b(lon)o(g)e(as)i(on)o(e)32 133 y(m)n(ust)13 b(go)g(t)o(o)g(dou)n(ble)g(preci)q(s)q(ion)g(t)o(o)h (implem)n(en)o(t)d(ar)q(it)n(hm)o(et)o(ic)h(mo)q(d)o(ulo)f(a)i(pr)q(im) o(e,)f(on)o(e)h(migh)o(t)e(as)32 183 y(w)o(ell)f(get)i(t)n(h)o(e)h(m)n (u)o(c)o(h)d(lon)o(ger)i(p)q(er)q(io)q(d)g(b)o(y)f(goin)o(g)g(t)o(o)h (an)f(ext)o(en)o(d)o(e)q(d)i(con)o(gruen)o(t)o(ial)e(gen)o(era)o(t)o (or.)19 b(F)m(or)32 232 y(t)n(h)o(em,)14 b(t)n(h)o(e)i(recurs)q(ion)g (i)q(s)e(a)h(lin)o(ear)g(com)n(bin)o(a)o(t)o(ion)d(mo)q(d)o(ulo)h(a)i (pr)q(im)o(e)f Fg(p)p Fj(.)21 b(Wit)n(h)15 b(pro)o(p)q(er)g(c)o(h)o (oice)32 282 y(of)g(t)n(h)o(e)i Fg(k)g Fj(co)q(e\016cien)o(t)o(s,)g(t)n (h)o(e)g(p)q(er)q(io)q(d)f(i)q(s)f Fg(p)682 267 y Fc(k)713 282 y Fa(\000)c Fj(1.)25 b(Example)q(s)14 b(f)q(rom)g(t)n(h)o(e)j Fe(makewhat)e Fj(program:)140 332 y Fg(x)164 338 y Fc(n)198 332 y Fj(=)d(1176)p Fg(x)350 338 y Fc(n)p Fb(\000)p Ff(1)423 332 y Fj(+)d(1476)p Fg(x)572 338 y Fc(n)p Fb(\000)p Ff(2)645 332 y Fj(+)h(1776)p Fg(x)795 338 y Fc(n)p Fb(\000)p Ff(3)870 332 y Fj(mo)q(d)g(2)982 317 y Ff(32)1019 332 y Fa(\000)r Fj(5)140 382 y Fg(x)164 388 y Fc(n)198 382 y Fj(=)i(2)263 367 y Ff(13)298 382 y Fj([)p Fg(x)334 388 y Fc(n)p Fb(\000)p Ff(1)407 382 y Fj(+)e Fg(x)473 388 y Fc(n)p Fb(\000)p Ff(2)547 382 y Fj(+)f Fg(x)612 388 y Fc(n)p Fb(\000)p Ff(3)677 382 y Fj(])i(mo)q(d)f(2)812 367 y Ff(32)849 382 y Fa(\000)r Fj(5)140 432 y Fg(x)164 438 y Fc(n)198 432 y Fj(=)i(1995)p Fg(x)350 438 y Fc(n)p Fb(\000)p Ff(1)423 432 y Fj(+)d(1998)p Fg(x)572 438 y Fc(n)p Fb(\000)p Ff(2)645 432 y Fj(+)h(2001)p Fg(x)795 438 y Fc(n)p Fb(\000)p Ff(3)870 432 y Fj(mo)q(d)g(2)982 417 y Ff(35)1019 432 y Fa(\000)r Fj(849)140 481 y Fg(x)164 487 y Fc(n)198 481 y Fj(=)i(2)263 466 y Ff(19)298 481 y Fj([)p Fg(x)334 487 y Fc(n)p Fb(\000)p Ff(1)407 481 y Fj(+)e Fg(x)473 487 y Fc(n)p Fb(\000)p Ff(2)547 481 y Fj(+)f Fg(x)612 487 y Fc(n)p Fb(\000)p Ff(3)677 481 y Fj(])i(mo)q(d)f(2)812 466 y Ff(35)849 481 y Fa(\000)r Fj(1629)32 531 y(All)i(pass)i(t)n(h)o(e)g(t)o(e)q(st)o (s)i(in)c(DIEHARD,)h(bu)o(t)h(t)n(h)o(e)g(s)q(econ)o(d)g(an)o(d)f (fourt)n(h)g(can)h(b)q(e)f(implem)n(en)o(t)o(e)q(d)e(\(as)32 581 y(dou)n(ble)g(preci)q(s)q(ion)h(reals\))h(t)o(o)f(a)o(v)o(oid)f(m)n (ul)o(t)o(ipli)o(ca)o(t)o(ion.)j(Th)o(e)e(s)q(econ)o(d)h(can)f(also)g (b)q(e)g(implem)n(en)o(t)o(e)q(d)32 631 y(in)i(32-bit)f(in)o(t)o(eger)i (ar)q(it)n(hm)o(et)o(ic.)j(A)c(DOS)h(ass)q(em)n(bler)f(v)o(ers)q(ion)g (t)o(ak)o(e)q(s)h(170)f(n)o(anos)q(econ)o(ds)i(on)e(a)32 681 y(P)o(en)o(t)o(iu)o(m)d(120,)h(a)h(C)h(v)o(ers)q(ion,)e(400.)17 b(It)d(i)q(s)e(on)o(e)i(of)e(t)n(h)o(e)i(f)q(ast)o(e)q(st)g(pass-all-t) o(e)q(st)o(s)h(gen)o(era)o(t)o(ors)g(wit)n(h)32 731 y(so)f(lon)o(g)g(a) g(p)q(er)q(io)q(d,)f Fa(\031)g Fj(2)415 715 y Ff(96)450 731 y Fj(.)19 b(I)14 b(h)o(ad)g(mi)q(sgivin)o(gs)d(wh)o(en)k(d)o(ev)o (elo)o(pin)o(g)f(it,)g(rem)o(em)n(b)q(er)q(in)o(g)e(t)n(h)o(e)j(us)q(e) 32 780 y(of)f(m)n(ul)o(t)o(iplier)e(2)289 765 y Ff(16)334 780 y Fa(\000)e Fj(3)k(in)g(RANDU,)g(c)o(h)o(os)q(en)i(t)o(o)f(a)o(v)o (oid)e(m)n(ul)o(t)o(iplica)o(t)o(io)o(n,)f(wit)n(h)i(p)q(o)q(or)h(re)q (sul)o(t)o(s.)32 830 y(Bu)o(t)g(in)o(t)o(egers)f(f)q(rom)e(t)n(h)o(e)j (recurs)q(ion)g Fg(x)637 836 y Fc(n)671 830 y Fj(=)d(2)736 815 y Ff(13)771 830 y Fj([)p Fg(x)807 836 y Fc(n)p Fb(\000)p Ff(1)881 830 y Fj(+)d Fg(x)946 836 y Fc(n)p Fb(\000)p Ff(2)1020 830 y Fj(+)h Fg(x)1086 836 y Fc(n)p Fb(\000)p Ff(3)1151 830 y Fj(])h(mo)q(d)f(2)1286 815 y Ff(32)1323 830 y Fa(\000)r Fj(5)15 b(s)q(eem)e(t)o(o)32 880 y(pass)k(all)e(t)o(e)q (st)o(s|so)j(f)q(ar.)24 b(Y)m(ou)15 b(m)o(ay)g(w)o(an)o(t)g(t)o(o)i(d)o (ev)o(elo)o(p)f(a)g(f)q(ast)g(ass)q(em)n(bler)g(v)o(ers)q(ion)g(y)o (ours)q(elf)32 930 y(an)o(d)d(t)o(e)q(st)i(it.)-60 1038 y Fh(4)66 b(Ho)n(w)21 b(t)m(h)n(e)h(Ran)n(dom)g(Bit)f(File)r(s)g(W)-6 b(ere)22 b(F)-6 b(orm)n(e)r(d)-60 1129 y Fj(Th)o(e)20 b(ran)o(dom)f(bit)g(\014le)q(s)i(are)f Fe(bit.01,)h(bit.02,)f(...)43 b(,)22 b(bit.60)p Fj(,)d(eac)o(h)i(10)f(m)o(ega)o(b)o(yt)o(e)q(s.)35 b(Th)o(ey)20 b(w)o(ere)h(form)o(e)q(d)e(b)o(y)-60 1179 y(com)n(binin)o(g)12 b(t)n(h)o(e)j(32-bit)e(ou)o(t)o(pu)o(t)i(of)f(a)o (t)g(least)h(t)o(w)o(o)e(of)h(t)n(h)o(e)h(a)o(b)q(o)o(v)o(e)e(d)o(et)o (ermini)q(st)o(ic)h(gen)o(era)o(t)o(or)h(wit)n(h)f(32-bit)f(in)o(t)o (egers)i(form)o(e)q(d)-60 1229 y(b)o(y)g(streams)g(of)g(bit)o(s)h(f)q (rom)d(on)o(e)i(or)g(more)f(of)h(t)n(h)o(e)g(ph)o(ys)q(ical)f(d)o (evice)q(s)j(f)q(rom)c(Can)o(ad)o(a,)i(Germ)o(an)o(y)e(or)i(Califor)q (nia.)20 b(Most)c(of)-60 1278 y(t)n(h)o(e)f(\014le)q(s)f(h)o(ad)g(t)n (h)o(e)g(d)o(et)o(ermini)q(st)o(ic)f(comp)q(on)o(en)o(t)g(m)o(ad)o(e)g (f)q(rom)f(t)n(h)o(e)j(su)o(m)e(of)g(t)n(h)o(e)i(Mot)n(h)o(er-of-All)e (an)o(d)h(t)n(h)o(e)g(KISS)h(gen)o(era)o(t)o(ors.)-60 1328 y(Som)o(e)10 b(of)h(t)n(h)o(e)h(\014le)q(s)g(h)o(ad)f(y)o(et)h (anot)n(h)o(er)g(32-bit)e(in)o(t)o(eger)i(com)n(bin)o(e)q(d,)e(f)q(rom) f(a)i(rap)h(m)n(us)q(ic)e(CD,)g(or,)i(a)f(few)g(t)o(im)o(e)q(s,)g(f)q (rom)e(capt)o(ure)-60 1378 y(of)k(t)n(h)o(e)h(screen)h(of)e(a)g(TV)h (program)e(or)h(t)n(h)o(e)h(bit)f(m)o(ap)f(of)h(a)g(n)o(ak)o(e)q(d)h (lady)m(.)i(Th)o(e)e(com)n(bin)o(a)o(t)o(ions)d(w)o(ere)k(b)o(y)e (exclus)q(iv)o(e-or)g(of)g(t)n(h)o(e)-60 1428 y(32-bit)h(w)o(ords.)21 b(Thi)q(s)14 b(m)o(eans)h(bit)o(s)g(in)f(corre)q(sp)q(on)o(din)o(g)j(p) q(os)q(it)o(ions)d(are)h(add)o(e)q(d)h(mo)q(d)o(ulo)d(2,)h(as)h(d)o(e)q (scr)q(ib)q(e)q(d)h(a)o(b)q(o)o(v)o(e)e(wit)n(h)h(t)n(h)o(e)-60 1478 y Fg(x)f Fj(an)o(d)f Fg(y)j Fj(s)q(equence)q(s)g(of)d(bit)o(s.)2 1527 y(Con\014d)o(ence)i(in)e(\014n)o(al)g(ran)o(dom)f(bit)h(\014le)q (s)h(st)o(ems)f(f)q(rom)f(t)n(h)o(e)i(suit)o(a)o(bilit)o(y)d(of)i(t)n (h)o(e)h(d)o(et)o(ermini)q(st)o(ic)f(gen)o(era)o(t)o(ors)i(t)n(h)o(ems) q(elv)o(e)q(s.)-60 1577 y(If)e(t)n(h)o(ey)i(can)f(pro)o(p)q(erly)g(s)q (erv)o(e)h(b)o(y)e(t)n(h)o(ems)q(elv)o(e)q(s)h(as)g(source)q(s)i(of)d (ran)o(domn)o(e)q(ss,)g(t)n(h)o(en)i(p)q(ert)o(urbin)o(g)f(t)n(h)o(em)f (wit)n(h)h(t)n(h)o(e)h(ou)o(t)o(pu)o(t)g(of)-60 1627 y(ph)o(ys)q(ical)e(d)o(evice)q(s,)j(rap)f(m)n(us)q(ic)e(or)i(TV)f (screen)j(capt)o(ure)q(s,)f(can)f(only)e(add)i(t)o(o)g(t)n(h)o(e)q(ir)g (u)o(npre)q(dict)o(a)o(bilit)o(y)m(,)e(not)i(d)o(etract)h(f)q(rom)-60 1677 y(t)n(h)o(e)q(ir)f(suit)o(a)o(bilit)o(y)d(as)h(a)h(source)h(of)f (ran)o(domn)o(e)q(ss.)2 1727 y(Th)o(e)j(re)q(sul)o(t)o(in)o(g)g(in)o(t) o(egers)h(w)o(ere)f(wr)q(it)n(t)o(en)g(t)o(o)g(bin)o(ary)f(\014le)q(s,) h(so)f(t)n(h)o(e)i Fe(bit.??)25 b Fj(\014le)q(s)17 b(can)f(b)q(e)h (view)o(e)q(d)f(as)h(a)f(s)q(equence)j(of)-60 1776 y(bit)o(s,)14 b(or)g(b)o(yt)o(e)q(s)g(or)g(16-)f(or)h(32-bit)f(in)o(t)o(egers,)h(d)o (ep)q(en)o(din)o(g)h(on)f(inpu)o(t)g(require)q(d)h(for)e(an)h(ap)o (plica)o(t)o(ion.)-60 1914 y Fh(5)66 b(Su)o(mm)n(ary)21 b(of)i(File)r(s)e(on)g(Thi)q(s)g(CDR)n(OM)-60 2005 y Fj(In)15 b(t)n(h)o(e)h(bas)q(e)g(direct)o(ory)m(,)g(10)e(m)o(ega)o(b)o (yt)o(e)g(\014le)q(s)i Fe(bit.01,)k(bit.02,)g(...)43 b(,)22 b(bit.60)14 b Fj(as)h(w)o(ell)g(as)g(\014le)q(s)h(of)e(a)o(b)q (ou)o(t)i(10)e(m)o(eg)-60 2054 y(f)q(rom)e(t)n(h)o(e)i(ou)o(t)o(pu)o(t) h(of)f(t)n(hree)h(ph)o(ys)q(ical)e(d)o(evice)q(s:)19 b Fe(canada.bit,)h(germany.bit,)f(california.bit)p Fj(.)2 2104 y(Th)o(ere)f(i)q(s)e(a)g(direct)o(ory)h Fe(pscript)e Fj(con)o(t)o(ainin)o(g)g(t)n(hi)q(s)i(\014le,)f Fe(cdrom.ps)p Fj(,)f(as)h(w)o(ell)g(as)g(\014le)q(s)h(d)o(e)q(scr)q(ibin)o(g)h(ran)o (dom)c(n)n(u)o(m)n(b)q(er)-60 2154 y(gen)o(era)o(t)o(ors)i(\()p Fe(keynote.ps)p Fj(\),)11 b(t)o(e)q(st)o(s)16 b(\()p Fe(monkey.ps)p Fj(\))c(or)i(t)n(h)o(e)h(n)o(ew)f(m)n(ul)o(t)o(iply-wit) n(h-carry)e(RNG's)h(\()p Fe(mwc1.ps)p Fj(\).)2 2204 y(Th)o(ere)22 b(are)f(t)n(hree)h(direct)o(or)q(ie)q(s,)h Fe(dos,)e(linux)g(and)g (unix)p Fj(,)g(con)o(t)o(ainin)o(g)e(\014le)q(s)i(for)f(ru)o(nnin)o(g)h (DIEHARD)f(on)h(t)n(h)o(os)q(e)-60 2254 y(part)o(icular)13 b(syst)o(ems.)905 2742 y(4)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF source/diehard.doc~100755 765 144 25024 6072472314 13055 0ustar geousersVersion: Source C Files, Jan 3, 1996 Instructions for using DIEHARD: a battery of tests of randomness. I hope you will inform me of results, good or bad, of new kinds of generators you have tested, particularly deterministic generators, but also the output of physical devices. (I have found none of the latter that get past DIEHARD, and would like to learn of any that do.) Since, in my opinion, there is no true randomness, collective experience in finding sequences that depart from the theoretical ideal in a significant way can perhaps lead to better ways for finding those that do not. &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 1. How To Use DIEHARD. This set of files contains examples of some tests (15) from the DIEHARD battery of tests I have developed over many years and found effective. It also contains some utility files that are described at the end of this text file. ----------------------------------------------------------| |The source code is in C. It comes from an f2c translation| |of many Fortran files that have suffered countless patches| |over their long development, some going back thirty years.| |So while the melange in C might seems to run and give good| |results, you might find it difficult to try to figure out | |or modify the translated code. | |----------------------------------------------------------| To run DIEHARD, you will need to compile the *.c files on your platform. As indicated in the *.c listings, you must link the resulting object file with the libraries: -lf2c -lm (in that order). You will also need files tests.txt, make.txt and operm5d.ata. To be safe, copy all the files to your working directory.) For this discussion, assume the executable files that come form compiling and linking the *.c files have the same root name. Thus diehard is the exec file from diehard.c and makewhat is the exec file from makewhat.c. The tests in DIEHARD require that you provide a large binary file of random integers to be tested. The makewhat exec file is used to create such binary files, and the exec file asc2bin is used for transforming an ascii file into the kind of file that DIEHARD expects. With the exception of the RUNS test, which is a `standard' test and the only one of the standard tests I have found to be very effective, all tests here are those I have developed. General versions of the tests call for various parameters that specify sample size, bit patterns to be tested, and so on. To avoid complications, I have chosen to fix the parameters of the tests on this disk. For each test, a description is provided, from which interested users may fashion their own versions with variable parameters. 2. Providing Input Files For DIEHARD. The executable file diehard will prompt you to name the file you want to be tested and ask you to select any or all of the 15 tests. You must provide the binary file that DIEHARD expects---a file of 10 to 11 megabytes, that is, a file of at least 80 million bits. DIEHARD will do the best it can with shorter binary files, then give up on the test under way, give an END OF FILE message and go to the next test. 3. Some Examples. Imagine, (as is probably the case), you have just got this disk (or diehard.zip, diehard.tar.gz via ftp and have unzipped it), have compiled all the files in your current directory and are ready to try DIEHARD. If you merely invoked it with the DOS command diehard you would be prompted to give the name of the file you want tested. But of course you have no such file. So you must first create one. You may use the file makewhat.exe to create files of the form that DIEHARD expects. Suppose you try it and when prompted, choose option 4: make a KISS file. That creates a binary file of integers from the generator KISS, which stands for Keep It Simple Stupid, a generator that combines three simple generators of the form x <-- f(x) for 32 bit integers x. (You will find that KISS, among several others, passes all tests.) Then the makewhat exec program will create the binary file kiss.32. After displaying details of the KISS generator, the program will ask you to enter four seed integers, after which it will create a binary file of some 11 megabytes. Having finished creating the file that will test KISS, enter diehard and you will be prompted to enter the name of the file to be tested. You will of course enter the name of your only file so far, say kiss.32 You will then be asked to enter the name of an output file, since DIEHARD displays results both to the screen and to a specified output file. You might, as I do, choose kiss.out for the name of your output file. You will then be asked, with a crude menu, to choose the tests you want run. This is done with a sequence of 15 1's or 0's. For example: 111111111111111 selects all the tests, while 010101010101010 selects only the even numbered menu items. For a fast PC, DIEHARD may take perhaps 10 minutes for the entire battery of tests (but an early 386 I tested it on took 203 minutes). You will see the output on the screen and, when the tests are completed, you may examine results in detail by displaying the file kiss.out. Next, you may want to test some other generators. The makewhat exec program provides for creating binary files for generic Congruential Generators Shift Register Generators Lagged Fibonacci Generators Multiply-with-carry Generators on 32 bits: x(n)=ax(n-1)+carry mod 2^32 There are also choices for specific generators: A version of the mother-of-all RNG's KISS Two multiply-with-carry on 16 bits A simple but good combination generator COMBO The super-duper generator A subtract-with-borrow generator The system generator in Microsoft or Sun Fortran An extended congruential generator The ran2 generator from Numerical Recipes An inverse congruential generator There is also a file that will combine, by addition mod 2^32 or exclusive-or, any two binary files that have already been created. The file is meld, from meld.c, and of course by repeated invocations you can create a mixture of as many binary files as you wish. :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: OK, those are some of the ways you can create and test files with programs on this disk. But what if you want to test your own---or some other---generator? And it is only available through some program or procedure in Fortran, C, Pascal etc.? There are at least two ways: 1) Write a main program in the language of your procedure, in which you open a binary file and send your random integers to it. But if your language can't---or you don't know how to---create a binary file of the form required by DIEHARD, then 2) Write a main program that sends the (hex) output of your random number procedure to an ordinary ascii file. Then invoke the exec file asc2bin that will prompt for the names of your input and output files and do the conversion. Your random number generator should produce 32-bit integers. (If 31 bits, left justify by shift-left-one, as some of the tests in DIEHARD favor leading bits.) You should send them to your ascii file in hex form, 8 hex 'digits' per integer, 10 integers per line, no intervening spaces. The ascii file will be twice as big as the binary file it is reduced to. You can see that DIEHARD requires large test files. But they need only be created one at a time, then deleted. The CDROM I will soon be distributing contains some 60 ten-meg binary files of random numbers for use in serious Monte Carlo calculations as well as for input to DIEHARD. Most of those files combine several of the best deterministic generators with white noise and black noise, (the latter from a CD of rap music). Some of the files contain only random bits from physical devices. They fail many of the tests in DIEHARD. When you absolutely, positively have to have an unassailable source of random bits, you should, in my opinion, use a combination of the output from a physical device(s) with some of the best deterministic random number generators. As you can see from applying DIEHARD, many of the latter may well be suitable by themselves. George Marsaglia geo@stat.fsu.edu Addendum: You will also find a postscript file mwc1.ps that, when processed, describes what I think are the RNG's of the future: multiply-with-carry. You will find they pass all tests, have very long periods and are particularly well suited for computer implementation. I predict a version with base b=2^32 will be the generator of choice in future systems. That file mwc1.ps is extracted from a summary description of RNG's, tests and the theory behind them im a TeX file that I may or may not ever complete. I have also included the postscript file keynote.ps. It is taken from the Keynote Address of a national meeting 11 years ago, and describes some of the ideas behind the tests. Many have reported difficulty in finding Proceedings of the Meeting in their libraries. A third postscript file is cdmake.ps. It describes the coming CDROM. Another potentially useful file is getrnor, from getrnor.c. It will transform a binary file of random bits into a (binary) file of real standard normal random variables using my ziggurat method. Files on this version of DIEHARD: diehard.doc diehard (.c) The diehard exec file diequick (.c) A terse version of diehard makewhat (.c) The exec file for making random number files tests.txt Descriptions of the tests. Read by diehard (exec) make.txt Descriptions of RNG's. Read by makewhat (exec) asc2bin (.c) Converts an ascii integer file to a binary file getrnor (.c) Converts a random bit file to normal random variables merge (.c) Makes a new binary bit file by merging two others operm5d.ata The covariance matrix read by the OPERM5 test mwc1.ps A postscript file describing multiply-with-carry RNG's monkey.ps Describes the difficult-to-pass monkey tests. keynote.ps Descrition of tests and RNG's cdmake.ps Early version of postscript file for the CDROM source/readme.txt100644 765 144 4375 6074521745 12556 0ustar geousersThe *.c files in this directory were created by the program f2c, which translates Fortran code to C code. The primary purpose of this set of files is to provide means to create six executable files: diehard, makewhat, diequick, getrnor, asc2bin, meld, asc2bin from the six C files diehard.c, makewhat.c, diequick.c, getrnor.c, meld.c, asc2bin.c thus getting the full DIEHARD battery of tests. Please note that the Fortran source files for DIEHARD are a mixture of patched and addended Fortran files going back over thirty years. They were gathered to provide the DIEHARD battery of tests and the makewhat exec file for generating various kinds of RNG's. The resulting mix seems to suit my purposes, but if you want to examine particular *.c files for details of testing or generating procedures, you may have difficulty. The f2c translation is meant for machines, not people, and even if relation to the original Fortran file were transparent, you might still have problems because the Fortran file may itself be a mix of earlier working versions, or because of steps necessary to overcome Fortran's quaint insistence on signed integers and the un-mathematical way it decides I < J? for 32-bit integers. Whatever, if you compile these *.c files you should get a working version of DIEHARD. Be sure to link with the f2c and math libraries. A typical command might go (for the gnu c compiler): gcc -o diehard diehard.c -lf2c -lm which would produce the executable file that does the DIEHARD battery of tests. Similar commands would create the other exec files---`makewhat' for creating test files, `asc2bin' for changing an ascii (hex) file of integers to the binary form required by `diehard', `meld' for merging two binary files of random bits, `getrnor' for creating a file of standard normal variables. And `diequick' for a terse version of `diehard'. These exec files need to read from three text or data files tests.txt makef.txt operm5d.ata that must be available to them. There is also a diehard.doc file in this package, as well as three postscript files that give theory and descriptions of tests and random number generators. There is a fourth postcript file, cdmake.ps, that describes the CDROM I will be distributing soon. George Marsaglia geo@stat.fsu.edu source/readme.txt~100644 765 144 2533 6074517466 12753 0ustar geousersThe *.c files in this directory were created by the program f2c, which translates Fortran code to C code. The primary purpose of this set of files is to provide means to create six executable files: diehard, makewhat, diequick, getrnor, asc2bin, meld from the six C files diehard.c, makewhat.c, diequick.c, getrnor.c, meld.c, thus getting the DIEHARD battery of tests. Please note that the Fortran source files for DIEHARD are a mixture of patched and addended Fortran files going back over thirty years. They were gathered to provide the DIEHARD battery of tests and the makewhat exec file for generating various kinds of RNG's. The resulting mix seems to suit my purposes, but if you want to examine particular *.c files for details of testing or generating procedures, you may have difficulty. The f2c translation is meant for machines, not people, and even if relation to the original Fortran file were transparent, you might still have problems because the Fortran file may itself be a mix of earlier working versions, or because of steps necessary to overcome Fortran's quaint insistence on signed integers and the un-mathematical way it decides I < J? Whatever, if you compile these *.c files you should get a working version of DIEHARD. Be sure to link with the f2c and math libraries. A typical command might go gcc -o diehard diehard.c -lf2c -lm source/keynote.ps100644 765 144 413654 6072344766 12652 0ustar geousers%!PS-Adobe-2.0 %%Creator: dvipsk 5.58a Copyright 1986, 1994 Radical Eye Software %%Title: keynote.dvi %%Pages: 11 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentPaperSizes: a4 %%EndComments %DVIPSCommandLine: dvips keynote %DVIPSParameters: dpi=300, compressed, comments removed %DVIPSSource: TeX output 1996.01.02:1910 %%BeginProcSet: texc.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} {adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] }if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict /eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (keynote.dvi) @start /Fa 2 50 df48 D<12035AB4FC1207B3A2EA7FF8 0D187D9713>I E /Fb 5 90 df<132013401380EA01005A1206A25AA25AA212381230A2 1270A3126012E0AD12601270A31230A212381218A27EA27EA27E7EEA0080134013200B31 7A8113>0 D<7E12407E7E12187EA27EA27EA213801201A213C0A3120013E0AD13C01201 A31380A212031300A21206A25AA25A12105A5A5A0B317F8113>I80 D88 DI E /Fc 21 117 df<127812FCA4127806067D 850D>46 D48 D<1360EA01E0120F12FF12F3 1203B3A2387FFF80A2111B7D9A18>III<38380180383FFF005B5B5B13C00030C7FCA4 EA31F8EA361E38380F80EA3007000013C014E0A3127812F8A214C012F038600F8038381F 00EA1FFEEA07F0131B7E9A18>53 D<137EEA03FF38078180380F03C0EA1E07123C387C03 800078C7FCA212F813F8EAFB0E38FA0780EAFC0314C000F813E0A41278A214C0123CEB07 80381E0F00EA07FEEA03F8131B7E9A18>I<1260387FFFE0A214C01480A238E00300EAC0 065B5BC65AA25B13E0A212015B1203A41207A66C5A131C7D9B18>I69 D<39FFFC3FFFA2390FC003F0AA90B5FCA2EBC003AC 39FFFC3FFFA2201C7E9B25>72 D77 D79 D82 D<007FB512E0A238781F810070 13800060146000E0147000C01430A400001400B03807FFFEA21C1C7E9B21>84 D101 D<3803F0F0380E1F38EA3C0F38380730007813 80A400381300EA3C0FEA1E1CEA33F00030C7FCA3EA3FFF14C06C13E014F0387801F838F0 0078A300701370007813F0381E03C03807FF00151B7F9118>103 D<121E123FA4121EC7FCA6127FA2121FAEEAFFC0A20A1E7F9D0E>105 D<38FF0FC0EB31E0381F40F0EB80F8A21300AB38FFE7FFA218127F911B>110 D114 DI<1203A45AA25AA2EA3FFC12FFEA1F00A9130C A4EA0F08EA0798EA03F00E1A7F9913>I E /Fd 15 107 df0 D<126012F0A2126004047C8B0C>I<0040132000C01360006013C03830018038180300EA 0C066C5A6C5AEA01B0EA00E0A2EA01B0EA0318EA060C487E487E38300180386000C04813 600040132013147A9320>I<1203A4EAC30CEAE31CEA7338EA1FE0EA0780A2EA1FE0EA73 38EAE31CEAC30CEA0300A40E127D9215>I<7F487EEA0360EA0630487E487E487E487E38 C00180A238600300EA30066C5A6C5A6C5A6C5A6C5A6C5A11127E9215>5 D<13041306ACB612E0A2D80006C7FCABB612E0A21B1C7E9A20>I8 D15 D20 D<12C012F0123C120FEA03 C0EA00F0133C130FEB03C0EB00F0143C140FEC0380EC0F00143C14F0EB03C0010FC7FC13 3C13F0EA03C0000FC8FC123C127012C0C9FCA7007FB5FCB6128019227D9920>I<13C048 5AA348C9FCA212065A121C1230B712F0A20030C9FC121C120C7E7EA26C7EA36C7E24167D 942A>32 D50 D<133C13E0EA01C013801203 AD13005A121C12F0121C12077E1380AD120113C0EA00E0133C0E297D9E15>102 D<12F0121C12077E1380AD120113C0EA00E0133C13E0EA01C013801203AD13005A121C12 F00E297D9E15>I<12C0B3B3A502297B9E0C>106 D E /Fe 3 50 df0 D<1204120EA2121CA31238A212301270A21260A212C0A207 0F7F8F0A>48 D<000F131E393BC06180396060804038403100D8801A1320130EA3130B39 40118040903820C0C03930C07B80390F001E001B0D7E8C21>I E /Ff 11 117 df<124012E012601220A31240A2128003097D820A>59 D<123C120C5AA45AEA3380EA3C60EA3020EA6030A4EAC060A2EA40C0EA6080EA2300121E 0C147F930F>98 D<1206120712061200A41238124CA2128C12981218A212301232A21264 A2123808147F930C>105 D<1330133813301300A4EA01C0EA0260EA0430136012081200 A213C0A4EA0180A4EA630012E312C612780D1A81930E>I<121E12065AA45A1338135C13 9CEA3118EA36001238EA3F80EA61C0EA60C8A3EAC0D013600E147F9312>I<3830F87C38 590C86384E0D06EA9C0EEA980C1218A248485A15801418A23960301900140E190D7F8C1D >109 DI112 D114 D<1207EA1880EA19C0EA3180EA3800121E7EEA0380124112E1EAC10012 82127C0A0D7E8C10>I<1204120CA35AEAFF80EA1800A25AA45A1261A212621264123809 127F910D>I E /Fg 14 62 df<120212041208121812101230122012601240A212C0AA12 40A212601220123012101218120812041202071E7D950D>40 D<12801240122012301210 12181208120C1204A21206AA1204A2120C1208121812101230122012401280071E7E950D >I<1360AAB512F0A238006000AA14167E9119>43 D<120FEA30C0EA6060A2EA4020EAC0 30A9EA4020EA6060A2EA30C0EA0F000C137E9211>48 D<120C121C12EC120CAFEAFFC00A 137D9211>I<121FEA60C01360EAF07013301260EA0070A2136013C012011380EA02005A EA08101210EA2020EA7FE012FF0C137E9211>II<1360 13E0A2EA016012021206120C120812101220126012C0EAFFFCEA0060A5EA03FC0E137F92 11>III<1240EA7FFC 13F8EA4010EA80301320EA00401380EA0100A25A12021206A2120EA512040E147E9311> II<120FEA3080EA6040EA4060EAC0201330A312 40EA6070EA30B0EA0F30120013201360EAE0401380EA4100123E0C137E9211>I<387FFF E0B512F0C8FCA6B512F06C13E0140A7E8B19>61 D E /Fh 44 123 df<13F8EA030C380E0604EA1C07383803080030138800701390A200E013A0A214C01480 A3EA6007EB0B8838307190380F80E016127E911B>11 DI<13 38137FEB87803801030090C7FC7FA27F12007FA2137013F8EA03B8EA063CEA0C1C121812 381270A212E0A413181338EA6030EA70606C5AEA0F80111E7F9D12>14 D21 D<3801803000031370A3380700E0A4380E01C0A4381C0388A3EA1E07383E1990383BE0E0 0038C7FCA25AA45AA25A151B7F9119>I<3801FFF85A120F381E1E00EA180EEA38061270 A2EAE00EA3130C131C13185BEA60606C5A001FC7FC15127E9118>27 D<126012F0A2126004047C830C>58 D<126012F0A212701210A41220A212401280040C7C 830C>II<13 0113031306A3130CA31318A31330A31360A213C0A3EA0180A3EA0300A31206A25AA35AA3 5AA35AA35AA210297E9E15>I<12E01278121EEA0780EA01E0EA0078131EEB0780EB01E0 EB0078141EEC0780A2EC1E001478EB01E0EB0780011EC7FC1378EA01E0EA0780001EC8FC 127812E019187D9520>I<903801F80890380E0618903838013890386000F04848137048 5A48C71230481420120E5A123C15005AA35AA45CA300701302A200305B00385B6C5B6C13 6038070180D800FEC7FC1D1E7E9C1E>67 D<3A01FFC3FF803A003C00780001381370A449 5BA449485AA390B5FC3901C00380A4484848C7FCA43807000EA448131E39FFE1FFC0211C 7E9B23>72 D<3801FFC038003C001338A45BA45BA4485AA4485AA448C7FCA45AEAFFE012 1C7E9B12>II<3801FFE038003C001338A45BA45B A4485AA438038002A31404EA0700140C14181438000E13F0B5FC171C7E9B1C>76 DI81 D<3801FFFE39003C03C090383800E015F01570A24913F0 A3EC01E001E013C0EC0780EC1E00EBFFF03801C038140C140EA2EA0380A43807001E1508 A2151048130FD8FFE01320C7EA03C01D1D7E9B20>II<001FB512F039 1C03807039300700300020142012601240130E1280A2000014005BA45BA45BA45BA41201 EA7FFF1C1C7F9B18>I<39FFE007F8390F0001E0158015006C13026D5A00035BEBC01814 1000015B6D5A00005B01F1C7FC13F21376137C1338A25BA45BA4485AEA1FFC1D1C7F9B18 >89 D97 D<123F1207A2120EA45AA4EA39E0EA3A30EA3C1812381270131C A3EAE038A313301370136013C01261EA2300121E0E1D7E9C12>III102 DIII<1307 130FA213061300A61378139CEA010C1202131C12041200A21338A41370A413E0A4EA01C0 1261EAF180EAF30012E6127C1024809B11>II<39381F81F0394E20C618394640E81CEB80F0EA8F00008E13 E0120EA2391C01C038A315703938038071A215E115E23970070064D83003133820127E91 24>109 DI<380787803809C8603808D03013E0 EA11C014381201A238038070A31460380700E014C0EB0180EB8300EA0E86137890C7FCA2 5AA4123CB4FC151A819115>112 D114 DI< 13C01201A3EA0380A4EAFFF0EA0700A3120EA45AA4EA3820A21340A2EA1880EA0F000C1A 80990F>I<001C13C0EA27011247A238870380A2120EA2381C0700A438180E20A3EA1C1E 380C26403807C38013127E9118>II<001CEBC080392701C1C0124714 C03987038040A2120EA2391C070080A3EC0100EA1806A2381C0E02EB0F04380E13083803 E1F01A127E911E>I<380787803808C8403810F0C03820F1E0EBE3C03840E1803800E000 A2485AA43863808012F3EB810012E5EA84C6EA787813127E9118>I<001C13C0EA270112 47A238870380A2120EA2381C0700A4EA180EA3EA1C1EEA0C3CEA07DCEA001C1318EA6038 EAF0305B485AEA4180003EC7FC121A7E9114>II E /Fi 20 120 df<497EA3497EA3EB05E0A2EB09F01308A2EB1078A3497EA3497EA2 EBC01F497EA248B51280EB0007A20002EB03C0A348EB01E0A348EB00F0121C003EEB01F8 39FF800FFF20237EA225>65 D<903807E0109038381830EBE0063901C0017039038000F0 48C7FC000E1470121E001C1430123CA2007C14101278A200F81400A812781510127C123C A2001C1420121E000E14407E6C6C13803901C001003800E002EB381CEB07E01C247DA223 >67 D<903807F00890383C0C18EBE0023901C001B839038000F848C71278481438121E15 185AA2007C14081278A200F81400A7EC1FFF0078EB00F81578127C123CA27EA27E7E6C6C 13B86C7E3900E0031890383C0C08903807F00020247DA226>71 D<39FF8007FF3907C000 F81570D805E01320EA04F0A21378137C133C7F131F7FEB0780A2EB03C0EB01E0A2EB00F0 14F81478143C143E141E140FA2EC07A0EC03E0A21401A21400000E1460121FD8FFE01320 20227EA125>78 D82 D86 D97 D<120E12FE121E120EAB131FEB61C0EB8060380F0030000E1338143C141C141E A7141C143C1438000F1370380C8060EB41C038083F0017237FA21B>I<14E0130F130113 00ABEA01F8EA0704EA0C02EA1C01EA38001278127012F0A7127012781238EA1801EA0C02 38070CF03801F0FE17237EA21B>100 DI<133E13E33801C780EA0387130748C7FCA9EAFFF80007C7FCB27FEA7FF01123 80A20F>I<121C121E123E121E121CC7FCA8120E127E121E120EB1EAFFC00A227FA10E> 105 D<390E1FC07F3AFE60E183803A1E807201C03A0F003C00E0A2000E1338AF3AFFE3FF 8FFE27157F942A>109 D<380E1F8038FE60C0381E80E0380F0070A2120EAF38FFE7FF18 157F941B>II114 DI<1202A41206A3120E121E123E EAFFFCEA0E00AB1304A6EA07081203EA01F00E1F7F9E13>I<000E137038FE07F0EA1E00 000E1370AD14F0A238060170380382783800FC7F18157F941B>I<39FF8FF87F393E01E0 3C001CEBC01814E0000E1410EB0260147000071420EB04301438D803841340EB8818141C D801C81380EBD00C140E3900F00F00497EA2EB6006EB400220157F9423>119 D E /Fj 49 123 df<9138FE0FF090390307380C0106137090390E06601C90391C00E00C EDC0001401A21338A24A5A0003B612F03A00380380701370A291380700E0A313E0ED01C0 A2140EA2D801C0EB0388A3021C139015010180EB00E0000315005C13001430EAC73038E6 386038CC30C0D8781FC8FC2625819C25>14 D<13031306130813181330136013C0A2EA01 80EA0300A21206A25AA2121C1218A212381230A21270A21260A412E0A51260A512201230 12107EA2102A7B9E11>40 D<1310A21308130C13041306A51307A51306A4130EA2130CA2 131C1318A213381330A21360A213C0A2EA0180EA0300A212065A5A121012605A102A809E 11>I<12181238127812381208A21210A212201240A21280050C7D830D>44 DI<1230127812F0126005047C830D>I<133EEB4180EB80C0EA01 00000213E0EA0440A21208A3381081C0A238110380000E1300EA00065B5B136013800003 C7FC12044813404813805AEB0100EA7F07EA43FEEA81FCEA8078131D7D9B15>50 D52 D<131FEB60C0EBC060EA018038030030A200061360120714C013803803C10013E6EA01FC EA0078EA01BCEA061E487E487E383003801220EA6001A238C00300A21306EA60045BEA38 30EA0FC0141D7D9B15>56 D<1206120FA212061200AA1230127812F0126008127C910D> 58 D<1418A21438A21478A214B8EB0138A2EB023C141C1304130C13081310A21320A2EB 7FFCEBC01C1380EA0100141E0002130EA25A120C001C131EB4EBFFC01A1D7E9C1F>65 D<48B5FC39003C038090383801C0EC00E0A35B1401A2EC03C001E01380EC0F00141EEBFF FC3801C00E801580A2EA0380A43907000F00140E141E5C000E13F0B512C01B1C7E9B1D> I<903803F02090381E0C6090383002E09038E003C03801C001EA038048C7FC000E148012 1E121C123C15005AA35AA41404A35C12705C6C5B00185B6C485AD80706C7FCEA01F81B1E 7A9C1E>I<48B512F038003C00013813301520A35BA214081500495AA21430EBFFF03801 C020A448485A91C7FCA348C8FCA45AEAFFF01C1C7E9B1B>70 D73 DI<3801FFC038003C001338A45BA45BA4485AA438038002A3 1404EA0700140C14181438000E13F0B5FC171C7E9B1A>76 DII<3801FFFE39003C038090383801C0EC00E0A3EB7001A315C0 EBE0031580EC0700141C3801FFF001C0C7FCA3485AA448C8FCA45AEAFFE01B1C7E9B1C> 80 D<3801FFFE39003C078090383801C015E01400A2EB7001A3EC03C001E01380EC0700 141CEBFFE03801C03080141CA2EA0380A43807003C1520A348144039FFE01E80C7EA0F00 1B1D7E9B1E>82 DI<001FB512C0381C070138300E0000201480126012405B12 80A2000014005BA45BA45BA4485AA41203EA7FFE1A1C799B1E>I<39FF801FC0393C0007 00001C1304A25C5CA25CA25C5CA26C48C7FCA213025BA25BA25B5B120F6C5AA25B90C8FC A21206A21A1D779B1F>86 D97 D<123F1207A2120EA45AA4EA39E0EA3A18EA 3C0C12381270130EA3EAE01CA31318133813301360EA60C0EA3180EA1E000F1D7C9C13> I<13F8EA0304120EEA1C0EEA181CEA30001270A25AA51304EA60081310EA3060EA0F800F 127C9113>II<13F8EA0704120CEA1802 EA38041230EA7008EA7FF0EAE000A5EA60041308EA30101360EA0F800F127C9113>IIIII<13 03130713031300A71378138CEA010C1202131C12041200A21338A41370A413E0A4EA01C0 A2EAC180EAE30012C612781024819B0D>I108 D<391C1E078039266318C0394683A0E03847 03C0008E1380A2120EA2391C0701C0A3EC0380D8380E1388A2EC0708151039701C032039 300C01C01D127C9122>II<13F8EA030CEA0E06487E1218 123000701380A238E00700A3130EA25BEA60185BEA30E0EA0F8011127C9115>I<380387 803804C860EBD03013E0EA09C014381201A238038070A31460380700E014C0EB0180EB83 00EA0E86137890C7FCA25AA45AB4FC151A809115>II II<12035AA3120EA4EAFFE0EA1C00A35AA45AA4 EAE080A2EAE100A2126612380B1A7C990E>I<381C0180EA2E03124EA2388E0700A2121C A2EA380EA438301C80A3EA383C38184D00EA0F8611127C9116>II<38 1E0183382703871247148338870701A2120EA2381C0E02A31404EA180C131C1408EA1C1E 380C26303807C3C018127C911C>I<38038780380CC840380870E012103820E0C0140012 00A2485AA4EA03811263EAE38212C5EA8584EA787813127E9113>I<381C0180EA2E0312 4EA2388E0700A2121CA2EA380EA4EA301CA3EA383CEA1878EA0FB8EA003813301370EAE0 605BEA81800043C7FC123C111A7C9114>II E /Fk 81 125 df11 D<137E3801C180EA0301380703C0120EEB 018090C7FCA5B512C0EA0E01B0387F87F8151D809C17>I<90383F07E03901C09C183803 80F0D80701133C000E13E00100131892C7FCA5B612FC390E00E01CB03A7FC7FCFF80211D 809C23>14 D34 D<126012F012F812681208A31210A2122012401280050C7C9C0C>39 D<1380EA0100120212065AA25AA25AA35AA412E0AC1260A47EA37EA27EA27E12027EEA00 80092A7C9E10>I<7E12407E12307EA27EA27EA37EA41380AC1300A41206A35AA25AA25A 12205A5A092A7E9E10>I<1306ADB612E0A2D80006C7FCAD1B1C7E9720>43 D<126012F0A212701210A41220A212401280040C7C830C>II<12 6012F0A2126004047C830C>I48 D<5A1207123F12C71207B3A5EAFFF80D1C7C9B15>III<130CA2131C133CA2135C13DC139CEA011C12 0312021204120C1208121012301220124012C0B512C038001C00A73801FFC0121C7F9B15 >II<13F0EA030CEA0404 EA0C0EEA181E1230130CEA7000A21260EAE3E0EAE430EAE818EAF00C130EEAE0061307A5 1260A2EA7006EA300E130CEA1818EA0C30EA03E0101D7E9B15>I<1240387FFF801400A2 EA4002485AA25B485AA25B1360134013C0A212015BA21203A41207A66CC7FC111D7E9B15 >III<126012F0A212601200AA126012F0A2126004127C910C>I<126012F0A212601200 AA126012F0A212701210A41220A212401280041A7C910C>I<007FB512C0B612E0C9FCA8 B612E06C14C01B0C7E8F20>61 D63 D<1306A3130FA3EB1780A2EB37C01323A2EB43E01341A2EB80F0A338010078A2EBFFF838 02003CA3487FA2000C131F80001E5BB4EBFFF01C1D7F9C1F>65 DI<90381F8080EBE0613801801938070007000E13035A14015A00781300A212 7000F01400A8007014801278A212386CEB0100A26C13026C5B380180083800E030EB1FC0 191E7E9C1E>IIII<90381F8080EBE0613801801938070007000E13035A14015A007813 00A2127000F01400A6ECFFF0EC0F80007013071278A212387EA27E6C130B380180113800 E06090381F80001C1E7E9C21>I<39FFF0FFF0390F000F00AC90B5FCEB000FAD39FFF0FF F01C1C7F9B1F>II<3807FF8038007C00133CB3 127012F8A21338EA7078EA4070EA30E0EA0F80111D7F9B15>I<39FFF01FE0390F000780 EC060014045C5C5C5C5C49C7FC13021306130FEB17801327EB43C0EB81E013016D7E1478 A280143E141E80158015C039FFF03FF01C1C7F9B20>IIIIIIII<3807E080EA1C19EA30051303EA600112E01300A36C 13007E127CEA7FC0EA3FF8EA1FFEEA07FFC61380130FEB07C0130313011280A300C01380 A238E00300EAD002EACC0CEA83F8121E7E9C17>I<007FB512C038700F01006013000040 1440A200C014201280A300001400B1497E3803FFFC1B1C7F9B1E>I<39FFF01FF0390F00 0380EC0100B3A26C1302138000035BEA01C03800E018EB7060EB0F801C1D7F9B1F>I<39 FFE00FF0391F0003C0EC01806C1400A238078002A213C000035BA2EBE00C00011308A26C 6C5AA213F8EB7820A26D5AA36D5AA2131F6DC7FCA21306A31C1D7F9B1F>I<3AFFE1FFC0 FF3A1F003E003C001E013C13186C6D1310A32607801F1320A33A03C0278040A33A01E043 C080A33A00F081E100A39038F900F3017913F2A2017E137E013E137CA2013C133C011C13 38A20118131801081310281D7F9B2B>I<39FFF07FC0390FC01E003807800CEBC0080003 5B6C6C5A13F000005BEB7880137C013DC7FC133E7F7F80A2EB13C0EB23E01321EB40F049 7E14783801007C00027F141E0006131F001F148039FF807FF01C1C7F9B1F>I<39FFF003 FC390F8001E00007EB00C06D13800003EB01006D5A000113026C6C5A13F8EB7808EB7C18 EB3C10EB3E20131F6D5A14C06D5AABEB7FF81E1C809B1F>I<387FFFF0EA7C01007013E0 386003C0A238400780130F1400131E12005B137C13785BA2485A1203EBC010EA0780A2EA 0F00481330001E13205A14604813E0EAF803B5FC141C7E9B19>I<12FEA212C0B3B312FE A207297C9E0C>II<12FEA21206B3B312FEA20729809E0C>I97 D<12FC121CAA137CEA1D87381E0180381C00C014E014601470A6146014E014C0381E 018038190700EA10FC141D7F9C17>IIII<13F8EA018CEA071E1206EA0E0C1300A6EAFFE0EA0E00B0 EA7FE00F1D809C0D>II<12FC121CAA137C1387EA1D03001E1380121C AD38FF9FF0141D7F9C17>I<1218123CA21218C7FCA712FC121CB0EAFF80091D7F9C0C>I< 13C0EA01E0A2EA00C01300A7EA07E01200B3A21260EAF0C012F1EA6180EA3E000B25839C 0D>I<12FC121CAAEB0FE0EB0780EB06005B13105B5B13E0121DEA1E70EA1C781338133C 131C7F130F148038FF9FE0131D7F9C16>I<12FC121CB3A9EAFF80091D7F9C0C>I<39FC7E 07E0391C838838391D019018001EEBE01C001C13C0AD3AFF8FF8FF8021127F9124>IIII<3803E080EA0E19EA1805EA3807EA7003A2 12E0A61270A2EA38071218EA0E1BEA03E3EA0003A7EB1FF0141A7F9116>III<1204A4120CA2121C123CEAFFE0EA1C00A91310A5120CEA0E20EA03C00C1A7F9910> I<38FC1F80EA1C03AD1307120CEA0E1B3803E3F014127F9117>I<38FF07E0383C038038 1C0100A2EA0E02A2EA0F06EA0704A2EA0388A213C8EA01D0A2EA00E0A3134013127F9116 >I<39FF3FC7E0393C0703C0001CEB01801500130B000E1382A21311000713C4A2132038 03A0E8A2EBC06800011370A2EB8030000013201B127F911E>I<38FF0FE0381E0700EA1C 06EA0E046C5AEA039013B0EA01E012007F12011338EA021C1204EA0C0E487E003C138038 FE1FF014127F9116>I<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA03 88A213C8EA01D0A2EA00E0A31340A25BA212F000F1C7FC12F312661238131A7F9116>I< EA7FFCEA70381260EA407013F013E0EA41C012031380EA0700EA0F04120E121CEA3C0CEA 380812701338EAFFF80E127F9112>I124 D E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: a4 %%BeginPaperSize: a4 a4 %%EndPaperSize %%EndSetup %%Page: 1 1 1 0 bop 0 -41 a Fk(Th)o(e)15 b(follo)o(win)o(g)c(i)q(s)j(bas)q(e)q(d)h (on)f(t)n(h)o(e)h(K)o(eynot)o(e)g(Addre)q(ss,)h(Compu)o(t)o(er)e (Science)i(an)o(d)e(St)o(a)o(t)o(i)q(st)o(ics:)19 b(16t)n(h)14 b(Symp)q(os)q(iu)o(m)0 9 y(on)k(t)n(h)o(e)h(In)o(t)o(erf)q(ace,)g(A)o (t)n(lan)o(t)o(a,)f(1984.)29 b(It)19 b(ap)o(p)q(eare)q(d)f(in)g Fj(The)h(Pr)n(o)n(c)n(e)n(e)n(dings)f Fk(of)f(t)n(h)o(e)i(Conference,)i (pu)n(bli)q(sh)o(e)q(d)c(b)o(y)0 59 y(Els)q(evier)e(Pre)q(ss.)387 167 y Fi(A)h(Curren)o(t)g(View)f(of)i(Ran)o(dom)e(Nu)o(m)m(b)q(er)g (Gen)o(era)o(t)o(ors)741 217 y Fk(George)f(Marsaglia)62 267 y(Th)o(e)g(a)o(bilit)o(y)d(t)o(o)i(gen)o(era)o(t)o(e)h(sa)o(t)o(i)q (sf)q(act)o(ory)e(s)q(equence)q(s)k(of)c(ran)o(dom)f(n)n(u)o(m)n(b)q (ers)i(i)q(s)g(on)o(e)g(of)f(t)n(h)o(e)i(k)o(ey)f(links)f(b)q(et)o(w)o (een)0 317 y(Compu)o(t)o(er)20 b(Science)i(an)o(d)e(St)o(a)o(t)o(i)q (st)o(ics.)36 b(St)o(an)o(d)o(ard)21 b(m)o(et)n(h)o(o)q(ds)f(m)o(ay)e (no)j(lon)o(ger)f(b)q(e)h(suit)o(a)o(ble)e(for)h(increas)q(in)o(gly)0 367 y(so)o(phi)q(st)o(ica)o(t)o(e)q(d)d(us)q(e)q(s,)j(su)o(c)o(h)e(as)f (in)h(preci)q(s)q(ion)f(Mon)o(t)o(e)g(Carlo)g(st)o(udie)q(s,)i(t)o(e)q (st)o(in)o(g)g(for)e(pr)q(im)o(e)q(s,)g(com)n(bin)o(a)o(t)o(or)q(ics)f (or)0 416 y(pu)n(blic)h(encrypt)o(ion)h(sc)o(h)o(em)o(e)q(s.)30 b(Thi)q(s)17 b(art)o(icle)h(d)o(e)q(scr)q(ib)q(e)q(s)h(str)q(in)o(gen)o (t)g(n)o(ew)f(t)o(e)q(st)o(s)h(for)f(whic)o(h)f(st)o(an)o(d)o(ard)i (ran)o(dom)0 466 y(n)n(u)o(m)n(b)q(er)10 b(gen)o(era)o(t)o(ors:)18 b(con)o(gruen)o(t)o(ial,)11 b(shift-regi)q(st)o(er)f(an)o(d)g(lagge)q (d-Fib)q(on)o(acci,)g(giv)o(e)g(p)q(o)q(or)g(re)q(sul)o(t)o(s,)j(an)o (d)d(d)o(e)q(scr)q(ib)q(e)q(s)0 516 y(n)o(ew)k(m)o(et)n(h)o(o)q(ds)g(t) n(h)o(a)o(t)g(pass)h(t)n(h)o(e)f(str)q(in)o(gen)o(t)h(t)o(e)q(st)o(s)h (an)o(d)d(s)q(eem)h(more)f(suit)o(a)o(ble)g(for)g(preci)q(s)q(ion)h (Mon)o(t)o(e)f(Carlo)h(us)q(e.)0 566 y(1.)32 b(INTR)o(ODUCTION)62 616 y(Most)17 b(compu)o(t)o(er)f(syst)o(ems)g(h)o(a)o(v)o(e)g(ran)o (dom)e(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(ors)i(a)o(v)n(aila)o(bl)o (e,)c(an)o(d)h(for)h(most)f(purp)q(os)q(e)q(s)j(t)n(h)o(ey)0 666 y(w)o(or)o(k)h(rem)o(ar)o(ka)o(bly)f(w)o(ell.)33 b(In)o(d)o(ee)q(d,)21 b(a)e(ran)o(dom)e(n)n(u)o(m)n(b)q(er)i(gen)o(era) o(t)o(or)h(i)q(s)f(m)n(u)o(c)o(h)f(lik)o(e)h(s)q(ex:)29 b(wh)o(en)19 b(it)o(s)h(go)q(o)q(d)e(it)o(s)0 715 y(w)o(on)o(d)o (erful,)13 b(an)o(d)h(wh)o(en)g(it)o(s)h(bad)e(it)o(s)i(st)o(ill)e (pret)n(t)o(y)i(go)q(o)q(d.)62 765 y(Bu)o(t)g(m)o(an)o(y)d(of)i(t)n(h)o (e)g(st)o(an)o(d)o(ard)h(ran)o(dom)d(n)n(u)o(m)n(b)q(er)i(gen)o(era)o (t)o(ors)h(\(RNG's\))f(are)g(not)g(go)q(o)q(d)f(enough)h(for)g (increas-)0 815 y(in)o(gly)j(so)o(phi)q(st)o(ica)o(t)o(e)q(d)h(Mon)o(t) o(e)g(Carlo)g(us)q(e)q(s,)i(su)o(c)o(h)f(as)f(in)g(geom)o(etr)q(ic)e (proba)o(bilit)o(y)m(,)h(com)n(bin)o(a)o(t)o(or)q(ics,)g(e)q(st)o(im)o (a)o(t)o(in)o(g)0 865 y(di)q(str)q(ibu)o(t)o(ion)d(fu)o(nct)o(ions,)h (compar)q(in)o(g)e(st)o(a)o(t)o(i)q(st)o(ical)h(pro)q(ce)q(d)o(ure)q (s,)j(gen)o(era)o(t)o(in)o(g)e(an)o(d)g(t)o(e)q(st)o(in)o(g)g(for)g (large)g(pr)q(im)o(e)q(s)e(for)0 915 y(us)q(e)k(in)f(encrypt)o(ion)h (sc)o(h)o(em)o(e)q(s)g(an)o(d)f(t)n(h)o(e)h(lik)o(e.)25 b(A)o(t)17 b(least,)g(t)n(h)o(a)o(t)g(i)q(s)f(m)o(y)f(curren)o(t)i (view,)g(an)o(d)f(I)h(will)e(giv)o(e)h(reasons)0 964 y(for)e(it,)f(b)o(y)g(d)o(e)q(scr)q(ibin)o(g)i(n)o(ew,)f(more)f(str)q (in)o(gen)o(t)h(t)o(e)q(st)o(s)i(t)n(h)o(a)o(t)e(st)o(an)o(d)o(ard)h (RNG's)e(f)q(ail)f(y)o(et)i(n)o(ew)g(kin)o(ds)g(of)f(gen)o(era)o(t)o (ors)0 1014 y(pass.)62 1064 y(Th)o(e)j(more)e(str)q(in)o(gen)o(t)i(t)o (e)q(st)o(s)i(are)d(st)o(ill)g(reason)o(a)o(ble,)g(rela)o(t)o(e)q(d)h (t)o(o)g(t)n(h)o(e)g(kin)o(ds)f(of)f(ap)o(plica)o(t)o(ions)g(of)g (RNG's)h(t)n(h)o(a)o(t)0 1114 y(c)o(h)o(eap)10 b(an)o(d)f(f)q(ast)g (compu)o(t)o(in)o(g)g(p)q(o)o(w)o(er)g(h)o(a)o(v)o(e)g(m)o(ad)o(e)g (feas)q(ible,)g(oft)o(en)g(callin)o(g)f(for)h(sample)q(s)f(of)h(h)n(u)o (n)o(dre)q(ds)j(of)c(t)n(h)o(ousan)o(ds)0 1164 y(or)k(millio)o(ns.)j (Th)o(e)d(kin)o(ds)g(of)f(gen)o(era)o(t)o(ors)j(t)n(h)o(a)o(t)d(pass)i (t)n(h)o(e)g(more)e(str)q(in)o(gen)o(t)h(t)o(e)q(st)o(s)i(are)e(t)n(h)o (os)q(e)h(t)n(h)o(a)o(t)f(com)n(bin)o(e)f(s)q(imple,)0 1213 y(st)o(an)o(d)o(ard)k(gen)o(era)o(t)o(ors)g(in)f(v)n(ar)q(ious)e (w)o(ays.)62 1263 y(Most)17 b(of)e(t)n(h)o(e)h(st)o(an)o(d)o(ard)g(RNG) f('s)g(pro)q(d)o(u)o(ce)h(a)g(s)q(equence)h(of)e(elem)o(en)o(t)o(s)h(b) o(y)f(m)o(eans)g(of)g(a)g(lin)o(ear)h(transform)o(a-)0 1313 y(t)o(ion)e(on)h(som)o(e)e(alge)o(braic)i(stru)o(ct)o(ure.)22 b(Three)16 b(m)o(et)n(h)o(o)q(ds)f(domin)o(a)o(t)o(e:)j(con)o(gruen)o (t)o(ial,)c(shift-regi)q(st)o(er)h(an)o(d)g(lagge)q(d-)0 1363 y(Fib)q(on)o(acci.)j(Th)o(e)q(s)q(e)13 b(will)f(b)q(e)h(calle)q(d) g Fj(simple)f Fk(RNG's;)g(d)o(et)o(ails)h(an)o(d)f(pro)o(p)q(ert)o(ie)q (s)i(will)e(b)q(e)h(su)o(mm)o(ar)q(ize)q(d)e(in)h(s)q(ect)o(ions)0 1413 y(b)q(elo)o(w.)21 b(Most)16 b(example)q(s)e(of)g(s)q(imple)f(gen)o (era)o(t)o(ors)k(pass)f(st)o(an)o(d)o(ard)f(t)o(e)q(st)o(s)i(for)e(ran) o(domn)o(e)q(ss,)g(su)o(c)o(h)h(as)f(t)n(h)o(os)q(e)h(en)n(u-)0 1463 y(m)o(era)o(t)o(e)q(d)g(in)f(Kn)n(u)o(t)n(h's)j(V)m(olu)o(m)o(e)c (2)i([6],)f(bu)o(t)h(m)o(ay)f(f)q(ail)f(sp)q(ect)o(acularly)i(on)g(on)o (e)g(or)g(more)f(of)h(t)n(h)o(e)h(n)o(ew,)f(str)q(in)o(gen)o(t)0 1512 y(t)o(e)q(st)o(s)j(d)o(e)q(scr)q(ib)q(e)q(d)f(b)q(elo)o(w.)26 b(M)o(et)n(h)o(o)q(ds)18 b(t)n(h)o(a)o(t)f(com)n(bin)o(e)e(t)o(w)o(o)i (of)f(t)n(h)o(e)h(s)q(imple)e(gen)o(era)o(t)o(ors)j(do)f(m)n(u)o(c)o(h) f(b)q(et)n(t)o(er)i(on)e(t)n(h)o(e)0 1562 y(str)q(in)o(gen)o(t)f(t)o(e) q(st)o(s.)62 1612 y(Aft)o(er)d(su)o(mm)o(ary)c(d)o(e)q(scr)q(ipt)o (ions)k(of)e(t)n(h)o(e)h(t)n(hree)h(most)f(common)c(s)q(imple)i(RNG's)g (:)17 b(con)o(gruen)o(t)o(ial,)10 b(shift-regi)q(st)o(er)0 1662 y(an)o(d)j(lagge)q(d-Fib)q(on)o(acci)f(\(wit)n(h)i(more)e(d)o(et)o (ail)h(on)g(t)n(h)o(e)h(la)o(t)n(t)o(er)g(t)o(w)o(o,)e(as,)h(in)g(spit) o(e)g(of)g(b)q(e)q(in)o(g)g(cons)q(id)o(ere)q(d)i(b)o(y)e(v)n(ar)q (ious)0 1712 y(re)q(s)q(earc)o(h)o(ers)18 b(for)d(t)n(h)o(e)g(past)h (25)e(y)o(ears,)i(t)n(h)o(ey)f(are)g(not)g(as)g(wid)o(ely)g(kno)o(wn)f (as)h(con)o(gruen)o(t)o(ial)g(RNG's\),)e(I)i(will)f(giv)o(e)0 1761 y(som)o(e)d(t)n(h)o(eoret)o(ical)h(just)o(i\014ca)o(t)o(ion)g(for) f(com)n(binin)o(g)f(s)q(imple)g(gen)o(era)o(t)o(ors,)k(t)n(h)o(en)f(d)o (e)q(scr)q(ib)q(e)g(n)o(ew,)f(str)q(in)o(gen)o(t)h(t)o(e)q(st)o(s)h(t)n (h)o(a)o(t)0 1811 y(s)q(imple)d(gen)o(era)o(t)o(ors)16 b(f)q(ail)c(bu)o(t)j(com)n(bin)o(a)o(t)o(ion)c(gen)o(era)o(t)o(ors)k (pass.)0 1885 y(2.)36 b(SIMPLE)15 b(GENERA)m(TORS:)g(CONGR)o(UENTIAL)g (Th)o(e)q(s)q(e)h(gen)o(era)o(t)o(ors)h(us)q(e)f(a)f(lin)o(ear)g (transform)o(a)o(t)o(ion)e(on)0 1934 y(t)n(h)o(e)i(r)q(in)o(g)e(of)g (re)q(d)o(u)o(ce)q(d)j(re)q(s)q(id)o(ue)q(s)f(of)e(som)o(e)g(mo)q(d)o (ulus)g(m,)f(t)o(o)i(pro)q(d)o(u)o(ce)h(a)e(s)q(equence)j(of)d(in)o(t)o (egers:)515 2023 y Fh(x)539 2029 y Fg(1)558 2023 y Fh(;)7 b(x)601 2029 y Fg(2)619 2023 y Fh(;)g(x)662 2029 y Fg(3)679 2023 y Fh(;)g(:)g(:)g(:)12 b Fk(wit)n(h)i Fh(x)877 2029 y Ff(n)911 2023 y Fk(=)e Fh(ax)1001 2029 y Ff(n)p Fe(\000)p Fg(1)1075 2023 y Fk(+)d Fh(b)i Fk(mo)q(d)g Fh(m:)0 2111 y Fk(Th)o(ey)k(are)h(t)n(h)o(e)f(most)g(wid)o(ely)f(us)q(e)q(d)i (RNG's,)e(an)o(d)h(t)n(h)o(ey)g(w)o(or)o(k)h(rem)o(ar)o(ka)o(bly)d(w)o (ell)h(for)h(most)f(purp)q(os)q(e)q(s.)23 b(Bu)o(t)16 b(for)0 2160 y(som)o(e)e(purp)q(os)q(e)q(s)j(t)n(h)o(ey)e(are)g(not)g (sa)o(t)o(i)q(sf)q(act)o(ory;)f(p)q(oin)o(t)o(s)h(in)g(n-space)g(pro)q (d)o(u)o(ce)q(d)h(b)o(y)f(con)o(gruen)o(t)o(ial)f(RNG's)g(f)q(all)f(on) 0 2210 y(a)i(la)o(t)n(t)o(ice)h(wit)n(h)g(a)f(h)n(uge)h(u)o(nit)g(cell) g(v)o(olu)o(m)o(e,)e Fh(m)747 2195 y Ff(n)p Fe(\000)p Fg(1)812 2210 y Fk(,)i(compare)q(d)f(t)o(o)h(t)n(h)o(e)g(u)o(nit)g (cell)g(v)o(olu)o(m)o(e)e(of)h(1)g(t)n(h)o(a)o(t)h(w)o(ould)f(b)q(e)0 2260 y(exp)q(ect)o(e)q(d)k(f)q(rom)c(truly)i(ran)o(dom)e(in)o(t)o (egers.)29 b(Det)o(ails)16 b(are)i(in)e([9,10].)26 b(Con)o(gruen)o(t)o (ial)17 b(RNG's)f(p)q(erform)g(w)o(ell)g(on)0 2310 y(m)o(an)o(y)c(of)h (t)n(h)o(e)i(str)q(in)o(gen)o(t)f(t)o(e)q(st)o(s)i(d)o(e)q(scr)q(ib)q (e)q(d)g(b)q(elo)o(w,)c(bu)o(t)j(not)e(on)h(all)f(of)g(t)n(h)o(em.)0 2383 y(3.)32 b(SIMPLE)14 b(GENERA)m(TORS:)f(SHIFT-REGISTER)62 2433 y(Th)o(e)q(s)q(e)20 b(are)f(bas)q(e)q(d)h(on)f(viewin)o(g)f(t)n(h) o(e)i(bit)o(s)f(of)f(a)h(compu)o(t)o(er)g(w)o(ord)g(as)f(t)n(h)o(e)i (elem)o(en)o(t)o(s)f(of)f(a)h(bin)o(ary)f(v)o(ect)o(or,)0 2483 y(t)n(h)o(en)g(us)q(in)o(g)f(it)o(era)o(t)o(e)q(s)h(of)e(a)h(lin)o (ear)g(transform)o(a)o(t)o(ion)e(t)o(o)i(gen)o(era)o(t)o(e)h(a)f(s)q (equence)i(of)d(bin)o(ary)h(v)o(ect)o(ors,)i(an)o(d)e(h)o(ence)0 2533 y(compu)o(t)o(er)h(w)o(ords,)g(t)n(h)o(a)o(t)f(m)o(ay)f(b)q(e)h (in)o(t)o(erpret)o(e)q(d)i(as)f(a)f(s)q(equence)i(of)e(u)o(niform)f (ran)o(dom)g(in)o(t)o(egers.)29 b(In)17 b(t)o(erms)h(of)0 2583 y(v)o(ect)o(ors)d(an)o(d)d(m)o(a)o(tr)q(ice)q(s,)g(t)n(h)o(e)i(s)q (equence)h(e)e(i)q(s)f Fh(\014)r(;)7 b(\014)r(T)s(;)g(\014)r(T)877 2567 y Fg(2)898 2583 y Fh(;)g(\014)r(T)972 2567 y Fg(3)990 2583 y Fh(;)g(:)g(:)g(:)k Fk(wit)n(h)i Fh(\014)j Fk(a)c(1)c Fd(\002)f Fh(n)13 b Fk(bin)o(ary)g(v)o(ect)o(or,)g(T)g(an)g Fh(n)7 b Fd(\002)h Fh(n)0 2632 y Fk(bin)o(ary)13 b(m)o(a)o(tr)q(ix)f (of)h(0's)g(an)o(d)g(1's,)g(all)g(ar)q(it)n(hm)o(et)o(ic)f(mo)q(d)o (ulo)f(2)i(an)o(d)h(addit)o(ion)e(of)h(bin)o(ary)g(v)o(ect)o(ors)j(t)n (h)o(e)e(exclus)q(iv)o(e-or)890 2757 y(1)p eop %%Page: 2 2 2 1 bop 0 -41 a Fk(o)o(p)q(era)o(t)o(ion)17 b(\(d)o(e)q(s)q(ign)o(a)o (t)o(e)q(d)i Fd(\010)p Fk(\))f(of)g(t)n(h)o(e)h(t)o(w)o(o)e(corre)q(sp) q(on)o(din)o(g)j(compu)o(t)o(er)e(w)o(ords.)31 b(Shift-regi)q(st)o(er) 18 b(gen)o(era)o(t)o(ors)i(are)0 9 y(som)o(et)o(im)o(e)q(s)11 b(calle)q(d)j(T)m(a)n(usw)o(ort)n(h)o(e)g(gen)o(era)o(t)o(ors.)19 b(Th)o(e)14 b(bin)o(ary)f(m)o(a)o(tr)q(ix)e(T)j(i)q(s)f(usually)f(c)o (h)o(os)q(en)j(so)f(t)n(h)o(a)o(t)f(t)n(h)o(e)h(pro)q(d)o(u)o(ct)0 59 y Fh(\014)r(T)k Fk(m)o(ay)10 b(b)q(e)i(pro)q(d)o(u)o(ce)q(d)h(wit)n (h)f(s)q(imple)d(compu)o(t)o(er)j(o)o(p)q(era)o(t)o(ions.)k(A)c(go)q(o) q(d)g(c)o(h)o(oice)g(i)q(s)f Fh(T)17 b Fk(=)12 b(\()p Fh(I)d Fk(+)c Fh(R)1499 43 y Ff(s)1516 59 y Fk(\)\()p Fh(I)k Fk(+)c Fh(L)1640 43 y Ff(t)1655 59 y Fk(\),)12 b(wh)o(ere)0 108 y Fh(R)i Fk(i)q(s)g(t)n(h)o(e)g(m)o(a)o(tr)q(ix)e(t)n (h)o(a)o(t)j(transforms)e(ev)o(ery)i(v)o(ect)o(or)h Fh(\014)e Fk(=)f(\()p Fh(b)936 114 y Fg(1)954 108 y Fh(;)7 b(b)991 114 y Fg(2)1009 108 y Fh(;)g(:)g(:)g(:)e(;)i(b)1120 114 y Ff(n)p Fe(\000)p Fg(1)1184 108 y Fh(;)g(b)1221 114 y Ff(n)1243 108 y Fk(\))14 b(in)o(t)o(o)g Fh(\014)r Fk(\()p Fh(b)1416 114 y Fg(2)1435 108 y Fh(;)7 b(b)1472 114 y Fg(3)1490 108 y Fh(;)g(:)g(:)g(:)e(;)i(b)1601 114 y Ff(n)1623 108 y Fh(;)g Fk(0\).)18 b(Th)n(us)0 158 y Fh(R)c Fk(i)q(s)f(all)g(0's)h (except)h(for)f(1's)f(on)h(t)n(h)o(e)h(pr)q(incipal)e(sup)q(er-diagon)o (al;)f(L)i(i)q(s)g(all)e(0's)i(except)h(for)f(1's)g(on)f(t)n(h)o(e)i (pr)q(incipal)0 208 y(su)n(b)q(diagon)o(al.)62 258 y(Th)o(en)g Fh(\014)r(T)20 b Fk(=)13 b Fh(\014)r Fk(\()p Fh(I)h Fk(+)c Fh(R)431 243 y Ff(s)448 258 y Fk(\)\()p Fh(I)k Fk(+)c Fh(L)582 243 y Ff(t)597 258 y Fk(\))15 b(m)o(ay)e(b)q(e)h(eas)q(ily)g (pro)q(d)o(u)o(ce)q(d)i(b)o(y)f(formin)o(g)d Fh(\014)k Fd( )c Fh(\014)g Fd(\010)e Fh(\014)r(R)1511 243 y Ff(s)1530 258 y Fk(,)k(wit)n(h)h(a)f(logical)0 308 y(r)q(igh)o(t-shift-s)19 b(an)o(d)g(a)h Fd(\010)p Fk(,)g(follo)o(w)o(e)q(d)e(b)o(y)i Fh(\014)j Fd( )e Fh(\014)16 b Fd(\010)d Fh(\014)r(L)898 293 y Ff(t)933 308 y Fk(wit)n(h)20 b(a)f(logical)f(left-shift-t)h(an)o (d)h(anot)n(h)o(er)g Fd(\010)p Fk(.)36 b(Th)o(e)0 357 y(m)o(axim)m(u)o(m)10 b(p)q(oss)q(ible)j(p)q(er)q(io)q(d)g(of)f(a)h (shift-regi)q(st)o(er)g(gen)o(era)o(t)o(or)i(i)q(s)d(2)1040 342 y Ff(n)1070 357 y Fd(\000)c Fk(1,)k(t)n(h)o(e)i(n)n(u)o(m)n(b)q(er) f(of)f(non-n)n(ull)g(1)c Fd(\002)g Fh(n)k Fk(bin)o(ary)0 407 y(v)o(ect)o(ors.)24 b(F)m(or)15 b(su)o(c)o(h)h(a)f(gen)o(era)o(t)o (or,)h(an)o(y)f(non-n)n(ull)f(init)o(ial)f(\(s)q(ee)q(d\))k(v)o(ect)o (or)g(m)o(ay)c(b)q(e)j(us)q(e)q(d,)g(a)f(d)o(e)q(s)q(ira)o(ble)g(pro)o (p)q(ert)o(y)0 457 y(for)i(gen)o(era)o(t)o(ors)j(t)n(h)o(a)o(t)e(allo)o (w)e(s)q(et)n(t)o(in)o(g)j(t)n(h)o(e)f(s)q(ee)q(d)h(v)n(alue,)f(whic)o (h)f(t)o(o)h(t)n(h)o(e)h(us)q(er)g(b)q(ecom)o(e)q(s)e(an)o(y)h (non-zero)g(in)o(t)o(eger.)0 507 y(Ma)o(tr)q(ix)11 b(t)n(h)o(eory)i (pro)o(vid)o(e)q(s)g(an)f(easy)h(m)o(eans)f(t)o(o)g(c)o(h)o(aract)o(er) q(ize)i(shift-regi)q(st)o(er)e(s)q(equence)q(s)j(of)d(m)o(axim)n(al)c (p)q(er)q(io)q(d;)k(for)0 557 y(an)i(easy)g(pro)q(of,)f(s)q(ee)i([11].) 0 606 y Fc(THEOREM)d(1.)p Fj(L)n(et)f(T)g(b)n(e)g(a)g(nonsingular)g Fh(n)q Fd(\002)q Fh(n)g Fj(binary)g(matrix.)17 b(In)11 b(or)n(der)f(that)h(the)g(se)n(quenc)n(e)h Fh(\014)r(;)7 b(\014)r(T)s(;)g(\014)r(T)1713 591 y Fg(2)1733 606 y Fh(;)g(:)g(:)g(:)0 656 y Fj(have)18 b(p)n(erio)n(d)g Fk(2)246 641 y Ff(n)279 656 y Fd(\000)12 b Fk(1)17 b Fj(for)g(every)h(non-nul)r(l)g(binary)g(se)n(e)n(d)f(ve)n(ctor)h Fh(\014)r Fj(,)g(it)f(is)h(ne)n(c)n(essary)f(and)i(su\016cient)e(that)h (the)0 706 y(matrix)c(T)h(have)g(or)n(der)g Fk(2)404 691 y Ff(n)435 706 y Fd(\000)10 b Fk(1)k Fj(in)h(the)g(gr)n(oup)g(of)g (nonsingular)g Fh(n)10 b Fd(\002)f Fh(n)15 b Fj(binary)g(matric)n(es.)0 780 y Fk(4.)j(SIMPLE)c(GENERA)m(TORS:)f(LA)o(GGED-FIBONA)o(CCI)62 829 y(Th)o(e)q(s)q(e)j(gen)o(era)o(t)o(ors)g(us)q(e)f(an)f(init)o(ial)e (s)q(et)j(of)f(elem)o(en)o(t)o(s)g Fh(x)939 835 y Fg(1)958 829 y Fh(;)7 b(x)1001 835 y Fg(2)1018 829 y Fh(;)g(:)g(:)g(:)e(;)i(x) 1135 835 y Ff(r)1167 829 y Fk(an)o(d)14 b(t)o(w)o(o)g(\\lags")f Fh(r)i Fk(an)o(d)f Fh(s)h Fk(wit)n(h)f Fh(r)f(>)g(s)p Fk(.)0 879 y(Su)o(cce)q(ss)q(iv)o(e)18 b(elem)o(en)o(t)o(s)d(are)h(gen) o(era)o(t)o(e)q(d)h(b)o(y)e(t)n(h)o(e)i(recurs)q(ion,)f(for)f Fh(n)f(>)h(r)q Fk(:)21 b Fh(x)1181 885 y Ff(n)1218 879 y Fk(=)15 b Fh(x)1289 885 y Ff(n)p Fe(\000)p Ff(r)1363 879 y Fd(\005)c Fh(x)1419 885 y Ff(n)p Fe(\000)p Ff(s)1482 879 y Fk(,)16 b(wh)o(ere)h Fd(\005)e Fk(i)q(s)g(som)o(e)0 929 y(bin)o(ary)d(o)o(p)q(era)o(t)o(ion.)17 b(Th)o(e)c(init)o(ial)e (\(s)q(ee)q(d\))j(elem)o(en)o(t)o(s)f(are)g(compu)o(t)o(er)g(w)o(ords)g (an)o(d)g(t)n(h)o(e)g(bin)o(ary)f(o)o(p)q(era)o(t)o(ion)g(migh)o(t)f(b) q(e)0 979 y(+,)p Fd(\000)p Fk(,)p Fd(\003)f Fk(or)h Fd(\010)f Fk(\(exclus)q(iv)o(e-or\).)18 b(F)m(or)10 b(+)h(or)f Fd(\000)p Fk(,)h(t)n(h)o(e)h Fh(x)p Fk('s)e(migh)o(t)e(b)q(e)j(in)o(t)o (egers)h(mo)q(d)d(2)1256 964 y Ff(k)1286 979 y Fk(or)i(s)q(in)o(gle-)f (or)h(dou)n(ble-preci)q(s)q(ion)0 1029 y(reals)i(mo)q(d)d(1.)18 b(F)m(or)11 b Fd(\003)p Fk(,)h(o)q(dd)g(in)o(t)o(egers)h(mo)q(d)d(2)698 1014 y Ff(k)718 1029 y Fk(.)18 b(W)m(e)11 b(d)o(e)q(s)q(ign)o(a)o(t)o (e)i(su)o(c)o(h)g(a)e(gen)o(era)o(t)o(or)j(lo)q(os)q(ely)d(as)h (F\(r,s,)p Fd(\005)p Fk(\),)g(al)o(t)n(h)o(ough)0 1078 y(eac)o(h)j(lagge)q(d-Fib)q(on)o(acci)e(gen)o(era)o(t)o(or)j(d)o(ep)q (en)o(ds)f(on)f(d)o(et)o(ails)g(of)f(t)n(h)o(e)i(part)o(icular)f(bin)o (ary)f(o)o(p)q(era)o(t)o(ion)g(an)o(d)h(t)n(h)o(e)h(\014nit)o(e)0 1128 y(s)q(et)g(of)e(elem)o(en)o(t)o(s)h(it)f(o)o(p)q(era)o(t)o(e)q(s)i (on.)62 1178 y(Example)q(s)c(of)h(gen)o(era)o(t)o(ors)i(of)e(m)o(axim)n (al)d(p)q(er)q(io)q(d)j(are)h(F\(l7,5,+\))e(or)h(F\(17,5,)p Fd(\000)p Fk(\))g(on)g(in)o(t)o(egers)h(mo)q(d)e(2)1640 1163 y Ff(k)1660 1178 y Fk(,)h(p)q(er)q(io)q(d)0 1228 y(\(2)37 1213 y Fg(17)73 1228 y Fd(\000)q Fk(1\)2)164 1213 y Ff(k)q Fe(\000)p Fg(1)227 1228 y Fk(;)e(F\(17,5,)p Fd(\000)p Fk(\))f(on)h(32-bit)e(reals)j(wit)n(h)f(24)f(bit)g(f)q(ract)o (ions,)h(su)n(btract)o(ion)g(mo)q(d)o(ulo)e(1,)i(p)q(er)q(io)q(d)f(\(2) 1638 1213 y Fg(17)1674 1228 y Fd(\000)q Fk(1\)2)1765 1213 y Fg(23)0 1278 y Fk(or)15 b(dou)n(ble)g(preci)q(s)q(ion)f(reals)i (mo)q(d)o(ulo)d(1,)i(p)q(er)q(io)q(d)f(\(2)823 1263 y Fg(17)868 1278 y Fd(\000)d Fk(1\)2)969 1263 y Fg(55)1004 1278 y Fk(;)k(F\(17,5,)p Fd(\003)p Fk(\))e(on)i(o)q(dd)g(in)o(t)o (egers)h(mo)q(d)e(2)1623 1263 y Fg(32)1657 1278 y Fk(,)h(p)q(er)q(io)q (d)0 1327 y(\(2)37 1312 y Fg(17)82 1327 y Fd(\000)c Fk(1\)2)183 1312 y Fg(29)218 1327 y Fk(;)16 b(F\(17,5,)p Fd(\010)p Fk(\),)e(p)q(er)q(io)q(d)h(2)602 1312 y Fg(17)648 1327 y Fd(\000)10 b Fk(1)k(=)h(131071.)22 b(Ot)n(h)o(er)17 b(go)q(o)q(d)e(c)o(h)o(oice)q(s)h(for)f(\(r,s\))h(are)g (\(31,13\),\(55,24\),)0 1377 y(\(68,33\),\(97,33\),\(60)o(7,2)o (73\),\(12)o(79,)o(418\))11 b(plus)i(m)o(an)o(y)f(ot)n(h)o(ers,)j(som)o (e)e(of)g(whic)o(h)g(are)i(li)q(st)o(e)q(d)e(in)h(Kn)n(u)o(t)n(h)h([6,) e(p28].)62 1427 y(A)j(lagge)q(d-Fib)q(on)o(acci)e(gen)o(era)o(t)o(or)j (i)q(s)e(eas)q(ily)g(programm)o(e)q(d,)e(us)q(in)o(g)i(a)g(circular)h (li)q(st)e(an)o(d)h(t)o(w)o(o)g(p)q(oin)o(t)o(ers.)23 b(F)m(or)0 1477 y(example,)17 b(a)h(pro)q(ce)q(d)o(ure)i(for)e(an)g (F\(17,5,)p Fd(\005)p Fk(\))e(gen)o(era)o(t)o(or)k(us)q(e)q(s)f(17)e(m) o(emory)f(lo)q(ca)o(t)o(ions)h Fh(L)p Fk(\(\),)j(init)o(ially)15 b(\014lle)q(d)j(as)0 1527 y Fh(L)p Fk(\(1\))12 b(=)g Fh(x)161 1533 y Fg(17)196 1527 y Fh(;)7 b(L)p Fk(\(2\))k(=)h Fh(x)375 1533 y Fg(16)410 1527 y Fh(;)7 b(:)g(:)g(:)t(;)g(L)p Fk(\(17\))k(=)h Fh(x)683 1533 y Fg(1)715 1527 y Fk(an)o(d)h(p)q(oin)o (t)o(ers)h Fh(I)h Fk(=)d(17,)g Fh(J)j Fk(=)d(5.)18 b(Th)o(en)c(eac)o(h) g(call)e(t)o(o)i(t)n(h)o(e)g(pro)q(ce)q(d)o(ure)0 1577 y(execu)o(t)o(e)q(s)i(t)n(h)o(e)q(s)q(e)g(instru)o(ct)o(ions:)104 1654 y Fh(L)p Fk(\()p Fh(I)s Fk(\))c Fd( )f Fh(L)p Fk(\()p Fh(I)s Fk(\))g Fd(\005)e Fh(L)p Fk(\()p Fh(J)t Fk(\))104 1704 y(ou)o(t)o(pu)o(t)15 b Fh(L)p Fk(\()p Fh(I)s Fk(\))104 1753 y Fh(I)g Fd( )c Fh(I)i Fd(\000)c Fk(1;)k(If)h Fh(I)h Fk(=)d(0)h(,)h Fh(I)h Fd( )c Fk(17)104 1803 y Fh(J)k Fd( )c Fh(J)j Fd(\000)9 b Fk(1;)k(If)h Fh(J)h Fk(=)d(0,)h Fh(J)j Fd( )11 b Fk(17)0 1880 y(\(Decrem)o(en)o(t)o(in)o(g)j(t)n(h)o(e) g(p)q(oin)o(t)o(ers)h(an)o(d)e(t)o(e)q(st)o(in)o(g)i(on)f(0)f(i)q(s)h (usually)f(f)q(ast)o(er)h(t)n(h)o(an)g(increm)o(en)o(t)o(in)o(g)f(an)o (d)g(t)o(e)q(st)o(in)o(g)i(on)f(17.\))62 1930 y(Ch)o(aract)o(er)q(iza)o (t)o(ion)19 b(of)g(m)o(axim)o(al)d(p)q(er)q(io)q(d)j(F\(r,s,-\))g(gen)o (era)o(t)o(ors)j(m)o(ay)17 b(b)q(e)j(bas)q(e)q(d)g(on)g(t)n(h)o(e)g(t)n (h)o(eory)g(of)f(lin)o(ear)0 1980 y(recurs)q(iv)o(e)c(s)q(equence)q(s)h (of)e(in)o(t)o(egers:)478 2057 y Fh(x)502 2063 y Ff(n)536 2057 y Fk(=)d Fh(a)601 2063 y Fg(1)620 2057 y Fh(x)644 2063 y Ff(n)p Fe(\000)p Fg(1)718 2057 y Fk(+)e Fh(a)781 2063 y Fg(2)800 2057 y Fh(x)824 2063 y Ff(n)p Fe(\000)p Fg(2)898 2057 y Fk(+)h Fd(\001)d(\001)g(\001)g Fk(+)j Fh(a)1061 2063 y Ff(k)1081 2057 y Fh(x)1105 2063 y Ff(n)p Fe(\000)p Ff(k)1183 2057 y Fk(mo)q(d)g Fh(m:)0 2134 y Fk(Th)o(ere)k(i)q(s)f(ext)o(ens)q(iv)o(e)h(lit)o(era)o(t)o(ure)f(on)g (t)n(hi)q(s)h(problem,)d(m)n(u)o(c)o(h)h(more)g(ext)o(ens)q(iv)o(e)i(t) n(h)o(an)g(n)o(ece)q(ssary)h(for)e(our)g(purp)q(os)q(e)q(s,)0 2184 y(for)20 b(it)h(i)q(s)f(p)q(oss)q(ible)h(t)o(o)g(d)o(ev)o(elo)o(p) g(a)g(br)q(ief)f(s)q(elf-con)o(t)o(ain)o(e)q(d)g(trea)o(t)o(m)o(en)o(t) h(for)f(c)o(h)o(aract)o(er)q(izin)o(g)i(lagge)q(d-Fib)q(on)o(acci)0 2234 y(gen)o(era)o(t)o(ors)d(of)f(m)o(axim)n(al)c(p)q(er)q(io)q(d)j (for)h(t)n(h)o(e)g(most)f(imp)q(ort)o(an)o(t)f(mo)q(d)o(ulus,)h(2)1207 2219 y Ff(n)1229 2234 y Fk(,)h(us)q(in)o(g)g(only)e(elem)o(en)o(t)o (ary)h(m)o(a)o(tr)q(ix)0 2284 y(t)n(h)o(eory)m(.)62 2333 y(F)m(or)h(lagge)q(d-Fib)q(on)o(acci)g(gen)o(era)o(t)o(ors,)i(t)n(h)o (e)g(in)o(t)o(eger)e(recurs)q(ion)h(re)q(d)o(u)o(ce)q(s)i(t)o(o)d Fh(x)1308 2339 y Ff(n)1350 2333 y Fk(=)h Fh(x)1425 2339 y Ff(n)p Fe(\000)p Ff(r)1502 2333 y Fd(\006)12 b Fh(x)1570 2339 y Ff(n)p Fe(\000)p Ff(s)1634 2333 y Fk(,)19 b(bu)o(t)g(t)n(h)o(e)0 2383 y(t)n(h)o(eory)13 b(for)g(t)n(h)o(e)g(gen)o(eral)g(in)o(t)o(eger)g (recurs)q(ion)g(mo)q(d)f(2)823 2368 y Ff(n)858 2383 y Fk(i)q(s)g(just)h(as)g(eas)q(ily)f(e)q(st)o(a)o(bli)q(sh)o(e)q(d,)g(b)o (y)h(cons)q(id)o(er)q(in)o(g)g(an)f(init)o(ial)0 2433 y(v)o(ect)o(or)i(of)d(in)o(t)o(egers,)i Fh(\013)f Fk(=)g(\()p Fh(x)454 2439 y Fg(1)472 2433 y Fh(;)7 b(x)515 2439 y Fg(2)533 2433 y Fh(;)g(:::;)g(x)631 2439 y Ff(r)646 2433 y Fk(\))13 b(an)o(d)f(su)o(cce)q(ss)q(iv)o(e)j(v)o(ect)o(ors)f Fh(\013T)s(;)7 b(\013T)1214 2418 y Fg(2)1232 2433 y Fh(;)g(\013T)1308 2418 y Fg(3)1326 2433 y Fh(;)g(:)g(:)g(:)j Fk(gen)o(era)o(t)o(e)q(d)k (b)o(y)e(a)g(m)o(a)o(tr)q(ix)0 2483 y Fh(T)20 b Fk(of)13 b(in)o(t)o(egers.)19 b(Here)c(i)q(s)f(t)n(h)o(e)g(re)q(sul)o(t;)h(for)e (a)h(pro)q(of)g(s)q(ee)g([11].)0 2533 y Fc(THEOREM)22 b(2.)32 b Fj(L)n(et)19 b(r)f(b)n(e)h(an)g Fh(r)13 b Fd(\002)g Fh(r)20 b Fj(matrix)e(of)h(inte)n(gers,)g(with)f(o)n(dd)i(determinant.) 30 b(In)20 b(or)n(der)e(that)h(the)0 2583 y(se)n(quenc)n(e)d(of)e(ve)n (ctors)635 2632 y Fh(\013;)7 b(\013T)s(;)g(\013T)811 2615 y Fg(2)829 2632 y Fh(;)g(\013T)905 2615 y Fg(3)922 2632 y Fh(;)g(:)g(:)g(:)39 b Fk(mo)q(d)11 b(2)1143 2615 y Ff(n)890 2757 y Fk(2)p eop %%Page: 3 3 3 2 bop 0 -41 a Fj(have)17 b(p)n(erio)n(d)g Fk(\(2)260 -56 y Ff(r)289 -41 y Fd(\000)11 b Fk(1\)2)390 -56 y Ff(n)p Fe(\000)p Fg(1)471 -41 y Fj(for)17 b(every)g Fh(n)e Fd(\025)g Fk(1)i Fj(and)g(every)g(initial)f(ve)n(ctor)g(of)h(inte)n(gers)g Fh(\013)d Fk(=)i(\()p Fh(x)1556 -35 y Fg(1)1574 -41 y Fh(;)7 b(:)g(:)g(:)e(;)i(x)1691 -35 y Ff(r)1709 -41 y Fk(\))17 b Fj(not)0 9 y(al)r(l)g(even,)i(it)e(is)g(ne)n(c)n(essary)h (and)h(su\016cient)e(that)h(T)f(have)h(or)n(der)f Fh(j)i Fk(=)e(2)1168 -6 y Ff(r)1198 9 y Fd(\000)11 b Fk(1)18 b Fj(in)f(the)h(gr)n(oup)g(of)g(non-singular)0 59 y(matric)n(es)c(for)g (mo)n(d)h(2,)g(and)h(or)n(der)e(2j)h(for)f(mo)n(d)h(4)g(and)h(or)n(der) e(4j)h(for)f(mo)n(d)i(8.)62 108 y Fk(T)m(o)c(v)o(er)q(ify)g(t)n(h)o(a)o (t)g(a)h(part)o(icular)e(F\(r,s,+\))i(or)f(F\(r,s,-\))h(gen)o(era)o(t)o (or)g(h)o(as)g(m)o(axim)n(al)c(p)q(er)q(io)q(d)j Fh(j)i Fk(=)e(\(2)1552 93 y Ff(r)1577 108 y Fd(\000)6 b Fk(1\)2)1673 93 y Ff(n)p Fe(\000)p Fg(1)1750 108 y Fk(for)0 158 y(in)o(t)o(egers)16 b(mo)q(d)e(2)270 143 y Ff(n)292 158 y Fk(,)h(on)o(e)g(n)o(ee)q(d)h (only)e(call)h(a)g(m)o(a)o(tr)q(ix-squar)q(in)o(g)d(rou)o(t)o(in)o(e)k (\(mo)q(d)d(8\))i(a)g(few)g(more)g(t)n(h)o(an)g Fh(r)h Fk(t)o(im)o(e)q(s)e(t)o(o)0 208 y(v)o(er)q(ify)f(t)n(h)o(a)o(t)g Fh(T)19 b Fk(h)o(as)13 b(ord)o(er)i(j)e(,2j)f(,4j)g(for)h(mo)q(d)e (2,4,8.)16 b Fj(This)e(wil)r(l)f(b)n(e)h(true)g(only)h(if)e Fh(H)i Fk(=)d Fh(T)1399 193 y Ff(j)r Fg(+1)1472 208 y Fj(is)i Fh(T)21 b Fj(mo)n(d)14 b(2,)g(not)h Fh(T)0 258 y Fj(mo)n(d)g(4)g(and)h Fh(H)244 243 y Fg(2)277 258 y Fj(not)f Fh(T)j Fk(mo)q(d)10 b(8)p Fj(.)62 308 y Fk(Th)o(e)17 b(m)o(a)o(tr)q(ix)d Fh(T)23 b Fk(i)q(s)16 b(a)g(companion)f(m)o(a)o(tr) q(ix,)f(wit)n(h)i(0's)h(ev)o(erywh)o(ere)h(except)g(for)e(1's)g(on)h(t) n(h)o(e)g(pr)q(incipal)e(su)n(b-)0 357 y(diagon)o(al)h(an)o(d)i(t)o(w)o (o)g(1's)g(in)g(t)n(h)o(e)h(ap)o(pro)o(pr)q(ia)o(t)o(e)e(p)q(os)q(it)o (ions)h(of)f(t)n(h)o(e)i(last)f(colu)o(mn.)30 b(F)m(or)18 b(example,)f(t)n(h)o(e)i(F\(3,1,+\))0 425 y(gen)o(era)o(t)o(or)c(on)f (in)o(t)o(egers)g(mo)q(d)f(2)507 410 y Ff(n)543 425 y Fk(h)o(as)28 b Fh(T)17 b Fk(=)715 392 y Fb(\000)759 396 y Fa(0)c(0)g(1)759 425 y(1)g(0)g(0)759 453 y(0)g(1)g(1)867 392 y Fb(\001)886 425 y Fk(.)62 496 y(A)g(few)h(calls)e(t)o(o)i(a)e(m)o (a)o(tr)q(ix-squar)q(in)o(g)f(rou)o(t)o(in)o(e)i(v)o(er)q(i\014e)q(s)h (t)n(h)o(a)o(t)g Fh(T)1051 480 y Fg(8)1082 496 y Fk(i)q(s)f Fh(T)k Fk(mo)q(d)11 b(2,)h(not)h Fh(T)18 b Fk(mo)q(d)10 b(4)i(an)o(d)h Fh(T)1650 480 y Fg(16)1699 496 y Fk(i)q(s)f(not)0 545 y Fh(T)18 b Fk(mo)q(d)10 b(8.)17 b(Since)d(T)f(i)q(s)f(nons)q(in)o (gular)h(an)o(d)g Fh(j)h Fk(=)d(2)773 530 y Fg(3)800 545 y Fd(\000)d Fk(1)13 b(i)q(s)f(pr)q(im)o(e,)f(t)n(h)o(e)j(ord)o(er)h (of)d Fh(T)19 b Fk(for)13 b(mo)q(d)o(ulus)f(2)h(i)q(s)f Fh(j)r Fk(.)18 b(Wh)o(en)c Fh(j)0 595 y Fk(i)q(s)e(comp)q(os)q(it)o(e,) f(say)h Fh(j)i Fk(=)e(2)413 580 y Fg(55)454 595 y Fd(\000)6 b Fk(1,)12 b(it)g(t)o(ak)o(e)q(s)h(a)f(lit)n(t)n(le)h(more)e(w)o(or)o (k)h(t)o(o)h(v)o(er)q(ify)f(t)n(h)o(e)h(ord)o(er)g(of)f(T.)g(Su)o(cce)q (ss)q(iv)o(e)i(squar)q(in)o(g)0 645 y(will)i(v)o(er)q(ify)g(t)n(h)o(a)o (t)h Fh(T)320 630 y Ff(j)r Fg(+1)397 645 y Fk(i)q(s)g Fh(T)23 b Fk(for)16 b(mo)q(d)g(2)h(an)o(d)g(not)g(T)g(for)f(mo)q(d)g(4) h(et)o(c.,)h(bu)o(t)g(on)o(e)f(m)n(ust)f(also)h(v)o(er)q(ify)f(t)n(h)o (a)o(t)i Fh(T)1780 630 y Ff(k)0 695 y Fk(i)q(s)d(not)g Fh(I)k Fk(mo)q(d)14 b(2)h(for)g(eac)o(h)i Fh(k)e Fk(=)f Fh(j)r(=p)p Fk(,)i(wit)n(h)f Fh(p)g Fk(ran)o(gin)o(g)h(o)o(v)o(er)f(t)n (h)o(e)h(pr)q(im)o(e)e(divi)q(sors)h(of)g Fh(j)r Fk(.)23 b(Ev)o(en)16 b(t)n(h)o(en,)g(a)f(s)q(imple)0 745 y(compu)o(t)o(er)f (program)f(will)f(s)q(erv)o(e)j(t)o(o)g(e)q(st)o(a)o(bli)q(sh|or)e (refu)o(t)o(e|t)n(h)o(a)o(t)i(a)e(pro)o(p)q(os)q(e)q(d)i(F\(r,s,+\))g (or)f(F\(r,s,-\))g(gen)o(era)o(t)o(or)0 794 y(h)o(as)g(m)o(axim)n(al)c (p)q(er)q(io)q(d.)62 844 y(T)m(o)17 b(\014n)o(d)g(t)n(h)o(e)g(p)q(er)q (io)q(d)g(of)f(an)h(F\(r,s,)p Fd(\003)p Fk(\))g(gen)o(era)o(t)o(or)h(u) o(n)o(d)o(er)h(m)n(ul)o(t)o(iplica)o(t)o(io)o(n)14 b(of)j(re)q(s)q(id)o (ue)q(s)h(rela)o(t)o(iv)o(ely)e(pr)q(im)o(e)g(t)o(o)0 894 y(a)j(mo)q(d)o(ulus)e Fh(m)p Fk(,)j(on)o(e)f(n)o(ee)q(d)h(only)e (expre)q(ss)j(t)n(h)o(e)f(A)n(b)q(elian)d(group)i(of)f(t)n(h)o(os)q(e)j (re)q(s)q(id)o(ue)q(s)f(as)f(a)f(direct)i(pro)q(d)o(u)o(ct)g(of)0 944 y(cyclic)c(groups,)g(t)n(h)o(en)g(cons)q(id)o(er)g(t)n(h)o(e)h (F\(r,s,+\))e(gen)o(era)o(t)o(or)i(on)e(t)n(h)o(e)i(exp)q(on)o(en)o(t)o (s)f(of)f(t)n(h)o(e)i(gen)o(era)o(t)o(ors)g(of)e(t)n(h)o(e)h(cyclic)0 994 y(groups.)25 b(F)m(or)15 b(example,)f(ev)o(ery)j(o)q(dd)f(in)o(t)o (eger)g(mo)q(d)f(2)860 979 y Ff(n)898 994 y Fk(h)o(as)h(a)f(u)o(nique)i (repre)q(s)q(en)o(t)o(a)o(t)o(ion)g(as)f(a)f(pro)q(d)o(u)o(ct)i(\()p Fd(\000)p Fk(1\))1748 979 y Ff(i)1762 994 y Fk(3)1783 979 y Ff(j)0 1043 y Fk(wit)n(h)e Fh(i)e Fd(2)g(f)p Fk(0)p Fh(;)7 b Fk(1)p Fd(g)13 b Fk(an)o(d)i Fh(j)g Fd(2)e(f)p Fk(1)p Fh(;)7 b Fk(2)p Fh(;)g(:)g(:)g(:)s(;)g Fk(2)626 1028 y Ff(n)p Fe(\000)p Fg(2)691 1043 y Fd(g)p Fk(.)20 b(Th)n(us)c(t)n(h)o(e)f(p)q(er)q(io)q(d)g(of)f(F\(r,s,)p Fd(\003)p Fk(\))h(for)f(o)q(dd)h(in)o(t)o(egers)h(mo)q(d)d(2)1665 1028 y Ff(n)1702 1043 y Fk(i)q(s)h(t)n(h)o(e)0 1093 y(p)q(er)q(io)q(d)g (of)f(t)n(h)o(e)h(F\(r,s,+\))h(gen)o(era)o(t)o(or)g(on)e(in)o(t)o (egers)i(mo)q(d)d(2)913 1078 y Ff(n)p Fe(\000)p Fg(1)978 1093 y Fk(:)0 1143 y Fj(If)k(the)h(F\(r,s,)p Fk(+)p Fj(\))f(gener)n (ator)h(has)g(maximal)f(p)n(erio)n(d,)h Fk(\(2)894 1128 y Ff(r)923 1143 y Fd(\000)10 b Fk(1\)2)1023 1128 y Ff(n)p Fe(\000)p Fg(1)1088 1143 y Fj(,)17 b(for)f(inte)n(gers)g(mo)n(d)h Fk(2)1454 1128 y Ff(n)1493 1143 y Fj(then)g(the)g(F\(r,s,)p Fd(\003)p Fj(\))0 1193 y(gener)n(ator)e(on)g(o)n(dd)g(inte)n(gers)g(mo) n(d)g Fk(2)585 1178 y Ff(n)622 1193 y Fj(has)g(p)n(erio)n(d)g Fk(\(2)857 1178 y Ff(r)884 1193 y Fd(\000)10 b Fk(1\)2)984 1178 y Ff(n)p Fe(\000)p Fg(3)1049 1193 y Fj(.)62 1243 y Fk(Th)o(e)18 b(F\(r,s,)p Fd(\000)p Fk(\))f(gen)o(era)o(t)o(ors)i(on)e (reals)h(are)g(part)o(icularly)e(suit)o(a)o(ble)g(for)h(ran)o(dom)e(n)n (u)o(m)n(b)q(er)i(su)n(brou)o(t)o(in)o(e)q(s)i(t)n(h)o(a)o(t)0 1293 y(ret)o(ur)q(n)f(UNI)g(or)g(VNI,)g(con)o(t)o(in)n(uous)g(ran)o (dom)e(v)n(ar)q(ia)o(ble)q(s)g(on)i([0,1\))e(or)i(\(-1,1\).)29 b(Ordin)o(ar)q(ily)m(,)17 b(su)o(c)o(h)h(su)n(brou)o(t)o(in)o(e)q(s)0 1342 y(gen)o(era)o(t)o(e)h(a)e(ran)o(dom)f(in)o(t)o(eger)i(f)q(rom)d (som)o(e)i(s)q(et,)h(t)n(h)o(en)h(divid)o(e)e(b)o(y)h(t)n(h)o(e)g (large)q(st)g(in)o(t)o(eger)g(in)f(t)n(h)o(e)h(s)q(et)h(t)o(o)e(get)h (t)n(h)o(e)0 1392 y(require)q(d)13 b(UNI)g(or)f(VNI.)g(If)f(t)n(h)o(e)i (init)o(ial)d(reals)j Fh(x)745 1398 y Fg(1)764 1392 y Fh(;)7 b(x)807 1398 y Fg(2)824 1392 y Fh(;)g(:)g(:)g(:)e(;)i(x)941 1398 y Ff(r)971 1392 y Fk(are)12 b(all)f(bin)o(ary)h(f)q(ract)o(ions)g (of)f(t)n(h)o(e)i(form)e Fh(k)q(=)p Fk(2)1664 1377 y Fg(24)1698 1392 y Fk(,)h(t)n(h)o(en)0 1442 y(t)n(h)o(e)h(bin)o(ary)f(o) o(p)q(era)o(t)o(ion)f Fh(x)6 b Fd(\005)g Fh(y)13 b Fk(=)f Fd(f)p Fk(if)g Fh(x)f Fd(\025)h Fh(y)i Fk(t)n(h)o(en)f Fh(x)6 b Fd(\000)g Fh(y)14 b Fk(els)q(e)f Fh(x)6 b Fd(\000)g Fh(y)i Fk(+)e(1)p Fd(g)13 b Fk(in)e(t)n(h)o(e)j(F\(r,s,)p Fd(\005)p Fk(\))e(gen)o(era)o(t)o(or)h(will)e(pro)q(d)o(u)o(ce)0 1492 y(a)j(s)q(equence)j(of)d(reals)i(on)e([0,1\),)f(eac)o(h)j(a)e(bin) o(ary)h(f)q(ract)o(ion)f Fh(k)q(=)p Fk(2)1001 1477 y Fg(24)1050 1492 y Fk(wit)n(h)h(n)n(u)o(m)o(era)o(t)o(or)g(t)n(h)o(e)g (in)o(t)o(eger)g(t)n(h)o(a)o(t)g(w)o(ould)f(b)q(e)0 1542 y(pro)q(d)o(u)o(ce)q(d)h(b)o(y)f(t)n(h)o(e)g(corre)q(sp)q(on)o(din)o(g) i(F\(r,s,)p Fd(\000)p Fk(\))e(gen)o(era)o(t)o(or)h(on)e(in)o(t)o(egers) i(mo)q(d)e(2)1241 1527 y Fg(24)1275 1542 y Fk(.)62 1591 y(Th)n(us)i(t)n(h)o(e)f(F\(r,s,)p Fd(\005)p Fk(\))g(gen)o(era)o(t)o(or) h(us)q(in)o(g)e(t)n(h)o(a)o(t)h(a)o(b)q(o)o(v)o(e)g Fd(\005)f Fk(on)h(32-bit)f(reals)h(\(h)o(a)o(vin)o(g)f(24-bit)g(f)q(ract)o (ions\))h(pro)q(d)o(u)o(ce)q(s)0 1641 y(real)19 b(UNI's)f(on)h([0,1\))e (wit)n(h)h(p)q(er)q(io)q(d)g(\(2)639 1626 y Ff(r)670 1641 y Fd(\000)12 b Fk(1\)2)772 1626 y Fg(23)825 1641 y Fk(direct)n(ly)m(,)20 b(a)o(v)o(oidin)o(g)c(t)n(h)o(e)k(divi)q(s)q (ion)c(o)o(p)q(era)o(t)o(ion)h(n)o(ece)q(ssary)k(in)0 1691 y(con)o(v)o(en)o(t)o(ion)o(al)15 b(gen)o(era)o(t)o(ors.)25 b(Th)o(e)16 b(sam)o(e)f(m)o(et)n(h)o(o)q(d)g(will)g(direct)n(ly)h(pro)q (d)o(u)o(ce)h(64-bit)d(dou)n(ble)i(preci)q(s)q(ion)f(reals)i(wit)n(h)0 1741 y(p)q(er)q(io)q(d)d(\(2)167 1726 y Ff(r)194 1741 y Fd(\000)c Fk(1\)2)294 1726 y Fg(55)328 1741 y Fk(.)0 1814 y(Lagge)q(d-Fib)q(on)o(acci)j(Gen)o(era)o(t)o(ors)j(wit)n(h)e Fd(\010)62 1864 y Fk(Th)o(e)g(F\(r,s,)p Fd(\010)p Fk(\))h(s)q(equence)g (st)o(art)o(s)h(wit)n(h)e(an)f(init)o(ial)f(s)q(et)j(of)e(compu)o(t)o (er)h(w)o(ords)g Fh(x)1303 1870 y Fg(1)1321 1864 y Fh(;)7 b(x)1364 1870 y Fg(2)1382 1864 y Fh(;)g(:)g(:)g(:)e(;)i(x)1499 1870 y Ff(r)1516 1864 y Fk(,)14 b(t)n(h)o(en)g(gen)o(era)o(t)o(e)q(s)0 1914 y(su)o(cce)q(ss)q(iv)o(e)19 b(w)o(ords)e(b)o(y)g(t)n(h)o(e)h (recurs)q(ion)f Fh(x)656 1920 y Ff(n)695 1914 y Fk(=)g Fh(x)768 1920 y Ff(n)p Fe(\000)p Ff(r)844 1914 y Fd(\010)12 b Fh(x)912 1920 y Ff(n)p Fe(\000)p Ff(s)976 1914 y Fk(.)27 b(Th)o(e)17 b(t)o(e)q(st)o(s)i(d)o(e)q(scr)q(ib)q(e)q(d)f(b)q(elo)o(w)e (sh)o(o)o(w)h(gen)o(era)o(t)o(ors)0 1964 y(bas)q(e)q(d)c(on)f(t)n(hi)q (s)g(s)q(equence)j(t)o(o)d(b)q(e)h(amon)o(g)e(t)n(h)o(e)i(w)o(orst)g (of)e(all)g(gen)o(era)o(t)o(ors,)j(u)o(nle)q(ss)h(t)n(h)o(e)e(lag)e Fh(r)i Fk(i)q(s)f(som)o(e)f(600)h(or)g(more.)0 2014 y(In)f(addit)o (ion,)f(t)n(h)o(e)j(m)o(axim)m(u)o(m)8 b(p)q(oss)q(ible)j(p)q(er)q(io)q (d)g(i)q(s)g(2)819 1998 y Ff(r)841 2014 y Fd(\000)t Fk(1,)h(wh)o(a)o(t) o(ev)o(er)g(t)n(h)o(e)g(w)o(ord)f(s)q(ize,)h(f)q(ar)e(sh)o(ort)i(of)f (t)n(h)o(e)h(a)o(t)n(t)o(ain)o(a)o(ble)0 2063 y(\(2)37 2048 y Ff(r)61 2063 y Fd(\000)6 b Fk(1\)2)157 2048 y Ff(n)p Fe(\000)p Fg(1)234 2063 y Fk(for)12 b(F\(r,s,+\),)g(F\(r,s,)p Fd(\000)p Fk(\))h(or)f(\(2)713 2048 y Ff(r)737 2063 y Fd(\000)6 b Fk(1\)2)833 2048 y Ff(n)p Fe(\000)p Fg(3)910 2063 y Fk(for)12 b(F\(r,s,)p Fd(\003)p Fk(\))g(wit)n(h)g(w)o(ords)h(of) e(n)i(bit)o(s.)18 b(Th)o(e)12 b(exclus)q(iv)o(e-or)0 2113 y(o)o(p)q(era)o(t)o(ion,)18 b Fd(\010)p Fk(,)h(i)q(s)f(no)g(f)q (ast)o(er)h(t)n(h)o(an)g(+)f(or)h Fd(\000)f Fk(in)g(most)g(compu)o(t)o (ers,)i(an)o(d)e(not)g(a)o(v)n(aila)o(ble)e(in)i(m)o(an)o(y)e(high-lev) o(el)0 2163 y(lan)o(guage)q(s.)i(So,)12 b(t)o(ak)o(en)h(wit)n(h)f(t)n (h)o(e)i(p)q(o)q(or)e(st)o(a)o(t)o(i)q(st)o(ical)g(p)q(erform)o(ance)g (an)o(d)g(f)q(ar)g(sh)o(ort)o(er)i(p)q(er)q(io)q(ds,)f(on)o(e)f(w)o(on) o(d)o(ers)i(wh)o(y)0 2213 y(F\(r,s,)p Fd(\010)p Fk(\))h(gen)o(era)o(t)o (ors)h(h)o(a)o(v)o(e)e(ev)o(er)i(b)q(een)f(giv)o(en)f(s)q(er)q(ious)h (cons)q(id)o(era)o(t)o(ion.)20 b(Bu)o(t)c(t)n(h)o(ey)f(h)o(a)o(v)o(e.)k (Calle)q(d)14 b(\\gen)o(eralize)q(d)0 2263 y(fee)q(dbac)o(k)h(shift)e (regi)q(st)o(er)i(gen)o(era)o(t)o(ors")g(\(GFSR's\),)e(t)n(h)o(ey)i(h)o (a)o(v)o(e)e(b)q(een)i(t)n(h)o(e)f(su)n(b)r(ject)i(of)d(s)q(ev)o(eral)i (pap)q(ers)f([1,2,4,7].)0 2336 y(5.)50 b(COMBINA)m(TION)15 b(GENERA)m(TORS)62 2386 y(Empir)q(ical)8 b(st)o(udie)q(s)j(sugge)q(st)g (t)n(h)o(a)o(t)f(com)n(binin)o(g)e(t)o(w)o(o)i(or)g(more)f(s)q(imple)f (gen)o(era)o(t)o(ors,)k(b)o(y)e(m)o(eans)f(of)h(a)g(con)o(v)o(enien)o (t)0 2436 y(compu)o(t)o(er)j(o)o(p)q(era)o(t)o(ion)e(su)o(c)o(h)j(as)e (+,)p Fd(\000)p Fk(,)p Fd(\003)g Fk(or)h Fd(\010)g Fk(\(exclus)q(iv)o (e-or\),)f(pro)o(vid)o(e)q(s)h(a)g(comp)q(os)q(it)o(e)e(wit)n(h)i(b)q (et)n(t)o(er)h(ran)o(domn)o(e)q(ss)0 2485 y(t)n(h)o(an)g(e)q(it)n(h)o (er)h(of)e(t)n(h)o(e)i(comp)q(on)o(en)o(t)o(s.)j(Th)o(ere)d(i)q(s)e(in) o(t)o(ere)q(st)o(in)o(g)i(t)n(h)o(eoret)o(ical)f(sup)o(p)q(ort)h(for)e (su)o(c)o(h)i(an)e(obs)q(erv)n(a)o(t)o(ion.)62 2535 y(Let)k Fh(x)g Fk(b)q(e)g(a)f(ran)o(dom)f(v)n(ar)q(ia)o(ble)g(t)o(akin)o(g)h(v) n(alue)q(s)g(in)h(a)f(\014nit)o(e)h(s)q(et)g Fh(S)r Fk(.)27 b(T)m(o)16 b(\014x)h(id)o(eas,)h(let)e Fh(S)j Fk(=)e Fd(f)p Fk(1)p Fh(;)7 b Fk(2)p Fh(;)g Fk(3)p Fd(g)p Fk(;)15 b(t)n(h)o(e)0 2585 y(t)n(h)o(eory)g(i)q(s)e(eas)q(ily)g(ext)o(en)o(d)o (e)q(d)j(t)o(o)e(an)o(y)f(\014nit)o(e)h(s)q(et.)19 b(Let)14 b(t)n(h)o(e)h(proba)o(bilit)o(y)d(v)o(ect)o(or)j(for)f Fh(x)f Fk(b)q(e)h(\()p Fh(a;)7 b(b;)g(c)p Fk(\),)12 b(t)n(h)o(a)o(t)i (i)q(s,)890 2757 y(3)p eop %%Page: 4 4 4 3 bop 0 -41 a Fk(Pr)q(\()p Fh(x)11 b Fk(=)h(1\))f(=)h Fh(a;)20 b Fk(Pr)q(\()p Fh(x)11 b Fk(=)h(2\))f(=)h Fh(b;)20 b Fk(Pr)q(\()p Fh(x)11 b Fk(=)h(3\))f(=)h Fh(c)p Fk(.)62 9 y(W)m(e)f(s)q(eek)g(t)n(h)o(e)h(u)o(niform)d(di)q(str)q(ibu)o(t)o (ions)h(on)h Fh(S)r Fk(,)h(wit)n(h)e(proba)o(bilit)o(y)g(v)o(ect)o(or)i (\()1220 -8 y Fg(1)p 1220 -1 17 2 v 1220 23 a(3)1241 9 y Fh(;)1265 -8 y Fg(1)p 1265 -1 V 1265 23 a(3)1286 9 y Fh(;)1310 -8 y Fg(1)p 1310 -1 V 1310 23 a(3)1331 9 y Fk(\).)17 b(Let)11 b Fh(\016)r Fk(\()p Fh(x)p Fk(\))g(b)q(e)g(t)n (h)o(e)h(di)q(st)o(ance)0 59 y(b)q(et)o(w)o(een)20 b(t)n(h)o(e)h(di)q (str)q(ibu)o(t)o(ion)e(of)g Fh(x)g Fk(an)o(d)g(t)n(h)o(e)i(u)o(niform)d (di)q(str)q(ibu)o(t)o(ion,)i(d)o(e\014n)o(e)q(d)h(as)e(t)n(h)o(e)i(di)q (st)o(ance)f(b)q(et)o(w)o(een)g(t)n(h)o(e)0 108 y(corre)q(sp)q(on)o (din)o(g)15 b(proba)o(bilit)o(y)d(v)o(ect)o(ors:)636 200 y Fh(\016)r Fk(\()p Fh(x)p Fk(\))g(=)f Fd(jj)p Fk(\()p Fh(a;)c(b;)g(c)p Fk(\))h Fd(\000)h Fk(\()989 172 y(1)p 989 190 21 2 v 989 229 a(3)1015 200 y Fh(;)1038 172 y Fk(1)p 1038 190 V 1038 229 a(3)1064 200 y Fh(;)1088 172 y Fk(1)p 1088 190 V 1088 229 a(3)1113 200 y(\))p Fd(jj)p Fh(;)0 288 y Fk(wh)o(ere)18 b Fd(jj)d Fk(i)q(s)h(t)n(h)o(e)i(enclos)q (er)g(for)e(an)o(y)h(v)o(ect)o(or)g(norm:)22 b Fh(L)871 294 y Fg(1)890 288 y Fh(;)7 b(L)937 294 y Fg(2)956 288 y Fh(;)g(L)1003 294 y Fe(1)1054 288 y Fk(or)17 b(an)o(y)f Fh(L)1217 294 y Ff(p)1236 288 y Fk(.)26 b(Let)17 b Fh(y)i Fk(b)q(e)e(som)o(e)e(ot)n(h)o(er)j(ran)o(dom)0 338 y(v)n(ar)q(ia)o(ble) d(on)h Fh(S)r Fk(,)i(in)o(d)o(ep)q(en)o(d)o(en)o(t)f(of)f Fh(x)p Fk(,)h(wit)n(h)f(proba)o(bilit)o(y)f(v)o(ect)o(or)j(\()p Fh(r)o(;)7 b(s;)g(t)p Fk(\).)25 b(F)m(urt)n(h)o(ermore,)17 b(sup)o(p)q(os)q(e)h(w)o(e)f(h)o(a)o(v)o(e)f(a)0 388 y(bin)o(ary)d(o)o(p)q(era)o(t)o(ion)g Fd(\017)h Fk(on)g Fh(S)r Fk(,)g(wit)n(h)g(o)o(p)q(era)o(t)o(ion)f(t)o(a)o(ble)g(formin)o (g)f(a)h(La)o(t)o(in)g(square,)i(say)796 517 y Fd(\017)p 837 535 2 60 v 41 w Fk(1)42 b(2)f(3)p 775 536 250 2 v 796 578 a(1)p 837 596 2 60 v 41 w(3)h(1)f(2)796 638 y(2)p 837 656 V 41 w(1)h(2)f(3)796 698 y(3)p 837 716 V 41 w(2)h(3)f(1)62 782 y(Th)o(en)19 b(w)o(e)f(m)o(ay)e(us)q(e)j(t)n(h)o(e)f(bin)o(ary)g(o) o(p)q(era)o(t)o(ion)f Fd(\017)h Fk(t)o(o)g(form)e(a)i(n)o(ew)g(ran)o (dom)e(v)n(ar)q(ia)o(ble,)h Fh(z)j Fk(=)f Fh(x)12 b Fd(\017)f Fh(y)q Fk(,)20 b(an)o(d)d(t)n(h)o(e)0 832 y(di)q(str)q(ibu)o(t)o(ion)c (of)g Fh(z)j Fk(will)d(b)q(e)h(\\clos)q(er")g(t)o(o)g(u)o(niform)f(t)n (h)o(an)h(t)n(h)o(a)o(t)g(of)f(e)q(it)n(h)o(er)i Fh(x)f Fk(or)f Fh(y)c Fk(:)0 917 y Fc(THEOREM)17 b(3.)28 b Fh(\016)r Fk(\()p Fh(x)9 b Fd(\017)g Fh(y)q Fk(\))k Fd(\024)e Fh(\016)r Fk(\()p Fh(x)p Fk(\))j Fj(and)h Fh(\016)r Fk(\()p Fh(x)9 b Fd(\017)g Fh(y)q Fk(\))k Fd(\024)e Fh(\016)r Fk(\()p Fh(y)q Fk(\).)62 1028 y(Th)o(e)j(pro)q(of)g(i)q(s)f(s)q(imple)f(for)h (t)n(h)o(e)i(a)o(b)q(o)o(v)o(e)e Fh(S)k Fk(an)o(d)d Fd(\017)p Fk(,)f(an)o(d)g(it)h(gen)o(eralize)q(s)h(in)e(an)h(ob)o(vious)f(w)o(ay) m(.)641 1124 y(Pr\()p Fh(x)d Fd(\017)f Fh(y)k Fk(=)f(1\))f(=)h Fh(as)e Fk(+)f Fh(br)h Fk(+)g Fh(ct)641 1184 y Fk(Pr\()p Fh(x)g Fd(\017)f Fh(y)k Fk(=)f(2\))f(=)h Fh(at)d Fk(+)h Fh(bs)f Fk(+)h Fh(cr)641 1244 y Fk(Pr\()p Fh(x)g Fd(\017)f Fh(y)k Fk(=)f(3\))f(=)h Fh(ar)e Fk(+)g Fh(bt)f Fk(+)g Fh(cs:)0 1319 y Fk(Th)n(us)15 b(t)n(h)o(e)f(proba)o(bilit)o(y)e(v)o (ect)o(or)j(for)f Fh(z)g Fk(=)d Fh(x)e Fd(\017)g Fh(y)16 b Fk(i)q(s)563 1473 y(\()p Fh(a;)7 b(b;)g(c)p Fk(\))691 1440 y Fb(\000)730 1415 y Fh(s)47 b(t)42 b(r)730 1475 y(r)h(s)k(t)735 1535 y(t)41 b(r)i(s)893 1440 y Fb(\001)924 1473 y Fk(=)12 b(\()p Fh(a;)7 b(b;)g(c)p Fk(\))p Fh(M)r(;)20 b Fk(say)m(.)0 1616 y(Th)o(en,)14 b(s)q(ince)g(\()242 1600 y Fg(1)p 242 1607 17 2 v 242 1631 a(3)264 1616 y Fh(;)287 1600 y Fg(1)p 287 1607 V 287 1631 a(3)309 1616 y Fh(;)332 1600 y Fg(1)p 332 1607 V 332 1631 a(3)354 1616 y Fk(\))p Fh(M)i Fk(=)c(\()491 1600 y Fg(1)p 491 1607 V 491 1631 a(3)513 1616 y Fh(;)536 1600 y Fg(1)p 536 1607 V 536 1631 a(3)558 1616 y Fh(;)581 1600 y Fg(1)p 581 1607 V 581 1631 a(3)602 1616 y Fk(\),)329 1714 y Fh(\016)r Fk(\()p Fh(x)d Fd(\017)g Fh(y)q Fk(\))k(=)e Fd(jj)p Fk(\()p Fh(a;)c(b;)g(c)p Fk(\))p Fh(M)12 b Fd(\000)e Fk(\()788 1686 y(1)p 788 1705 21 2 v 788 1743 a(3)814 1714 y Fh(;)837 1686 y Fk(1)p 837 1705 V 837 1743 a(3)863 1714 y Fh(;)886 1686 y Fk(1)p 886 1705 V 886 1743 a(3)912 1714 y(\))p Fd(jj)h Fk(=)h Fd(jj)p Fk([\()p Fh(a;)7 b(b;)g(c)p Fk(\))f Fd(\000)k Fk(\()1240 1686 y(1)p 1240 1705 V 1240 1743 a(3)1266 1714 y Fh(;)1289 1686 y Fk(1)p 1289 1705 V 1289 1743 a(3)1315 1714 y Fh(;)1338 1686 y Fk(1)p 1338 1705 V 1338 1743 a(3)1364 1714 y(\)])p Fh(M)5 b Fd(jj)p Fh(:)0 1803 y Fk(It)14 b(follo)o(ws)e(t)n(h)o(a)o(t)i Fh(\016)r Fk(\()p Fh(x)9 b Fd(\017)g Fh(y)q Fk(\))j Fd(\024)g Fh(\016)r Fk(\()p Fh(x)p Fk(\))i(b)q(eca)n(us)q(e)h(for)f(an)o(y)f(\()p Fh(f)r(;)7 b(g)q(;)g(h)p Fk(\),)499 1894 y Fd(jj)p Fk(\()p Fh(f)r(;)g(g)q(;)g(h)p Fk(\))p Fh(M)e Fd(jj)k(\024)j(jj)p Fk(\()p Fh(f)r(;)7 b(g)q(;)g(h)p Fk(\))p Fd(jj)e(jj)p Fh(M)g Fd(jj)k(\024)j(jj)p Fk(\()p Fh(f)r(;)7 b(g)q(;)g(h)p Fk(\))p Fd(jj)0 1985 y Fk(as)12 b(lon)o(g)e(as)i Fd(jj)p Fh(M)5 b Fd(jj)10 b(\024)h Fk(1.)17 b(Here)c Fd(jj)p Fh(M)5 b Fd(jj)k Fk(i)q(s)i(t)n(h)o(e)i(m)o(a)o(tr)q(ix)c(norm)h(in)o (d)o(u)o(ce)q(d)i(b)o(y)f(t)n(h)o(e)h(v)o(ect)o(or)h(p-norm)d Fd(jj)p Fk(.)16 b(Thi)q(s)11 b(i)q(s)g(cert)o(ainly)0 2035 y(true)h(for)g(t)n(h)o(e)g(m)o(a)o(tr)q(ix)d Fh(M)17 b Fk(ar)q(i)q(s)q(in)o(g)10 b(f)q(rom)f(t)n(h)o(e)k(La)o(t)o(in)e (square)h(o)o(p)q(era)o(t)o(ion)f(t)o(a)o(ble)f(for)i Fd(\017)p Fk(,)f(s)q(ince)h(t)n(h)o(e)g(ro)o(ws)g(an)o(d)f(colu)o(mns)0 2084 y(of)j Fh(M)k Fk(are)d(proba)o(bilit)o(y)e(v)o(ect)o(ors,)i(non-n) o(ega)o(t)o(iv)o(e)e(su)o(mmin)o(g)f(t)o(o)j(1.)j(Th)o(e)d Fh(L)1173 2090 y Fg(1)1206 2084 y Fk(norm)e(of)g Fh(M)19 b Fk(i)q(s)14 b(1,)f(t)n(h)o(e)i(m)o(ax)e(colu)o(mn)0 2134 y(su)o(m,)i(t)n(h)o(e)i Fh(L)200 2140 y Fe(1)251 2134 y Fk(norm)d(of)h Fh(M)21 b Fk(i)q(s)15 b(1,)h(t)n(h)o(e)g(m)o(ax)e (ro)o(w)i(su)o(m,)f(an)o(d)g(t)n(h)o(e)i Fh(L)1089 2140 y Fg(2)1124 2134 y Fk(\(Eu)o(clid)o(ean\))f(norm)f(of)g Fh(M)20 b Fk(i)q(s)c(t)n(h)o(e)g(square)0 2184 y(ro)q(ot)e(of)f(t)n(h)o (e)i(domin)o(an)o(t)c(e)q(igen)o(v)n(alue)j(of)f Fh(M)5 b(M)726 2169 y Fe(0)737 2184 y Fk(,)14 b(a)o(t)f(most)h(1.)62 2234 y(Thi)q(s)9 b(t)n(h)o(eoret)o(ical)g(re)q(sul)o(t)i(sugge)q(st)o (s)g(t)n(h)o(a)o(t)f(if)e(t)o(w)o(o)h(RNG's)f(pro)q(d)o(u)o(ce)j(s)q (equence)q(s)g Fh(x)1300 2240 y Fg(1)1319 2234 y Fh(;)c(x)1362 2240 y Fg(2)1379 2234 y Fh(;)g(x)1422 2240 y Fg(3)1440 2234 y Fh(;)g(:)g(:)g(:)g Fk(an)o(d)i Fh(y)1611 2240 y Fg(1)1630 2234 y Fh(;)e(y)1669 2240 y Fg(2)1688 2234 y Fh(;)g(y)1727 2240 y Fg(3)1745 2234 y Fh(;)g(:)g(:)g(:)0 2284 y Fk(on)j(som)o(e)f(\014nit)o(e)h(s)q(et)h Fh(S)i Fk(on)d(whic)o(h)g(w)o(e)h(h)o(a)o(v)o(e)e(a)h(bin)o(ary)g(o)o(p)q(era) o(t)o(ion)f Fd(\017)p Fk(,)i(t)n(h)o(en)g(t)n(h)o(e)f(com)n(bin)o(a)o (t)o(ion)e(gen)o(era)o(t)o(or,)k(pro)q(d)o(u)o(cin)o(g)0 2333 y Fh(x)24 2339 y Fg(1)48 2333 y Fd(\017)5 b Fh(y)94 2339 y Fg(1)113 2333 y Fh(;)i(x)156 2339 y Fg(2)179 2333 y Fd(\017)e Fh(y)225 2339 y Fg(2)244 2333 y Fh(;)i(x)287 2339 y Fg(3)310 2333 y Fd(\017)e Fh(y)356 2339 y Fg(3)375 2333 y Fh(;)i(:)g(:)g(:)i Fk(sh)o(ould)j(b)q(e)g(b)q(et)n(t)o(er,)h(or) f(a)o(t)g(least)g(no)g(w)o(ors)q(e)g(t)n(h)o(an,)g(e)q(it)n(h)o(er)i (of)d(t)n(h)o(e)h(comp)q(on)o(en)o(t)f(RNG's.)0 2383 y(A)n(p)o(plica)o(t)o(ions)j(migh)o(t)h(includ)o(e)i(+)f(or)h Fd(\000)f Fk(for)g(re)q(s)q(id)o(ue)q(s)i(of)e(som)o(e)f(mo)q(d)o(ulus) g(m,)g(exclus)q(iv)o(e-or,)i Fd(\010)p Fk(,)g(on)f(compu)o(t)o(er)0 2433 y(w)o(ords,)d(or)f(m)n(ul)o(t)o(iplica)o(t)o(io)o(n)e(on)i(t)n(h)o (e)i(s)q(et)f Fh(S)j Fk(of)c(re)q(s)q(id)o(ue)q(s)h(rela)o(t)o(iv)o (ely)f(pr)q(im)o(e)f(t)o(o)i(mo)q(d)o(ulus)e Fh(m)p Fk(,)i(su)o(c)o(h)g (as)g(o)q(dd)f(in)o(t)o(egers)0 2483 y(mo)q(d)j(2)117 2468 y Ff(n)139 2483 y Fk(.)26 b(Th)o(e)17 b(bin)o(ary)f(o)o(p)q(era)o (t)o(ion)g(n)o(ee)q(d)h(only)f(h)o(a)o(v)o(e)g(t)n(h)o(e)i(pro)o(p)q (ert)o(y)e(t)n(h)o(a)o(t)h(it)o(s)g(o)o(p)q(era)o(t)o(ion)f(t)o(a)o (ble)f(forms)h(a)g(La)o(t)o(in)0 2533 y(square;)e(it)g(n)o(ee)q(d)h(b)q (e)e(n)o(e)q(it)n(h)o(er)j(comm)n(u)o(t)o(a)o(t)o(iv)o(e)11 b(nor)j(asso)q(cia)o(t)o(iv)o(e.)62 2583 y(Anot)n(h)o(er)i(a)o(t)n (tract)o(iv)o(e)g(fea)o(t)o(ure)g(of)f(com)n(bin)o(a)o(t)o(ion)d(RNG's) j(i)q(s)f(t)n(h)o(a)o(t)h(t)n(h)o(ey)h(t)o(en)o(d)g(not)f(only)f(t)o(o) h(m)o(ak)o(e)f(t)n(h)o(e)i(re)q(sul)o(t)o(s)0 2632 y(more)e(u)o (niform|t)n(h)o(ey)f(m)o(ak)o(e)g(t)n(h)o(em)h(more)g(in)o(d)o(ep)q(en) o(d)o(en)o(t.)21 b(Giv)o(en)14 b Fh(x)1090 2638 y Fg(1)1108 2632 y Fh(;)7 b(x)1151 2638 y Fg(2)1169 2632 y Fh(;)g(x)1212 2638 y Fg(3)1230 2632 y Fh(;)g(:)g(:)g(:)12 b Fk(w)o(e)j(h)o(o)o(p)q(e) g(t)n(h)o(a)o(t)g Fh(x)1583 2638 y Fg(1)1616 2632 y Fk(i)q(s)f(u)o (niform)890 2757 y(4)p eop %%Page: 5 5 5 4 bop 0 -41 a Fk(on)16 b Fh(S)r Fk(,)h(t)n(h)o(a)o(t)f(\()p Fh(x)244 -35 y Fg(1)262 -41 y Fh(;)7 b(x)305 -35 y Fg(2)323 -41 y Fk(\))16 b(i)q(s)g(u)o(niform)e(on)i Fh(S)6 b Fd(\002)t Fh(S)r Fk(,)18 b(t)n(h)o(a)o(t)e(\()p Fh(x)869 -35 y Fg(1)887 -41 y Fh(;)7 b(x)930 -35 y Fg(2)948 -41 y Fh(;)g(x)991 -35 y Fg(3)1009 -41 y Fk(\))16 b(i)q(s)g(u)o(niform)e(on)i Fh(S)6 b Fd(\002)t Fh(S)g Fd(\002)t Fh(S)r Fk(,)18 b(an)o(d)e(so)g(on.) 24 b(If)16 b(w)o(e)0 9 y(com)n(bin)o(e)e Fh(x)186 15 y Fg(1)205 9 y Fh(;)7 b(x)248 15 y Fg(2)266 9 y Fh(;)g(x)309 15 y Fg(3)326 9 y Fh(;)g(:)g(:)g(:)14 b Fk(an)o(d)h Fh(y)510 15 y Fg(1)529 9 y Fh(;)7 b(y)568 15 y Fg(2)587 9 y Fh(;)g(y)626 15 y Fg(3)644 9 y Fh(;)g(:)g(:)g(:)14 b Fk(t)n(h)o(en)j(\()p Fh(x)861 15 y Fg(1)879 9 y Fh(;)7 b(x)922 15 y Fg(2)940 9 y Fh(;)g(x)983 15 y Fg(3)1001 9 y Fk(\))16 b(h)o(as)f(a)h(cert)o(ain) g(di)q(str)q(ibu)o(t)o(ion)f(on)h(t)n(h)o(e)g(\014nit)o(e)g(s)q(et)0 59 y Fh(S)s Fd(\002)q Fh(S)s Fd(\002)q Fh(S)r Fk(,)f(as)e(do)q(e)q(s)g (\()p Fh(y)355 65 y Fg(1)374 59 y Fh(;)7 b(y)413 65 y Fg(2)432 59 y Fh(;)g(y)471 65 y Fg(3)489 59 y Fk(\),)13 b(an)o(d)g(t)n(h)n(us)h(\()p Fh(x)737 65 y Fg(1)763 59 y Fd(\017)8 b Fh(y)812 65 y Fg(1)831 59 y Fh(;)f(x)874 65 y Fg(2)899 59 y Fd(\017)h Fh(y)948 65 y Fg(2)967 59 y Fh(;)f(x)1010 65 y Fg(3)1035 59 y Fd(\017)g Fh(y)1083 65 y Fg(3)1102 59 y Fk(\))14 b(h)o(as)f(a)f(di)q(str)q(ibu)o(t)o(ion)h (a)o(t)g(least)g(as)h(u)o(niform)0 108 y(on)k Fh(S)8 b Fd(\002)d Fh(S)k Fd(\002)c Fh(S)r Fk(.)33 b(Bu)o(t)19 b(t)n(h)o(a)o(t)g(m)o(eans)f(t)n(h)o(e)h(com)n(bin)o(e)q(d)e(v)o(ect)o (or)j(t)o(en)o(ds)f(t)o(o)f(h)o(a)o(v)o(e)h(in)o(d)o(ep)q(en)o(d)o(en)o (t)g(co)q(ordin)o(a)o(t)o(e)q(s,)h(s)q(ince)0 158 y(u)o(niformit)o(y)12 b(on)h(a)h(pro)q(d)o(u)o(ct)g(s)q(et)h Fh(S)5 b Fd(\002)r Fh(S)g Fd(\002)r Fh(S)18 b Fk(implie)q(s)12 b(in)o(d)o(ep)q(en)o(d)o (ence)k(of)d(t)n(h)o(e)h(co)q(ordin)o(a)o(t)o(e)q(s.)62 208 y(Th)o(e)q(s)q(e)h(rem)o(ar)o(ks)f(ap)o(ply)f(t)o(o)h(an)o(y)f(t)o (w)o(o)h(ran)o(dom)e(k-t)o(uple)q(s)i(\()p Fh(x)1009 214 y Fg(1)1027 208 y Fh(;)7 b(:)g(:)g(:)e(;)i(x)1144 214 y Ff(k)1163 208 y Fk(\))14 b(an)o(d)g(\()p Fh(y)1309 214 y Fg(1)1328 208 y Fh(;)7 b(:)g(:)g(:)e(;)i(y)1441 214 y Ff(k)1461 208 y Fk(\):)0 258 y(on)13 b(t)n(h)o(e)h(pro)q(d)o(u)o (ct)g(s)q(et)g Fh(S)370 243 y Ff(k)391 258 y Fk(,)f(t)n(h)o(e)h(comp)q (os)q(it)o(e)e(v)o(ect)o(or)j(\()p Fh(x)842 264 y Fg(1)868 258 y Fd(\017)8 b Fh(y)917 264 y Fg(1)936 258 y Fh(;)f(:)g(:)g(:)e(;)i (x)1053 264 y Ff(k)1080 258 y Fd(\017)h Fh(y)1129 264 y Ff(k)1150 258 y Fk(\))13 b(i)q(s)g(lik)o(ely)f(t)o(o)h(b)q(e)g(clos)q (er)i(t)o(o)e(t)n(h)o(e)h(id)o(eal)g(of)0 308 y(h)o(a)o(vin)o(g)f(in)o (d)o(ep)q(en)o(d)o(en)o(t,)h(u)o(niformly)e(di)q(str)q(ibu)o(t)o(e)q(d) i(elem)o(en)o(t)o(s)g(t)n(h)o(an)g(e)q(it)n(h)o(er)h(of)f(t)n(h)o(e)g (con)o(tr)q(ibu)o(t)o(in)o(g)g(v)o(ect)o(ors.)62 357 y(Wh)o(a)o(t)g(i)q(s)f(t)n(h)o(e)i(p)q(er)q(io)q(d)f(of)f(a)h(com)n (bin)o(a)o(t)o(ion)d(gen)o(era)o(t)o(or?)20 b(Th)o(e)14 b(read)o(er)i(m)o(ay)d(wi)q(sh)g(t)o(o)h(con)o(vince)h(hims)q(elf)d(of) h(t)n(h)o(e)0 407 y(follo)o(win)o(g:)i(If)e Fh(x)255 413 y Fg(1)274 407 y Fh(;)7 b(x)317 413 y Fg(2)334 407 y Fh(;)g(x)377 413 y Fg(3)395 407 y Fh(;)g(:)g(:)g(:)12 b Fk(an)o(d)h Fh(y)575 413 y Fg(1)594 407 y Fh(;)7 b(y)633 413 y Fg(2)651 407 y Fh(;)g(y)690 413 y Fg(3)709 407 y Fh(;)g(:)g(:)g(:)k Fk(are)j(str)q(ict)n(ly)g(p)q(er)q(io)q(dic)f(s)q (equence)q(s)j(h)o(a)o(vin)o(g)c(p)q(er)q(io)q(ds)i Fh(r)q(d)f Fk(an)o(d)g Fh(sd)0 457 y Fk(wit)n(h)g Fh(r)g Fk(an)o(d)g Fh(s)g Fk(rela)o(t)o(iv)o(ely)f(pr)q(im)o(e,)f(t)n(h)o(en)i(t)n(h)o(e)h (p)q(er)q(io)q(d)e(of)g Fh(x)897 463 y Fg(1)923 457 y Fd(\017)6 b Fh(y)970 463 y Fg(1)989 457 y Fh(;)h(x)1032 463 y Fg(2)1057 457 y Fd(\017)g Fh(y)1105 463 y Fg(2)1124 457 y Fh(;)g(x)1167 463 y Fg(3)1191 457 y Fd(\017)g Fh(y)1239 463 y Fg(3)1258 457 y Fh(;)g(:)g(:)g(:)k Fk(i)q(s)h Fh(r)q(st)p Fk(,)h(wh)o(ere)h Fh(t)e Fk(i)q(s)h(a)f(divi)q(sor)0 507 y(of)h Fh(d)p Fk(.)18 b(Th)n(us)c(t)n(h)o(e)h(sh)o(ort)o(e)q(st)h (p)q(oss)q(ible)e(p)q(er)q(io)q(d)f(i)q(s)h Fh(r)q(s)p Fk(,)f(t)n(h)o(e)i(lon)o(ge)q(st)f Fh(r)q(sd)p Fk(.)62 557 y(Reference)q(s)j([8])d(an)o(d)g([l2l)f(s)q(eem)h(t)o(o)h(h)o(a)o (v)o(e)f(\014rst)i(urge)q(d)f(t)n(h)o(a)o(t)g(s)q(imple)d(gen)o(era)o (t)o(ors)k(b)q(e)f(com)n(bin)o(e)q(d;)e(Bro)o(wn)i(an)o(d)0 606 y(Solomon)d([3])h(pro)o(vid)o(e)q(d)i(t)n(h)o(eoret)o(ical)g(sup)o (p)q(ort)h(for)e(su)o(c)o(h)i(com)n(bin)o(a)o(t)o(ions.)i(Th)o(ey)d(ga) o(v)o(e)f(an)h(ela)o(b)q(ora)o(t)o(e)f(pro)q(of)h(t)n(h)o(a)o(t)0 656 y Fh(x)7 b Fk(+)h Fh(y)13 b Fk(mo)q(d)d Fh(m)k Fk(w)o(as)f(more)f (u)o(niform)f(t)n(h)o(an)i Fh(x)g Fk(or)g Fh(y)h Fk(on)f(re)q(s)q(id)o (ue)q(s)h(mo)q(d)e Fh(m)p Fk(,)h(relyin)o(g)g(h)o(ea)o(vily)f(on)h(t)n (h)o(e)g(t)o(ec)o(hnique)q(s)i(of)0 706 y(m)o(a)r(jor)q(iza)o(t)o(ion.) g(Marsh)o(all)e(an)o(d)g(Olkin)g([13)g(p.)18 b(383])12 b(m)o(ad)o(e)h(t)n(h)o(e)h(re)q(sul)o(t)h(more)e(gen)o(eral)h(in)f(t)n (h)o(e)q(ir)h(elegan)o(t)g(b)q(o)q(ok)f(on)0 756 y(in)o(equalit)o(ie)q (s)i(an)o(d)h(m)o(a)r(jor)q(iza)o(t)o(ion.)22 b(T)m(o)15 b(t)n(h)o(os)q(e)j(not)e(f)q(amil)o(ia)o(r)e(wit)n(h)i(t)n(h)o(e)h(p)q (o)o(w)o(erful)f(t)o(ec)o(hnique)q(s)h(of)e(m)o(a)r(jor)q(iza)o(t)o (ion,)0 806 y(t)n(h)o(e)g(a)o(b)q(o)o(v)o(e)e(d)o(ev)o(elo)o(pm)o(en)o (t,)f(us)q(in)o(g)i(only)f(elem)o(en)o(t)o(ary)g(pro)o(p)q(ert)o(ie)q (s)i(of)e(v)o(ect)o(or)i(norms,)e(m)o(ay)f(b)q(e)i(prefera)o(ble.)0 879 y(6.)50 b(TESTS)14 b(OF)g(RNG's)62 929 y(A)i(ran)o(dom)e(n)n(u)o(m) n(b)q(er)h(gen)o(era)o(t)o(or)i(i)q(s)d(sup)o(p)q(os)q(e)q(d)k(t)o(o)d (pro)q(d)o(u)o(ce)i(a)e(s)q(equence)i(of)e(in)o(d)o(ep)q(en)o(d)o(en)o (t,)i(id)o(en)o(t)o(ically)d(di)q(s-)0 979 y(tr)q(ibu)o(t)o(e)q(d)h (\(iid\))e(ran)o(dom)g(v)n(ar)q(ia)o(ble)q(s)f Fh(x)602 985 y Fg(1)620 979 y Fh(;)7 b(x)663 985 y Fg(2)681 979 y Fh(;)g(x)724 985 y Fg(3)742 979 y Fh(;)g(:)g(:)g(:)e Fk(.)18 b(An)o(y)c(fu)o(nct)o(ion)g(of)g(elem)o(en)o(t)o(s)g(of)f(t)n (h)o(a)o(t)h(s)q(equence)i(m)o(ay)d(s)q(erv)o(e)0 1029 y(as)f(a)g(t)o(e)q(st,)h(if)e(it)o(s)h(di)q(str)q(ibu)o(t)o(ion)f(i)q (s)h(kno)o(wn,)f(or)h(ev)o(en)g(if)f(it)o(s)i(di)q(str)q(ibu)o(t)o(ion) e(i)q(s)g(m)o(erely)g(compare)q(d)h(wit)n(h)g(t)n(h)o(a)o(t)g(of)f(ot)n (h)o(er)0 1078 y(RNG's.)23 b(In)16 b(spit)o(e)g(of)f(t)n(h)o(e)i(eas)q (e)g(wit)n(h)f(whic)o(h)f(t)o(e)q(st)o(s)j(of)e(RNG's)f(m)o(ay)f(b)q(e) i(crea)o(t)o(e)q(d,)h(t)n(h)o(ere)h(are)e(surpr)q(i)q(s)q(in)o(gly)f (few)0 1128 y(rep)q(ort)o(e)q(d)h(in)d(t)n(h)o(e)i(lit)o(era)o(t)o (ure.)20 b(Th)o(e)14 b(sam)o(e)f(s)q(imple,)f(eas)q(ily)i(pass)q(e)q(d) h(t)o(e)q(st)o(s)i(are)d(rep)q(ort)o(e)q(d)i(again)d(an)o(d)h(again.)k (Su)o(c)o(h)0 1178 y(i)q(s)13 b(t)n(h)o(e)i(p)q(o)o(w)o(er)f(of)g(t)n (h)o(e)g(pr)q(in)o(t)o(e)q(d)g(w)o(ord.)62 1228 y(A)j(few)f(t)o(e)q(st) o(s)i(w)o(ere)g(sugge)q(st)o(e)q(d)f(in)f(t)n(h)o(e)h(early)g(d)o(ays)g (of)e(m)o(akin)o(g)g(t)o(a)o(ble)q(s)g(of)h(ran)o(dom)f(digit)o(s)h ([5],)f(an)o(d)h(M.)g(D.)0 1278 y(MacLaren)11 b(an)o(d)f(I)h(sugge)q (st)o(e)q(d)h(s)q(ev)o(eral)f(more)f([8].)15 b(Th)o(e)q(s)q(e,)d(an)o (d)e(a)h(few)f(ot)n(h)o(ers,)i(h)o(a)o(v)o(e)f(b)q(ecom)o(e)e(a)i Fj(de)h(facto)e Fk(st)o(an)o(d)o(ard)0 1327 y(s)q(et)18 b(of)e(t)o(e)q(st)o(s,)j(en)n(u)o(m)o(era)o(t)o(e)q(d)f(in)e(Kn)n(u)o (t)n(h's)j(V2,)e([6].)26 b(Kn)n(u)o(t)n(h's)18 b(b)q(o)q(oks)f(are)g (su)o(c)o(h)h(m)o(arv)o(els)d(t)n(h)o(a)o(t)i(t)n(h)o(ey)h(som)o(et)o (im)o(e)q(s)0 1377 y(di)q(scourage)12 b(init)o(ia)o(t)o(iv)o(e|so)f(w)o (ell)g(don)o(e)i(t)n(h)o(a)o(t)g(m)o(an)o(y)d(read)o(ers)15 b(t)o(ak)o(e)e(t)n(h)o(em)f(as)g(gosp)q(el,)h(t)n(h)o(e)g(d)o(e\014nit) o(iv)o(e)g(w)o(ord)f(on)g(t)n(h)o(e)0 1427 y(part)o(icular)h(su)n(b)r (ject)j(trea)o(t)o(e)q(d.)k(An)o(d)13 b(so)h(t)n(h)o(ey)h(are,)f(most)f (of)g(t)n(h)o(e)i(t)o(im)o(e.)62 1477 y(Bu)o(t)f(not,)f(I)g(t)n(hink,)f (for)h(t)o(e)q(st)o(in)o(g)g(ran)o(dom)e(n)n(u)o(m)n(b)q(er)i(gen)o (era)o(t)o(ors.)19 b(An)o(y)o(on)o(e)13 b(wit)n(h)g(a)g(kno)o(wle)q (dge)f(of)h(proba)o(bilit)o(y)0 1527 y(t)n(h)o(eory)k(sh)o(ould)f(b)q (e)h(a)o(ble)e(t)o(o)i(crea)o(t)o(e)h(hi)q(s)e(o)o(wn)g(t)o(e)q(st)o (s.)28 b(If)16 b(t)n(h)o(e)h(RNG)f(i)q(s)g(t)o(o)g(b)q(e)h(us)q(e)q(d)g (for)f(a)g(part)o(icular)g(problem,)0 1577 y(on)o(e)d(sh)o(ould)f(try)h (t)o(o)g(crea)o(t)o(e)i(a)d(t)o(e)q(st)i(bas)q(e)q(d)f(on)g(a)f(s)q (imilar)e(problem)h(for)h(whic)o(h)g(t)n(h)o(e)i(u)o(n)o(d)o(erlyin)o (g)f(di)q(str)q(ibu)o(t)o(ions)g(are)0 1626 y(kno)o(wn,)h(or,)h(lac)o (kin)o(g)f(t)n(h)o(a)o(t,)h(a)o(t)f(least)i(compare)q(d)e(wit)n(h)h(re) q(sul)o(t)o(s)i(pro)q(d)o(u)o(ce)q(d)f(b)o(y)f(wid)o(ely)g(di\013eren)o (t)g(RNG's.)21 b(I)14 b(will)0 1676 y(d)o(e)q(scr)q(ib)q(e)i(s)q(ev)o (eral)f(t)o(e)q(st)o(s)h(t)n(h)o(a)o(t)f(I)f(us)q(e.)21 b(Th)o(ey)15 b(are)g(calle)q(d)f Fc(str)q(in)o(gen)o(t)d Fk(t)o(e)q(st)o(s,)16 b(b)q(eca)n(us)q(e)g(t)n(h)o(ey)f(s)q(eem)g(more) e(di\016cul)o(t)0 1726 y(t)o(o)f(pass)h(t)n(h)o(an)g(t)n(h)o(e)f(mild)e (t)o(e)q(st)o(s)k(t)n(h)o(a)o(t)e(h)o(a)o(v)o(e)g(b)q(ecom)o(e)f(st)o (an)o(d)o(ard.)18 b(Most)13 b(of)f(t)n(h)o(em)f(w)o(ere)i(d)o(ev)o(elo) o(p)q(e)q(d)g(as)f(an)o(alogue)q(s)g(t)o(o)0 1776 y(part)o(icular)g (Mon)o(t)o(e)g(Carlo)g(problems,)f(bu)o(t)i(wit)n(h)g(con)o(dit)o(ions) f(t)n(h)o(a)o(t)g(m)o(ak)o(e)g(\014n)o(din)o(g)g(t)n(h)o(e)h(u)o(n)o(d) o(erlyin)o(g)g(di)q(str)q(ibu)o(t)o(ions)0 1826 y(p)q(oss)q(ible.)0 1899 y(7.)50 b(O)o(VERLAPPING)14 b(M-TUPLE)g(TESTS)62 1949 y(W)m(e)g(illustra)o(t)o(e)f(wit)n(h)h(an)g(example.)i(Cons)q(id)o (er)e(a)g(s)q(equence)i(of)d Fh(n)h Fk(v)n(alue)q(s)g(su)o(c)o(h)g(as) 314 1999 y(5,4,5,0,4,)o(2,7)o(,3,)o(4,)o(1,.)o(..)o(,5,)o(3,)o(6,2)0 2048 y(Sup)o(p)q(os)q(e)k(t)n(h)o(e)q(s)q(e)f(are)g(bas)q(e-8)g(digit)o (s)f(pro)q(d)o(u)o(ce)q(d)i(b)o(y)e(t)n(h)o(e)h(\014rst)h(3)e(bit)o(s)h (of)f Fh(n)g Fk(calls)g(t)o(o)h(a)f(RNG.)f(A)i(st)o(an)o(d)o(ard)g(t)o (e)q(st)0 2098 y(w)o(ould)12 b(us)q(e)i(P)o(earson's)g(c)o(hi-square,) 570 2067 y Fb(P)613 2098 y Fk(\(OBS)8 b Fd(\000)g Fk(EXP)q(\))865 2083 y Fg(2)883 2098 y Fh(=)p Fk(EXP)q(,)k(on)h(t)n(h)o(e)g(in)o(divid) o(ual)e(digit)o(s,)h(on)h(non-o)o(v)o(erlap)o(pin)o(g)0 2148 y(pairs,)i(tr)q(iple)q(s,)f(et)o(c.)22 b(t)o(o)15 b(s)q(ee)h(if)e(t)n(h)o(e)h(obs)q(erv)o(e)q(d)i(w)o(ere)f(sa)o(t)o(i)q (sf)q(act)o(or)q(ily)d(clos)q(e)i(t)o(o)g(t)n(h)o(e)h(exp)q(ect)o(e)q (d)g(f)q(requencie)q(s.)23 b(Su)o(c)o(h)0 2198 y(are)14 b(t)o(ypical)f(t)o(e)q(st)o(s)j(of)d(RNG's:)k(s)q(imple)12 b(an)o(d)h(eas)q(ily)h(pass)q(e)q(d.)62 2248 y(As)d(a)f(m)o(eans)g(t)o (o)h(t)o(e)q(st)g(in)o(d)o(ep)q(en)o(d)o(ence)i(as)d(w)o(ell)g(as)g(u)o (niformit)o(y)m(,)e(sup)o(p)q(os)q(e)k(w)o(e)f(\014rst)g(m)o(ak)o(e)e (t)n(h)o(e)i(s)q(equence)i(circular)0 2298 y(b)o(y)h(adjoinin)o(g)e(t)n (h)o(e)j(\014rst)g(t)o(w)o(o)e(elem)o(en)o(t)o(s)h(t)o(o)g(t)n(h)o(e)h (en)o(d,)f(get)n(t)o(in)o(g)314 2347 y(5,4,5,0,4,)o(2,7)o(,3,)o(4,)o (1,.)o(..)o(,5,)o(3,)o(6,2)o(,5,)o(4)0 2397 y(\(t)n(hi)q(s)f(h)o(as)g (an)g(asympt)o(ot)o(ically)d(n)o(egligible)h(e\013ect,)j(bu)o(t)g(it)f (m)o(ak)o(e)q(s)f(d)o(er)q(ivin)o(g)h(t)n(h)o(e)g(su)n(bs)q(equen)o(t)j (co)o(v)n(ar)q(iance)c(m)o(a)o(tr)q(ix)0 2447 y(m)n(u)o(c)o(h)h(s)q (impler\).)62 2497 y(No)o(w)h(cons)q(id)o(er)h(t)n(h)o(e)f(n)g(tr)q (iple)q(s)g(form)o(e)q(d)e(b)o(y)i(su)o(cce)q(ss)q(iv)o(e)i(elem)o(en)o (t)o(s)e(of)f(t)n(h)o(a)o(t)h(s)q(equence:)300 2547 y (\(5,4,5\),\(4,5,0\),)o(..)o(.,)o(\(3,6,)o(2\),\(6)o(,2,)o(5\),\(2,)o (5,)o(4\).)62 2596 y(Let)i Fh(w)168 2602 y Ff(ij)r(k)231 2596 y Fk(b)q(e)f(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)g(of)e(t)o(im)o(e)q(s) h(t)n(h)o(e)h(tr)q(iple)e(\()p Fh(i;)7 b(j;)g(k)q Fk(\))15 b(ap)o(p)q(ears)h(in)f(t)n(hi)q(s)h(s)q(equence)h(of)e Fh(n)g Fk(tr)q(iple)q(s.)22 b(If)15 b Fh(n)h Fk(i)q(s)890 2757 y(5)p eop %%Page: 6 6 6 5 bop 0 -41 a Fk(large,)11 b(t)n(h)o(e)i(512)d(ran)o(dom)g(v)n(ar)q (ia)o(ble)q(s)g Fh(w)600 -35 y Ff(ij)r(k)659 -41 y Fk(sh)o(ould)i(b)q (e)f(join)o(t)n(ly)f(norm)o(al)g(wit)n(h)h(m)o(eans)g Fh(\026)1344 -35 y Ff(ij)r(k)1404 -41 y Fk(=)g Fh(n=)p Fk(512)g(an)o(d)g(a)g(cert)o(ain)0 9 y(co)o(v)n(ar)q(iance)i(m)o(a)o (tr)q(ix)f Fh(C)s Fk(.)18 b(If)13 b Fh(C)472 -6 y Fe(\000)528 9 y Fk(i)q(s)g(an)o(y)g(w)o(eak)i(in)o(v)o(ers)q(e)f(of)g Fh(C)s Fk(,)f Fh(C)s(C)1063 -6 y Fe(\000)1090 9 y Fh(C)h Fk(=)e Fh(C)s Fk(,)h(t)n(h)o(en)h(t)n(h)o(e)h(quadra)o(t)o(ic)e(form:) 578 67 y Fb(X)638 106 y Fk(\()p Fh(w)684 112 y Ff(ij)r(k)741 106 y Fd(\000)c Fh(\026)807 112 y Ff(ij)r(k)855 106 y Fk(\))p Fh(c)889 88 y Fe(\000)889 119 y Ff(ij)r(k)q(;r)q(st)991 106 y Fk(\()p Fh(w)1037 112 y Ff(r)q(st)1093 106 y Fd(\000)g Fh(\026)1159 112 y Ff(r)q(st)1206 106 y Fk(\))0 208 y(i)q(s)19 b(in)o(v)n(ar)q(ian)o(t)f(u)o(n)o(d)o(er)j(c)o(h)o(oice)f(of)f(w)o(eak) h(in)o(v)o(ers)q(e)h Fh(C)819 192 y Fe(\000)866 208 y Fk(an)o(d)e(h)o(as)h(\(asympt)o(ot)o(ically\))d(a)j(c)o(hi-square)g(di) q(str)q(ibu)o(t)o(ion)0 257 y(wit)n(h)d(d)o(egree)q(s)j(of)d(f)q(ree)q (dom)f(t)n(h)o(e)i(asympt)o(ot)o(ic)e(rank)i(of)f Fh(C)s Fk(.)28 b(Thi)q(s)17 b(pro)o(vid)o(e)q(s)h(a)f(t)o(e)q(st)h(for)f(b)q (ot)n(h)h(u)o(niformit)o(y)d(an)o(d)0 307 y(in)o(d)o(ep)q(en)o(d)o (ence)h(of)d(su)o(cce)q(ss)q(iv)o(e)i(v)n(alue)q(s)f(pro)q(d)o(u)o(ce)q (d)h(b)o(y)e(t)n(h)o(e)h(RNG.)f(Of)g(cours)q(e,)i(an)o(y)e(s)q(et)h(of) f(t)n(hree)i(bit)o(s)f(ot)n(h)o(er)h(t)n(h)o(an)0 357 y(t)n(h)o(e)g(\014rst)g(t)n(hree)g(could)f(s)q(erv)o(e)h(for)e(t)n(h)o (e)i(t)o(e)q(st,)f(or)g(s)q(et)o(s)i(of)d(four)h(bit)o(s,)g(et)o(c.)62 407 y(Th)o(e)e(a)o(b)q(o)o(v)o(e)f(quadra)o(t)o(ic)f(form)g(t)o(ur)q (ns)h(ou)o(t)h(t)o(o)g(b)q(e)f(rem)o(ar)o(ka)o(bly)e(easy)j(t)o(o)g(ev) n(alua)o(t)o(e.)k(Here)d(i)q(s)e(t)n(h)o(e)h(rule:)17 b(Compu)o(t)o(e)0 457 y Fh(Q)33 463 y Fg(3)51 457 y Fk(,)d(t)n(h)o(e)g (quadra)o(t)o(ic)g(form)e(on)o(e)i(w)o(ould)f(us)q(e)h(if)f(n)o(aiv)o (ely)g(ap)o(plyin)o(g)g(P)o(earson's)i(t)o(e)q(st)g(t)o(o)f(t)n(h)o(e)g (3-t)o(uple)q(s:)642 554 y Fh(Q)675 560 y Fg(3)705 554 y Fk(=)751 515 y Fb(X)749 604 y Ff(i;j;k)813 554 y Fk(\()p Fh(w)859 560 y Ff(ij)r(k)915 554 y Fd(\000)c Fh(\026)982 560 y Ff(ij)r(k)1029 554 y Fk(\))1045 537 y Fg(2)1064 554 y Fh(=\026)1110 560 y Ff(ij)r(k)0 688 y Fk(Th)o(en)k(compu)o(t)o(e) g Fh(Q)307 694 y Fg(2)325 688 y Fk(,)g(t)n(h)o(e)g(n)o(aiv)o(e)g (quadra)o(t)o(ic)f(form)f(for)i(t)o(e)q(st)o(in)o(g)g(pairs:)666 785 y Fh(Q)699 791 y Fg(2)729 785 y Fk(=)773 746 y Fb(X)784 834 y Ff(i;j)833 785 y Fk(\()p Fh(w)879 791 y Ff(ij)917 785 y Fd(\000)c Fh(\026)984 791 y Ff(ij)1013 785 y Fk(\))1029 768 y Fg(2)1048 785 y Fh(=\026)1094 791 y Ff(ij)1123 785 y Fh(;)0 921 y Fk(wh)o(ere)15 b Fh(w)149 927 y Ff(ij)193 921 y Fk(i)q(s)e(t)n(h)o(e)i(n)n(u)o(m)n(b)q(er)f(of)g(o)q(ccurrence)q (s)k(of)13 b(t)n(h)o(e)i(o)o(v)o(erlap)o(pin)o(g)f(pair)g(\()p Fh(i;)7 b(j)r Fk(\))14 b(in)g(t)n(h)o(e)h(or)q(igin)o(al)d(s)q (equence.)22 b(Th)o(en)0 971 y(t)n(h)o(e)14 b(gen)o(eral)f(quadra)o(t)o (ic)f(form)g(in)g(t)n(h)o(e)i(w)o(eak)f(in)o(v)o(ers)q(e)h Fh(C)878 956 y Fe(\000)905 971 y Fk(,)f(a)o(b)q(o)o(v)o(e,)f(re)q(d)o (u)o(ce)q(s)j(t)o(o)f Fh(Q)1287 977 y Fg(3)1312 971 y Fd(\000)8 b Fh(Q)1385 977 y Fg(2)1416 971 y Fk(an)o(d)13 b(i)q(s)g(asympt)o(ot)o(ically)0 1021 y(c)o(hi-square)h(wit)n(h)g(8)310 1006 y Fg(3)338 1021 y Fd(\000)9 b Fk(8)400 1006 y Fg(2)433 1021 y Fk(d)o(egree)q(s)16 b(of)d(f)q(ree)q(dom.)62 1070 y(More)h(gen)o(erally)m(,)d(t)n(hi)q(s)i(i)q(s)f(t)n(h)o(e)i(o)o(v)o (erlap)o(pin)o(g)e(3-t)o(uple)g(t)o(e)q(st)i(for)e(iid)g(s)q(equence)q (s:)20 b(Let)13 b Fh(v)1397 1076 y Fg(1)1416 1070 y Fh(;)7 b(v)1455 1076 y Fg(2)1473 1070 y Fh(;)g(:)g(:)g(:)k Fk(b)q(e)h(a)h(s)q (equence)0 1120 y(of)18 b(in)o(d)o(ep)q(en)o(d)o(en)o(t)h(ran)o(dom)e (v)n(ar)q(ia)o(ble)q(s)f(t)o(akin)o(g)i(v)n(alue)q(s)g(1)p Fh(;)7 b Fk(2)p Fh(;)g(:)g(:)g(:)t(;)g(b)18 b Fk(wit)n(h)g(proba)o (bilit)o(ie)q(s)f Fh(p)1427 1126 y Fg(1)1446 1120 y Fh(;)7 b(p)1486 1126 y Fg(2)1504 1120 y Fh(;)g(:)g(:)g(:)t(;)g(p)1617 1126 y Ff(b)1633 1120 y Fk(.)32 b(If)18 b Fh(w)1753 1126 y Ff(ij)r(k)0 1170 y Fk(an)o(d)d Fh(w)111 1176 y Ff(ij)156 1170 y Fk(are,)g(re)q(sp.,)i(t)n(h)o(e)f(n)n(u)o(m)n(b)q(er)f(of)g(t)o (im)o(e)q(s)f(t)n(h)o(e)j(tr)q(iple)d(\()p Fh(i;)7 b(j;)g(k)q Fk(\))15 b(an)o(d)g(t)n(h)o(e)i(dou)n(ble)e(\()p Fh(i;)7 b(j)r Fk(\))16 b(ap)o(p)q(ear)f(in)h(a)f(circular)0 1220 y(s)q(equence)h(of)d Fh(n)h(v)q Fk('s,)g(\()p Fh(v)370 1226 y Fg(1)389 1220 y Fh(;)7 b(v)428 1226 y Fg(2)460 1220 y Fk(adjoin)o(e)q(d)13 b(t)o(o)h(get)g Fh(v)766 1226 y Fg(1)785 1220 y Fh(;)7 b(v)824 1226 y Fg(2)842 1220 y Fh(;)g(v)881 1226 y Fg(3)899 1220 y Fh(;)g(:)g(:)g(:)e(;)i(v) 1012 1226 y Ff(n)1034 1220 y Fh(;)g(v)1073 1226 y Fg(1)1092 1220 y Fh(;)g(v)1131 1226 y Fg(2)1149 1220 y Fk(\))14 b(t)n(h)o(en)355 1280 y Fb(X)353 1369 y Ff(i;j;k)416 1320 y Fk(\()p Fh(w)462 1326 y Ff(ij)r(k)519 1320 y Fd(\000)9 b Fh(np)606 1326 y Ff(i)620 1320 y Fh(p)641 1326 y Ff(j)658 1320 y Fh(p)679 1326 y Ff(k)700 1320 y Fk(\))716 1302 y Fg(2)735 1320 y Fh(=)p Fk(\()p Fh(np)818 1326 y Ff(i)831 1320 y Fh(p)852 1326 y Ff(j)869 1320 y Fh(p)890 1326 y Ff(k)911 1320 y Fk(\))g Fd(\000)978 1280 y Fb(X)989 1369 y Ff(i;j)1038 1320 y Fk(\()p Fh(w)1084 1326 y Ff(ij)1122 1320 y Fd(\000)g Fh(np)1209 1326 y Ff(i)1223 1320 y Fh(p)1244 1326 y Ff(j)1261 1320 y Fk(\))1277 1302 y Fg(2)1296 1320 y Fh(=)p Fk(\()p Fh(np)1379 1326 y Ff(i)1393 1320 y Fh(p)1414 1326 y Ff(j)1431 1320 y Fk(\))0 1459 y(i)q(s)18 b(asympt)o(ot)o(ically) e(c)o(hi)q(square)i(wit)n(h)h Fh(b)632 1444 y Fg(3)662 1459 y Fd(\000)13 b Fh(b)725 1444 y Fg(2)762 1459 y Fk(d)o(egree)q(s)20 b(of)e(f)q(ree)q(dom)f(an)o(d)h(sh)o(ould)h(b)q(e)f(us)q(e)q(d)h(t)o(o) g(t)o(e)q(st)h(for)e(b)q(ot)n(h)0 1509 y(u)o(niformit)o(y)12 b(an)o(d)h(in)o(d)o(ep)q(en)o(d)o(ence)j(for)e(t)n(h)o(e)g(s)q(equence) i Fh(v)861 1515 y Fg(1)880 1509 y Fh(;)7 b(v)919 1515 y Fg(2)937 1509 y Fh(;)g(:)g(:)g(:)e Fk(.)62 1558 y(A)15 b(s)q(imilar)d(re)q(sul)o(t)k(h)o(olds)e(for)g(t)o(e)q(st)o(in)o(g,)i (say)m(,)e(o)o(v)o(erlap)o(pin)o(g)g(4-t)o(uple)q(s:)19 b(t)n(h)o(e)d(quadra)o(t)o(ic)e(form)f Fh(Q)1547 1564 y Fg(4)1575 1558 y Fd(\000)d Fh(Q)1650 1564 y Fg(3)1683 1558 y Fk(sh)o(ould)0 1608 y(b)q(e)16 b(c)o(hi-square)h(wit)n(h)f Fh(b)370 1593 y Fg(4)399 1608 y Fd(\000)11 b Fh(b)460 1593 y Fg(3)494 1608 y Fk(d)o(egree)q(s)19 b(of)c(f)q(ree)q(dom,)g(wh)o (ere)j Fh(Q)1021 1614 y Fg(4)1055 1608 y Fk(i)q(s)e(t)n(h)o(e)1170 1577 y Fb(P)1214 1608 y Fk(\(OBS)c Fd(\000)f Fk(EXP\))1472 1593 y Fg(2)1491 1608 y Fh(=)p Fk(EXP)17 b(on)o(e)f(w)o(ould)0 1658 y(get)e(b)o(y)g(n)o(aiv)o(e)f(ap)o(plica)o(t)o(ion)f(of)h(P)o (earson's)i(t)o(e)q(st)g(t)o(o)f(t)n(h)o(e)h(o)o(v)o(erlap)o(pin)o(g)e (4-t)o(uple)g(cou)o(n)o(t)o(s,)i(an)o(d)e Fh(Q)1490 1664 y Fg(3)1523 1658 y Fk(et)o(c.)62 1708 y(Th)o(e)f(t)o(e)q(st)g(re)q(sul) o(t)o(s)h(MTUPLE,)f(m)o(en)o(t)o(ion)o(e)q(d)d(b)q(elo)o(w,)i(are)g (bas)q(e)q(d)h(on)f(o)o(v)o(erlap)o(pin)o(g)f(3-t)o(uple)q(s)h(for)g (bit)o(s)h(1,2,3)d(t)n(h)o(en)0 1758 y(for)k(bit)o(s)h(2,3,4)d(t)n(h)o (en)j(3,4,5)e(an)o(d)h(so)g(on,)g(for)g(eac)o(h)h(su)o(cce)q(ss)q(iv)o (e)i(t)n(hree)e(bit)o(s)g(of)f(t)n(h)o(e)h(compu)o(t)o(er)f(w)o(ords)h (pro)q(d)o(u)o(ce)q(d)g(b)o(y)0 1807 y(t)n(h)o(e)h(RNG)e(b)q(e)q(in)o (g)h(t)o(e)q(st)o(e)q(d.)62 1857 y(Anot)n(h)o(er)g(example)d(of)h(t)n (h)o(e)h(o)o(v)o(erlap)o(pin)o(g)f(m-t)o(uple)f(t)o(e)q(st)i(i)q(s)f (bas)q(e)q(d)i(on)e(o)o(v)o(erlap)o(pin)o(g)g(pairs)g(in)h(t)n(h)o(e)g (circular)g(li)q(st)0 1907 y Fh(v)20 1913 y Fg(1)39 1907 y Fh(;)7 b(v)78 1913 y Fg(2)96 1907 y Fh(;)g(:)g(:)g(:)e(;)i(v)209 1913 y Ff(n)231 1907 y Fh(;)g(v)270 1913 y Fg(1)288 1907 y Fh(;)g(v)327 1913 y Fg(2)345 1907 y Fk(,)15 b(wit)n(h)f(t)n(h)o(e)i Fh(v)q Fk('s)f(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)e(of)g(1's)h(in)f(t)n(h)o (e)i(\014rst)f(s)q(ix)f(bit)o(s)i(of)e(compu)o(t)o(er)h(w)o(ords)g(pro) q(d)o(u)o(ce)q(d)0 1957 y(b)o(y)d(a)h(RNG.)e(Th)o(en)i(t)n(h)o(e)g Fh(v)q Fk('s)g(t)o(ak)o(e)g(v)n(alue)q(s)f(0)g(t)o(o)h(6)f(wit)n(h)h (corre)q(sp)q(on)o(din)o(g)h(binomial)9 b(proba)o(bilit)o(ie)q(s.)17 b(Th)o(e)12 b(quadra)o(t)o(ic)0 2007 y(form)18 b Fh(Q)137 2013 y Fg(2)168 2007 y Fd(\000)13 b Fh(Q)246 2013 y Fg(1)284 2007 y Fk(sh)o(ould)19 b(b)q(e)h(c)o(hi-square)g(di)q(str)q(ibu)o(t)o (e)q(d)f(wit)n(h)h(49)12 b Fd(\000)h Fk(7)21 b(=)g(42)e(d)o(egree)q(s)i (of)e(f)q(ree)q(dom.)34 b(F\(r,s,)p Fd(\010)p Fk(\))0 2057 y(gen)o(era)o(t)o(ors)16 b(f)q(ail)c(su)o(c)o(h)i(t)o(e)q(st)o(s)i (u)o(nle)q(ss)g Fh(r)e Fk(i)q(s)g(quit)o(e)f(large.)0 2130 y(8.)32 b(O)o(VERLAPPING-PERMUT)m(A)m(TION)13 b(TESTS)62 2180 y(Th)o(e)q(s)q(e)j(t)o(e)q(st)o(s)i(are)d(example)q(s)f(of)h(o)o (v)o(erlap)o(pin)o(g)f(m-t)o(uple)f(t)o(e)q(st)o(s)k(for)e(whic)o(h)g (elem)o(en)o(t)o(s)g(of)f(t)n(h)o(e)i(o)o(v)o(erlap)o(pin)o(g)f(m-)0 2230 y(t)o(uple)q(s)d(are)f(not)h(in)o(d)o(ep)q(en)o(d)o(en)o(t,)g(or)f (ev)o(en)h(su)o(cce)q(ss)q(iv)o(e)i(st)o(a)o(t)o(e)q(s)f(of)d(a)i(Mar)o (k)o(o)o(v)f(c)o(h)o(ain:)16 b(Let)c Fh(u)1387 2236 y Fg(1)1405 2230 y Fh(;)7 b(u)1448 2236 y Fg(2)1466 2230 y Fh(;)g(u)1509 2236 y Fg(3)1527 2230 y Fh(;)g(:)g(:)g(:)i Fk(b)q(e)j(u)o(niform)0 2279 y(v)n(ar)q(ia)o(t)o(e)q(s)e(pro)q(d)o(u)o (ce)q(d)h(b)o(y)g(a)f(RNG.)f(Eac)o(h)i(of)e(t)n(h)o(e)i(o)o(v)o(erlap)o (pin)o(g)f(3-t)o(uple)q(s)g(\()p Fh(u)1147 2285 y Fg(1)1166 2279 y Fh(;)d(u)1209 2285 y Fg(2)1227 2279 y Fh(;)g(u)1270 2285 y Fg(3)1287 2279 y Fk(\))p Fh(;)g Fk(\()p Fh(u)1362 2285 y Fg(2)1381 2279 y Fh(;)g(u)1424 2285 y Fg(3)1441 2279 y Fh(;)g(u)1484 2285 y Fg(4)1502 2279 y Fk(\))p Fh(;)g Fk(\()p Fh(u)1577 2285 y Fg(3)1595 2279 y Fh(;)g(u)1638 2285 y Fg(4)1656 2279 y Fh(;)g(u)1699 2285 y Fg(5)1717 2279 y Fk(\))p Fh(;)g(:)g(:)g(:)0 2329 y Fk(i)q(s)13 b(in)h(on)o(e)g(of)f(s)q(ix)g(p)q(oss)q(ible)h(st)o(a)o(t)o(e)q(s:)300 2379 y Fh(S)325 2385 y Fg(1)344 2379 y Fk(:)k Fh(x)11 b(<)h(y)i(<)d(z)r Fk(;)28 b Fh(S)616 2385 y Fg(2)635 2379 y Fk(:)18 b Fh(x)11 b(<)h(z)h(<)f(y)q Fk(;)28 b Fh(S)906 2385 y Fg(3)925 2379 y Fk(:)18 b Fh(y)c(<)e(x)f(<)h(z)300 2429 y(S)325 2435 y Fg(4)344 2429 y Fk(:)18 b Fh(y)13 b(<)f(z)i(<)e(x)p Fk(;)27 b Fh(S)616 2435 y Fg(5)635 2429 y Fk(:)18 b Fh(z)13 b(<)f(x)f(<)h(y)q Fk(;)28 b Fh(S)906 2435 y Fg(6)925 2429 y Fk(:)18 b Fh(z)c(<)e(y)h(<)f(x)p Fk(.)62 2528 y(Th)n(us)j(o)o(v)o(erlap)o(pin)o(g)e(tr)q(iple)q(s)h(of)f Fh(u)p Fk('s)g(lead)h(t)o(o)h(a)e(s)q(equence)j(of)d(st)o(a)o(t)o(e)q (s)i(su)o(c)o(h)g(as)314 2578 y(3)p Fh(;)7 b Fk(3)p Fh(;)g Fk(2)p Fh(;)g Fk(5)p Fh(;)g Fk(1)o Fh(;)g Fk(4)p Fh(;)f Fk(3)p Fh(;)g(::)o(:;)g Fk(3)p Fh(;)h Fk(2)o Fh(;)g Fk(5)o Fh(;)g(:)f(:)h(:)890 2757 y Fk(6)p eop %%Page: 7 7 7 6 bop 0 -41 a Fk(If)14 b Fh(w)72 -35 y Ff(ij)r(k)133 -41 y Fk(repre)q(s)q(en)o(t)o(s)k(t)n(h)o(e)c(n)n(u)o(m)n(b)q(er)g(of)g (t)o(im)o(e)q(s)f(t)n(h)o(a)o(t)h(t)n(h)o(e)h(su)o(cce)q(ss)q(iv)o(e)i (st)o(a)o(t)o(e)q(s)e Fh(i;)7 b(j;)g(k)15 b Fk(ap)o(p)q(ear)f(in)g(t)n (h)o(e)h(st)o(a)o(t)o(e)f(s)q(equence,)0 9 y(t)n(h)o(en)578 19 y Fb(X)638 59 y Fk(\()p Fh(w)684 65 y Ff(ij)r(k)741 59 y Fd(\000)9 b Fh(\026)807 65 y Ff(ij)r(k)855 59 y Fk(\))p Fh(c)889 41 y Fe(\000)889 71 y Ff(ij)r(k)q(;r)q(st)991 59 y Fk(\()p Fh(w)1037 65 y Ff(r)q(st)1093 59 y Fd(\000)g Fh(\026)1159 65 y Ff(r)q(st)1206 59 y Fk(\))0 139 y(will)14 b(h)o(a)o(v)o(e,)i(asympt)o(ot)o(ically)m(,)c(a)k(c)o(hi-square)g(di)q (str)q(ibu)o(t)o(ion.)23 b(Th)o(e)16 b(m)o(eans)f(an)o(d)h(co)o(v)n(ar) q(iance)f(m)o(a)o(tr)q(ix)f Fh(C)s Fk(,)h(an)o(d)g(an)o(y)0 189 y(w)o(eak)k(in)o(v)o(ers)q(e)h Fh(C)286 174 y Fe(\000)333 189 y Fk(m)n(ust)e(b)q(e)h(fou)o(n)o(d.)33 b(I)19 b(h)o(a)o(v)o(e)g (fou)o(n)o(d)g(t)n(h)o(e)q(s)q(e)h(for)f(3-,4-)f(an)o(d)g(5-p)q(erm)n (u)o(t)o(a)o(t)o(ions.)32 b(Th)o(e)q(s)q(e)20 b(t)o(e)q(st)o(s,)0 239 y(d)o(e)q(s)q(ign)o(a)o(t)o(e)q(d)d(OPERM)f(b)q(elo)o(w,)g(are)h (not)f(v)o(ery)h(str)q(in)o(gen)o(t;)g(most)f(gen)o(era)o(t)o(ors)i(s)q (eem)e(t)o(o)h(pass)g(t)n(h)o(em,)f(except)h(for)0 289 y(F\(r,s,)p Fd(\010)p Fk(\).)0 362 y(9.)32 b(THE)14 b(OPSO)g(TEST)62 412 y(OPSO)h(m)o(eans)e(o)o(v)o(erlap)o(pin)o(g-pairs-spars)q(e-o)q (ccupancy)m(,)g(a)g(t)o(e)q(st)i(d)o(evi)q(s)q(e)q(d)f(t)o(o)g(o)o(v)o (ercom)o(e)f(t)n(h)o(e)h(problem)d(of)i(t)n(h)o(e)0 462 y(h)n(uge)18 b(sample)q(s)e(n)o(ece)q(ssary)k(for)d(t)n(h)o(e)h(o)o(v)o (erlap)o(pin)o(g-pairs)e(t)o(e)q(st)o(s,)k(wh)o(en)d(t)n(h)o(e)h(n)n(u) o(m)n(b)q(er)f(of)g(p)q(oss)q(ible)g(pairs)h(i)q(s)e(v)o(ery)0 511 y(large.)28 b(F)m(or)18 b(example,)e(if)g(w)o(e)i(us)q(e)g(t)n(h)o (e)g(\014rst)h(11)e(bit)o(s)h(of)f(su)o(cce)q(ss)q(iv)o(e)i(w)o(ords)f (pro)q(d)o(u)o(ce)q(d)h(b)o(y)e(a)g(RNG)g(t)o(o)g(giv)o(e)g(a)0 561 y(s)q(equence)f(of)e(in)o(t)o(egers)i(in)e(t)n(h)o(e)h(ran)o(ge)g (0)f(t)o(o)h(2047,)e(an)o(d)h(w)o(an)o(t)g(t)o(o)h(us)q(e)g(t)n(h)o(e)g (o)o(v)o(erlap)o(pin)o(g)f(2-t)o(uple)g(t)o(e)q(st,)h(w)o(e)g(w)o(ould) 0 611 y(n)o(ee)q(d)f(som)o(e)f(2)220 596 y Fg(26)268 611 y Fk(calls)g(t)o(o)h(t)n(h)o(e)g(RNG)f(in)g(ord)o(er)i(t)n(h)o(a)o (t)e(t)n(h)o(e)h(cou)o(n)o(t)o(s)h Fh(w)1054 617 y Ff(ij)1097 611 y Fk(b)q(e)e(sa)o(t)o(i)q(sf)q(act)o(or)q(ily)f(clos)q(e)i(t)o(o)g (join)o(t)n(ly)e(norm)o(al)0 661 y(wit)n(h)k(t)n(h)o(e)g(d)o(er)q(iv)o (e)q(d)g(co)o(v)n(ar)q(iance)g(m)o(a)o(tr)q(ix.)21 b(Inst)o(ead,)c(sup) o(p)q(os)q(e)g(w)o(e)f(en)o(vi)q(s)q(ion)e(2)1236 646 y Fg(22)1286 661 y Fk(cells,)i(eac)o(h)h(asso)q(cia)o(t)o(e)q(d)g(wit)n (h)e(a)0 711 y(part)o(icular)e(pair)g Fh(i;)7 b(j)15 b Fk(an)o(d)e(cons)q(id)o(er)h(t)n(hi)q(s)g(gen)o(eralize)q(d)g(o)q (ccupancy)g(problem:)i(for)d(eac)o(h)i(su)o(cce)q(ss)q(iv)o(e)g(pair)e Fh(i;)7 b(j)16 b Fk(w)o(e)0 761 y(place)e(a)g(ball)f(in)h(t)n(h)o(e)h (ap)o(pro)o(pr)q(ia)o(t)o(e)e(cell.)19 b(If)14 b Fh(x)717 767 y Fg(0)735 761 y Fh(;)7 b(x)778 767 y Fg(1)796 761 y Fh(;)g(x)839 767 y Fg(2)871 761 y Fk(are,)14 b(re)q(sp.,)h(t)n(h)o(e) g(n)n(u)o(m)n(b)q(er)f(of)f(cells)i(wit)n(h)f(0,1,2)e(balls)i(t)n(h)o (en,)0 810 y(wit)n(h)f(v)o(ery)g(large)g Fh(n)p Fk(,)g(w)o(e)g(exp)q (ect)h(t)n(h)o(a)o(t)f Fh(x)632 816 y Fg(0)650 810 y Fh(;)7 b(x)693 816 y Fg(1)711 810 y Fh(;)g(x)754 816 y Fg(2)785 810 y Fk(will)k(b)q(e)i(join)o(t)n(ly)f(norm)o(al)f(wit)n(h) i(m)o(eans)f(an)o(d)h(co)o(v)n(ar)q(iance)f(m)o(a)o(tr)q(ix)0 860 y(t)o(o)g(b)q(e)f(calcula)o(t)o(e)q(d.)17 b(Wit)n(h)12 b(m)o(y)d(st)o(ud)o(en)o(t,)k(L.)e(H.)g(Tsay)m(,)g(I)g(fou)o(n)o(d)h(t) n(h)o(e)g(m)o(eans)f(an)o(d)g(co)o(v)n(ar)q(iance)q(s)g(som)o(e)g(y)o (ears)h(ago.)17 b(It)0 910 y(t)o(ur)q(n)o(e)q(d)c(ou)o(t,)g(h)o(o)o(w)o (ev)o(er,)g(t)n(h)o(a)o(t)g(us)q(in)o(g)f(just)h Fh(x)682 916 y Fg(0)701 910 y Fk(,)f(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)g(of)f(empt) o(y)g(cells,)g(s)q(erv)o(e)q(d)j(as)d(a)h(go)q(o)q(d)f(t)o(e)q(st)i (for)e(RNG's.)0 960 y(Here)j(are)g(a)e(few)h(example)q(s)f(of)g(t)n(h)o (e)i(re)q(sul)o(t)o(in)o(g)g(OPSO)f(t)o(e)q(st:)62 1010 y(Th)o(e)i(\014rst)f(10)g(bit)o(s)g(f)q(rom)e(eac)o(h)j(of)f(2)637 995 y Fg(21)686 1010 y Fk(calls)g(t)o(o)g(t)n(h)o(e)h(Sup)q(er-Dup)q (er)f(RNG)g(pro)q(d)o(u)o(ce)q(d)h(a)e(circular)i(li)q(st)e(of)g(2)1765 995 y Fg(21)0 1059 y Fk(in)o(t)o(egers)g(in)e(t)n(h)o(e)i(ran)o(ge)f(0) g(t)o(o)g(1023,)e(an)o(d)i(\\placin)o(g)e(a)i(ball")e(in)i(cell\()p Fh(i;)7 b(j)r Fk(\))13 b(for)f(eac)o(h)i(o)o(v)o(erlap)o(pin)o(g)e (pair)h Fh(i;)7 b(j)15 b Fk(yield)o(e)q(d)0 1109 y(141,711)d(empt)o(y)h (cells.)18 b(Su)n(btract)o(in)o(g)d(t)n(h)o(e)f(m)o(ean,)f Fh(\026)e Fk(=)h(141909,)g(an)o(d)h(dividin)o(g)g(b)o(y)h Fh(\033)e Fk(=)g(290)p Fh(:)p Fk(46)g(pro)q(d)o(u)o(ce)q(d)j(wh)o(a)o (t)0 1159 y(sh)o(ould)f(h)o(a)o(v)o(e)g(b)q(een)g(a)g(st)o(an)o(d)o (ard)g(norm)o(al)e(v)n(ar)q(ia)o(t)o(e,)h(v)n(alue)g(-.682.)k(P)o (erformin)o(g)c(t)n(h)o(e)i(t)o(e)q(st)g(four)f(t)o(im)o(e)q(s)f(yield) o(e)q(d)h(t)n(h)o(e)0 1209 y(v)n(alue)q(s)g(-.682,)e(.32,)g(-1.09,)g (-.84.)17 b(Quit)o(e)d(sa)o(t)o(i)q(sf)q(act)o(ory)m(.)62 1259 y(Bu)o(t)j(four)e(s)q(imilar)e(v)n(alue)q(s)i(f)q(rom)e(t)n(h)o(e) k(con)o(gruen)o(t)o(ial)e(RNG)g Fh(x)1040 1265 y Ff(n)1076 1259 y Fk(=)g(62605)p Fh(x)1252 1265 y Ff(n)p Fe(\000)p Fg(1)1326 1259 y Fk(+)10 b(113218009)g(mo)q(d)g(2)1679 1244 y Fg(29)1729 1259 y Fk(\(t)n(h)o(e)0 1308 y(Ber)o(k)o(eley)18 b(Unix)d(P)o(ascal)h(RNG\))f(pro)q(d)o(u)o(ce)q(d)i(1.81,)e(1.92,)g (2.15,)g(3.36.)23 b(Not)16 b(so)g(go)q(o)q(d.)24 b(Thi)q(s)15 b(con)o(gruen)o(t)o(ial)h(gen-)0 1358 y(era)o(t)o(or)g(f)q(ails)c(t)n (h)o(e)k(OPSO)f(t)o(e)q(st,)g(bu)o(t)g(not)f(sp)q(ect)o(acularly)m(.)20 b(Th)o(e)15 b(con)o(gruen)o(t)o(ial)f(RNG)f Fh(x)1369 1364 y Ff(n)1404 1358 y Fk(=)g(69069)p Fh(x)1578 1364 y Ff(n)p Fe(\000)p Fg(1)1653 1358 y Fk(mo)q(d)d(2)1765 1343 y Fg(32)0 1408 y Fk(pro)q(d)o(u)o(ce)q(d)16 b(t)n(h)o(e)g(four)e (v)n(alue)q(s)h(4.611,)e(4.682,)g(4.114,)g(5.591|a)g(f)q(ailure)g(b)q (ord)o(er)q(in)o(g)j(on)f(t)n(h)o(e)g(sp)q(ect)o(acular)h(for)e(four)0 1458 y(sup)o(p)q(os)q(e)q(dly)20 b(st)o(an)o(d)o(ard)f(norm)o(al)d(v)n (ar)q(ia)o(t)o(e)q(s.)32 b(F)m(or)18 b(som)o(et)n(hin)o(g)g(really)h (sp)q(ect)o(acular:)28 b(t)n(h)o(e)19 b(F\(17,5,)p Fd(\010)p Fk(\))f(gen)o(era)o(t)o(or)0 1508 y(pro)q(d)o(u)o(ce)q(d)d(v)n(alue)q (s)f(2895.9)e(st)o(an)o(d)o(ard)i(d)o(evia)o(t)o(ions)g(f)q(rom)e(t)n (h)o(e)i(m)o(ean.)62 1558 y(Here)h(i)q(s)d(a)h(sh)o(ort)h(t)o(a)o(ble)e (of)h(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)e(of)h(bit)o(s,)g(t)n(h)o(e)h (sample)e(s)q(ize)h(n,)g(t)n(h)o(e)h(m)o(ean)e Fh(\026)h Fk(an)o(d)g(st)o(an)o(d)o(ard)h(d)o(evia)o(t)o(ion)0 1700 y Fh(\033)h Fk(for)f(s)q(imila)o(r)e(OPSO)i(t)o(e)q(st)o(s:)635 1612 y(Bit)o(s)58 b Fh(n)135 b(\026)166 b(\033)651 1671 y Fk(10)56 b(2)770 1656 y Fg(21)866 1671 y Fk(141)p Fh(;)7 b Fk(909)60 b(290)p Fh(:)p Fk(26)651 1731 y(11)c(2)770 1716 y Fg(22)847 1731 y Fk(1)p Fh(;)7 b Fk(542)p Fh(;)g Fk(998)39 b(638)p Fh(:)p Fk(75)651 1791 y(11)56 b(2)770 1776 y Fg(23)866 1791 y Fk(567)p Fh(;)7 b Fk(639)60 b(580)p Fh(:)p Fk(80)0 1865 y(10.)17 b(P)m(ARKING)d(LOT,)f(LA)m(TTICE)h(AND)g (RELA)m(TED)f(TESTS)62 1915 y(Th)o(e)q(s)q(e)j(t)o(e)q(st)o(s)g(are)f (d)o(e)q(s)q(ign)o(e)q(d)g(t)o(o)f(ass)q(e)q(ss)j(t)n(h)o(e)e(u)o (niformit)o(y)d(of)i(p)q(oin)o(t)o(s)h(in)f(m-space,)f(wh)o(ere)j(co)q (ordin)o(a)o(t)o(e)q(s)f(of)e(t)n(h)o(e)0 1965 y(p)q(oin)o(t)o(s)i(com) o(e)f(f)q(rom)f(su)o(cce)q(ss)q(iv)o(e)k(calls)e(t)o(o)g(a)g(RNG.)e (Con)o(gruen)o(t)o(ial)i(gen)o(era)o(t)o(ors)h(us)q(e)g(it)o(era)o(t)o (e)q(s)g(of)e(a)h(lin)o(ear)g(trans-)0 2014 y(form)o(a)o(t)o(ion)8 b(on)i(t)n(h)o(e)h(r)q(in)o(g)f(of)g(re)q(s)q(id)o(ue)q(s)i(of)e(som)o (e)f(mo)q(d)o(ulus,)g(an)o(d)i(as)f(a)g(cons)q(equence,)j(m-t)o(uple)q (s)c(of)h(p)q(oin)o(t)o(s)h(pro)q(d)o(u)o(ce)q(d)0 2064 y(b)o(y)17 b(t)n(h)o(e)h(gen)o(era)o(t)o(or)g(f)q(all)d(on)i(a)f(la)o (t)n(t)o(ice)i(wit)n(h)e(a)h(h)n(uge)h(u)o(nit)f(cell)g(v)o(olu)o(m)o (e)e([9,10].)25 b(Since)18 b(shift-regi)q(st)o(er)f(gen)o(era)o(t-)0 2114 y(ors)e(also)f(us)q(e)i(it)o(era)o(t)o(e)q(s)f(of)g(a)f(lin)o(ear) h(transform)o(a)o(t)o(ion,)d(t)n(h)o(ere)17 b(migh)o(t)12 b(b)q(e)j(som)o(e)f(sort)h(of)f(regular)q(it)o(y)g(an)o(alogous)g(t)o (o)0 2164 y(t)n(h)o(a)o(t)j(for)f(con)o(gruen)o(t)o(ial)g(gen)o(era)o (t)o(ors,)j(an)o(d)d(t)n(h)o(ere)i(i)q(s.)26 b(Bu)o(t)17 b(t)n(h)o(e)h(bin)o(ary)e(v)o(ect)o(ors)i(pro)q(d)o(u)o(ce)q(d)g(b)o(y) e(a)g(shift-regi)q(st)o(er)0 2214 y(gen)o(era)o(t)o(or)j(are)f(view)o (e)q(d)g(as)g(bas)q(e-2)g(repre)q(s)q(en)o(t)o(a)o(t)o(ions)h(of)e(in)o (t)o(egers)i(in)e(su)n(bs)q(equen)o(t)j(us)q(e,)f(an)o(d)f(t)n(h)o(e)g (regular)q(it)o(ie)q(s)0 2264 y(get)f(fold)o(e)q(d)e(o)o(v)o(er)i(an)o (d)f(di)q(st)o(ort)o(e)q(d,)h(m)n(u)o(c)o(h)f(as)g(t)n(h)o(e)h(or)q (igin)o(al)d(s)q(e)q(dim)o(en)o(t)o(ary)h(lay)o(ers)i(in)f(t)n(h)o(e)h (eart)n(h)h(are)e(fold)o(e)q(d)g(an)o(d)0 2313 y(di)q(st)o(ort)o(e)q(d) g(in)e(geological)e(form)o(a)o(t)o(ions)g(view)o(e)q(d)k(eons)f(la)o(t) o(er.)20 b(Figure)15 b(1)g(giv)o(e)q(s)f(an)h(example)e(of)h(su)o(c)o (h)h(regular)q(it)o(ie)q(s)0 2363 y(in)e(shift-regi)q(st)o(er)i(gen)o (era)o(t)o(ors.)p 0 2436 643 2 v 0 2647 2 212 v 28 2477 a(Tw)o(o)24 b(\014gure)q(s)i(sh)o(ould)e(b)q(e)h(ins)q(ert)o(e)q(d)28 2527 y(h)o(ere,)13 b(bu)o(t)g(I)f(no)f(lon)o(ger)i(h)o(a)o(v)o(e)e(t)n (h)o(e)i(or)q(i-)28 2577 y(gin)o(als.)k(Y)m(ou)c(will)f(h)o(a)o(v)o(e)h (t)o(o)h(go)f(t)o(o)h(t)n(h)o(e)28 2627 y Fj(Pr)n(o)n(c)n(e)n(e)n (dings)g Fk(v)o(olu)o(m)o(e)d(t)o(o)k(s)q(ee)g(t)n(h)o(em.)p 640 2647 V 0 2649 643 2 v 890 2757 a(7)p eop %%Page: 8 8 8 7 bop 62 9 a Fk(On)15 b(t)n(h)o(e)h(t)o(o)o(p)f(i)q(s)f(a)h(s)q(et)h (of)e(16000)f(ran)o(dom)h(p)q(oin)o(t)o(s)h(pro)q(d)o(u)o(ce)q(d)h(b)o (y)e(a)h(go)q(o)q(d)f(ran)o(dom)f(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o (or,)h(on)o(e)0 59 y(t)n(h)o(a)o(t)h(com)n(bin)o(e)q(s)f(t)o(w)o(o)h (st)o(an)o(d)o(ard)g(gen)o(era)o(t)o(ors)i(\(Sup)q(er-Dup)q(er\).)28 b(Th)o(e)17 b(b)q(ot)n(t)o(om)g(sh)o(o)o(ws)g(16000)f(p)q(oin)o(t)o(s)h (pro)q(d)o(u)o(ce)q(d)0 108 y(b)o(y)f(t)n(h)o(e)i(v)o(ery)f(shift-regi) q(st)o(er)g(gen)o(era)o(t)o(or)h(pro)o(p)q(os)q(e)q(d)g(b)o(y)e(Whit)n (t)n(le)q(s)q(ey)i([14])d(as)i(a)f(replacem)o(en)o(t)g(for)g(con)o (gruen)o(t)o(ial)0 158 y(gen)o(era)o(t)o(ors,)i(aft)o(er)e(di)q(sco)o (v)o(ery)h(of)e(t)n(h)o(e)q(ir)i(la)o(t)n(t)o(ice)f(stru)o(ct)o(ure)i ([9].)24 b(Th)o(e)16 b(pro)o(p)q(os)q(e)q(d)i(shift-regi)q(st)o(er)e (gen)o(era)o(t)o(or)i(us)q(e)q(s)0 208 y(31)13 b(bit)h(bin)o(ary)f(v)o (ect)o(ors)j(an)o(d)d Fh(T)18 b Fk(=)12 b(\()p Fh(I)h Fk(+)c Fh(R)675 193 y Fg(28)710 208 y Fk(\)\()p Fh(I)k Fk(+)d Fh(L)843 193 y Fg(3)862 208 y Fk(\).)62 258 y(Lagge)q(d-Fib)q (on)o(acci)20 b(gen)o(era)o(t)o(ors)h(also)f(us)q(e)g(it)o(era)o(t)o(e) q(s)h(of)e(a)h(lin)o(ear)f(transform)o(a)o(t)o(ion,)g(bu)o(t)i(lags)e (su)o(c)o(h)h(as)g(in)0 308 y(F\(17,5,-\),)13 b(F\(31,13,-\))h(or)h (F\(55,24,-\))e(gen)o(era)o(t)o(ors)k(s)q(eem)d(lon)o(g)h(enough)g(t)n (h)o(a)o(t)g(no)g(ob)o(vious)f(regular)q(it)o(ie)q(s)h(ap)o(p)q(ear)0 357 y(in)e(dim)o(ens)q(ions)f(up)i(t)o(o)h(10)e(or)h(so.)62 407 y(Vi)q(sual)e(t)o(e)q(st)o(s)i(su)o(c)o(h)f(as)g(in)f(\014gure)h(1) f(are)h(str)q(ikin)o(g,)f(bu)o(t)h(not)g(feas)q(ible)f(in)g(high)o(er)g (dim)o(ens)q(ions.)k(A)d(quan)o(t)o(it)o(a)o(t)o(iv)o(e)0 457 y(v)o(ers)q(ion)h(of)f(t)n(h)o(e)h(par)o(kin)o(g)g(lot)f(t)o(e)q (st)i(go)q(e)q(s)f(as)g(follo)o(ws:)i(Let)e(eac)o(h)h(p)q(oin)o(t)e(in) g(m-space)h(b)q(e)f(t)n(h)o(e)i(cen)o(t)o(er)g(of)e(a)h(cu)n(bic)g(or)0 507 y(sph)o(er)q(ical)g(\\car",)f(of)g(sp)q(eci\014e)q(d)i(s)q(ize,)e (an)o(d)h(sup)o(p)q(os)q(e)h(w)o(e)f(par)o(k)g(\\b)o(y)f(ear")h(\(as)g (m)o(an)o(y)e(p)q(eo)o(ple)h(do\).)18 b(If)13 b Fh(c)1616 513 y Fg(1)1635 507 y Fh(;)7 b(c)1672 513 y Fg(2)1690 507 y Fh(;)g(c)1727 513 y Fg(3)1752 507 y Fh(:)g(:)g(:)0 557 y Fk(are)14 b(non-o)o(v)o(erlap)o(pin)o(g)f(cars,)i(already)f(par)o (k)o(e)q(d,)g(w)o(e)g(try)g(t)o(o)h(par)o(k)f(ran)o(domly)d(u)o(n)o(t)o (il)j(w)o(e)g(su)o(ccee)q(d)i(wit)n(h)e(a)f(car)i(t)n(h)o(a)o(t)0 606 y(do)q(e)q(s)k(not)g(hit)g(an)o(y)g(of)f(t)n(h)o(os)q(e)i(already)f (par)o(k)o(e)q(d,)i(t)n(h)o(en)f(add)f(t)n(h)o(e)h(n)o(ew)f(car)g(t)o (o)h(t)n(h)o(e)f(li)q(st.)33 b(Ou)o(t)20 b(of)e Fh(n)h Fk(tr)q(ie)q(s,)i(w)o(e)0 656 y(will)15 b(h)o(a)o(v)o(e)h(a)g(li)q(st)f (of)h Fh(k)h Fk(cars)g(su)o(cce)q(ssfully)h(par)o(k)o(e)q(d.)26 b(I)16 b(do)g(not)g(kno)o(w)g(t)n(h)o(e)h(di)q(str)q(ibu)o(t)o(ion)e (of,)h(say)m(,)g Fh(k)q Fk(\(2000\),)f(bu)o(t)0 706 y(s)q(im)n(ula)o(t) o(ion)e(wit)n(h)k(a)f(go)q(o)q(d)g(RNG)f(giv)o(e)q(s)i(t)n(h)o(e)g(m)o (ean)e(an)o(d)h(v)n(ar)q(iance)g(accura)o(t)o(ely)h(enough)g(for)f (compar)q(i)q(son)e(wit)n(h)0 756 y(ot)n(h)o(er)h(RNG's.)j(Figure)d(2)f (sh)o(o)o(ws)g(t)n(h)o(e)h(di\013erence)h(in)e(curv)o(e)q(s)i Fh(k)q Fk(\()p Fh(n)p Fk(\),)e(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)f(of)f (cars)i(par)o(k)o(e)q(d)g(aft)o(er)g Fh(n)f Fk(tr)q(ie)q(s,)0 806 y(for)f(a)h(com)n(bin)o(a)o(t)o(ion)d(RNG)i(\(t)o(o)o(p)h(curv)o(e) q(s\))h(an)o(d)e(a)h(shift-regi)q(st)o(er)g(RNG)f(\(b)q(ot)n(t)o(om)g (curv)o(e)q(s\).)19 b(Clearly)14 b(t)n(h)o(e)g(t)o(w)o(o)g(are)0 856 y(di\013eren)o(t;)i(ext)o(ens)q(iv)o(e)g(tr)q(ie)q(s)g(wit)n(h)f(v) n(ar)q(ious)f(com)n(bin)o(a)o(t)o(ion)e(RNG's)i(sugge)q(st)j(t)n(h)o(e) e(up)o(p)q(er)h(curv)o(e)q(s)h(are)e(t)n(h)o(os)q(e)i(t)o(o)e(b)q(e)0 905 y(exp)q(ect)o(e)q(d)i(wit)n(h)e(a)g(p)q(erfect)h(RNG)f(an)o(d)g(t)n (h)n(us)h(shift-regi)q(st)o(er)g(\(an)o(d)f(also)g(F\(r,s,)p Fd(\010)p Fk(\)\))h(gen)o(era)o(t)o(ors)h(f)q(ail)c(par)o(kin)o(g)j (lot)0 955 y(t)o(e)q(st)o(s.)62 1005 y(Th)o(e)j(quan)o(t)o(it)o(a)o(t)o (iv)o(e)e(par)o(kin)o(g)h(lot)g(t)o(e)q(st)o(s)j(can)d(b)q(e)h(p)q (erform)o(e)q(d)e(in)h(an)o(y)g(dim)o(ens)q(ion;)g(on)o(e)h(n)o(ee)q(d) g(only)f(sp)q(ecify)0 1055 y(t)n(h)o(e)d(s)q(ize)f(an)o(d)g(sh)o(ap)q (e)g(of)g(\\cars",)g(t)n(h)o(en)h(try)g(m-dim)n(ens)q(ion)o(al)10 b(par)o(kin)o(g-b)o(y-ear)15 b(t)o(o)g(compare)e(t)n(h)o(e)i(p)q (erform)o(ance)f(of)0 1105 y(di\013eren)o(t)j(RNG's.)25 b(Th)o(e)17 b(ran)o(dom)d(par)o(kin)o(g)j(of)f(cu)n(b)q(e)q(s)h(an)o(d) f(sph)o(ere)q(s)j(i)q(s)d(an)g(imp)q(ort)o(an)o(t,)e(u)o(nsolv)o(e)q(d) j(proba)o(bilit)o(y)0 1154 y(problem,)12 b(an)o(d)h(RNG's)g(us)q(e)q(d) i(for)e(s)q(im)n(ula)o(t)o(in)o(g)f(su)o(c)o(h)i(problems)f(sh)o(ould)g (b)q(e)h(b)q(ey)o(on)o(d)g(reproac)o(h.)0 1228 y(11.)j(THE)e(BIR)m(THD) o(A)m(Y-SP)m(A)o(CINGS)d(TEST)62 1278 y(Thi)q(s)k(i)q(s)g(t)n(h)o(e)g (di)q(scret)o(e)i(v)o(ers)q(ion)e(of)f(wh)o(a)o(t)h(I)g(call)g(t)n(h)o (e)h(It)o(era)o(t)o(e)q(d)g(Spacin)o(gs)f(T)m(e)q(st,)h(whic)o(h)f(go)q (e)q(s)h(lik)o(e)e(t)n(hi)q(s:)22 b(Let)0 1327 y Fh(S)25 1333 y Fg(1)44 1327 y Fh(;)7 b(S)88 1333 y Fg(2)107 1327 y Fh(;)g(:)g(:)g(:)t(;)g(S)224 1333 y Ff(n)263 1327 y Fk(b)q(e)17 b(t)n(h)o(e)g(spacin)o(gs)h(in)o(d)o(u)o(ce)q(d)e(b)o(y)h Fh(n)11 b Fd(\000)g Fk(1)16 b(u)o(niform)f(ran)o(dom)g(v)n(ar)q(ia)o (ble)q(s)g(on)h([0,1\).)25 b(If)16 b(t)n(h)o(e)h Fh(S)r Fk('s)h(are)0 1377 y(sort)o(e)q(d,)c(t)o(o)h(get)f Fh(S)281 1384 y Fg(\(1\))337 1377 y Fd(\024)e Fh(S)406 1384 y Fg(\(2\))463 1377 y Fd(\024)f(\001)c(\001)g(\001)j(\024)i Fh(S)635 1384 y Fg(\()p Ff(n)p Fg(\))684 1377 y Fk(,)i(t)n(h)o(en)g(t)n (h)o(e)h(w)o(e)q(igh)o(t)o(e)q(d)f(di\013erence)q(s:)310 1460 y Fh(nS)360 1467 y Fg(\(1\))405 1460 y Fh(;)7 b Fk(\()p Fh(n)i Fd(\000)h Fk(1\)[)p Fh(S)590 1467 y Fg(\(2\))643 1460 y Fd(\000)g Fh(S)710 1467 y Fg(\(1\))755 1460 y Fk(])p Fh(;)d(:)g(:)g(:)t(;)g Fk(2[)p Fh(S)917 1467 y Fg(\()p Ff(n)p Fe(\000)p Fg(1\))1017 1460 y Fd(\000)i Fh(S)1083 1467 y Fg(\()p Ff(n)p Fe(\000)p Fg(2\))1175 1460 y Fk(])p Fh(;)e Fk(1[)p Fh(S)1264 1467 y Fg(\()p Ff(n)p Fg(\))1320 1460 y Fd(\000)j Fh(S)1387 1467 y Fg(\()p Ff(n)p Fe(\000)p Fg(1\))1478 1460 y Fk(])0 1543 y(form)e(a)h(n)o(ew)h (s)q(et)h(of)e(u)o(niform)f(spacin)o(gs,)j(t)o(o)f(whic)o(h)f(t)n(h)o (e)h(KS)g(t)o(e)q(st)h(m)o(ay)d(b)q(e)i(ap)o(plie)q(d,)f(t)n(h)o(en)h (t)n(h)o(e)h(w)o(e)q(igh)o(t)o(e)q(d)e(di\013erence)q(s)0 1593 y(of)i(t)n(h)o(os)q(e)i(sort)o(e)q(d)g(spacin)o(gs)g(pro)q(d)o(u)o (ce)f(a)g(n)o(ew)g(s)q(et)h(of)e(spacin)o(gs,)h(an)o(d)g(so)g(on,)f (forev)o(er:)18 b(Eac)o(h)12 b(init)o(ial)e(s)q(et)i(of)g(u)o(niform)0 1643 y(spacin)o(gs)j(leads)f(t)o(o)g(an)g(in\014nit)o(e)f(s)q(equence)j (of)d(s)q(et)o(s)j(of)d(u)o(niform)f(spacin)o(gs.)62 1692 y(In)h(pract)o(ice,)h(t)n(h)o(e)g(pro)q(ce)q(d)o(ure)h(breaks)f (do)o(wn)f(aft)o(er)g(3)g(or)g(4)g(t)o(o)g(p)q(erh)o(aps)h(10)f(it)o (era)o(t)o(ions,)f(b)q(eca)n(us)q(e)j(of)d(t)n(h)o(e)i(\014nit)o(e)0 1742 y(repre)q(s)q(en)o(t)o(a)o(t)o(ion)f(of)f(u)o(niform)e(v)n(ar)q (ia)o(t)o(e)q(s)i(in)f(t)n(h)o(e)i(compu)o(t)o(er.)18 b(Degen)o(eracy)13 b(ar)q(i)q(s)q(e)q(s)f(f)q(rom)e(equal)i(v)n(alue)q (s)g(of)g(spacin)o(gs,)0 1792 y(an)o(d)i(t)n(h)n(us)h(t)n(h)o(e)f(di)q (scret)o(e)h(v)o(ers)q(ion)f(of)f(t)n(hi)q(s)h(pro)q(ce)q(d)o(ure)i (leads)e(t)o(o)g(t)n(h)o(e)h Fj(Birthday-Sp)n(acings)h(T)m(est)p Fk(:)62 1842 y(Let)j(t)n(h)o(e)f(RNG)f(pro)q(d)o(u)o(ce)i(in)o(t)o (egers)f Fh(I)659 1848 y Fg(1)678 1842 y Fh(;)7 b(I)715 1848 y Fg(2)733 1842 y Fh(;)g(I)770 1848 y Fg(3)789 1842 y Fh(;)g(:)g(:)g(:)e(;)i(I)900 1848 y Ff(m)948 1842 y Fk(in)18 b(t)n(h)o(e)g(ran)o(ge)h(1)e(t)o(o)h Fh(n)p Fk(.)30 b(Th)o(e)18 b Fh(I)s Fk('s)g(are)g Fh(m)g Fk(birt)n(h)o(d)o (ays)0 1892 y(in)g(a)f(y)o(ear)i(of)f Fh(n)g Fk(d)o(ays.)31 b(Th)o(e)18 b(f)q(amous)e(problem)g(of)i(V)m(on-Mi)q(s)q(e)q(s)f(an)o (d)h(F)m(eller)g(on)g(d)o(uplica)o(t)o(e)f(birt)n(h)o(d)o(ays)i(i)q(s)e (not)0 1941 y(str)q(in)o(gen)o(t)k(enough)g(for)g(a)f(t)o(e)q(st)i(h)o (ere,)h(bu)o(t)e(t)n(h)o(e)h(problem)d(of)h(d)o(uplica)o(t)o(e)g (spacin)o(gs)h(i)q(s:)31 b(Sort)21 b(t)n(h)o(e)h Fh(I)s Fk('s)f(t)o(o)g(get)0 1991 y Fh(I)18 1998 y Fg(\(1\))78 1991 y Fd(\024)15 b Fh(I)143 1998 y Fg(\(2\))203 1991 y Fd(\024)g(\001)7 b(\001)g(\001)13 b(\024)i Fh(I)378 1998 y Fg(\()p Ff(m)p Fg(\))436 1991 y Fk(.)24 b(Let)16 b Fh(Y)26 b Fk(b)q(e)16 b(t)n(h)o(e)g(n)n(u)o(m)n(b)q(er)g(of)f(v)n (alue)q(s)h(whic)o(h)f(ap)o(p)q(ear)i(more)d(t)n(h)o(an)i(once)h(amon)o (g)d(t)n(h)o(e)0 2041 y(spacin)o(gs)505 2091 y Fh(I)523 2098 y Fg(\(1\))568 2091 y Fh(;)7 b(I)605 2098 y Fg(\(2\))659 2091 y Fd(\000)i Fh(I)718 2098 y Fg(\(1\))763 2091 y Fh(;)e(I)800 2098 y Fg(\(3\))853 2091 y Fd(\000)j Fh(I)913 2098 y Fg(\(2\))958 2091 y Fh(;)d(:)g(:)g(:)e(;)i(I)1069 2098 y Fg(\()p Ff(m)p Fg(\))1135 2091 y Fd(\000)i Fh(I)1194 2098 y Fg(\()p Ff(m)p Fe(\000)p Fg(1\))0 2160 y Fk(Th)n(us)15 b Fh(Y)23 b Fk(i)q(s)14 b Fh(m)g Fk(min)n(us)f(t)n(h)o(e)i(n)n(u)o(m)n (b)q(er)f(of)f(di)q(st)o(inct)h(birt)n(h)o(d)o(ay)g(spacin)o(gs,)h(an)o (d)f Fh(Y)23 b Fk(i)q(s)13 b(asympt)o(ot)o(ically)f(P)o(oi)q(sson)i (wit)n(h)0 2210 y(param)o(et)o(er)f Fh(\025)f Fk(=)g Fh(m)312 2195 y Fg(3)331 2210 y Fh(=)p Fk(\(4)p Fh(n)p Fk(\).)62 2260 y(A)f(pro)q(of,)g(b)o(y)f(Janos)i(Komlos,)d(an)o(d)i(d)o (et)o(aile)q(d)g(di)q(scuss)q(ion)f(of)g(t)n(h)o(e)i(t)o(e)q(st)g(will) d(ap)o(p)q(ear)i(els)q(ewh)o(ere.)19 b(Th)o(e)11 b(birt)n(h)o(d)o(ay)0 2310 y(spacin)o(gs)18 b(t)o(e)q(st)g(addre)q(ss)q(e)q(s)i(only)d(t)n(h) o(e)h(s)q(et)g(of)e(in)o(t)o(egers)j(pro)q(d)o(u)o(ce)q(d)f(b)o(y)f(a)g (RNG,)f(not)h(t)n(h)o(e)h(ord)o(er)h(in)d(whic)o(h)h(t)n(h)o(ey)0 2360 y(are)d(pro)q(d)o(u)o(ce)q(d.)19 b(Con)o(gruen)o(t)o(ial)12 b(gen)o(era)o(t)o(ors)j(gen)o(erally)e(pass)h(t)n(h)o(e)g(t)o(e)q(st.) 19 b(Shift-regi)q(st)o(er)13 b(gen)o(era)o(t)o(ors)i(f)q(ail)c(it,)i (as)g(do)0 2409 y(lagge)q(d-Fib)q(on)o(acci)f(gen)o(era)o(t)o(ors)i(us) q(in)o(g)e(+,)p Fd(\000)g Fk(or)h Fd(\010)p Fk(.)k(Of)c(t)n(h)o(e)g(s)q (imple)d(gen)o(era)o(t)o(ors,)k(only)d(con)o(gruen)o(t)o(ial)h(an)o(d)h (lagge)q(d)0 2459 y(Fib)q(on)o(acci)g(us)q(in)o(g)h(m)n(ul)o(t)o (iplica)o(t)o(i)o(on)d(pass)j(t)n(h)o(e)g(birt)n(h)o(d)o(ay)g(spacin)o (gs)h(t)o(e)q(st;)f(most)f(com)n(bin)o(a)o(t)o(ion)e(gen)o(era)o(t)o (ors)k(pass)g(it.)0 2533 y(12.)i(RANKS)d(OF)h(RANDOM)e(BINAR)m(Y)h(MA)m (TRICES.)62 2583 y(Man)o(y)21 b(Mon)o(t)o(e)f(Carlo)g(st)o(udie)q(s,)k (part)o(icularly)19 b(in)i(com)n(bin)o(a)o(t)o(or)q(ics)e(an)o(d)h (graph)h(t)n(h)o(eory)m(,)h(call)e(for)h(ran)o(dom)0 2632 y(incid)o(ence)f(m)o(a)o(tr)q(ice)q(s,)d(elem)o(en)o(t)o(s)i(0)f (or)g(1)g(t)o(o)g(repre)q(s)q(en)o(t)j(t)n(h)o(e)e(a)o(bs)q(ence)h(or)e (pre)q(s)q(ence)i(of)e(som)o(e)f(pro)o(p)q(ert)o(y)m(.)31 b(It)19 b(i)q(s)890 2757 y(8)p eop %%Page: 9 9 9 8 bop 0 -41 a Fk(n)o(a)o(t)o(ural)11 b(t)o(o)h(let)g(t)n(h)o(e)h(ro)o (ws)f(of)f(su)o(c)o(h)h(a)g(ran)o(dom)e(m)o(a)o(tr)q(ix)f(b)q(e)j(form) o(e)q(d)f(b)o(y)g(su)o(cce)q(ss)q(iv)o(e)j(compu)o(t)o(er)e(w)o(ords,)g (or)g(p)q(ort)o(ions)0 9 y(of)h(w)o(ords,)h(pro)q(d)o(u)o(ce)q(d)h(b)o (y)f(a)f(ran)o(dom)f(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(or.)62 59 y(Shift-regi)q(st)o(er)h(or)g(F\(r,s,)p Fd(\010)p Fk(\))h(gen)o(era)o(t)o(ors)g(are)g(not)f(suit)o(a)o(ble)f(for)g(su)o (c)o(h)i(us)q(e.)22 b(In)15 b(ord)o(er)h(t)n(h)o(a)o(t)f(t)n(h)o(e)h(s) q(equence)h(of)0 108 y(1)9 b Fd(\002)g Fh(n)14 b Fk(bin)o(ary)f(v)o (ect)o(ors)j Fh(\014)r(;)7 b(\014)r(T)s(;)g(\014)r(T)550 93 y Fg(2)570 108 y Fh(;)g(:)g(:)g(:)k Fk(h)o(a)o(v)o(e)j(a)f(lon)o(g)h (p)q(er)q(io)q(d,)f(it)g(i)q(s)g(n)o(ece)q(ssary)k(t)n(h)o(a)o(t)c(t)n (h)o(e)i(\014rst)g Fh(n)e Fk(v)o(ect)o(ors)j(in)d(t)n(h)o(e)0 158 y(s)q(equence)j(b)q(e)f(lin)o(early)f(in)o(d)o(ep)q(en)o(d)o(en)o (t.)20 b(Th)n(us)c(a)e(bin)o(ary)g(m)o(a)o(tr)q(ix)e(wit)n(h)j(ro)o(ws) f(form)o(e)q(d)f(b)o(y)i Fh(n)f Fk(or)g(few)o(er)i(su)o(cce)q(ss)q(iv)o (e)0 208 y(v)o(ect)o(ors)e(pro)q(d)o(u)o(ce)q(d)f(b)o(y)f(a)g (shift-regi)q(st)o(er)h(gen)o(era)o(t)o(or)g(will)e(alw)o(ays)g(h)o(a)o (v)o(e)h(full)f(rank,)h(while)f(a)h(truly)g(ran)o(dom)f Fh(m)6 b Fd(\002)g Fh(n)0 258 y Fk(bin)o(ary)17 b(m)o(a)o(tr)q(ix)e (will)h(h)o(a)o(v)o(e)h(rank)g Fh(m)h Fk(wit)n(h)f(proba)o(bilit)o(y)e (\(1)d Fd(\000)g Fk(2)1027 243 y Fe(\000)p Ff(n)1075 258 y Fk(\)\(1)f Fd(\000)h Fk(2)1204 243 y Fg(1)p Fe(\000)p Ff(n)1269 258 y Fk(\))7 b Fd(\001)g(\001)g(\001)e Fk(\(1)12 b Fd(\000)g Fk(2)1461 243 y Ff(m)p Fe(\000)p Fg(1)p Fe(\000)p Ff(n)1581 258 y Fk(\),)18 b(a)o(b)q(ou)o(t)f(.30)0 308 y(wh)o(en)d Fh(m)e Fk(=)g Fh(n)f Fd(\025)h Fk(10)i(or)f(so.)62 357 y(More)e(sp)q(eci\014cally)m(,)e(t)n(h)o(e)i(rank)f(of)f(a)h(ran)o (dom)f Fh(m)r Fd(\002)r Fh(n)g Fk(bin)o(ary)h(m)o(a)o(tr)q(ix)e(t)o(ak) o(e)q(s)i(t)n(h)o(e)h(v)n(alue)e Fh(r)k Fk(=)f(1)p Fh(;)7 b Fk(2)p Fh(;)g(:)g(:)g(:)s(;)g Fk(min)n(\()p Fh(m;)g(n)p Fk(\))0 407 y(wit)n(h)14 b(proba)o(bilit)o(y)534 536 y(2)555 519 y Ff(r)q Fg(\()p Ff(n)p Fg(+)p Ff(m)p Fe(\000)p Ff(r)q Fg(\))p Fe(\000)p Ff(mn)800 484 y(r)q Fe(\000)p Fg(1)803 496 y Fb(Y)802 585 y Ff(i)p Fg(=0)871 508 y Fk(\(1)9 b Fd(\000)g Fk(2)979 493 y Ff(i)p Fe(\000)p Ff(n)1039 508 y Fk(\)\(1)h Fd(\000)f Fk(2)1164 493 y Ff(i)p Fe(\000)p Ff(m)1233 508 y Fk(\))p 871 526 379 2 v 970 564 a(\(1)g Fd(\000)g Fk(2)1078 552 y Ff(i)p Fe(\000)p Ff(r)1134 564 y Fk(\))1254 536 y Fh(:)0 647 y Fk(If)19 b(t)n(h)o(e)h(ro)o(ws)f(of)g(t)n(h)o(e)h Fh(m)13 b Fd(\002)h Fh(n)19 b Fk(bin)o(ary)g(m)o(a)o(tr)q(ix)e(are)j Fh(m)f Fk(cons)q(ecu)o(t)o(iv)o(e)i(compu)o(t)o(er)e(w)o(ords,)i(or)e (p)q(ort)o(ions)g(t)n(h)o(ereof,)0 697 y(pro)q(d)o(u)o(ce)q(d)d(b)o(y)g (a)f(ran)o(dom)e(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(or,)i(t)n(h)o(en) f(t)n(h)o(e)g(rank)g(of)e(t)n(h)o(e)i(m)o(a)o(tr)q(ix)e(sh)o(ould)h(h)o (a)o(v)o(e)g(t)n(h)o(e)h(di)q(str)q(ibu)o(t)o(ion)0 747 y(giv)o(en)e(b)o(y)h(t)n(h)o(e)g(proba)o(bilit)o(ie)q(s)e(a)o(b)q(o)o (v)o(e.)20 b(Shift-regi)q(st)o(er)15 b(gen)o(era)o(t)o(ors)h(f)q(ail)d (su)o(c)o(h)i(t)o(e)q(st)o(s,)i(as)d(do)h(F\(r,s,)p Fd(\010)p Fk(\))g(gen)o(era)o(t)o(ors.)0 796 y(Con)o(gruen)o(t)o(ial)e(an)o(d)h (F\(r,s,)p Fd(\006)p Fk(\))g(usually)f(pass.)0 870 y(13.)k(CONCLUSIONS) 62 920 y(Th)o(e)d(t)o(a)o(ble)e(b)q(elo)o(w)h(in)o(dica)o(t)o(e)q(s)g (h)o(o)o(w)g(v)n(ar)q(ious)f(kin)o(ds)h(of)g(RNG's)g(p)q(erform)f(in)h (DIEHARD,)f(a)h(ba)o(t)n(t)o(ery)h(of)f(str)q(in-)0 969 y(gen)o(t)d(t)o(e)q(st)o(s)i(d)o(e)q(s)q(ign)o(e)q(d)e(t)o(o)h(t)o(e)q (st)g(RNG's)e(more)g(t)n(h)o(oroughly)g(t)n(h)o(an)h(st)o(an)o(d)o(ard) g(t)o(e)q(st)o(s)i(do.)17 b(It)10 b(us)q(e)q(s)h(v)n(ar)q(ious)e(o)o(v) o(erlap)o(pin)o(g)0 1019 y(m-t)o(uple)i(an)o(d)i(OPSO)h(t)o(e)q(st)o(s) h(t)o(o)e(t)o(e)q(st)i(for)d(in)o(d)o(ep)q(en)o(d)o(ence)j(as)f(w)o (ell)e(as)h(u)o(niformit)o(y)m(,)d(an)o(d)j(t)o(e)q(st)o(s)i(all)d (part)o(s)i(of)f(a)f(com-)0 1069 y(pu)o(t)o(er)i(w)o(ord,)e(not)h(only) f(t)n(h)o(e)h(most)f(s)q(igni\014can)o(t)g(bit)o(s.)18 b(Ch)o(oice)12 b(of)g(st)o(art)o(in)o(g)h(v)n(alue)q(s)g(s)q(eems)f(t)o (o)h(m)o(ak)o(e)e(no)i(di\013erence)0 1119 y(in)h(t)n(h)o(e)i(t)o(e)q (st)o(s,)h(an)o(d)e(re)q(sul)o(t)o(s)i(m)o(ar)o(k)o(e)q(d)d(F)-5 b(AIL)16 b(are)f(sp)q(ect)o(acular)h(f)q(ailure)q(s|t)n(h)o(e)e(obs)q (erv)o(e)q(d)j(di)q(str)q(ibu)o(t)o(ion)d(pro)q(d)o(u)o(ce)q(d)0 1169 y(b)o(y)g(t)n(h)o(e)g(RNG)f(i)q(s)h(no)o(wh)o(ere)g(n)o(ear)h(t)n (h)o(a)o(t)f(calle)q(d)g(for)f(b)o(y)h(proba)o(bilit)o(y)e(t)n(h)o (eory)j(for)e(truly)h(iid)f(s)q(equence)q(s.)62 1219 y(Th)o(e)j(t)o(e)q(st)o(s)h(sh)o(o)o(w)d(t)n(h)o(a)o(t)i(som)o(e)e(of)g (t)n(h)o(e)i(w)o(orst)f(RNG's)f(are)i(t)n(h)o(os)q(e)g(t)n(h)o(a)o(t)f (us)q(e)h(exclus)q(iv)o(e-or:)k(shift-regi)q(st)o(er)15 b(an)o(d)0 1268 y(F\(r,s,)p Fd(\010)p Fk(\),)e(p)q(erh)o(aps)i(not)e (surpr)q(i)q(s)q(in)o(g)f(wh)o(en)i(on)o(e)f(cons)q(id)o(ers)i(t)n(h)o (a)o(t)e(a)g(RNG)g(i)q(s)g(sup)o(p)q(os)q(e)q(d)h(t)o(o)g(scram)n(ble)e (t)n(h)o(e)i(bit)o(s)g(of)0 1318 y(a)f(curren)o(t)i(compu)o(t)o(er)e(w) o(ord,)g(or)h(w)o(ords,)f(t)o(o)h(get)f(a)h(n)o(ew)f(on)o(e,)g(an)o(d)g Fd(\010)p Fk(,)h(a)f(no-carry)h(add,)e(do)q(e)q(s)i(lit)n(t)n(le)g(t)o (o)f(scram)n(ble)0 1368 y(bit)o(s,)h(compare)q(d)f(t)o(o)h(+,)p Fd(\000)g Fk(or)g Fd(\003)p Fk(.)62 1418 y(Th)o(e)k(t)o(e)q(st)o(s)i (on)d(lagge)q(d-Fib)q(on)o(acci)g(gen)o(era)o(t)o(ors)i(us)q(e)q(d)g (F\(17,5,)p Fd(\005)p Fk(\),)d(F\(31,13,)p Fd(\005)p Fk(\))g(an)o(d)h(F\(55,24,)p Fd(\005)p Fk(\).)27 b(Us)q(in)o(g)18 b Fd(\010)0 1468 y Fk(ga)o(v)o(e)h(almost)e(u)o(niformly)g(bad)i(re)q (sul)o(t)o(s.)35 b(Th)o(e)20 b(bin)o(ary)e(o)o(p)q(era)o(t)o(ions)h(+,) p Fd(\000)g Fk(an)o(d)g Fd(\003)f Fk(ga)o(v)o(e)h(go)q(o)q(d)g(re)q (sul)o(t)o(s,)j(except)0 1517 y(on)17 b(t)n(h)o(e)h(birt)n(h)o(d)o (ay-spacin)o(gs)g(t)o(e)q(st.)28 b(Not)o(e,)18 b(h)o(o)o(w)o(ev)o(er,)g (t)n(h)o(a)o(t)f(F\(r,s,)p Fd(\005)p Fk(\))g(gen)o(era)o(t)o(ors)i(wit) n(h)d(a)h(v)o(ery)h(lon)o(g)e(lag)g(r,)i(say)0 1567 y(F\(607,273,)p Fd(\005)p Fk(\))13 b(or)i(F\(1279,418,)p Fd(\005)p Fk(\),)e(pass)j(all) e(t)o(e)q(st)o(s)k(for)c(ev)o(ery)j(c)o(h)o(oice)e(of)g(bin)o(ary)g(o)o (p)q(era)o(t)o(ion:)20 b(+)p Fh(;)7 b Fd(\000)p Fh(;)g Fd(\003)14 b Fk(an)o(d)h(ev)o(en)0 1617 y Fd(\010)p Fk(.)k(Bu)o(t)c (also)e(recall)h(t)n(h)o(e)h(gi)q(st)f(of)f(m)o(y)f(previous)j(comm)o (en)o(t:)h(It)e(i)q(s)f(di\016cul)o(t)h(t)o(o)g(u)o(n)o(d)o(erst)o(an)o (d)i(wh)o(y)e(an)o(y)o(on)o(e)g(w)o(ould)0 1667 y(us)q(e)19 b(an)o(y)e(F\(r,s,)p Fd(\010)p Fk(\))i(wh)o(en)f(t)n(h)o(e)h(corre)q (sp)q(on)o(din)o(g)h(gen)o(era)o(t)o(or)f(us)q(in)o(g)f(+)g(or)g Fd(\000)g Fk(h)o(as)h(a)o(t)e(least)i(as)g(go)q(o)q(d)e(st)o(a)o(t)o(i) q(st)o(ical)0 1717 y(b)q(e)o(h)o(a)o(vior)11 b(an)o(d)h(a)f(p)q(er)q (io)q(d)h(billions)e(of)h(t)o(im)o(e)q(s)g(as)g(lon)o(g.)17 b(Implem)o(en)o(t)o(a)o(t)o(i)o(ons)9 b(h)o(a)o(v)o(e)j(exact)n(ly)g(t) n(h)o(e)g(sam)o(e)f(programmin)o(g)0 1766 y(stru)o(ct)o(ure,)k(except)h (t)n(h)o(a)o(t)e Fd(\010)g Fk(i)q(s)f(replace)q(d)i(b)o(y)e Fd(\000)h Fk(or)g(+.)62 1816 y(Com)n(bin)o(a)o(t)o(ion)6 b(gen)o(era)o(t)o(ors)11 b(do)f(b)q(e)q(st)g(in)f(str)q(in)o(gen)o(t)h (t)o(e)q(st)o(s.)18 b(Th)o(e)10 b(gen)o(era)o(t)o(or)g(COMBO)g(ret)o (ur)q(ns)h Fh(x)1550 1822 y Ff(i)1563 1816 y Fd(\000)p Fh(y)1615 1822 y Ff(i)1641 1816 y Fk(mo)q(d)g(2)1754 1801 y Fg(32)1788 1816 y Fk(,)0 1866 y(wit)n(h)g Fh(x)114 1872 y Ff(n)148 1866 y Fk(=)g Fh(x)215 1872 y Ff(n)p Fe(\000)p Fg(1)283 1866 y Fd(\003)s Fh(x)331 1872 y Ff(n)p Fe(\000)p Fg(2)407 1866 y Fk(mo)q(d)f(2)519 1851 y Fg(32)554 1866 y Fk(,)h(an)g(F\(2,1,)p Fd(\003)p Fk(\))e(gen)o(era)o(t)o(or)j(on) e(o)q(dd)h(in)o(t)o(egers)h(an)o(d)e Fh(y)1345 1872 y Ff(i)1371 1866 y Fk(=)i Fh(y)1435 1872 y Ff(i)p Fe(\000)p Fg(3)1494 1866 y Fd(\000)s Fh(y)1549 1872 y Ff(i)p Fe(\000)p Fg(1)1618 1866 y Fk(mo)q(d)e(2)1730 1851 y Fg(30)1768 1866 y Fd(\000)0 1916 y Fk(35,)k(an)g(F\(3,1,)p Fd(\000)p Fk(\))g(gen)o(era)o(t)o(or.)22 b(It)15 b(pass)q(e)q(d)h(all)e(t)o(e)q (st)o(s,)i(as)f(did)f(NCOMBO,)h(a)g(s)q(imilar)d(com)n(bin)o(a)o(t)o (ion)g(except)k(t)n(h)o(a)o(t)0 1966 y Fh(y)20 1972 y Ff(i)46 1966 y Fk(=)c Fh(y)110 1972 y Ff(i)p Fe(\000)p Fg(3)175 1966 y Fd(\000)e Fh(y)237 1972 y Ff(i)p Fe(\000)p Fg(1)305 1966 y Fk(mo)q(d)g(2)417 1951 y Fg(32)461 1966 y Fd(\000)g Fk(5.)62 2016 y(Th)o(e)q(s)q(e)19 b(are)f(t)o(w)o(o)f(com)n (bin)o(a)o(t)o(ion)f(gen)o(era)o(t)o(ors)j(t)n(h)o(a)o(t)f(us)q(e)g (only)f(a)h(few)f(compu)o(t)o(er)h(instru)o(ct)o(ions)g(an)o(d)g(h)o(a) o(v)o(e)f(no)0 2065 y(arrays)h(t)o(o)f(acce)q(ss.)31 b(Th)n(us)19 b(t)n(h)o(ey)f(are)f(f)q(ast.)29 b(Man)o(y)17 b(ot)n(h)o(er)h(example)q(s)e(are,)i(of)f(cours)q(e,)i(p)q(oss)q(ible.) 29 b(On)o(e)18 b(sh)o(ould)0 2115 y(not)c(get)h(t)o(o)q(o)f(carr)q(ie)q (d)h(aw)o(ay)f(wit)n(h)g(t)n(h)o(e)h(promi)q(s)q(e)e(of)h(com)n(bin)o (a)o(t)o(ion)d(gen)o(era)o(t)o(ors)16 b(pro)o(vid)o(e)q(d)f(b)o(y)f(t)n (h)o(e)h(a)o(b)q(o)o(v)o(e)f(t)n(h)o(eory)m(,)0 2165 y(h)o(o)o(w)o(ev)o(er.)27 b(In)17 b(com)n(binin)o(g)d(gen)o(era)o(t)o (ors,)19 b(it)d(s)q(eems)h(prud)o(en)o(t)h(t)o(o)e(us)q(e)i(s)q (equence)q(s)h(wit)n(h)d(incompa)o(t)o(ible)e(alge)o(braic)0 2215 y(stru)o(ct)o(ure)q(s,)23 b(an)o(d)c(wit)n(h)h(t)n(h)o(e)g(com)n (binin)o(g)e(bin)o(ary)h(o)o(p)q(era)o(t)o(ion)g(on)g(an)h(incompa)o(t) o(ible)d(stru)o(ct)o(ure)k(as)f(w)o(ell.)35 b(Th)o(e)0 2265 y(gen)o(era)o(t)o(or)13 b(Sup)q(er-Dup)q(er,)f(part)g(of)f(t)n(h)o (e)i(McGill)d(Ran)o(dom)f(Nu)o(m)n(b)q(er)i(P)o(ac)o(kage)h(wid)o(ely)f (us)q(e)q(d)i(a)o(t)e(s)q(ev)o(eral)h(h)n(u)o(n)o(dre)q(d)0 2314 y(lo)q(ca)o(t)o(ions,)f(com)n(bin)o(e)q(s)h(t)n(h)o(e)g(con)o (gruen)o(t)o(ial)g(gen)o(era)o(t)o(or)i Fh(x)863 2320 y Ff(n)897 2314 y Fk(=)e(69069)p Fh(x)1070 2320 y Ff(n)p Fe(\000)p Fg(1)1145 2314 y Fk(mo)q(d)e(2)1257 2299 y Fg(32)1304 2314 y Fk(via)h Fd(\010)h Fk(wit)n(h)h(t)n(h)o(e)f (shift-regi)q(st)o(er)0 2364 y(gen)o(era)o(t)o(or)20 b Fh(\014)i Fd( )d Fh(\014)r Fk(\()p Fh(I)d Fk(+)d Fh(R)445 2349 y Fg(15)480 2364 y Fk(\)\()p Fh(I)j Fk(+)d Fh(L)619 2349 y Fg(17)654 2364 y Fk(\).)32 b(It)19 b(f)q(ails)e(t)n(h)o(e)i (MTUPLE)g(t)o(e)q(st)h(on)e(su)n(bstr)q(in)o(gs)j(of)c(lo)o(w)h(ord)o (er)i(bit)o(s,)0 2414 y(proba)o(bly)13 b(b)q(eca)n(us)q(e)j(b)q(ot)n(h) e(of)g(t)n(h)o(e)h(const)o(it)o(uen)o(t)g(part)o(s)g(do,)f(an)o(d)g Fd(\010)h Fk(i)q(s)e(a)h(p)q(o)q(or)h(bin)o(ary)f(o)o(p)q(era)o(t)o (ion)f(for)h(scram)n(blin)o(g)0 2464 y(bit)o(s.)21 b(Th)o(os)q(e)15 b(wh)o(o)f(us)q(e)i(Sup)q(er-Dup)q(er)f(m)o(ay)e(w)o(an)o(t)h(t)o(o)h (mo)q(dify)d(t)n(h)o(e)j(ass)q(em)n(bly)e(lan)o(guage)i(instru)o(ct)o (ions:)20 b(replace)0 2514 y Fd(\010)14 b Fk(b)o(y)g Fd(\000)g Fk(in)f(t)n(h)o(e)i(st)o(ep)g(t)n(h)o(a)o(t)f(com)n(bin)o(e)q (s)f(t)n(h)o(e)h(t)o(w)o(o)g(s)q(imple)d(gen)o(era)o(t)o(ors.)62 2563 y(Con)o(gruen)o(t)o(ial)h(gen)o(era)o(t)o(ors)i(wit)n(h)e(a)g(pr)q (im)o(e)f(mo)q(d)o(ulus)g(s)q(eem)h(t)o(o)h(do)f(b)q(et)n(t)o(er)i(on)e (str)q(in)o(gen)o(t)h(t)o(e)q(st)o(s)h(t)n(h)o(an)f(do)f(t)n(h)o(os)q (e)0 2613 y(wit)n(h)19 b(mo)q(d)o(ulus)e(2)290 2598 y Ff(n)312 2613 y Fk(.)32 b(While)18 b(t)n(h)o(e)h(la)o(t)n(t)o(er)h(are) f(eas)q(ier)g(an)o(d)g(f)q(ast)o(er)f(for)h(compu)o(t)o(er)g(implem)n (en)o(t)o(a)o(t)o(i)o(on,)d(t)n(h)o(ey)k(giv)o(e)890 2757 y(9)p eop %%Page: 10 10 10 9 bop 0 -41 a Fk(u)o(nsa)o(t)o(i)q(sf)q(act)o(ory)13 b(re)q(sul)o(t)o(s)j(on)d(su)n(bstr)q(in)o(gs)i(of)e(lo)o(w)f(ord)o(er) i(bit)o(s.)19 b(Mul)o(t)o(iplica)o(t)o(ion)10 b(mo)q(d)o(ulo)h(a)i(pr)q (im)o(e)f Fh(p)h Fk(i)q(s)g(di\016cul)o(t)g(t)o(o)0 9 y(implem)n(en)o(t)h(in)h(in)o(t)o(eger)h(ar)q(it)n(hm)o(et)o(ic.)23 b(On)o(e)17 b(of)e(t)n(h)o(e)i(b)q(e)q(st)g(w)o(ays)f(i)q(s)f(t)o(o)i (repre)q(s)q(en)o(t)h(in)o(t)o(egers)f(as)f(dou)n(ble)f(preci)q(s)q (ion)0 59 y(reals)h(an)o(d)e(us)q(e)h(t)n(h)o(e)h(DMOD)e(fu)o(nct)o (ion.)21 b(In)14 b(t)n(h)o(a)o(t)h(cas)q(e,)h(t)n(h)o(e)f(pr)q(im)o(e)e (mo)q(d)o(ulus)g Fh(p)g Fk(=)g(2)1345 43 y Fg(31)1390 59 y Fd(\000)d Fk(1,)k(us)q(e)q(d)i(in)e(a)h(p)q(o)o(pular)0 108 y(IBM)g(gen)o(era)o(t)o(or,)h(s)q(eems)f(a)g(p)q(o)q(or)g(c)o(h)o (oice.)22 b(It)15 b(giv)o(e)q(s)g(only)f(31,)g(ra)o(t)n(h)o(er)i(t)n(h) o(an)f(32)g(bit)o(s,)g(an)o(d)g Fh(p)10 b Fd(\000)g Fk(1)15 b(h)o(as)g(t)o(o)q(o)g(m)o(an)o(y)0 158 y(f)q(act)o(ors.)23 b(Bet)n(t)o(er)18 b(c)o(h)o(oice)q(s)e(are,)g(for)f(example,)f Fh(p)g Fk(=)h(2)852 143 y Fg(33)897 158 y Fd(\000)c Fk(209,)j(whic)o(h) i(giv)o(e)q(s)f(a)g(full)g(32)g(bit)o(s,)h(or)f Fh(p)f Fk(=)h(2)1671 143 y Fg(37)1716 158 y Fd(\000)10 b Fk(45)0 208 y(whic)o(h,)17 b(wit)n(h)g(a)f(m)n(ul)o(t)o(iplier)f(of)h(19)h(or)g (few)o(er)g(bit)o(s,)h(allo)o(ws)e(full)g(an)o(d)g(exact)i(exploit)o(a) o(t)o(ion)c(of)j(dou)n(ble)f(preci)q(s)q(ion)0 258 y(ar)q(it)n(hm)o(et) o(ic.)22 b(F)m(or)15 b(t)n(h)o(e)i(t)o(w)o(o)e(la)o(t)n(t)o(er)h(c)o(h) o(oice)q(s,)h(\()p Fh(p)10 b Fd(\000)h Fk(1\))p Fh(=)p Fk(2)k(i)q(s)g(also)g(pr)q(im)o(e,)f(so)i(t)n(h)o(a)o(t)g(h)o(alf)e(of) h(t)n(h)o(e)i(re)q(s)q(id)o(ue)q(s)g(of)e Fh(p)h Fk(are)0 308 y(pr)q(imit)o(iv)o(e)11 b(elem)o(en)o(t)o(s)j(an)o(d)g(m)o(ay)e(b)q (e)i(us)q(e)q(d)h(as)e(m)n(ul)o(t)o(ipliers)g(givin)o(g)g(t)n(h)o(e)h (full)f(p)q(er)q(io)q(d.)71 357 y(Bas)q(e)q(d)f(on)f(t)n(h)o(e)i(a)o(b) q(o)o(v)o(e)e(di)q(scuss)q(ion,)g(m)o(y)f(curren)o(t)j(view)e(of)g (RNG's)f(m)o(ay)g(b)q(e)h(su)o(mm)o(ar)q(ize)q(d)f(wit)n(h)h(t)n(h)o(e) i(follo)o(win)o(g)0 407 y(b)q(ot)n(t)o(om)e(lin)o(e:)16 b(Com)n(bin)o(a)o(t)o(io)o(n)9 b(gen)o(era)o(t)o(ors)k(s)q(eem)d(b)q(e) q(st;)j(con)o(gruen)o(t)o(ial)e(gen)o(era)o(t)o(ors)i(are)e(lik)o(e)q (d,)g(bu)o(t)h(not)f(w)o(ell-lik)o(e)q(d;)0 457 y(shift-regi)q(st)o(er) k(an)o(d)f(lagge)q(d-Fib)q(on)o(acci)f(gen)o(era)o(t)o(ors)j(us)q(in)o (g)e Fd(\010)g Fk(are)h(no)f(go)q(o)q(d;)f(a)o(v)o(oid)g Fd(\010)p Fk(;)i(lagge)q(d-Fib)q(on)o(acci)e(gen-)0 507 y(era)o(t)o(ors)i(us)q(in)o(g)d(+)i(or)f Fd(\000)g Fk(pass)h(most)e(of) h(t)n(h)o(e)g(str)q(in)o(gen)o(t)h(t)o(e)q(st)o(s)h(except)g(birt)n(h)o (d)o(ay)e(spacin)o(gs,)g(an)o(d)g(ev)o(en)h(t)n(h)o(os)q(e)g(if)e(t)n (h)o(e)0 557 y(lag)g(i)q(s)h(lon)o(g)g(enough,)g(say)g(1279;)f(Lagge)q (d-Fib)q(on)o(acci)h(gen)o(era)o(t)o(ors)i(us)q(in)o(g)e(m)n(ul)o(t)o (ipli)o(ca)o(t)o(ion)d(on)j(o)q(dd)g(in)o(t)o(egers)h(mo)q(d)0 606 y(2)21 591 y Fg(32)69 606 y Fk(pass)f(all)f(t)n(h)o(e)h(t)o(e)q(st) o(s;)h(com)n(bin)o(a)o(t)o(ion)c(gen)o(era)o(t)o(ors)15 b(s)q(eem)d(b)q(e)q(st|if)g(t)n(h)o(e)i(n)n(u)o(m)n(b)q(ers)f(are)g (not)f(ran)o(dom,)f(t)n(h)o(ey)i(are)g(a)o(t)0 656 y(least)i(higgle)q (dy)e(piggle)q(dy)m(.)554 730 y(A)h(SUMMAR)m(Y)f(OF)i(SOME)f(TEST)g (RESUL)m(TS)p 0 759 1976 2 v -1 809 2 50 v 394 794 a(LA)m(TTICE)50 b(P)m(ARKLOT)g(MTUPLE)g(OPSO)h(BD)o(A)m(Y)e(OPERM)i(R)o(UNS)e(RANK)p 1974 809 V 0 811 1976 2 v -1 860 2 50 v 69 845 a(Con)o(gruen)o(t)o(ial) 138 b(F)-5 b(AIL)162 b(pass)d(F)-5 b(AIL)105 b(F)-5 b(AIL)82 b(pass)112 b(pass)d(pass)94 b(pass)p 1974 860 V 0 862 1976 2 v -1 912 2 50 v 60 897 a(Shift-Regi)q(st)o(er)140 b(pass)162 b(F)-5 b(AIL)150 b(F)-5 b(AIL)105 b(F)-5 b(AIL)73 b(F)-5 b(AIL)103 b(pass)e(F)-5 b(AIL)75 b(F)-5 b(AIL)p 1974 912 V 0 914 1976 2 v -1 963 2 50 v 25 948 a(Lagge)q(d-Fib)q(on)o (acci)104 b(pass)162 b(F)-5 b(AIL)150 b(F)-5 b(AIL)105 b(F)-5 b(AIL)73 b(F)-5 b(AIL)94 b(F)-5 b(AIL)92 b(F)-5 b(AIL)75 b(F)-5 b(AIL)p 1974 963 V -1 1013 V 114 998 a(us)q(in)o(g)14 b Fd(\010)p 1974 1013 V 0 1015 1976 2 v -1 1065 2 50 v 25 1050 a Fk(Lagge)q(d-Fib)q(on)o(acci)104 b(pass)171 b(pass)d(pass)123 b(pass)82 b(F)-5 b(AIL)103 b(pass)109 b(pass)94 b(pass)p 1974 1065 V -1 1114 V 73 1100 a(us)q(in)o(g)13 b(+)h(or)p Fd(\000)p 1974 1114 V 0 1116 1976 2 v -1 1166 2 50 v 25 1151 a Fk(Lagge)q(d-Fib)q(on)o (acci)104 b(pass)171 b(pass)d(pass)123 b(pass)91 b(pass)112 b(pass)d(pass)94 b(pass)p 1974 1166 V -1 1216 V 120 1201 a(us)q(in)o(g)14 b Fd(\003)p 1974 1216 V 0 1217 1976 2 v -1 1267 2 50 v 69 1252 a Fk(Sup)q(er-Dup)q(er)149 b(pass)171 b(pass)159 b(F)-5 b(AIL)114 b(pass)91 b(pass)112 b(pass)d(pass)94 b(pass)p 1974 1267 V 0 1269 1976 2 v -1 1319 2 50 v 104 1304 a(COMBO)184 b(pass)171 b(pass)d(pass)123 b(pass)91 b(pass)112 b(pass)d(pass)94 b(pass)p 1974 1319 V 0 1320 1976 2 v -1 1370 2 50 v 88 1355 a(NCOMBO)169 b(pass)i(pass)d(pass)123 b(pass)91 b(pass)112 b(pass)d(pass)94 b(pass)p 1974 1370 V 0 1372 1976 2 v 0 1475 a(REFERENCES)0 1549 y([1])17 b(Arvillias,)f(A.C.)h(an)o(d)h(Mar)q(it)o(sas,)g(A.E.)f (P)o(art)o(it)o(ionin)o(g)g(t)n(h)o(e)h(p)q(er)q(io)q(d)g(of)f(m-s)q (equence)q(s)i(an)o(d)e(ap)o(plica)o(t)o(ions)f(t)o(o)0 1598 y(ps)q(eudoran)o(dom)d(n)n(u)o(m)n(b)q(er)h(gen)o(era)o(t)o(ion.)k Fj(J.)c(A)o(CM)g Fc(25)p Fk(,)f(675-686,)f(\(1978\).)0 1660 y([2])g(Br)q(igh)o(t,)h(H.)g(J.)g(an)o(d)g(Eni)q(son,)g(R.)f(L.)h (Quas)q(i-ran)o(dom)e(n)n(u)o(m)n(b)q(er)i(s)q(equence)q(s)j(f)q(rom)c (a)h(lon)o(g)g(p)q(er)q(io)q(d)g(TLP)g(gen)o(er-)0 1710 y(a)o(t)o(or)h(wit)n(h)g(rem)o(ar)o(ks)g(on)g(ap)o(plica)o(t)o(ions)d (t)o(o)k(crypt)o(ograph)o(y)m(.)j Fj(Computing)d(Surveys)f Fc(11)p Fk(,)f(357-370,)f(\(1979\).)0 1772 y([3])i(Bro)o(wn,M.)h(an)o (d)h(Solomon,)c(H.)j(On)h(com)n(binin)o(g)e(ps)q(eudoran)o(dom)h(n)n(u) o(m)n(b)q(er)g(gen)o(era)o(t)o(ors,)j(T)m(ec)o(hnical)d(Rep)q(ort)0 1821 y(No.)j(233,)13 b(Dept.)18 b(of)13 b(St)o(a)o(t)o(i)q(st)o(ics,)g (St)o(anford)g(Univ)o(ers)q(it)o(y)m(.)18 b(\(1976\).)0 1883 y([4])13 b(F)m(ushimi,)f(M.)h(an)o(d)h(T)m(ezuka,)g(5.)19 b(Th)o(e)14 b(k-di)q(str)q(ibu)o(t)o(ion)f(of)h(gen)o(eralize)q(d)h (fee)q(dbac)o(k)g(shift)f(regi)q(st)o(er)h(ps)q(eudoran-)0 1933 y(dom)d(n)n(u)o(m)n(b)q(ers.)19 b Fj(Communic)n(ations)c(A)o(CM)e Fc(26)p Fk(,)g(516-523,)f(\(1983\).)0 1994 y([5])i(K)o(en)o(d)o(all,)i (D.)f(G.)g(an)o(d)g(Ba)o(bin)o(gt)o(on-Smit)n(h,)f(B.)i(Ran)o(domn)o(e) q(ss)f(an)o(d)g(ran)o(dom)f(samplin)o(g)g(n)n(u)o(m)n(b)q(ers,)i Fj(J.)g(R)n(oyal)0 2044 y(Statist.)i(So)n(c.)h Fc(101)14 b Fk(146-)f(166,\(1938\).)j(See)e(also)g Fj(J.)g(R)n(oyal)h(Statist.)k (So)n(c.)g(Supplement)c Fc(6)f Fk(51-36,)e(\(1939\).)0 2106 y([6])g(Kn)n(u)o(t)n(h,)j(D.)d(E.)h Fj(The)i(A)o(rt)e(of)h (Computer)g(Pr)n(o)n(gr)n(amming,)g(V2:)19 b(Semi-numeric)n(al)13 b(A)o(lgorithms)p Fk(,)f(2n)o(d)h(Edit)o(ion,)0 2156 y(Addi)q(son-W)m(e)q(sley)m(,)f(Readin)o(g,)i(Mass.,)g(\(1981\).)0 2217 y([7])k(Lewi)q(s,T.)f(G.)h(an)o(d)g(P)o(ayn)o(e,)i(W.)e(H.)g(Gen)o (eralize)q(d)i(fee)q(dbac)o(k)f(shift)g(regi)q(st)o(er)g(ps)q(eudoran)o (dom)f(n)n(u)o(m)n(b)q(er)h(al-)0 2267 y(gor)q(it)n(hms.)d Fj(Journal)f(A)o(CM)f Fc(20)p Fk(,)f(456-468,)f(\(1973\).)879 2757 y(10)p eop %%Page: 11 11 11 10 bop 62 -41 a Fk([8])14 b(MacLaren,)g(M.)g(D.)g(an)o(d)g (Marsaglia,)f(G.)h(Uniform)e(ran)o(dom)h(n)n(u)o(m)n(b)q(er)h(gen)o (era)o(t)o(ors,)i Fj(J.)f(A)o(CM)f Fc(12)p Fk(,)g(83-89)0 9 y(\(1965\).)0 70 y([9])d(Marsaglia,)g(G.)h(Ran)o(dom)e(n)n(u)o(m)n(b) q(ers)j(f)q(all)d(m)o(ainly)g(in)i(t)n(h)o(e)h(plan)o(e)q(s.)k Fj(Pr)n(o)n(c)n(e)n(e)n(dings)d(National)f(A)n(c)n(ademy)h(Scienc)n(e)0 120 y Fc(61)p Fk(,)f(25-28)g(\(1968\).)0 182 y([10])e(Marsaglia,)g(G.)h (Th)o(e)h(stru)o(ct)o(ure)h(of)e(lin)o(ear)h(con)o(gruen)o(t)o(ial)f(s) q(equence)q(s,)j Fj(Applic)n(ations)f(of)f(Numb)n(er)h(The)n(ory)f(to)0 232 y(Numeric)n(al)h(A)o(nalysis)p Fk(.)k(Z.)c(K.)f(Zarem)n(ba,)g(Ed.,) g(Acad)o(emic)g(Pre)q(ss,)j(New)e(Y)m(or)o(k,)g(\(1972\).)0 293 y([11])e(Marsaglia.)17 b(G.)12 b(an)o(d)h(L.)g(H.)g(Tsay)m(,)f(Ma)o (tr)q(ice)q(s)i(an)o(d)f(t)n(h)o(e)h(stru)o(ct)o(ure)h(of)e(ran)o(dom)f (n)n(u)o(m)n(b)q(er)h(s)q(equence)q(s.)20 b Fj(Line)n(ar)0 343 y(A)o(lgebr)n(a)14 b(and)i(Its)e(Applic)n(ations)g Fc(67)g Fk(147-156,)d(\(1985\))0 405 y([12])f(Marsaglia,)h(G.)g(an)o(d) g(Bray)m(,)h(T.)f(A.)h(On)o(e-lin)o(e)f(ran)o(dom)f(n)n(u)o(m)n(b)q(er) i(gen)o(era)o(t)o(ors)h(an)o(d)f(t)n(h)o(e)q(ir)g(us)q(e)h(in)e(com)n (bin)o(a)o(t)o(ion,)0 454 y Fj(Communic)n(ations)k(A)o(CM)f Fc(11)p Fk(,)f(757-759,)f(\(1968\).)0 516 y([13])i(Marsh)o(all,)h(A.)g (W.)f(an)o(d)h(Olkin,)g(I.)g Fj(Ine)n(qualities:)21 b(The)n(ory)16 b(of)h(Majorization)f(and)h(its)f(Applic)n(ations)p Fk(,)f(Aca-)0 566 y(d)o(emic)e(Pre)q(ss,)j(New)e(Y)m(or)o(k,)g(\(1979\).)0 628 y([14])g(Whit)n(t)n(le)q(s)q(ey)m(,)h(J.)g(R.)f(B.)i(On)f(t)n(h)o (e)h(m)n(ul)o(t)o(idim)n(ens)q(ion)o(al)c(u)o(niformit)o(y)h(of)h(ps)q (eudoran)o(dom)h(n)n(u)o(m)n(b)q(er)g(gen)o(era)o(t)o(ors.)0 677 y Fj(Comm.)k(A)o(CM)13 b Fc(12)h Fk(247,)e(\(1969\).)879 2757 y(11)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF source/monkey.ps100644 765 144 350426 6073514272 12463 0ustar geousers%!PS-Adobe-2.0 %%Creator: dvipsk 5.58a Copyright 1986, 1994 Radical Eye Software %%Title: monkey.dvi %%Pages: 9 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentPaperSizes: a4 %%EndComments %DVIPSCommandLine: dvips monkey %DVIPSParameters: dpi=300, compressed, comments removed %DVIPSSource: TeX output 1996.01.06:0954 %%BeginProcSet: texc.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} {adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] }if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict /eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (monkey.dvi) @start /Fa 35 119 df<1238127C12FEA3127C123807077C8610>46 D<13181378EA01F812FFA21201B3A7387FFFE0A213207C9F1C>49 DI<13FE3807FFC0380F07E0381E03F0123FEB81F8A3EA1F 0314F0120014E0EB07C0EB1F803801FE007F380007C0EB01F014F8EB00FCA2003C13FE12 7EB4FCA314FCEA7E01007813F8381E07F0380FFFC03801FE0017207E9F1C>I<14E01301 1303A21307130F131FA21337137713E7EA01C71387EA03071207120E120C121812381270 12E0B6FCA2380007E0A790B5FCA218207E9F1C>I<00301320383E01E0383FFFC0148014 005B13F8EA33C00030C7FCA4EA31FCEA37FF383E0FC0383807E0EA3003000013F0A214F8 A21238127C12FEA200FC13F0A2387007E0003013C0383C1F80380FFF00EA03F815207D9F 1C>II<1470A214F8A3497EA2497EA3EB06 7FA2010C7F143FA2496C7EA201307F140F01707FEB6007A201C07F90B5FC4880EB8001A2 D803007F14004880000680A23AFFE007FFF8A225227EA12A>65 DII 70 DI76 DI82 D<3801FE023807FF86381F01FE383C 007E007C131E0078130EA200F81306A27E1400B4FC13E06CB4FC14C06C13F06C13F86C13 FC000313FEEA003F1303EB007F143FA200C0131FA36C131EA26C133C12FCB413F838C7FF E00080138018227DA11F>I87 D97 DI< EBFF80000713E0380F83F0EA1F03123E127E387C01E090C7FC12FCA6127C127EA2003E13 186C1330380FC0603807FFC0C6130015167E9519>II<13FE3807FF80380F87C0381E01E0003E13F0EA7C0014F812 FCA2B5FCA200FCC7FCA3127CA2127E003E13186C1330380FC0703803FFC0C6130015167E 951A>II<3801FE0F3907FFBF80380F87C7381F03E7391E01E000003E7F A5001E5BEA1F03380F87C0EBFF80D809FEC7FC0018C8FCA2121C381FFFE06C13F86C13FE 001F7F383C003F48EB0F80481307A40078EB0F006C131E001F137C6CB45A000113C01921 7F951C>II<121C123FA25A7EA2121CC7FCA7B4FCA2121FB2EAFFE0A20B247EA310>I< B4FCA2121FB3ADEAFFE0A20B237EA210>108 D<3AFF07F007F090391FFC1FFC3A1F303E 303E01401340496C487EA201001300AE3BFFE0FFE0FFE0A22B167E9530>I<38FF07E0EB 1FF8381F307CEB403CEB803EA21300AE39FFE1FFC0A21A167E951F>I<13FE3807FFC038 0F83E0381E00F0003E13F848137CA300FC137EA7007C137CA26C13F8381F01F0380F83E0 3807FFC03800FE0017167E951C>I114 DI<487EA41203A21207A2120F123FB5FCA2EA0F80ABEB8180A5EB83 00EA07C3EA03FEEA00F811207F9F16>I<38FF01FEA2381F003EAF147E14FE380F81BE39 07FF3FC0EA01FC1A167E951F>I<39FFE01FE0A2391F800700000F1306EBC00E0007130C 13E000035BA26C6C5AA26C6C5AA2EB7CC0A2137F6D5AA26DC7FCA2130EA21B167F951E> I E /Fb 5 53 df<121EEA61801240EAC0C0A7EA40801261EA1E000A0D7E8C0E>48 D<121812F81218AA12FF080D7D8C0E>I<123EEA4180EA80C012C01200A2EA0180EA0300 1204EA08401230EA7F8012FF0A0D7E8C0E>I<123E1241EA61801201EA0300121EEA0180 EA00C0A212C0A2EA4180EA3E000A0D7E8C0E>I<12035AA2120B12131223126312C3EAFF C0EA0300A3EA0FC00A0D7E8C0E>I E /Fc 1 89 df88 D E /Fd 9 116 df11 D22 D<13201360A213C0A3EA0180A3EA0300A31206A2 5AA35AA35AA35AA35AA30B1D7E9511>61 D<1206120712061200A41238124CA2128C1298 1218A212301232A21264A2123808147F930C>105 D<1330133813301300A4EA01C0EA02 60EA0430136012081200A213C0A4EA0180A4EA630012E312C612780D1A81930E>I<121E 12065AA45A1338135C139CEA3118EA36001238EA3F80EA61C0EA60C8A3EAC0D013600E14 7F9312>I110 D114 D<1207EA1880EA19C0EA3180EA3800121E7EEA0380124112E1EAC1001282127C0A0D7E8C 10>I E /Fe 2 49 df0 D<1204120EA2121CA31238A212301270 A21260A212C0A2070F7F8F0A>48 D E /Ff 9 104 df0 D<126012F0A2126004047C8B0C>I<0040132000C01360006013C03830018038180300EA 0C066C5A6C5AEA01B0EA00E0A2EA01B0EA0318EA060C487E487E38300180386000C04813 600040132013147A9320>I<1203A4EAC30CEAE31CEA7338EA1FE0EA0780A2EA1FE0EA73 38EAE31CEAC30CEA0300A40E127D9215>I<7F487EEA0360EA0630487E487E487E487E38 C00180A238600300EA30066C5A6C5A6C5A6C5A6C5A6C5A11127E9215>5 D8 D24 D<133C13E0EA01C013801203AD 13005A121C12F0121C12077E1380AD120113C0EA00E0133C0E297D9E15>102 D<12F0121C12077E1380AD120113C0EA00E0133C13E0EA01C013801203AD13005A121C12 F00E297D9E15>I E /Fg 33 123 df<13F8EA030C380E0604EA1C073838030800301388 00701390A200E013A0A214C01480A3EA6007EB0B8838307190380F80E016127E911B>11 DI21 D<3801803000031370A3380700E0A4380E01C0A4381C0388 A3EA1E07383E1990383BE0E00038C7FCA25AA45AA25A151B7F9119>I<3801FFF85A120F 381E1E00EA180EEA38061270A2EAE00EA3130C131C13185BEA60606C5A001FC7FC15127E 9118>27 D<126012F0A2126004047C830C>58 D<126012F0A212701210A41220A2124012 80040C7C830C>I<130113031306A3130CA31318A31330A31360A213C0A3EA0180A3EA03 00A31206A25AA35AA35AA35AA35AA210297E9E15>61 D<12E01278121EEA0780EA01E0EA 0078131EEB0780EB01E0EB0078141EEC0780A2EC1E001478EB01E0EB0780011EC7FC1378 EA01E0EA0780001EC8FC127812E019187D9520>I<903801F80890380E06189038380138 90386000F048481370485A48C71230481420120E5A123C15005AA35AA45CA300701302A2 00305B00385B6C5B6C136038070180D800FEC7FC1D1E7E9C1E>67 D<3801FFC038003C001338A45BA45BA4485AA4485AA448C7FCA45AEAFFE0121C7E9B12> 73 D<3801FFE038003C001338A45BA45BA4485AA438038002A31404EA0700140C141814 38000E13F0B5FC171C7E9B1C>76 D78 D81 D<3801FFFE39003C03C090383800E015F01570A24913F0 A3EC01E001E013C0EC0780EC1E00EBFFF03801C038140C140EA2EA0380A43807001E1508 A2151048130FD8FFE01320C7EA03C01D1D7E9B20>I<001FB512F0391C03807039300700 300020142012601240130E1280A2000014005BA45BA45BA45BA41201EA7FFF1C1C7F9B18 >84 D97 D<123F1207A2120EA45AA4EA39E0EA3A30EA3C1812381270131C A3EAE038A313301370136013C01261EA2300121E0E1D7E9C12>II101 D105 D<1307130FA213061300A6137813 9CEA010C1202131C12041200A21338A41370A413E0A4EA01C01261EAF180EAF30012E612 7C1024809B11>I I<39381F81F0394E20C618394640E81CEB80F0EA8F00008E13E0120EA2391C01C038A315 703938038071A215E115E23970070064D83003133820127E9124>109 DI<380787803809C8603808D03013E0EA11C014 381201A238038070A31460380700E014C0EB0180EB8300EA0E86137890C7FCA25AA4123C B4FC151A819115>112 D114 DI<001C13C0 EA27011247A238870380A2120EA2381C0700A438180E20A3EA1C1E380C26403807C38013 127E9118>117 DI<001CEBC080392701C1C0124714C03987038040A2 120EA2391C070080A3EC0100EA1806A2381C0E02EB0F04380E13083803E1F01A127E911E >I<380787803808C8403810F0C03820F1E0EBE3C03840E1803800E000A2485AA4386380 8012F3EB810012E5EA84C6EA787813127E9118>I122 D E /Fh 12 62 df<1360AAB512F0A238006000AA14167E9119>43 D<120FEA30C0EA6060A2EA4020EAC030A9EA4020EA6060A2EA30C0EA0F000C137E9211> 48 D<120C121C12EC120CAFEAFFC00A137D9211>I<121FEA60C01360EAF07013301260EA 0070A2136013C012011380EA02005AEA08101210EA2020EA7FE012FF0C137E9211>II<136013E0A2EA016012021206120C120812101220126012 C0EAFFFCEA0060A5EA03FC0E137F9211>III<1240EA7FFC13F8EA4010EA80301320EA00401380EA0100A25A12 021206A2120EA512040E147E9311>II<120FEA 3080EA6040EA4060EAC0201330A31240EA6070EA30B0EA0F30120013201360EAE0401380 EA4100123E0C137E9211>I<387FFFE0B512F0C8FCA6B512F06C13E0140A7E8B19>61 D E /Fi 50 122 df<903901FF81FE011FEBEFFF903A7F00FF8F80903AFC01FE1FC03901 F003FC1203D807E013F8EE0F80020190C7FCA7B712F0A22707E001F8C7FCB3A53A7FFE1F FFC0A22A2A7FA927>11 D<49B4EB7FC0011F9038C7FFF0903A7F01FFC038D9FC00EB003C 2701F003FC137E000316FED807E05BA2177C0201143894C7FCA5B812FEA23B07E001F800 7EB3A53C7FFE1FFF87FFE0A2332A7FA937>14 D<123C127EB4FCA21380A2127F123D1201 A3EA0300A31206120E120C5A5A122009147BA912>39 D<123C127EB4FCA21380A2127F12 3D1201A3EA0300A31206120E120C5A5A122009147B8712>44 D48 D<130C131C137CEA07FC12FF12F81200B3ADB512FCA216277BA621>III<141C143CA2147C14FC1301A213031307130E130C13 1813381370136013C01201EA038013001206120E5A12185A12705AB612F0A2C7EAFC00A9 90383FFFF0A21C277EA621>I<00181306381F803EEBFFFC5C5C5C148049C7FC0018C8FC A7EB7F803819FFF0381B80F8381E007E00187FC7FCEC1F80A215C0A3127C12FEA315805A 0078133F006014006C133E001C5B380F01F83807FFE0C690C7FC1A277DA621>II<1230123C003FB512E0A215C0 481480A215003870000600605B5C5A5C5CC75A495AA249C7FC5BA2130E131EA2133EA25B A313FCA41201A76C5A13701B297CA821>III<123C127E12FFA4127E123C1200AB123C127E12FFA412 7E123C081B7B9A12>I<1407A24A7EA34A7EA24A7EA3EC67F0A2ECC7F814C3A290380181 FCA290380301FE1400497F01067FA24980153F011C800118131FA2013FB57EA290397000 0FF001601307A249801503000181491301A248C87E487ED8FFF890381FFFF8A22D297EA8 32>65 D<91387FE002903907FFF80690391FE01E0E90397F00039E01FCEB01FE4848EB00 7ED807F0143E5B4848141E001F150E485AA21606127F90C8FC16005AA97EA26D1406123F A36C6C140C120F6C6C14186D1438D801F814306C6C14E0017FEB03C090391FE00F009038 07FFFC9038007FE027297CA830>67 DII<91387FE002903907FFF8069039 1FE01E0E90397F00039E01FCEB01FE4848EB007ED807F0143E5B4848141E001F150E485A A21606127F90C8FC93C7FC5AA892B512E07E923800FE007F123FA27F121F120F6C7E7FEA 01F86C6C1301017FEB03BE90391FF00F1E903907FFFC0E9039007FE0022B297CA834>71 D73 D77 DI<903801FFC0010F13F890383F80FE9039FE003F 80D801F8EB0FC048486D7E48486D7E000F8148486D7EA248486D7EA2007F8190C87EA348 1680AA6C16006D5CA2003F5DA26C6C495AA26C6C495A6C6C495A00035D6C6C495AD800FE EB3F8090263F80FEC7FC90380FFFF8010113C029297CA832>II<903801FFC0010F13F890383F80FE9039FE003F80D8 01F8EB0FC048486D7E48486D7E000F8148486D7EA248486D7EA2007F81A290C87EA24816 80AA6C1600A26D5C003F5DA26C6C495A143E3A0FE07F03F800079038C183F03A03F180C7 E0D801F9EB6FC0D800FFEB7F8090263FC0FEC7FC90380FFFF80101158090C7123881ED1E 01ED1F0716FF170081A25E6F5A1503ED01F029357CA832>II<9038FF80200003EBF060390F8078E0381E001D4813071403481301A200F813 00A215607EA26C1400EA7F8013F013FF6C13F06C13FC6C7F6C7F00011480D8003F13C001 0113E0EB001FEC0FF01407140312C01401A37E15E07E6CEB03C07EB4EB078039E3E01F00 38C1FFFC38801FF01C297CA825>I<007FB7FCA29039007F007F007C151F00701507A200 608100E01680A2481501A5C791C7FCB3A790B67EA229297EA82E>I<3803FF80000F13E0 381F01F8383F80FC147EA280EA1F00C7FCA4EB3FFF3801FE3FEA0FE0EA1F80EA3F005A12 FE150CA3145F007F139F393F831FF8391FFE0FF03903F807C01E1B7E9A21>97 DIIIII104 D<120FEA1F8013C0123FA2121F1380EA0F00C7FCA8EAFFC0A2120FB3A5EAFFF8A20D2B7E AA13>I107 DI<26FFC0FEEB3F80 903AC3FF80FFE03B0FC60FC183F0903AC807E201F89039D003E40001F001FC7F01E05BA2 01C05BB13CFFFC3FFF0FFFC0A2321B7E9A37>I<38FFC0FE9038C3FF80390FC60FC09038 C807E0EBD00301F013F013E0A213C0B139FFFC3FFFA2201B7E9A25>II<38FFC1FE 9038C7FF80390FDE0FE09038F003F09038E001F801C013FC140015FEA2157FA8157E15FE A215FC140101E013F89038F007F09038DC0FE09038C7FF809038C1FC0001C0C7FCAAEAFF FCA220277E9A25>I<38FF83E0EB8FF8380F8C7CEB98FE13B013A0A2EBE07CEBC000B1EA FFFEA2171B7E9A1B>114 D<3803FC60381FFFE0EA3C03EA7801EA700000F01360A300FC 1300B47EEA7FFC13FF6C13C0000F13E0000313F0EA003FEB03F8EAC00014787EA27E1470 6C13E0EAFE0338E7FF803881FE00151B7E9A1A>I<1360A413E0A21201A212031207121F B512E0A23807E000AE1430A73803F0603801F8C03800FF80EB3F0014267FA51A>I<39FF C03FF0A2000F1303B21407A2140F0007131B3803E0333901FFE3FF38007F83201B7E9A25 >I<39FFF801FFA2390FC000707F000714606D13E0000314C07F0001EB0180A23900FC03 00A26D5AEB7E06EB7F0EEB3F0C148CEB1F98A2EB0FF0A36D5AA26D5AA26D5A201B7F9A23 >I<39FFF80FFEA2390FE001C0D807F013800003EB03003801F806EBFC0E6C6C5AEB7E38 EB3F30EB1FE05C6D7E130780497EEB0DFCEB18FEEB387E497E01E013803901C01FC0EB80 0F39030007E048EB03F039FFE01FFFA2201B7F9A23>120 D<39FFF801FFA2390FC00070 7F000714606D13E0000314C07F0001EB0180A23900FC0300A26D5AEB7E06EB7F0EEB3F0C 148CEB1F98A2EB0FF0A36D5AA26D5AA26D5AA249C7FCA25BEA3006EAFC0E130C5B1338EA 7870EA3FE0EA1F8020277F9A23>I E /Fj 9 98 df<127012F812FCA3127C1204A21208 A3121012201240060E7D850D>44 D<1360EA01E0120F12FF12F31203B3A2387FFF80A211 1B7D9A18>49 DIII<137EEA03FF3807 8180380F03C0EA1E07123C387C03800078C7FCA212F813F8EAFB0E38FA0780EAFC0314C0 00F813E0A41278A214C0123CEB0780381E0F00EA07FEEA03F8131B7E9A18>54 D<1260387FFFE0A214C01480A238E00300EAC0065B5BC65AA25B13E0A212015B1203A412 07A66C5A131C7D9B18>I57 D97 D E /Fk 35 122 df<133C0163133001C1137038018080000314201301D807031340EC0080 390E00010014025CEBE01A380F1021000E1341EC8080EA1A203839C10038300160387000 E0A248EB0100A31402A200605B00705B00305B6C1360380E0380D801FCC7FC1C1F7B9D20 >38 D<12181238127812381208A21210A212201240A21280050C7D830D>44 DI<1304130C131813381378EA07B8EA0070A413E0A4EA01C0A4 EA0380A4EA0700A45AEAFFF00E1C7B9B15>49 D54 D<1206120FA212061200AA1230127812F0126008127C910D>58 D<1418A21438A21478A2 14B8EB0138A2EB023C141C1304130C13081310A21320A2EB7FFCEBC01C1380EA0100141E 0002130EA25A120C001C131EB4EBFFC01A1D7E9C1F>65 D<903803F02090381E0C609038 3002E09038E003C03801C001EA038048C7FC000E1480121E121C123C15005AA35AA41404 A35C12705C6C5B00185B6C485AD80706C7FCEA01F81B1E7A9C1E>67 D73 D<3801FFC038003C001338A45BA45BA4485AA438038002A31404EA0700140C14 181438000E13F0B5FC171C7E9B1A>76 DI< D801FCEBFF80D8001CEB1C00012E13181510A2132701475B13431480A2903881C040A3EB 80E0D801005B1470A300020139C7FCA3141D48131E140EA2120C001C1304EAFF80211C7E 9B1F>I<3801FFFE39003C038090383801C0EC00E0A3EB7001A315C0EBE0031580EC0700 141C3801FFF001C0C7FCA3485AA448C8FCA45AEAFFE01B1C7E9B1C>80 D83 D<001FB512C0381C070138300E0000201480126012405B1280A200001400 5BA45BA45BA4485AA41203EA7FFE1A1C799B1E>I97 D<123F1207A2120EA45AA4EA39E0EA3A18EA3C0C12381270130EA3EAE01CA31318133813 301360EA60C0EA3180EA1E000F1D7C9C13>I<13F8EA0304120EEA1C0EEA181CEA300012 70A25AA51304EA60081310EA3060EA0F800F127C9113>II<13F8EA0704120CEA1802EA38041230EA7008EA7FF0EAE000A5EA6004 1308EA30101360EA0F800F127C9113>IIIII108 D<391C1E078039266318C0394683A0E0384703 C0008E1380A2120EA2391C0701C0A3EC0380D8380E1388A2EC0708151039701C03203930 0C01C01D127C9122>II<13F8EA030CEA0E06487E121812 3000701380A238E00700A3130EA25BEA60185BEA30E0EA0F8011127C9115>I<38038780 3804C860EBD03013E0EA09C014381201A238038070A31460380700E014C0EB0180EB8300 EA0E86137890C7FCA25AA45AB4FC151A809115>I114 DI<12035AA3120EA4EAFFE0EA1C00A35AA45AA4EAE080A2EAE100A2126612380B1A7C99 0E>I<381C0180EA2E03124EA2388E0700A2121CA2EA380EA438301C80A3EA383C38184D 00EA0F8611127C9116>I<381E0183382703871247148338870701A2120EA2381C0E02A3 1404EA180C131C1408EA1C1E380C26303807C3C018127C911C>119 D<381C0180EA2E03124EA2388E0700A2121CA2EA380EA4EA301CA3EA383CEA1878EA0FB8 EA003813301370EAE0605BEA81800043C7FC123C111A7C9114>121 D E /Fl 88 125 df6 D11 D<137E3801C180EA030138 0703C0120EEB018090C7FCA5B512C0EA0E01B0387F87F8151D809C17>II<90383F07E03901C09C18 380380F0D80701133C000E13E00100131892C7FCA5B612FC390E00E01CB03A7FC7FCFF80 211D809C23>I<126012F0A71260AD1200A5126012F0A21260041E7C9D0C>33 D I<126012F012F812681208A31210A2122012401280050C7C9C0C>39 D<1380EA0100120212065AA25AA25AA35AA412E0AC1260A47EA37EA27EA27E12027EEA00 80092A7C9E10>I<7E12407E12307EA27EA27EA37EA41380AC1300A41206A35AA25AA25A 12205A5A092A7E9E10>I<1203A4EAC30CEAE31CEA7338EA1FE0EA0780A2EA1FE0EA7338 EAE31CEAC30CEA0300A40E127D9E15>I<1306ADB612E0A2D80006C7FCAD1B1C7E9720>I< 126012F0A212701210A41220A212401280040C7C830C>II<1260 12F0A2126004047C830C>I<130113031306A3130CA31318A31330A31360A213C0A3EA01 80A3EA0300A31206A25AA35AA35AA35AA35AA210297E9E15>II<5A1207123F12C71207B3A5EAFFF80D1C7C9B15>III<130CA2131C133CA2135C13DC139CEA 011C120312021204120C1208121012301220124012C0B512C038001C00A73801FFC0121C 7F9B15>II<13F0EA030C EA0404EA0C0EEA181E1230130CEA7000A21260EAE3E0EAE430EAE818EAF00C130EEAE006 1307A51260A2EA7006EA300E130CEA1818EA0C30EA03E0101D7E9B15>I<1240387FFF80 1400A2EA4002485AA25B485AA25B1360134013C0A212015BA21203A41207A66CC7FC111D 7E9B15>III<126012F0A212601200AA126012F0A2126004127C910C>I<126012F0A212 601200AA126012F0A212701210A41220A212401280041A7C910C>I<007FB512C0B612E0 C9FCA8B612E06C14C01B0C7E8F20>61 D63 D<1306A3130FA3EB1780A2EB37C01323A2EB43E01341A2EB80F0A338010078A2EBFFF838 02003CA3487FA2000C131F80001E5BB4EBFFF01C1D7F9C1F>65 DI<90381F8080EBE0613801801938070007000E13035A14015A00781300A212 7000F01400A8007014801278A212386CEB0100A26C13026C5B380180083800E030EB1FC0 191E7E9C1E>IIII<90381F8080EBE0613801801938070007000E13035A14015A007813 00A2127000F01400A6ECFFF0EC0F80007013071278A212387EA27E6C130B380180113800 E06090381F80001C1E7E9C21>I<39FFF0FFF0390F000F00AC90B5FCEB000FAD39FFF0FF F01C1C7F9B1F>II<3807FF8038007C00133CB3 127012F8A21338EA7078EA4070EA30E0EA0F80111D7F9B15>I<39FFF01FE0390F000780 EC060014045C5C5C5C5C49C7FC13021306130FEB17801327EB43C0EB81E013016D7E1478 A280143E141E80158015C039FFF03FF01C1C7F9B20>IIIIIIII<3807E080EA1C19EA30051303EA600112E01300A36C 13007E127CEA7FC0EA3FF8EA1FFEEA07FFC61380130FEB07C0130313011280A300C01380 A238E00300EAD002EACC0CEA83F8121E7E9C17>I<007FB512C038700F01006013000040 1440A200C014201280A300001400B1497E3803FFFC1B1C7F9B1E>I<39FFF01FF0390F00 0380EC0100B3A26C1302138000035BEA01C03800E018EB7060EB0F801C1D7F9B1F>I<39 FFE00FF0391F0003C0EC01806C1400A238078002A213C000035BA2EBE00C00011308A26C 6C5AA213F8EB7820A26D5AA36D5AA2131F6DC7FCA21306A31C1D7F9B1F>I<3AFFE1FFC0 FF3A1F003E003C001E013C13186C6D1310A32607801F1320A33A03C0278040A33A01E043 C080A33A00F081E100A39038F900F3017913F2A2017E137E013E137CA2013C133C011C13 38A20118131801081310281D7F9B2B>I<39FFF07FC0390FC01E003807800CEBC0080003 5B6C6C5A13F000005BEB7880137C013DC7FC133E7F7F80A2EB13C0EB23E01321EB40F049 7E14783801007C00027F141E0006131F001F148039FF807FF01C1C7F9B1F>I<39FFF003 FC390F8001E00007EB00C06D13800003EB01006D5A000113026C6C5A13F8EB7808EB7C18 EB3C10EB3E20131F6D5A14C06D5AABEB7FF81E1C809B1F>I<387FFFF0EA7C01007013E0 386003C0A238400780130F1400131E12005B137C13785BA2485A1203EBC010EA0780A2EA 0F00481330001E13205A14604813E0EAF803B5FC141C7E9B19>I<12FEA212C0B3B312FE A207297C9E0C>II<12FEA21206B3B312FEA20729809E0C>I<1208121012201240A21280A3 12B012F812781230050C7D9C0C>96 DI<12FC121CAA13 7CEA1D87381E0180381C00C014E014601470A6146014E014C0381E018038190700EA10FC 141D7F9C17>IIII<13F8EA018CEA071E1206EA0E0C1300A6EAFFE0EA0E00B0EA7FE00F1D809C0D>I< EB03803807C4C0EA1C783838388038301800EA701CA4EA3018EA38386C5AEA27C00020C7 FCA21230EA3FF86CB4FC1480EA2003386001C0EAC000A33860018038300300EA1C0EEA07 F8121C7F9215>I<12FC121CAA137C1387EA1D03001E1380121CAD38FF9FF0141D7F9C17> I<1218123CA21218C7FCA712FC121CB0EAFF80091D7F9C0C>I<13C0EA01E0A2EA00C013 00A7EA07E01200B3A21260EAF0C012F1EA6180EA3E000B25839C0D>I<12FC121CAAEB0F E0EB0780EB06005B13105B5B13E0121DEA1E70EA1C781338133C131C7F130F148038FF9F E0131D7F9C16>I<12FC121CB3A9EAFF80091D7F9C0C>I<39FC7E07E0391C838838391D01 9018001EEBE01C001C13C0AD3AFF8FF8FF8021127F9124>IIII<3803E080EA0E19EA1805EA3807EA7003A212E0A61270A2EA380712 18EA0E1BEA03E3EA0003A7EB1FF0141A7F9116>III<1204A4120CA212 1C123CEAFFE0EA1C00A91310A5120CEA0E20EA03C00C1A7F9910>I<38FC1F80EA1C03AD 1307120CEA0E1B3803E3F014127F9117>I<38FF07E0383C0380381C0100A2EA0E02A2EA 0F06EA0704A2EA0388A213C8EA01D0A2EA00E0A3134013127F9116>I<39FF3FC7E0393C 0703C0001CEB01801500130B000E1382A21311000713C4A213203803A0E8A2EBC0680001 1370A2EB8030000013201B127F911E>I<38FF0FE0381E0700EA1C06EA0E046C5AEA0390 13B0EA01E012007F12011338EA021C1204EA0C0E487E003C138038FE1FF014127F9116> I<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA0388A213C8EA01D0A2EA 00E0A31340A25BA212F000F1C7FC12F312661238131A7F9116>IIII E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: a4 %%BeginPaperSize: a4 a4 %%EndPaperSize %%EndSetup %%Page: 1 1 1 0 bop 62 45 a Fl(Th)o(e)14 b(follo)o(win)o(g)e(i)q(s)h(extract)o(e)q (d)i(f)q(rom)d(an)i(art)o(icle)f(in)0 95 y Fk(Computers)i(&)f (Mathematics)h(with)g(Applic)n(ations,)f Fj(9,)i Fl(1{10,)c(1993.)175 204 y Fi(Monk)n(ey)21 b(T)-6 b(e)r(st)o(s)22 b(for)g(Ran)n(dom)g(Nu)o (m)m(b)q(er)e(Gen)n(era)n(t)o(ors)0 341 y(1)66 b(In)n(tro)r(d)n(u)n(ct) n(ion)0 432 y Fl(F)m(ew)18 b(im)o(age)q(s)e(in)o(v)o(ok)o(e)h(t)n(h)o (e)h(m)o(yst)o(er)q(ie)q(s)f(an)o(d)h(ul)o(t)o(im)o(a)o(t)o(e)d(cert)o (ain)o(t)o(ie)q(s)k(of)e(a)g(s)q(equence)j(of)d(ran)o(dom)f(ev)o(en)o (t)o(s)j(as)0 482 y(w)o(ell)g(as)g(t)n(h)o(a)o(t)h(of)f(t)n(h)o(e)h (pro)o(v)o(erbial)f(monk)o(ey)e(a)o(t)j(a)f(t)o(yp)q(ewr)q(it)o(er.)35 b(Surpr)q(i)q(s)q(in)o(gly)m(,)18 b(m)o(an)o(y)g(que)q(st)o(ions)i(a)o (b)q(ou)o(t)0 532 y(t)n(h)o(e)15 b(monk)o(ey's)d(lit)o(erary)h(ou)o(t)o (pu)o(t|t)n(h)o(e)i(t)o(im)o(e)q(s)e(b)q(et)o(w)o(een)i(ap)o(p)q (earance)q(s)g(of)e(cert)o(ain)i(str)q(in)o(gs,)f(t)n(h)o(e)g(n)n(u)o (m)n(b)q(er)g(of)0 581 y(di)q(st)o(inct)c(four-let)n(t)o(er)h(w)o(ords) f(in)f(a)h(milli)o(on)d(k)o(eystrok)o(e)q(s,)12 b(t)n(h)o(e)e(t)o(im)o (e)f(n)o(ee)q(d)o(e)q(d)j(t)o(o)e(sp)q(ell)f(CA)m(T,)g(for)h (example|are)0 631 y(w)o(ell)k(suit)o(e)q(d)h(for)g(ass)q(e)q(ss)q(in)o (g)h(b)q(ot)n(h)f(u)o(niformit)o(y)e(an)o(d)h(in)o(d)o(ep)q(en)o(d)o (ence)j(in)d(t)n(h)o(e)i(ou)o(t)o(pu)o(t)g(of)e(a)g(ran)o(dom)f(n)n(u)o (m)n(b)q(er)0 681 y(gen)o(era)o(t)o(or)i(\(t)n(h)o(e)f(monk)o(ey\).)j (T)m(ec)o(hnically)m(,)11 b(w)o(e)j(are)g(concer)q(n)o(e)q(d)h(wit)n(h) e(o)o(v)o(erlap)o(pin)o(g)g(m-t)o(uple)q(s)f(of)h(su)o(cce)q(ss)q(iv)o (e)0 731 y(elem)o(en)o(t)o(s)h(in)f(a)h(ran)o(dom)e(s)q(equence.)62 781 y(F)m(or)17 b(y)o(ears,)i(in)e(m)o(y)f(ann)n(ual)g(cours)q(e)j (Compu)o(t)o(er)e(M)o(et)n(h)o(o)q(ds)i(in)e(Proba)o(bilit)o(y)f(an)o (d)h(St)o(a)o(t)o(i)q(st)o(ics,)g(I)g(calle)q(d)0 830 y(t)n(h)o(e)q(s)q(e)d(Ov)o(erlap)o(pin)o(g)f(m-T)m(uple)d(T)m(e)q(st)o (s.)19 b(Bu)o(t)14 b(for)f(t)n(h)o(e)g(last)g(few)f(y)o(ears)i(I)f(h)o (a)o(v)o(e)f(us)q(e)q(d)i(t)n(h)o(e)f(monk)o(ey)f(m)o(et)o(aph)o(or.)0 880 y(It)i(s)q(eems)g(a)g(b)q(et)n(t)o(er)i(w)o(ay)e(t)o(o)g(st)o(im)n (ula)o(t)o(e)f(t)n(h)o(e)i(in)o(t)o(ere)q(st)o(s)h(of)e(t)n(h)o(e)h(st) o(ud)o(en)o(t)o(s)h(an)o(d,)d(b)o(y)h(in)o(v)o(okin)o(g)f(an)h(in)o(t)o (ere)q(st)o(in)o(g)0 930 y(im)o(age,)d(m)o(ak)o(e)i(t)n(h)o(em)g(more)g (readily)h(accept)h(t)n(h)o(e)g(id)o(eas)f(an)o(d)g(ev)o(en)g(feel)g (as)g(t)n(h)o(ough)g(t)n(h)o(ey)h(w)o(ere)g(t)n(h)o(e)q(ir)f(o)o(wn.)62 980 y(W)m(e)h(h)o(o)o(p)q(e)g(it)g(will)e(h)o(a)o(v)o(e)i(a)g(s)q (imilar)d(e\013ect)17 b(on)e(y)o(ou,)f(t)n(h)o(e)i(read)o(er|not)h(t)n (h)o(a)o(t)e(I)g(n)o(ece)q(ssar)q(ily)i(equa)o(t)o(e)e(y)o(ou)0 1030 y(wit)n(h)f(t)n(h)o(e)g(st)o(ud)o(en)o(t)o(s)i(\(or)e(t)n(h)o(e)h (monk)o(ey\).)62 1080 y(Thi)q(s)f(art)o(icle)f(d)o(e)q(scr)q(ib)q(e)q (s)i(som)o(e)e(v)o(ery)h(s)q(imple,)d(as)j(w)o(ell)f(as)h(som)o(e)f (quit)o(e)g(so)o(phi)q(st)o(ica)o(t)o(e)q(d,)g(t)o(e)q(st)o(s)j(t)n(h)o (a)o(t)e(sh)o(e)q(d)0 1129 y(ligh)o(t)c(on)h(t)n(h)o(e)h(suit)o(a)o (bilit)o(y)d(of)h(cert)o(ain)i(ran)o(dom)d(n)n(u)o(m)n(b)q(er)i(gen)o (era)o(t)o(ors.)19 b(Th)o(e)11 b(gen)o(era)o(t)o(ors)i(are)f(us)q(e)q (d)f(t)o(o)h(pro)o(vid)o(e)0 1179 y(t)n(h)o(e)j(ran)o(dom)e(k)o (eystrok)o(e)q(s)i(for)f(our)h(monk)o(ey)m(.)i(Th)o(e)e(k)o(eyb)q (oards)g(ran)o(ge)g(f)q(rom)d(t)n(h)o(e)j(st)o(an)o(d)o(ard)g(26)f(up)o (p)q(er-cas)q(e)0 1229 y(let)n(t)o(ers)f(t)o(o)f(an)f(organ-lik)o(e)e (k)o(eyb)q(oard)j(wit)n(h)f(1024)f(k)o(eys)i(t)o(o)f(t)n(h)o(e)h(DNA)g (k)o(eyb)q(oard)f(wit)n(h)g(four)g(k)o(eys:)17 b(C,G,A,T.)0 1366 y Fi(2)88 b(CA)-6 b(T)22 b(T)-6 b(e)r(st)o(s)0 1457 y Fl(No)o(w,)16 b(t)o(o)h(bus)q(in)o(e)q(ss.)28 b(St)o(art)17 b(wit)n(h)f(an)g(id)o(ea)i(t)n(h)o(a)o(t)e(pro)o(vid)o(e)q(s)i(a)e(v)o (ery)h(in)o(e\016cien)o(t)f(t)o(e)q(st,)i(bu)o(t)g(on)o(e)e(t)n(h)o(a)o (t)h(som)o(e)0 1507 y(ran)o(dom)12 b(n)n(u)o(m)n(b)q(er)i(gen)o(era)o (t)o(ors)i(\(RNG's\))e(f)q(ail.)i(Our)f(monk)o(ey)d(\(RNG\))i(h)o(as)g (a)g(t)o(yp)q(ewr)q(it)o(er)g(wit)n(h)g(26)g(up)o(p)q(er-)0 1557 y(cas)q(e)i(let)n(t)o(ers)h(A,B,...,Z)c(t)n(h)o(a)o(t)j(h)o(e)f (str)q(ik)o(e)q(s)h(a)o(t)f(ran)o(dom.)21 b(\(Assu)o(m)o(e)16 b(our)f(RNG)f(monk)o(ey)g(pro)q(d)o(u)o(ce)q(s)j(u)o(niform)0 1607 y(reals)e(in)f([0,1\),)f(say)i(b)o(y)f(m)o(eans)g(of)g(a)h(pro)q (ce)q(d)o(ure)h(UNI\(\).)21 b(Th)o(e)15 b(in)o(t)o(eger)f(part)h(of)f (26.*UNI\(\))g(pro)o(vid)o(e)q(s)h(t)n(h)o(e)0 1656 y(ran)o(dom)d(k)o (eystrok)o(e.\))20 b(No)o(w)14 b(t)n(h)o(e)h(CA)m(T)f(t)o(e)q(st:)20 b(h)o(o)o(w)14 b(m)o(an)o(y)e(k)o(eys)i(m)n(ust)g(t)n(h)o(e)h(monk)o (ey)e(str)q(ik)o(e)h(u)o(n)o(t)o(il)g(h)o(e)g(sp)q(ells)0 1706 y(CA)m(T?)62 1756 y(Th)o(ere)h(are)g(26)293 1741 y Fh(3)323 1756 y Fl(=)d(17)p Fg(;)7 b Fl(576)12 b(p)q(oss)q(ible)j (3-let)n(t)o(er)g(w)o(ords,)e(so)i(t)n(h)o(e)f(a)o(v)o(erage)h(n)n(u)o (m)n(b)q(er)e(of)h(k)o(eystrok)o(e)q(s)h(n)o(ece)q(s-)0 1806 y(sary)e(t)o(o)g(pro)q(d)o(u)o(ce)h(CA)m(T)e(sh)o(ould)g(b)q(e)h (arou)o(n)o(d)g(17,576,)e(an)o(d)h(t)n(h)o(e)h(t)o(im)o(e)f(t)o(o)h (reac)o(h)g(CA)m(T)g(sh)o(ould)f(b)q(e)h(v)o(ery)g(clos)q(e)0 1856 y(t)o(o)g(exp)q(on)o(en)o(t)o(ially)e(di)q(str)q(ibu)o(t)o(e)q(d.) 18 b(Exact)13 b(an)o(d)g(ap)o(pro)o(xim)o(a)o(t)o(e)d(di)q(str)q(ibu)o (t)o(ions,)i(an)o(d)g(more)g(e\016cien)o(t)h(t)o(e)q(st)o(s,)i(are)0 1906 y(b)q(ello)o(w;)d(for)i(no)o(w,)f(let's)h(try)g(t)n(hi)q(s)f(s)q (imple)f(CA)m(T)h(t)o(e)q(st)i(for)f(a)g(few)f(common)f(RNG's.)62 1955 y(Th)o(e)17 b(con)o(gruen)o(t)o(ial)g(monk)o(ey)m(,)e Fg(I)20 b Fl(=)d(69069)10 b Ff(\003)h Fg(I)k Fl(mo)q(d)c(2)932 1940 y Fh(32)966 1955 y Fl(,)18 b(con)o(v)o(ert)o(in)o(g)f(t)o(o)g(a)g (real)g(UNI)g(on)g([0,1\),)f(get)o(s)0 2005 y(CA)m(T)d(aft)o(er)h (13,561)e(k)o(eystrok)o(e)q(s,)j(t)n(h)o(en)g(aft)o(er)f(18,263,)e(t)n (h)o(en)i(anot)n(h)o(er)h(14,872)d(strok)o(e)q(s)j(pro)q(d)o(u)o(ce)q (s)g(t)n(h)o(e)g(t)n(hird)0 2055 y(CA)m(T.)e(Quit)o(e)h(sa)o(t)o(i)q (sf)q(act)o(ory)m(.)62 2105 y(No)o(w)h(cons)q(id)o(er)h(t)n(h)o(e)g (shift-regi)q(st)o(er)f(\(T)m(a)n(us)q(ew)o(ort)n(h)o(e\))i(monk)o(ey)c (t)n(h)o(a)o(t)i(pro)q(d)o(u)o(ce)q(s)i(31-bit)d(in)o(t)o(egers)i(b)o (y)f(ex-)0 2155 y(clus)q(iv)o(e)e(or's,)f(left)h(shift)g(28)g(an)o(d)g (r)q(igh)o(t)f(shift)h(3.)k(Thi)q(s)c(i)q(s)f(t)n(h)o(e)i(v)o(ery)g (gen)o(era)o(t)o(or)g(sugge)q(st)o(e)q(d)h([8)o(])e(as)g(a)g(replace-)0 2204 y(m)o(en)o(t)g(for)h(con)o(gruen)o(t)o(ial)f(gen)o(era)o(t)o(ors)j (aft)o(er)e(di)q(sco)o(v)o(ery)g(of)g(t)n(h)o(e)q(ir)h(la)o(t)n(t)o (ice)f(stru)o(ct)o(ure)i([3)o(].)i(Th)o(e)c(shift-regi)q(st)o(er)0 2254 y(monk)o(ey)f(n)o(ev)o(er)j(sp)q(ells)f(CA)m(T,)f(ev)o(en)h(aft)o (er)g(t)o(w)o(o)f(million)e(k)o(eystrok)o(e)q(s.)22 b(He)15 b(can't)g(get)g(KA)m(T,)f(DOG,)g(GOD,)0 2304 y(SEX,)d(W)o(O)o(W)g(or)h (ZIG)f(e)q(it)n(h)o(er.)18 b(Bu)o(t)13 b(h)o(e)f(can)f(get)h(ZA)o(G,)f (an)o(d)g(t)o(o)q(o)h(oft)o(en|ev)o(ery)g(few)f(t)n(h)o(ousan)o(d)h(k)o (eystrok)o(e)q(s.)0 2354 y(In)o(d)o(ee)q(d,)j(it)f(t)o(ur)q(ns)h(ou)o (t)f(t)n(h)o(a)o(t)h(t)n(hi)q(s)f(monk)o(ey)e(w)o(as)j(only)e(a)o(ble)h (t)o(o)g(get)h(7,834)d(of)i(t)n(h)o(e)h(p)q(oss)q(ible)g(17,576)d (3-let)n(t)o(er)0 2404 y(w)o(ords,)j(\(in)g(a)f(str)q(in)o(g)i(of)e (1,000,000)e(k)o(eystrok)o(e)q(s\))17 b(an)o(d)d(of)h(cours)q(e)h(wit)n (h)f(hi)q(s)f(limit)o(e)q(d)f(v)o(o)q(ca)o(bulary)m(,)h(h)o(e)h(get)o (s)0 2453 y(t)n(h)o(os)q(e)g(w)o(ords)f(t)o(o)q(o)g(oft)o(en.)62 2503 y(Not)o(e)g(t)n(h)o(a)o(t)f(in)o(a)o(bilit)o(y)e(t)o(o)j(get)f(CA) m(T)g(sh)o(ould)g(not)g(b)q(e)g(a)o(t)n(tr)q(ibu)o(t)o(e)q(d)i(t)o(o)e (t)n(h)o(e)h(equiv)n(alen)o(t)e(of)h(brok)o(en)h(k)o(eys)f(on)0 2553 y(t)n(h)o(e)g(t)o(yp)q(ewr)q(it)o(er.)18 b(Thi)q(s)12 b(monk)o(ey)g(st)o(ill)f(t)o(yp)q(e)q(s)j(eac)o(h)f(of)f(t)n(h)o(e)i (let)n(t)o(ers)g(A)f(t)o(o)g(Z)g(wit)n(h)g(t)n(h)o(e)g(exp)q(ect)o(e)q (d)h(f)q(requencie)q(s)0 2603 y(\(an)o(d)k(t)n(h)n(us)i(w)o(ould)d (pass)j(a)e(st)o(an)o(d)o(ard)h(t)o(e)q(st)h(for)e(let)n(t)o(er)i(f)q (requency\).)32 b(F)m(or)18 b(example,)g(26,000)f(k)o(eystrok)o(e)q(s)0 2653 y(pro)q(d)o(u)o(ce)q(d)d(984)e(C's,)h(967)f(A's)g(an)o(d)h(1021)f (T's,)g(quit)o(e)h(sa)o(t)o(i)q(sf)q(act)o(ory)m(.)k(Y)m(et)c(con)o(t)o (in)n(uin)o(g)f(t)n(h)o(e)i(ru)o(n)g(t)o(o)f(2,600,000)0 2703 y(k)o(eystrok)o(e)q(s)i(f)q(aile)q(d)e(t)o(o)h(pro)q(d)o(u)o(ce)h (a)e(s)q(in)o(gle)h(CA)m(T!)62 2752 y(As)k(s)q(illy)d(as)j(it)e(s)q (eems,)i(t)n(hi)q(s)f(i)q(s)g(a)f(v)o(ery)i(e\013ect)o(iv)o(e)h(an)o(d) d(con)o(vincin)o(g)h(w)o(ay)g(t)o(o)g(sh)o(o)o(w)g(t)n(h)o(e)h(u)o (nsuit)o(a)o(bilit)o(y)0 2802 y(of)g(cert)o(ain)h(ran)o(dom)d(n)n(u)o (m)n(b)q(er)j(gen)o(era)o(t)o(ors.)33 b(Y)m(ou)18 b(m)o(ay)e(eas)q(ily) i(wr)q(it)o(e)g(a)g(program)f(an)o(d)h(try)h(it)f(y)o(ours)q(elf.)845 2978 y(1)p eop %%Page: 2 2 2 1 bop 0 45 a Fl(Al)o(t)n(h)o(ough)12 b(d)o(et)o(ails)g(h)o(a)o(v)o(e) g(b)q(een)h(lost,)f(I)g(rem)o(em)n(b)q(er)f(us)q(in)o(g)g(t)n(h)o(e)i (CA)m(T)f(t)o(e)q(st)h(t)o(o)f(sh)o(o)q(ot)h(do)o(wn)e(RNG's)h(pro)o (vid)o(e)q(d)0 95 y(wit)n(h)i(A)n(p)o(ple)f(an)o(d)h(Radio)e(Sh)o(ac)o (k)i(compu)o(t)o(ers)g(\(TRS80's)f(?\))18 b(wh)o(en)d(t)n(h)o(ey)f (\014rst)h(cam)o(e)e(ou)o(t)h(in)g(t)n(h)o(e)g(1970's.)0 232 y Fi(3)88 b(More)21 b(E\016cien)n(t)h(T)-6 b(e)r(st)o(s)0 323 y Fl(Most)13 b(of)e(our)g(RNG)g(monk)o(ey's)f(ou)o(t)o(pu)o(t)j(i)q (s)e(w)o(ast)o(e)q(d)h(if)f(w)o(e)h(only)f(cou)o(n)o(t)h(t)n(h)o(e)h(n) n(u)o(m)n(b)q(er)e(of)g(k)o(eystrok)o(e)q(s)i(b)q(et)o(w)o(een)0 373 y(su)o(cce)q(ss)q(iv)o(e)g(ap)o(p)q(earance)q(s)g(of)d(CA)m(T,)h (DOG)f(or)h(som)o(e)f(su)o(c)o(h)i(3-let)n(t)o(er)g(w)o(ord.)17 b(So,)11 b(inst)o(ead,)h(sup)o(p)q(os)q(e)g(w)o(e)f(cou)o(n)o(t)0 423 y(t)n(h)o(e)g(f)q(requencie)q(s)h(of)e(all)g(t)n(h)o(e)h(p)q(oss)q (ible)g(3-let)n(t)o(er)h(w)o(ords)f(pro)q(d)o(u)o(ce)q(d)g(in)f(a)h (str)q(in)o(g)g(of,)f(say)h(1,757,603)d(k)o(eystrok)o(e)q(s)0 473 y(\(t)n(h)o(e)13 b(extra)g(3)f(so)g(t)n(h)o(a)o(t)h(w)o(e)f(h)o(a)o (v)o(e)g(exact)n(ly)h(1,757,600)c(3-let)n(t)o(er)14 b(w)o(ords,)e(an)o (d)g(our)g(exp)q(ect)o(e)q(d)i(f)q(requency)f(i)q(s)f(100)0 522 y(for)j(eac)o(h)i(part)o(icular)e(w)o(ord\).)24 b(W)m(e)15 b(n)o(ee)q(d)i(an)e(array)h(of)f(17576)g(elem)o(en)o(t)o(s)h(t)o(o)g (cou)o(n)o(t)g(t)n(h)o(e)g(f)q(requencie)q(s.)25 b(Let)0 572 y Fg(x)24 578 y Fh(1)42 572 y Fg(;)7 b(x)85 578 y Fh(2)103 572 y Fg(;)g(:)g(:)g(:)e(;)i(x)220 578 y Fh(17576)318 572 y Fl(b)q(e)14 b(t)n(h)o(e)g(obs)q(erv)o(e)q(d)i(cou)o(n)o(t)o(s.)62 622 y(T)m(ec)o(hnically)m(,)e(t)n(h)o(e)j Fg(x)p Fl('s)e(are)h(asympt)o (ot)o(ically)d(join)o(t)n(ly)h(norm)o(ally)f(di)q(str)q(ibu)o(t)o(e)q (d)j(\(t)n(h)o(ey)h(are)f(m-d)o(ep)q(en)o(d)o(en)o(t)0 672 y(v)n(ar)q(ia)o(ble)q(s\),)k(an)o(d)g(t)n(h)o(e)h(ap)o(pro)o(pr)q (ia)o(t)o(e)e(st)o(a)o(t)o(i)q(st)o(ical)g(t)o(e)q(st)i(i)q(s)f(t)n(h)o (e)h(quadra)o(t)o(ic)e(form)g(in)g(t)n(h)o(e)i(w)o(eak)g(in)o(v)o(ers)q (e)g(of)0 722 y(t)n(h)o(e)g(co)o(v)n(ar)q(iance)f(m)o(a)o(tr)q(ix)f(of) h(t)n(h)o(e)h Fg(x)p Fl('s,)g(t)n(h)o(a)o(t)g(i)q(s)f(t)n(h)o(e)h (quadra)o(t)o(ic)f(form)f(in)h(t)n(h)o(e)i(v)n(ar)q(ia)o(ble)q(s)d Fg(x)1484 728 y Fh(1)1509 722 y Ff(\000)7 b Fl(100)p Fg(;)g(x)1654 728 y Fh(2)1678 722 y Ff(\000)0 771 y Fl(100)p Fg(;)g(:)g(:)g(:)t(;)g(x)179 777 y Fh(17576)268 771 y Ff(\000)e Fl(100)17 b(wit)n(h)g(co)q(e\016cien)o(t)o(s)i(t)n(h)o(e)f (elem)o(en)o(t)o(s)g(of)f(an)o(y)g(w)o(eak)h(in)o(v)o(ers)q(e)g Fg(C)1354 756 y Fe(\000)1399 771 y Fl(of)f(t)n(h)o(e)h(co)o(v)n(ar)q (iance)0 821 y(m)o(a)o(tr)q(ix)10 b(of)i(t)n(h)o(e)h Fg(x)p Fl('s.)k(\(If)c(t)n(h)o(a)o(t)f(co)o(v)n(ar)q(iance)g(m)o(a)o (tr)q(ix)e(i)q(s)i Fg(C)s Fl(,)g(t)n(h)o(en)h(a)g(w)o(eak)f(in)o(v)o (ers)q(e)i Fg(C)1294 806 y Fe(\000)1334 821 y Fl(sa)o(t)o(i)q(s\014e)q (s)f Fg(C)s(C)1551 806 y Fe(\000)1578 821 y Fg(C)h Fl(=)e Fg(C)s Fl(,)0 871 y(an)o(d)i(t)n(h)o(e)g(v)n(alue)f(of)h(t)n(h)o(e)g (quadra)o(t)o(ic)g(form)e(i)q(s)h(in)o(v)n(ar)q(ian)o(t)f(\(wit)n(h)i (proba)o(bilit)o(y)e(1\))i(u)o(n)o(d)o(er)h(c)o(h)o(oice)f(of)g Fg(C)1559 856 y Fe(\000)1586 871 y Fl(.\))62 921 y(Not)o(e)c(t)n(h)o(a) o(t)f(t)n(h)o(e)h(quadra)o(t)o(ic)f(form)e(\006\(obs)q(erv)o(e)q(d-exp) q(ect)o(e)r(d)s(\))969 906 y Fh(2)987 921 y Fg(=)p Fl(exp)q(ect)o(e)q (d)r(,)i(P)o(earson's)i(class)q(ical)e(c)o(hi-square,)0 971 y(i)q(s)16 b(not)g(t)n(h)o(e)i(ap)o(pro)o(pr)q(ia)o(t)o(e)d(t)o(e)q (st.)27 b(Th)o(a)o(t)17 b(t)o(e)q(st)g(ap)o(plie)q(s)f(only)g(for)g(t)n (h)o(e)h(class)q(ical)f(o)q(ccupancy)i(problem)d(\(m)n(ul-)0 1020 y(t)o(inomial)h(di)q(str)q(ibu)o(t)o(ion\),)j(wh)o(ere)q(in)g (balls)f(are)i(pu)o(t)f(in)o(t)o(o)g(cells)g(in)o(d)o(ep)q(en)o(d)o(en) o(t)n(ly)m(.)33 b(Here)21 b(w)o(e)e(do)f(not)h(h)o(a)o(v)o(e)0 1070 y(in)o(d)o(ep)q(en)o(d)o(ence;)f(increm)o(en)o(t)o(in)o(g)e(t)n(h) o(e)g(cou)o(n)o(t)h(for,)e(say)m(,)h(QCA)g(cert)o(ainly)g(in\015uence)q (s)i(a)d(p)q(oss)q(ible)h(increm)o(en)o(t)0 1120 y(for)i (CAA,CAB,...,CAZ,)e(whic)o(h)o(ev)o(er)j(t)n(h)o(e)g(n)o(ext)g(k)o (eystrok)o(e)g(br)q(in)o(gs,)g(bu)o(t)g(do)q(e)q(s)g(not)f(in\015uence) i(p)q(oss)q(ible)0 1170 y(increm)o(en)o(t)o(s)14 b(t)o(o)g(t)n(h)o(e)h (ot)n(h)o(er)g(cells.)62 1220 y(Bu)o(t)j(it)e(t)o(ur)q(ns)h(ou)o(t)f (\(s)q(ee)i([4)o(]\))f(t)n(h)o(a)o(t)f(w)o(e)h(get)g(t)n(h)o(e)g (correct)h(\(or)f(ra)o(t)n(h)o(er,)g Fj(a)g Fl(correct\))h(quadra)o(t)o (ic)e(form)f(b)o(y)0 1270 y(ap)o(plyin)o(g)e(P)o(earson's)i(form)d(t)o (wice:)19 b(If)14 b(w)o(e)h(n)o(aiv)o(ely)e(get)h(P)o(earsons)i(quadra) o(t)o(ic)e(form)e(for)i(t)n(h)o(e)h(3-let)n(t)o(er)g(w)o(ord)0 1319 y(cou)o(n)o(t)o(s)g Fg(u)153 1325 y Fh(1)172 1319 y Fg(;)7 b(u)215 1325 y Fh(2)233 1319 y Fg(;)g(:)g(:)g(:)t(;)g(u)349 1325 y Fh(17576)433 1319 y Fl(:)627 1407 y Fg(Q)660 1413 y Fh(3)690 1407 y Fl(=)733 1355 y Fd(i)p Fh(=17576)763 1367 y Fc(X)767 1456 y Fd(i)p Fh(=1)865 1379 y Fl(\()p Fg(u)905 1385 y Fd(i)928 1379 y Ff(\000)j Fl(100\))1049 1364 y Fh(2)p 865 1397 202 2 v 935 1435 a Fl(100)1072 1407 y Fg(;)0 1518 y Fl(an)o(d)15 b(if)f(w)o(e)h(also)f(cou)o(n)o(t)i (t)n(h)o(e)g(f)q(requencie)q(s)g(of)f(2-let)n(t)o(er)g(w)o(ords)h(in)e (t)n(h)o(e)i(\014rst)g(1,757,602)c(k)o(eystrok)o(e)q(s)17 b(an)o(d)d(us)q(e)0 1568 y(t)n(h)o(e)h(n)o(aiv)o(e)e(P)o(earson)i(form) d(for)i(2-let)n(t)o(er)h(w)o(ords)f(wit)n(h)g(exp)q(ect)o(e)q(d)h(cell) f(cou)o(n)o(t)o(s)h(2600:)635 1697 y Fg(Q)668 1703 y Fh(2)698 1697 y Fl(=)741 1645 y Fd(i)p Fh(=676)755 1657 y Fc(X)758 1746 y Fd(i)p Fh(=1)840 1669 y Fl(\()p Fg(v)876 1675 y Fd(i)900 1669 y Ff(\000)9 b Fl(2600\))1041 1654 y Fh(2)p 840 1687 219 2 v 908 1725 a Fl(2600)1064 1697 y Fg(;)0 1824 y Fl(wh)o(ere)k Fg(v)137 1830 y Fh(1)156 1824 y Fg(;)7 b(v)195 1830 y Fh(2)213 1824 y Fg(;)g(:)g(:)g(:)e(;)i(v) 326 1830 y Fh(676)389 1824 y Fl(are)12 b(t)n(h)o(e)g(cou)o(n)o(t)o(s)h (for)f(t)n(h)o(e)g(p)q(oss)q(ible)g(2-let)n(t)o(er)h(w)o(ords,)f(t)n(h) o(en)g(t)n(h)o(e)h(di\013erence,)g Fg(Q)1586 1830 y Fh(3)1610 1824 y Ff(\000)5 b Fg(Q)1680 1830 y Fh(2)1698 1824 y Fl(,)0 1874 y(i)q(s)19 b(a)h(zero-cen)o(t)o(ere)q(d)j(quadra)o(t)o(ic)c (form)f(in)i(a)g(w)o(eak)g(in)o(v)o(ers)q(e)g(of)g(t)n(h)o(e)g(co)o(v)n (ar)q(iance)g(m)o(a)o(tr)q(ix)e(of)h(t)n(h)o(e)i(cou)o(n)o(t)o(s)0 1924 y Fg(x)24 1930 y Fh(1)42 1924 y Fg(;)7 b(:)g(:)g(:)e(;)i(x)159 1930 y Fh(17576)243 1924 y Fl(,)18 b(an)o(d)f(i)q(s)f(t)n(h)o(e)i(ap)o (pro)o(pr)q(ia)o(t)o(e)f(\(lik)o(elih)o(o)q(o)q(d)e(ra)o(t)o(io\))i(t)o (e)q(st)h(t)n(h)o(a)o(t)g(t)n(h)o(e)g Fg(x)p Fl('s)f(cam)o(e)f(f)q(rom) f(a)i(norm)o(al)0 1974 y(di)q(str)q(ibu)o(t)o(ion)c(wit)n(h)h(t)n(h)o (e)g(sp)q(eci\014e)q(d)h(m)o(eans)f(an)o(d)f(co)o(v)n(ar)q(iance)h(m)o (a)o(tr)q(ix.)62 2024 y(If)e(t)n(h)o(e)h(h)o(yp)q(ot)n(h)o(e)q(s)q(i)q (s)f(i)q(s)g(true)h(\(t)n(h)o(e)g(monk)o(ey)e(i)q(s)g(str)q(ikin)o(g)h (t)n(h)o(e)h(k)o(eys)g(u)o(niformly)d Fk(and)k(indep)n(endently)p Fl(\),)f(t)n(h)o(en)0 2073 y Fg(Q)33 2079 y Fh(3)59 2073 y Ff(\000)8 b Fg(Q)132 2079 y Fh(2)163 2073 y Fl(will)k(h)o(a)o(v)o(e)h (a)f(c)o(hi-square)i(di)q(str)q(ibu)o(t)o(ion)e(wit)n(h)h(26)923 2058 y Fh(3)949 2073 y Ff(\000)8 b Fl(26)1031 2058 y Fh(2)1062 2073 y Fl(d)o(egree)q(s)15 b(of)e(f)q(ree)q(dom,)e(\(t)n(h)o (e)j(rank)f(of)g Fg(C)s Fl(\).)0 2211 y Fi(4)99 b(Spars)q(e)32 b(Occupancy)h(T)-6 b(e)r(st)o(s:)51 b(OPSO,)32 b(OTSO,)g(OQSO)f(an)n(d) 99 2285 y(DNA)0 2376 y Fl(Wh)o(a)o(t)13 b(if)g(w)o(e)g(w)o(an)o(t)g(t)o (o)h(ap)o(ply)e(t)n(h)o(e)j(a)o(b)q(o)o(v)o(e)e(t)o(e)q(st)i(t)o(o,)e (say)m(,)g(4-let)n(t)o(er)h(w)o(ords?)k(W)m(e)13 b(migh)o(t)f(t)o(ak)o (e)h(a)h(str)q(in)o(g)f(of)g(t)o(w)o(o)0 2426 y(millio)o(n)e(k)o (eystrok)o(e)q(s)k(an)o(d)f(cou)o(n)o(t)g(t)n(h)o(e)h(f)q(requencie)q (s)g(of)e(all)f(t)n(h)o(e)j(p)q(oss)q(ible)f(26)1187 2411 y Fh(4)1217 2426 y Fl(=)d(456976)i(four-let)n(t)o(er)h(w)o(ords.)0 2476 y(Bu)o(t)k(t)n(h)o(a)o(t)g(require)q(s)g(an)g(array)f(of)f (456,976)g(elem)o(en)o(t)o(s.)28 b(Th)o(a)o(t)17 b(m)o(an)o(y)f(b)o(yt) o(e)q(s)i(will)d(do,)j(if)e(t)n(h)o(e)i(f)q(requencie)q(s)0 2526 y(are)g(100)f(or)h(so.)29 b(Th)o(a)o(t's)17 b(h)o(alf)g(a)g(m)o (eg)g(of)g(b)o(yt)o(e)q(s|quit)o(e)h(a)f(few.)29 b(W)m(e)18 b(migh)o(t)d(m)o(an)o(age)h(wit)n(h)i(a)f(carefully)0 2576 y(t)o(ailore)q(d)c(program,)f(bu)o(t)j(w)o(e)f(are)h(pre)q(ss)q (in)o(g)g(t)n(h)o(e)g(limit.)g(Cou)o(n)o(t)o(in)o(g)f(5-t)o(uple)f(or)h (6-t)o(uple)f(f)q(requencie)q(s)j(s)q(eems)0 2625 y(b)q(ey)o(on)o(d)g (reac)o(h.)25 b(\(Not)o(e)17 b(t)n(h)o(a)o(t,)f(in)g(ord)o(er)h(t)o(o)f (in)o(v)o(ok)o(e)f(asympt)o(ot)o(ic)g(join)o(t)g(norm)o(alit)o(y)f(for) h(t)n(h)o(e)i(m-d)o(ep)q(en)o(d)o(en)o(t)0 2675 y(cell)12 b(cou)o(n)o(t)o(s,)i(w)o(e)f(n)o(ee)q(d)g(exp)q(ect)o(e)q(d)h(cou)o(n)o (t)o(s)g(of)d(som)o(e)h(20)g(or)g(more,)f(so)i(w)o(e)f(will)f(n)o(ee)q (d)j(a)o(t)e(least)h(6)f(bit)o(s)h(for)f(eac)o(h)0 2725 y(cell.\))62 2775 y(An)o(d)h(y)o(et)g(4-,5-,6-t)o(uple)q(s,)d(an)o(d)j (lon)o(ger,)g(are)g(wh)o(ere)h(w)o(e)e(are)i(more)d(lik)o(ely)h(t)o(o)h (\014n)o(d)f(u)o(n)o(accept)o(a)o(ble)i(ou)o(t)o(pu)o(t)0 2825 y(f)q(rom)e(our)i(RNG)f(monk)o(eys.)845 2978 y(2)p eop %%Page: 3 3 3 2 bop 62 45 a Fl(Wh)o(a)o(t)14 b(t)o(o)g(do?)19 b(My)14 b(ap)o(proac)o(h)g(i)q(s)f(t)n(hi)q(s:)19 b(inst)o(ead)14 b(of)g(cou)o(n)o(t)o(in)o(g)g(f)q(requencie)q(s)i(of,)d(say)m(,)g (4-let)n(t)o(er)i(w)o(ords)f(in)0 95 y(a)g(lon)o(g)f(str)q(in)o(g)h(of) g(k)o(eystrok)o(e)q(s,)h(requir)q(in)o(g)f(a)f(m)o(emory)f(lo)q(ca)o(t) o(ion|or)g(a)o(t)i(least)h(a)e(b)o(yt)o(e|for)h(eac)o(h)h(p)q(oss)q (ible)0 145 y(4-let)n(t)o(er)f(w)o(ord,)e(wh)o(y)h(not)g(just)g(cou)o (n)o(t)g(t)n(h)o(e)h(pre)q(s)q(ence)h(or)e(a)o(bs)q(ence)h(of)e(eac)o (h)i(p)q(oss)q(ible)f(w)o(ord?)18 b(Th)o(a)o(t)13 b(require)q(s)0 195 y(a)g(s)q(in)o(gle)g(bit)g(for)g(eac)o(h)i(p)q(oss)q(ible)e(w)o (ord,)g(or)h(26)733 179 y Fh(4)762 195 y Fl(=)e(456796)g(bit)o(s)i(for) f(4-let)n(t)o(er)h(w)o(ords)g(in)f(an)g(alph)o(a)o(b)q(et)g(of)f(26)0 244 y(let)n(t)o(ers.)26 b(Th)o(a)o(t's)16 b(a)o(b)q(ou)o(t)g(14,000)f (compu)o(t)o(er)h(\(32-bit\))f(w)o(ords,)h(a)g(reason)o(a)o(bly-s)q (ize)q(d)g(array)g(for)g(most)g(high)0 294 y(lev)o(el)e(lan)o(guage)q (s.)62 344 y(I)g(call)f(t)n(h)o(e)q(s)q(e)j Fk(sp)n(arse-o)n(c)n(cup)n (ancy)e Fl(t)o(e)q(st)o(s.)20 b(Beca)n(us)q(e)d(cou)o(n)o(t)o(in)o(g)d (act)o(ual)f(f)q(requencie)q(s)i(require)q(s)h(arrays)e(t)o(o)q(o)0 394 y(large,)h(w)o(e)h(only)e(cou)o(n)o(t)i(t)n(h)o(e)g(n)n(u)o(m)n(b)q (er)f(of)g(empt)o(y)f(cells,)i(t)n(h)o(a)o(t)f(i)q(s,)g(in)g(a)g(lon)o (g)g(str)q(in)o(g)g(of)g(k)o(eystrok)o(e)q(s,)i(w)o(e)e(us)q(e)0 444 y(a)i(bit)g(m)o(ap)f(t)o(o)i(\014n)o(d)f(h)o(o)o(w)g(m)o(an)o(y)f (4-)h(\(5-,6-)f(or)h(high)o(er-\))h(let)n(t)o(er)h(w)o(ords)e(are)h(mi) q(ss)q(in)o(g.)27 b(Som)o(e)16 b(in)o(t)o(ere)q(st)o(in)o(g)0 493 y(proba)o(bilit)o(y)c(t)n(h)o(eory)j(i)q(s)e(require)q(d)i(t)o(o)f (d)o(ev)o(elo)o(p)g(ap)o(pro)o(pr)q(ia)o(t)o(e)f(t)o(e)q(st)o(s.)0 631 y Fi(5)88 b(Th)n(e)22 b(OPSO)f(T)-6 b(e)r(st)0 722 y Fl(Here)17 b(OPSO)f(m)o(eans)e(Ov)o(erlap)o(pin)o(g-P)o(airs-Spars)q (e-Occupancy)m(.)24 b(W)m(e)15 b(obs)q(erv)o(e)h(2-let)n(t)o(er)g(w)o (ords)g(in)f(a)f(lon)o(g)0 771 y(s)q(equence)i(of)e(k)o(eystrok)o(e)q (s)h(f)q(rom)d(an)i(alph)o(a)o(b)q(et)g(of)f(2)817 756 y Fh(10)866 771 y Fl(let)n(t)o(ers.)21 b(By)15 b(s)q(et)n(t)o(in)o(g)g (a)f(bit,)f(w)o(e)h(m)o(ar)o(k)g(t)n(h)o(e)g(pre)q(s)q(ence)0 821 y(or)i(a)o(bs)q(ence)i(of)e(ev)o(ery)h(p)q(oss)q(ible)g(2-let)n(t)o (er)g(w)o(ord.)25 b(Th)o(e)17 b(\014rst)g(10)f(bit)o(s)h(\(or)f(an)o(y) g(part)o(icular)g(10)f(bit)o(s\))i(of)f(an)0 871 y(in)o(t)o(eger)d(pro) q(d)o(u)o(ce)q(d)g(b)o(y)g(a)f(gen)o(era)o(t)o(or)i(\(monk)o(ey\))d(d)o (et)o(ermin)o(e)q(s)i(t)n(h)o(e)h(k)o(eystrok)o(e.)k(\(W)m(e)12 b(a)o(ban)o(don)g(t)n(h)o(e)h(26-let)n(t)o(er)0 921 y(alph)o(a)o(b)q (et)g(f)q(rom)f(h)o(ere)j(on;)e(alph)o(a)o(b)q(et)o(s)h(of)f(s)q(ize)h (2)p Fg(;)7 b Fl(2)798 906 y Fh(2)816 921 y Fg(;)g Fl(2)856 906 y Fh(3)874 921 y Fg(;)g(:)g(:)g(:)t(;)g Fl(2)987 906 y Fh(10)1036 921 y Fl(are)14 b(b)q(et)n(t)o(er)h(suit)o(e)q(d)g (for)e(t)o(e)q(st)o(in)o(g)i(RNG's.\))62 971 y(Before)i(d)o(ev)o(elo)o (pin)o(g)g(t)n(h)o(e)g(t)n(h)o(eory)m(,)f(h)o(ere)h(i)q(s)f(an)g (example)f(of)g(t)n(h)o(e)i(OPSO)g(t)o(e)q(st:)24 b(W)m(e)16 b(gen)o(era)o(t)o(e)h(2)1584 956 y Fh(21)1635 971 y Fl(k)o(ey-)0 1020 y(strok)o(e)q(s)j(f)q(rom)c(an)i(alph)o(a)o(b)q(et)f(of)h(2)556 1005 y Fh(10)610 1020 y Fl(=)h(1024)e(let)n(t)o(ers.)33 b(Eac)o(h)19 b(k)o(eystrok)o(e)g(i)q(s)f(pro)q(d)o(u)o(ce)q(d)h(b)o(y)f (t)n(h)o(e)h(\014rst)g(10)0 1070 y(bit)o(s)d(of)f(t)n(h)o(e)i(con)o (gruen)o(t)o(ial)e(gen)o(era)o(t)o(or)i Fg(x)646 1076 y Fd(n)683 1070 y Fl(=)e(69069)p Fg(x)859 1076 y Fd(n)p Fe(\000)p Fh(1)934 1070 y Fl(mo)q(d)10 b(2)1046 1055 y Fh(32)1081 1070 y Fl(.)23 b(W)m(e)16 b(cou)o(n)o(t)g(t)n(h)o(e)g(n)n (u)o(m)n(b)q(er)g(of)f(mi)q(ss)q(in)o(g)0 1120 y(2-let)n(t)o(er)h(w)o (ords.)21 b(As)16 b(w)o(e)f(sh)o(all)f(s)q(ee,)h(t)n(h)o(e)h(n)n(u)o(m) n(b)q(er)f(of)f(mi)q(ss)q(in)o(g)f(2-let)n(t)o(er)j(w)o(ords)f(sh)o (ould)g(b)q(e)g(ap)o(pro)o(xim)o(a)o(t)o(ely)0 1170 y(norm)o(al)9 b(wit)n(h)i Fg(\026)h Fl(=)g(141909)d(an)o(d)i Fg(\033)i Fl(=)f(290.)k(\(T)m(o)11 b(b)q(e)g(more)f(preci)q(s)q(e,)i(in)f(spars)q (e-o)q(ccupancy)i(t)o(e)q(st)o(s)h(w)o(e)d(exp)q(ect)0 1220 y(asympt)o(ot)o(ic)i(P)o(oi)q(sson)h(di)q(str)q(ibu)o(t)o(ions)g (for)g(empt)o(y-cell)f(cou)o(n)o(t)o(s.)21 b(In)14 b(pract)o(ice,)h(t)n (h)o(a)o(t)f(i)q(s)g(equiv)n(alen)o(t)g(t)o(o)g(us)q(in)o(g)0 1270 y(a)e(norm)o(al)f(di)q(str)q(ibu)o(t)o(ion,)g(if)h Fg(\025)h Fl(i)q(s)f(large.)17 b(An)o(d)c(exp)q(er)q(ience)h(sh)o(o)o (ws)f(t)n(h)o(a)o(t)f(ev)o(en)i(wh)o(en)f(n)f(i)q(s)g(not)h(large)f (enough)0 1319 y(t)o(o)17 b(pro)o(vid)o(e)g(a)g(go)q(o)q(d)f(P)o(oi)q (sson)h(di)q(str)q(ibu)o(t)o(ion,)g(t)n(h)o(e)g(norm)o(al)e(di)q(str)q (ibu)o(t)o(ion)h(st)o(ill)g(ap)o(plie)q(s.)27 b(It)17 b(just)g(h)o(ap)o(p)q(ens)0 1369 y(t)n(h)o(a)o(t)d(t)n(h)o(e)h(v)n(ar)q (iance)e(i)q(s)g(not)h(y)o(et)g(equal)g(t)o(o)g(t)n(h)o(e)h(m)o(ean,)d (as)i(i)q(s)f(require)q(d)i(in)f(t)n(h)o(e)g(limit.\))62 1419 y(Our)e(\014rst)h(ru)o(n)f(\(wit)n(h)g(s)q(ee)q(d)h(v)n(alue)e (1234567\))f(of)g(2)842 1404 y Fh(21)889 1419 y Fl(k)o(eystrok)o(e)q(s) j(h)o(as)e(141,979)f(mi)q(ss)q(in)o(g)g(2-let)n(t)o(er)i(w)o(ords,)0 1469 y(corre)q(sp)q(on)o(din)o(g)j(t)o(o)e(a)g(st)o(an)o(d)o(ard)h (norm)o(al)d(v)n(ar)q(ia)o(t)o(e)h(of)g(.240.)17 b(Th)o(e)c(n)o(ext)h (t)n(hree)h(ru)o(ns)f(of)f(2)1381 1454 y Fh(21)1429 1469 y Fl(k)o(eystrok)o(e)q(s)h(h)o(a)o(v)o(e)0 1519 y(141980,)j(141753)f (an)o(d)h(141785)f(mi)q(ss)q(in)o(g)g(2-let)n(t)o(er)j(w)o(ords,)f (corre)q(sp)q(on)o(din)o(g)h(t)o(o)f(st)o(an)o(d)o(ard)g(norm)o(al)e(v) n(alue)q(s)0 1568 y(.243,)c(-.535,)g(-.428.)17 b(Go)q(o)q(d.)g(Our)e (69069)d(con)o(gruen)o(t)o(ial)i(monk)o(ey)e(com)o(e)q(s)i(t)n(hrough)g (again.)62 1618 y(No)o(w)i(let's)f(pu)o(t)h(t)n(h)o(e)h(31-bit)d (left-28-r)q(igh)o(t-3)g(shift-regi)q(st)o(er)i(monk)o(ey)e(a)o(t)h(t)n (h)o(e)h(k)o(eyb)q(oard.)24 b(W)m(e)15 b(already)0 1668 y(saw)f(h)o(e)g(couldn't)f(m)o(an)o(age)f(CA)m(T)h(on)g(a)h(26-k)o(ey)f (t)o(yp)q(ewr)q(it)o(er;)g(h)o(o)o(w)g(will)f(h)o(e)i(do)g(on)f(a)g(v)o (er)q(it)o(a)o(ble)g(organ)g(wit)n(h)0 1718 y(1024)e(k)o(eys?)17 b(Lousy!)h(Wit)n(h)11 b(a)g(s)q(ee)q(d)i(v)n(alue)e(of)g(1234567,)e(hi) q(s)j(\014rst)g(str)q(in)o(g)g(of)f(2)1219 1703 y Fh(21)1265 1718 y Fl(k)o(eystrok)o(e)q(s)i(h)o(ad)f(1,032,192)0 1768 y(mi)q(ss)q(in)o(g)g(2-let)n(t)o(er)j(w)o(ords,)f(som)o(e)e(3070)h (s)q(igm)o(as)f(f)q(rom)g(t)n(h)o(e)j(m)o(ean.)i(Th)o(e)d(s)q(econ)o(d) g(w)o(as)g(as)g(bad.)62 1818 y(Next,)d(let's)f(imp)q(ort)e(a)i(monk)o (ey)e(f)q(rom)g(Ber)o(k)o(eley)m(,)k(wit)n(h)d(k)o(eystrok)o(e)q(s)j(d) o(et)o(ermin)o(e)q(d)e(b)o(y)g(t)n(h)o(e)g(leadin)o(g)g(10)f(bit)o(s)0 1867 y(f)q(rom)h(t)n(h)o(e)j(Ber)o(k)o(eley)i(Unix)c(RNG)h Fg(x)562 1873 y Fd(n)596 1867 y Fl(=)g(62605)p Fg(x)769 1873 y Fd(n)p Fe(\000)p Fh(1)838 1867 y Fl(+)6 b(113218009)k(mo)q(d)g (2)1187 1852 y Fh(29)1222 1867 y Fl(.)18 b(Again)11 b(wit)n(h)i(s)q(ee) q(d)g(1234567,)0 1917 y(s)q(ix)g(ru)o(ns)j(of)d(2)225 1902 y Fh(21)274 1917 y Fl(k)o(eystrok)o(e)q(s)i(pro)q(d)o(u)o(ce)q(d)h (wh)o(a)o(t)d(sh)o(ould)h(b)q(e)g(t)n(h)o(e)h(equiv)n(alen)o(t)e(of)h (s)q(ix)f(in)o(d)o(ep)q(en)o(d)o(en)o(t)i(st)o(an)o(d)o(ard)0 1967 y(norm)o(al)f(v)n(alue)q(s:)21 b(-1.771,-3.447,)o(-1.)o(585)o (,-2.)o(903)o(,-1.)o(757)o(,-2)o(.37)o(0.)g(Not)15 b(go)q(o)q(d;)h(t)n (hi)q(s)g(Ber)o(k)o(eley)h(monk)o(ey)e(f)q(ails)0 2017 y(t)n(h)o(e)g(OPSO)f(t)o(e)q(st,)h(bu)o(t)f(it)g(i)q(s)f(not)h(t)n(h)o (e)h(sp)q(ect)o(acular)f(f)q(ailure)f(of)g(t)n(h)o(e)i(shift-regi)q(st) o(er)f(monk)o(ey)m(.)62 2067 y(Anot)n(h)o(er)k(shift-regi)q(st)o(er)f (monk)o(ey:)22 b(left)16 b(shift)g(18,)h(r)q(igh)o(t)e(shift)i(13)f(on) g(31)g(bit)g(w)o(ords.)26 b(Thi)q(s)16 b(monk)o(ey)0 2116 y(us)q(e)q(s)g(wh)o(a)o(t)e(I)g(h)o(a)o(v)o(e)g(fou)o(n)o(d)g(t)o (o)h(b)q(e)g(t)n(h)o(e)g(b)q(e)q(st)g(of)f(t)n(h)o(e)h(\(t)o(w)o (o-shift\))f(shift-regi)q(st)o(er)h(gen)o(era)o(t)o(ors.)21 b(Ho)o(w)14 b(will)f(sh)o(e)0 2166 y(do)h(on)g(OPSO?)h(Wit)n(h)f(s)q (ee)q(d)i(v)n(alue)e(1234567,)e(our)i(monk)o(ey)f(pro)o(vid)o(e)q(s)i (2)1158 2151 y Fh(21)1208 2166 y Fl(k)o(eystrok)o(e)q(s)h(\(f)q(rom)c (leadin)o(g)i(10)0 2216 y(bit)o(s\))h(t)n(h)o(a)o(t)f(h)o(a)o(v)o(e)g (139,375)f(mi)q(ss)q(in)o(g)f(2-let)n(t)o(er)k(w)o(ords.)j(Th)o(a)o(t) 14 b(i)q(s)g(-8.74)f(s)q(igm)o(as)f(f)q(rom)h(t)n(h)o(e)i(m)o(ean.)j (Bad.)i(Th)o(e)0 2266 y(n)o(ext)e(ru)o(n)h(of)e(2)248 2251 y Fh(21)300 2266 y Fl(k)o(eystrok)o(e)q(s)i(h)o(as)f(139,946)e(mi) q(ss)q(in)o(g)g(2-let)n(t)o(er)j(w)o(ords:)26 b(-6.77)16 b(s)q(igm)o(as)f(of)j(290)f(f)q(rom)e(t)n(h)o(e)0 2316 y(m)o(ean)e(of)h(141,909.)j(Ev)o(en)e(t)n(h)o(e)g(b)q(e)q(st)g(of)e(t)n (h)o(e)i(shift-regi)q(st)o(er)g(gen)o(era)o(t)o(ors)h(f)q(ails)c(t)n(h) o(e)j(OPSO)g(t)o(e)q(st,)g(bu)o(t)g(not)f(in)0 2365 y(as)g(sp)q(ect)o (acular)h(f)q(ashion)d(as)i(t)n(h)o(os)q(e)h(for)f(ot)n(h)o(er)h(shift) e(regi)q(st)o(er)i(gen)o(era)o(t)o(ors.)0 2503 y Fi(6)88 b(OPSO)21 b(Th)n(eory)0 2594 y Fl(Th)o(e)f(OPSO)h(t)o(e)q(st)g(cou)o(n) o(t)o(s)g(t)n(h)o(e)g(n)n(u)o(m)n(b)q(er)f(of)f(mi)q(ss)q(in)o(g)f (2-let)n(t)o(er)j(w)o(ords)f(in)f(a)h(lon)o(g)f(str)q(in)o(g)i(of)e Fg(n)h Fl(ran)o(dom)0 2643 y(k)o(eystrok)o(e)q(s.)i(If)14 b Fg(n)f Fl(=)g(2)366 2628 y Fh(21)414 2643 y Fl(=)g(2)p Fg(;)7 b Fl(097)p Fg(;)g Fl(152)12 b(an)o(d)i(t)n(h)o(ere)i(are)f Fg(\013)e Fl(=)g(2)1016 2628 y Fh(10)1064 2643 y Fl(=)g(1024)h(let)n(t) o(ers)i(in)e(t)n(h)o(e)i(alph)o(a)o(b)q(et,)d(t)n(h)o(en)0 2693 y(t)n(h)o(e)i(n)n(u)o(m)n(b)q(er)f(of)g(mi)q(ss)q(in)o(g)f(w)o (ords)h(sh)o(ould)h(a)o(v)o(erage)f(141,909)f(wit)n(h)h(a)g(st)o(an)o (d)o(ard)h(d)o(evia)o(t)o(ion)f(of)g(290.)k(Ho)o(w)d(i)q(s)0 2743 y(t)n(hi)q(s)f(d)o(et)o(ermin)o(e)q(d?)62 2793 y(Th)o(e)k(answ)o (er:)25 b(not)17 b(eas)q(ily)m(.)27 b(A)o(t)18 b(least,)g(t)n(h)o(e)g (v)n(ar)q(iance)f(i)q(s)f(not)h(easy;)j(t)n(h)o(e)e(m)o(ean)e Fk(is)h Fl(easy)m(.)28 b(T)m(o)17 b(get)g(t)n(h)o(e)0 2843 y(m)o(ean,)f(w)o(e)h(t)o(ak)o(e)g(adv)n(an)o(t)o(age)e(of)i(t)n(h) o(e)g(n)o(ear)h(lac)o(k-of-m)o(em)o(ory)13 b(pro)o(p)q(ert)o(y)18 b(of)e(t)n(h)o(e)h(monk)o(ey's)e(ou)o(t)o(pu)o(t.)28 b(If)17 b(h)o(e)845 2978 y(3)p eop %%Page: 4 4 4 3 bop 0 45 a Fl(h)o(as)16 b(not)h(t)o(yp)q(e)q(d)f(a)g(part)o(icular) g(w)o(ord)g(aft)o(er,)h(say)m(,)f(1000)f(k)o(eystrok)o(e)q(s,)j(t)n(h)o (en)f(t)n(h)o(e)g(di)q(str)q(ibu)o(t)o(ion)f(of)g(t)n(h)o(e)h(t)o(im)o (e)0 95 y(rem)o(ainin)o(g)c(u)o(n)o(t)o(il)g(h)o(e)i(do)q(e)q(s)f(h)o (as)h(virt)o(ually)d(t)n(h)o(e)j(sam)o(e)f(di)q(str)q(ibu)o(t)o(ion)f (as)h(t)n(h)o(e)i(or)q(igin)o(al.)h(In)d(ot)n(h)o(er)h(w)o(ords,)f(t)n (h)o(e)0 145 y(t)o(im)o(e)c(u)o(n)o(t)o(il)g(t)n(h)o(e)i(monk)o(ey)e(t) o(yp)q(e)q(s)h(a)g(part)o(icular)g(2-let)n(t)o(er)h(w)o(ord)f(sh)o (ould)g(b)q(e)h(clos)q(e)g(t)o(o)f(exp)q(on)o(en)o(t)o(ial,)g(wit)n(h)g (m)o(ean)0 195 y Fg(\026)16 b Fl(=)h Fg(\013)117 179 y Fh(2)152 195 y Fl(=)g(2)222 179 y Fh(20)257 195 y Fl(,)g(an)o(d)f(t)n (h)o(e)i(proba)o(bilit)o(y)d(h)o(e)i(do)q(e)q(s)g(not)g(t)o(yp)q(e)g(t) n(h)o(e)g(w)o(ord)g(wit)n(hin)f Fg(n)h Fl(k)o(eystrok)o(e)q(s)h(sh)o (ould)f(b)q(e)0 244 y Fg(e)19 229 y Fe(\000)p Fd(n=\026)105 244 y Fl(,)c(t)o(o)i(cons)q(id)o(era)o(ble)f(accuracy)m(.)62 294 y(T)m(o)e(d)o(et)o(ermin)o(e)h(t)n(h)o(a)o(t)g(accuracy)m(,)g(w)o (e)g(n)o(ee)q(d)h(t)n(h)o(e)f(true)h(proba)o(bilit)o(y)d(t)n(h)o(a)o(t) h Fg(n)h Fl(k)o(eystrok)o(e)q(s)h(will)d(not)i(pro)q(d)o(u)o(ce)0 344 y(a)h(part)o(icular)f(2-let)n(t)o(er)i(w)o(ord.)i(Th)o(ere)f(are)e (t)o(w)o(o)f(kin)o(ds)h(of)f(2-let)n(t)o(er)i(w)o(ords:)j(AB)c(an)o(d)g (AA.)g(Th)o(e)g(proba)o(bilit)o(y)0 394 y(of)f(no)h(AB)g(in)g Fg(n)f Fl(k)o(eystrok)o(e)q(s)j(i)q(s)305 502 y(t)n(h)o(e)f(co)q (e\016cien)o(t)f(of)f Fg(z)635 487 y Fd(n)672 502 y Fl(in)g(t)n(h)o(e)i (T)m(aylor)d(expans)q(ion)i(of)1267 474 y(1)p 1166 493 223 2 v 1166 531 a(1)9 b Ff(\000)g Fg(z)j Fl(+)d Fg(p)1330 519 y Fh(2)1349 531 y Fg(z)1370 519 y Fh(2)1393 502 y Fg(;)0 618 y Fl(wh)o(ere)15 b Fg(p)c Fl(=)h(2)216 603 y Fe(\000)p Fh(10)277 618 y Fl(,)i(t)n(h)o(e)g(proba)o(bilit)o(y)e(for) i(eac)o(h)h(of)e(t)n(h)o(e)i(k)o(eystrok)o(e)q(s.)62 668 y(Th)o(e)10 b(gen)o(eral)g(form)d(of)i(t)n(h)o(e)h(require)q(d)h (proba)o(bilit)o(y)c(i)q(s)i Fg(c)902 674 y Fh(1)921 668 y Fg(r)941 653 y Fd(n)940 678 y Fh(1)963 668 y Fl(+)p Fg(c)1013 674 y Fh(2)1033 668 y Fg(r)1053 653 y Fd(n)1052 678 y Fh(2)1075 668 y Fl(,)h(wit)n(h)f Fg(r)1204 674 y Fh(1)1223 668 y Fg(;)e(r)1261 674 y Fh(2)1288 668 y Fl(t)n(h)o(e)j(ro)q(ot)o(s)g(of)f Fg(x)1519 653 y Fh(2)1538 668 y Ff(\000)p Fg(x)p Fl(+)p Fg(p)1647 653 y Fh(2)1678 668 y Fl(=)0 718 y(0)i(an)o(d)g Fg(c)127 724 y Fd(i)152 718 y Fl(=)h(1)p Fg(=)p Fl(\()p Fg(r)273 724 y Fd(i)289 718 y Ff(\000)t Fl(2\()p Fg(pr)402 724 y Fd(i)416 718 y Fl(\))432 703 y Fh(2)450 718 y Fl(\).)18 b(Ev)o(en)11 b(wit)n(h)g Fg(n)g Fl(as)g(sm)o(all)e(as)i(100)g(t)n(hi)q(s)g(b)q(ecom) o(e)q(s,)f(t)o(o)i(s)q(ev)o(eral)f(h)n(u)o(n)o(dre)q(d)i(place)q(s,)0 768 y Fg(c)18 774 y Fh(1)37 768 y Fg(r)57 753 y Fd(n)56 778 y Fh(1)79 768 y Fl(,)g(wit)n(h)h Fg(r)216 774 y Fh(1)248 768 y Fl(t)n(h)o(e)h(domin)o(an)o(t)d(ro)q(ot:)73 859 y(Pr)q(\(no)i(AB)g(in)f Fg(n)h Fl(strok)o(e)q(s)r(\))d(=)h(1)p Fg(:)p Fl(000002861032)o(0441)o(96\()p Fg(:)p Fl(9)o(9999)o(9046)o (3247)o(7409)o(7313)o(4994)o(5987)o(\))1605 842 y Fd(n)1625 859 y Fg(:)0 950 y Fl(Wh)o(en)i Fg(n)d Fl(=)h(2)221 935 y Fh(21)270 950 y Fl(t)n(hi)q(s)i(b)q(ecom)o(e)q(s)f(.13533528323646)o (9,)e(compare)q(d)i(t)o(o)h Fg(e)1122 935 y Fe(\000)p Fh(2)1178 950 y Fl(=)e Fg(:)p Fl(13533528323661)o(2.)62 1000 y(\(I)17 b(am)d(in)o(d)o(e)o(bt)o(e)q(d)k(t)o(o)e(Profe)q(ssor)i (Kn)n(u)o(t)n(h)g(for)e(p)q(oin)o(t)o(in)o(g)f(ou)o(t)i(t)n(h)o(e)g(or) q(igin)o(al)d(v)o(ers)q(ion)i(h)o(ad)g(an)g(error)i(t)n(h)o(a)o(t)0 1050 y(re)q(sul)o(t)o(e)q(d)e(in)d(only)g(7-place)g(accuracy)m(,)h(ra)o (t)n(h)o(er)h(t)n(h)o(an)f(t)n(h)o(e)h(13-place)e(accuracy)i(re)q(sul)o (t)o(in)o(g)g(f)q(rom)d(hi)q(s)h(\014x.\))62 1100 y(Th)o(e)h(proba)o (bilit)o(y)f(of)g(no)h(AA)g(in)f Fg(n)h Fl(k)o(eystrok)o(e)q(s)h(i)q(s) e(di\013eren)o(t:)191 1208 y(t)n(h)o(e)h(co)q(e\016cien)o(t)g(of)g Fg(z)521 1193 y Fd(n)557 1208 y Fl(in)g(t)n(h)o(e)g(T)m(aylor)f(expans) q(ion)g(of)1220 1180 y(1)c(+)h Fg(pz)p 1052 1199 452 2 v 1052 1237 a Fl(1)e Ff(\000)i Fl(\(1)f Ff(\000)h Fg(p)p Fl(\))p Fg(z)h Ff(\000)f Fl(\()p Fg(p)f Ff(\000)g Fg(p)1428 1225 y Fh(2)1447 1237 y Fl(\))p Fg(z)1484 1225 y Fh(2)1508 1208 y Fg(:)0 1322 y Fl(F)m(or)k(large)h Fg(n)p Fl(,)f(t)n(hi)q(s)h(b)q (ecom)o(e)q(s)41 1413 y(Pr)q(\(no)g(AA)g(in)f Fg(n)h Fl(strok)o(e)q(s)q(\))e(=)g(1)p Fg(:)p Fl(00000095181)o(7114)o(0532)o (98\()p Fg(:)p Fl(9)o(9999)o(9047)o(2551)o(9072)o(3887)o(1014)o(2577)o (\))1637 1396 y Fd(n)1657 1413 y Fg(:)0 1504 y Fl(Wh)o(en)17 b Fg(n)g Fl(=)g(2)235 1489 y Fh(21)286 1504 y Fl(t)n(hi)q(s)g(b)q(ecom) o(e)q(s)g(.1355993519979)o(8659)o(6411)o(.)25 b(Th)o(e)17 b(lac)o(k-of-m)o(em)o(ory)d(ap)o(pro)o(xim)o(a)o(t)o(ion)g(i)q(s)0 1554 y(st)o(ill)f(go)q(o)q(d,)g(bu)o(t)h(not)g(as)g(go)q(o)q(d)g(as)g (for)f(w)o(ords)h(AB,)g(o)o(win)o(g)f(t)o(o)i(t)n(h)o(e)f(sp)q(ecial)g (n)o(a)o(t)o(ure)g(of)f(w)o(ords)i(AA.)62 1604 y(No)o(w,)f(t)o(o)h (\014n)o(d)g(t)n(h)o(e)h(exp)q(ect)o(e)q(d)g(n)n(u)o(m)n(b)q(er)e(of)h (mi)q(ss)q(in)o(g)e(2-let)n(t)o(er)i(w)o(ords)g(in)f(a)h(str)q(in)o(g)g (of)f Fg(n)h Fl(k)o(eystrok)o(e)q(s,)h(w)o(e)0 1654 y(us)q(e)f(in)o (dica)o(t)o(or)e(v)n(ar)q(ia)o(ble)q(s.)j(Let)f Fg(w)538 1660 y Fh(1)556 1654 y Fg(;)7 b(w)605 1660 y Fh(2)623 1654 y Fg(;)g(:)g(:)g(:)e(;)i(w)746 1660 y Fh(209715)o(2)877 1654 y Fl(b)q(e)14 b(t)n(h)o(e)g(s)q(et)h(of)e(p)q(oss)q(ible)h(2-let)n (t)o(er)h(w)o(ords)f(an)o(d)g(let)488 1745 y Fg(x)512 1751 y Fd(i)537 1745 y Fl(=)e(1)i(if)f(w)o(ord)h Fg(w)787 1751 y Fd(i)814 1745 y Fl(i)q(s)f(mi)q(ss)q(in)o(g,)f(els)q(e)i Fg(x)1120 1751 y Fd(i)1146 1745 y Fl(=)d(0)p Fg(:)0 1837 y Fl(Th)o(en)k(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)f(of)f(mi)q(ss)q(in)o(g)f (w)o(ords)i(i)q(s)g Fg(x)714 1843 y Fh(1)742 1837 y Fl(+)10 b Ff(\001)d(\001)g(\001)i Fl(+)h Fg(x)909 1843 y Fh(2097152)1026 1837 y Fl(,)15 b(an)o(d)g(t)n(h)o(e)g(exp)q(ect)o(e)q(d)i(n)n(u)o(m)n (b)q(er)d(of)h(mi)q(ss)q(in)o(g)0 1886 y(w)o(ords)f(i)q(s)622 1936 y(E\()p Fg(x)690 1942 y Fh(1)709 1936 y Fl(\))9 b(+)g Ff(\001)e(\001)g(\001)h Fl(+)i(E\()p Fg(x)943 1942 y Fh(2097152)1061 1936 y Fl(\))p Fg(:)62 2011 y Fl(Th)o(ere)19 b(are)f(2)279 1996 y Fh(20)326 2011 y Ff(\000)12 b Fl(2)391 1996 y Fh(10)444 2011 y Fl(2-let)n(t)o(er)18 b(w)o(ords)g(of)f(t)o(yp)q (e)h(AB,)g(an)o(d)f(2)1055 1996 y Fh(10)1108 2011 y Fl(of)g(t)o(yp)q(e) h(AA.)f(Wh)o(en)h Fg(n)g Fl(=)g(2)1585 1996 y Fh(21)1620 2011 y Fl(,)g(our)0 2061 y(exp)q(ect)o(e)q(d)d(n)n(u)o(m)n(b)q(er)f(of) f(mi)q(ss)q(in)o(g)f(2-let)n(t)o(er)j(w)o(ords)f(i)q(s)263 2152 y(\(2)300 2135 y Fh(20)344 2152 y Ff(\000)9 b Fl(2)406 2135 y Fh(10)441 2152 y Fl(\))h Ff(\002)f Fg(:)p Fl(13533528323646)o(9) d(+)k(2)903 2135 y Fh(10)947 2152 y Ff(\002)f Fg(:)p Fl(135599351997986)o(5964)o(11)p Fg(;)0 2243 y Fl(an)o(d)14 b(t)n(hi)q(s)f(re)q(d)o(u)o(ce)q(s)j(t)o(o)e(141909.60)62 2293 y(Th)o(e)g(ap)o(pro)o(xim)o(a)o(t)o(ion)d(bas)q(e)q(d)j(on)g(t)n (h)o(e)h(lac)o(k-of-m)o(em)o(ory)c(assu)o(mpt)o(ion)i(yields)626 2390 y(2)647 2373 y Fh(20)682 2390 y Fg(e)701 2373 y Fe(\000)p Fh(2)744 2360 y Fb(21)774 2373 y Fd(=)p Fh(2)808 2360 y Fb(20)851 2390 y Fl(=)f(141909)p Fg(:)p Fl(33)p Fg(:)62 2481 y Fl(Th)n(us)21 b(t)n(h)o(e)g(easy)g(m)o(et)n(h)o(o)q(d)e (for)h(\014n)o(din)o(g)g(t)n(h)o(e)h(a)o(v)o(erage)f(n)n(u)o(m)n(b)q (er)g(of)f(mi)q(ss)q(in)o(g)g(2-let)n(t)o(er)i(w)o(ords)f(f)q(rom)e Fg(n)0 2531 y Fl(k)o(eystrok)o(e)q(s,)d(2)234 2516 y Fh(20)269 2531 y Fg(e)288 2516 y Fe(\000)p Fd(n=)p Fh(2)369 2503 y Fb(20)401 2531 y Fl(,)e(i)q(s)g(quit)o(e)h(suit)o(a)o(ble)f(for) g(pract)o(ical)h(ap)o(plica)o(t)o(ions)e(of)h(t)n(h)o(e)i(OPSO)f(t)o(e) q(st.)62 2581 y(Th)o(os)q(e)j(not)e(acquain)o(t)o(e)q(d)g(wit)n(h)h(m)o (et)n(h)o(o)q(ds)f(for)g(d)o(ev)o(elo)o(pin)o(g)g(gen)o(era)o(t)o(in)o (g)h(fu)o(nct)o(ions)g(an)o(d)f(solvin)o(g)g(recur-)0 2631 y(rence)i(equa)o(t)o(ions)d(su)o(c)o(h)i(as)f(t)n(h)o(os)q(e)h(a)o (b)q(o)o(v)o(e)e(m)o(ay)f(wi)q(sh)i(t)o(o)g(lo)q(ok)f(a)o(t)h(t)n(h)o (e)g(m)o(arv)o(elous)f(trea)o(t)o(m)o(en)o(t)g(in)h(t)n(h)o(e)g(b)q(o)q (ok)0 2681 y([1)o(])j(d)o(ev)o(elo)o(p)q(e)q(d)g(ou)o(t)g(of)f(Don)o (ald)g(Kn)n(u)o(t)n(h's)i(concret)o(e)h(m)o(a)o(t)n(h)o(em)o(a)o(t)o(i) o(cs)c(cours)q(e)j(a)o(t)f(St)o(anford,)g(in)f(part)o(icular,)0 2730 y(s)q(ect)o(ions)e(7.1-7.3)c(an)o(d)j(8.4.)845 2978 y(4)p eop %%Page: 5 5 5 4 bop 0 45 a Fa(6.1)56 b(Fin)n(din)o(g)19 b(t)n(h)n(e)f(v)m(ar)q (iance)0 122 y Fl(No)o(w)g(for)f(t)n(h)o(e)i(h)o(ard)f(part:)26 b(t)n(h)o(e)19 b(v)n(ar)q(iance)e(of)g(t)n(h)o(e)i(n)n(u)o(m)n(b)q(er)f (of)f(mi)q(ss)q(in)o(g)f(2-let)n(t)o(er)j(w)o(ords.)31 b(It)18 b(i)q(s)f(t)n(h)o(e)i(su)o(m)0 172 y(of)c(co)o(v\()p Fg(x)149 178 y Fd(i)163 172 y Fg(;)7 b(x)206 178 y Fd(j)223 172 y Fl(\))16 b(for)f Fg(i)h Fl(an)o(d)g Fg(j)i Fl(eac)o(h)f(ran)o (gin)o(g)f(f)q(rom)e(1)h(t)o(o)h(2)924 156 y Fh(10)959 172 y Fl(.)24 b(\(Recall)15 b(t)n(h)o(a)o(t)h Fg(x)1250 178 y Fd(i)1280 172 y Fl(i)q(s)f(t)n(h)o(e)i(in)o(dica)o(t)o(or)e(v)n (ar)q(ia)o(ble)0 221 y(for)j(t)n(h)o(e)h Fg(i)p Fl(t)n(h)g(w)o(ord,)g (1)f(if)g(it)g(ap)o(p)q(ears,)h(0)f(if)g(not\).)31 b(Th)o(ere)20 b(are)f(a)o(b)q(ou)o(t)f(2)1169 206 y Fh(20)1222 221 y Fl(su)o(c)o(h)h(co)o(v)n(ar)q(iance)q(s)g(\(act)o(ually)m(,)0 271 y(523)12 b Ff(\002)h Fl(1023)f(+)h(1024\).)34 b(Th)o(ey)19 b(f)q(all)f(in)o(t)o(o)h(som)o(e)f(17)h(di\013eren)o(t)h(t)o(yp)q(e)q (s,)h(wit)n(h)e(a)g(gen)o(era)o(t)o(in)o(g)h(fu)o(nct)o(ion)f(for)0 321 y(eac)o(h)e(t)o(yp)q(e.)23 b(Th)n(us)17 b(t)n(h)o(e)f(exp)q(ect)o (e)q(d)i(v)n(alue)d(of)g Fg(x)744 327 y Fd(i)758 321 y Fg(x)782 327 y Fd(j)799 321 y Fl(,)g(wit)n(h)h Fg(x)945 327 y Fd(i)974 321 y Fl(asso)q(cia)o(t)o(e)q(d)h(wit)n(h)f(a)g(w)o(ord) f(su)o(c)o(h)i(as)e(AB,)h(an)o(d)0 371 y Fg(x)24 377 y Fd(j)56 371 y Fl(asso)q(cia)o(t)o(e)q(d)g(wit)n(h)f(CA,)f(require)q (s)i(a)f(di\013eren)o(t)h(gen)o(era)o(t)o(in)o(g)f(fu)o(nct)o(ion)g(t)n (h)o(an)g(do)q(e)q(s)g(t)n(h)o(a)o(t)g(asso)q(cia)o(t)o(e)q(d)h(wit)n (h)0 421 y(AA,BA.)62 470 y(If)10 b(all)g(t)n(h)o(e)h(di\013eren)o(t)g (t)o(yp)q(e)q(s,)h(an)o(d)e(t)n(h)o(e)q(ir)h(f)q(requencie)q(s,)h(are)f (accou)o(n)o(t)o(e)q(d)h(for,)e(t)n(h)o(e)h(t)o(ot)o(al)f(yields)h(t)n (h)o(e)g(require)q(d)0 520 y(v)n(ar)q(iance.)17 b(It)11 b(i)q(s)f(84368.)16 b(Th)n(us,)c(wit)n(h)f(an)f(alph)o(a)o(b)q(et)g(of) h(2)883 505 y Fh(10)929 520 y Fl(let)n(t)o(ers,)i(t)n(h)o(e)e(n)n(u)o (m)n(b)q(er)g(of)g(mi)q(ss)q(in)o(g)e(2-let)n(t)o(er)j(w)o(ords)0 570 y(in)k(a)h(str)q(in)o(g)g(of)f(2)281 555 y Fh(21)333 570 y Fl(k)o(eystrok)o(e)q(s)i(h)o(as)f(m)o(ean)f(141,909)f(an)o(d)h (st)o(an)o(d)o(ard)i(d)o(evia)o(t)o(ion)e(290.46.)25 b(It)17 b(ap)o(p)q(ears)h(t)o(o)0 620 y(h)o(a)o(v)o(e)12 b(a)f(di)q(str)q(ibu)o(t)o(ion)g(clos)q(e)i(enough)f(t)o(o)h(norm)o(al) d(t)n(h)o(a)o(t)i(t)n(h)o(e)g(st)o(a)o(t)o(i)q(st)o(ic)g(\()p Fg(x)5 b Ff(\000)g Fl(141909\))p Fg(=)p Fl(290)11 b(i)q(s)g(t)n(h)o(e)i (ap)o(pro)o(pr)q(ia)o(t)o(e)0 670 y(on)o(e)g(for)f(t)n(h)o(e)i(OPSO)f (t)o(e)q(st,)h(wh)o(ere)g Fg(x)e Fl(i)q(s)g(t)n(h)o(e)i(n)n(u)o(m)n(b)q (er)e(of)g(2-let)n(t)o(er)i(w)o(ords)f(t)n(h)o(a)o(t)g(are)g(mi)q(ss)q (in)o(g)e(f)q(rom)f(t)n(h)o(e)k(str)q(in)o(g)0 719 y(of)h(2)70 704 y Fh(21)120 719 y Fl(k)o(eystrok)o(e)q(s.)25 b(A)16 b(v)n(alue)f(of)g(\()p Fg(x)10 b Ff(\000)h Fl(141909\))p Fg(=)p Fl(290)i(in)i(a)o(bsolu)o(t)o(e)h(v)n(alue)f(grea)o(t)o(er)i(t)n (h)o(an,)e(say)m(,)g(3)h(i)q(s)f(ca)n(us)q(e)0 769 y(for)e(concer)q(n.) 19 b(A)13 b(really)g(go)q(o)q(d)f(monk)o(ey)g(\(RNG\))h(w)o(ould)f(ca)n (us)q(e)i(concer)q(n)h(only)d(a)h(few)g(t)o(im)o(e)q(s)f(in)g(1000)g(t) o(e)q(st)o(s.)0 907 y Fi(7)88 b(Th)n(e)22 b(OTSO)e(T)-6 b(e)r(st)0 997 y Fl(OTSO)17 b(m)o(eans)e(Ov)o(erlap)o(pin)o(g-T)m(r)q (iple)q(s-Spars)q(e-Occupancy)m(,)i(m)o(eanin)o(g)e(t)n(h)o(e)h(n)n(u)o (m)n(b)q(er)g(of)g(mi)q(ss)q(in)o(g)e(3-let)n(t)o(er)0 1047 y(w)o(ords)h(in)g(a)g(lon)o(g)f(str)q(in)o(g)i(of)e Fg(n)h Fl(k)o(eystrok)o(e)q(s.)23 b(Constrain)o(t)o(s)16 b(on)f(t)n(h)o(e)h(s)q(ize)f(of)g(our)g(bit)g(m)o(ap)e(m)o(ak)o(e)h Fg(\013)f Fl(=)h(2)1656 1032 y Fh(6)1689 1047 y Fl(a)0 1097 y(reason)o(a)o(ble)g(s)q(ize)g(for)g(t)n(h)o(e)g(alph)o(a)o(b)q (et,)f(callin)o(g)f(for)i(an)f(array)h(of)f(2)1022 1082 y Fh(13)1071 1097 y Fl(32-bit)g(w)o(ords)h(t)o(o)g(record)h(t)n(h)o(e)f (pre)q(s)q(ence)0 1147 y(or)f(a)o(bs)q(ence)j(of)c(eac)o(h)j(p)q(oss)q (ible)f(w)o(ord.)j(Th)o(e)d(RNG)f(monk)o(ey's)f(k)o(eystrok)o(e)i(will) e(b)q(e)i(d)o(et)o(ermin)o(e)q(d)f(b)o(y)h(s)q(ix)e(bit)o(s)0 1197 y(f)q(rom)h(t)n(h)o(e)i(ran)o(dom)f(in)o(t)o(eger|most)g(oft)o(en) h(t)n(h)o(e)g(leadin)o(g)g(s)q(ix,)f(t)n(h)o(e)i(most)e(imp)q(ort)o(an) o(t,)f(bit)o(s.)21 b(Bu)o(t)16 b(ev)o(ery)g(s)q(et)0 1247 y(of)c(s)q(ix)f(bit)o(s)i(sh)o(ould)f(pro)o(vid)o(e)g(suit)o(a)o (bly)f(ran)o(dom)g(an)o(d)h(in)o(d)o(ep)q(en)o(d)o(en)o(t)h(k)o (eystrok)o(e)q(s,)g(if)f(w)o(e)g(are)h(t)o(o)f(h)o(a)o(v)o(e)g(a)g (truly)0 1296 y(sa)o(t)o(i)q(sf)q(act)o(ory)h(RNG.)62 1346 y(So)k(wit)n(h)g(a)g(k)o(eyb)q(oard)h(of)e Fg(\013)h Fl(=)h(64)e(k)o(eys)i(our)f(RNG)g(monk)o(ey)f(pro)q(d)o(u)o(ce)q(s,)j (say)m(,)e Fg(n)g Fl(=)g(2)1470 1331 y Fh(21)1523 1346 y Fl(k)o(eystrok)o(e)q(s)0 1396 y(an)o(d)d(w)o(e)h(cou)o(n)o(t)g(t)n(h) o(e)g(n)n(u)o(m)n(b)q(er)f(of)g(mi)q(ss)q(in)o(g)f(3-let)n(t)o(er)i(w)o (ords.)21 b(En)n(u)o(m)o(era)o(t)o(in)o(g)14 b(t)n(h)o(e)h(p)q(oss)q (ible)g(kin)o(ds)f(of)g(3-let)n(t)o(er)0 1446 y(w)o(ords:)k(AAA,)12 b(AAB,)h(ABA,BAA,ABC,)h(w)o(e)f(\014n)o(d)g(gen)o(era)o(t)o(in)o(g)g (fu)o(nct)o(ions)g(for)f(t)n(h)o(e)i(proba)o(bilit)o(y)d(t)n(h)o(a)o(t) i(eac)o(h)0 1496 y(part)o(icular)20 b(t)o(yp)q(e)h(will)e(b)q(e)h(mi)q (ss)q(in)o(g)f(in)h Fg(n)h Fl(k)o(eystrok)o(e)q(s,)i(t)o(ak)o(e)e(in)o (t)o(o)f(accou)o(n)o(t)h(t)n(h)o(e)q(ir)h(f)q(requencie)q(s.)39 b(Th)o(a)o(t)0 1545 y(pro)o(vid)o(e)q(s)15 b(t)n(h)o(e)f(true)h(exp)q (ect)o(e)q(d)g(n)n(u)o(m)n(b)q(er)f(of)f(mi)q(ss)q(in)o(g)f(3-let)n(t)o (er)j(w)o(ords)f(in)g(a)g(str)q(in)o(g)g(of)f(2)1370 1530 y Fh(21)1419 1545 y Fl(k)o(eystrok)o(e)q(s.)20 b(It)14 b(i)q(s)0 1595 y(87.9393.)62 1645 y(Th)o(e)d(v)n(alue)g(t)n(h)o(a)o(t)f (re)q(sul)o(t)o(s)j(f)q(rom)c(t)n(h)o(e)j(lac)o(k-of-m)o(em)o(ory)7 b(assu)o(mpt)o(ion)k(i)q(s)f Fg(\013)1191 1630 y Fh(3)1209 1645 y Fg(e)1228 1630 y Fe(\000)p Fd(n=\013)1314 1617 y Fb(3)1343 1645 y Fl(=)i(2)1408 1630 y Fh(18)1443 1645 y Fg(e)1462 1630 y Fe(\000)p Fh(8)1519 1645 y Fl(=)f(87)p Fg(:)p Fl(9395.)0 1695 y(So,)i(once)i(again,)d(t)n(h)o(e)j(ap)o(pro)o (xim)o(a)o(t)o(i)o(on)c(i)q(s)i(v)o(ery)i(accura)o(t)o(e.)62 1745 y(It)h(i)q(s)g(a)g(formid)o(a)o(ble)d(t)o(ask)j(t)o(o)h(\014n)o(d) f(t)n(h)o(e)g(exact)h(v)n(ar)q(iance)f(for)f(t)n(h)o(e)i(n)n(u)o(m)n(b) q(er)f(of)f(mi)q(ss)q(in)o(g)g(3-let)n(t)o(er)i(w)o(ords)0 1795 y(in)i(2)75 1779 y Fh(21)130 1795 y Fl(k)o(eystrok)o(e)q(s.)36 b(Th)o(ere)21 b(are)f(h)n(u)o(n)o(dre)q(ds)i(of)d(di\013eren)o(t)h(w)o (ord-t)o(yp)q(e)g(pairs,)g(su)o(c)o(h)g(as)g(ABA,CAB)g(for)0 1844 y(example,)11 b(for)j(whic)o(h)f(gen)o(era)o(t)o(in)o(g)h(fu)o (nct)o(ions)g(m)n(ust)f(b)q(e)g(fou)o(n)o(d.)18 b(Th)o(en)c(asympt)o (ot)o(ic)e(forms)g(m)n(ust)i(b)q(e)f(fou)o(n)o(d)0 1894 y(an)o(d)f(com)n(bin)o(e)q(d)g(wit)n(h)g(t)n(h)o(e)i(pro)o(p)q(er)f(f)q (requencie)q(s)h(t)o(o)f(get)g(t)n(h)o(e)g(true)h(v)n(ar)q(iance.)j(I) 12 b(h)o(ad)h(a)f(h)o(alf-h)o(eart)o(e)q(d)h(pro)r(ject)0 1944 y(u)o(n)o(d)o(erw)o(ay)f(t)o(o)g(a)n(u)o(t)o(om)o(a)o(t)o(e)e(t)n (h)o(e)i(pro)q(ce)q(ss)i(wit)n(h)d(a)g(compu)o(t)o(er)g(program,)f(bu)o (t)h(progre)q(ss)q(e)q(d)j(only)c(t)o(o)i(t)n(h)o(e)f(I-t)n(hink-)0 1994 y(it-i)q(s-feas)q(ible)h(st)o(age.)62 2044 y(Not)o(e)k(t)n(h)o(a)o (t)f(t)n(h)o(e)g(OTSO)h(t)o(e)q(st)g(do)q(e)q(s)g(not)f(require)g(t)n (h)o(e)h(true)g(v)n(ar)q(iance.)21 b(On)o(e)16 b(m)o(ay)d(t)o(e)q(st)j (t)n(h)o(a)o(t)f(a)g(s)q(et)h(of)e Fg(x)0 2093 y Fl(v)n(alue)q(s,)f(t)n (h)o(e)g(n)n(u)o(m)n(b)q(er)g(of)f(mi)q(ss)q(in)o(g)f(3-let)n(t)o(er)j (w)o(ords)f(in)g(a)g(str)q(in)o(g)g(of)f(2)1071 2078 y Fh(21)1119 2093 y Fl(k)o(eystrok)o(e)q(s,)i(com)o(e)q(s)f(f)q(rom)d (a)j(norm)o(al)0 2143 y(di)q(str)q(ibu)o(t)o(ion)e(wit)n(h)h(m)o(ean)f (87.85)f(wit)n(h)i(a)g(t-t)o(e)q(st,)h(us)q(in)o(g)f(cu)o(m)n(ula)o(t)o (iv)o(e)e(e)q(st)o(im)o(a)o(t)o(e)q(s)i(of)f(t)n(h)o(e)i(st)o(an)o(d)o (ard)g(d)o(evia)o(t)o(ion)0 2193 y(f)q(rom)d(t)n(h)o(e)j(sample)e(v)n (alue)q(s.)17 b(Larger)c(sample)q(s)e(of)h Fg(x)p Fl('s)g(are)g(n)o (ece)q(ssary)j(t)o(o)e(e)q(st)o(a)o(bli)q(sh)e(a)i(t)o(e)q(st)g(f)q (ailure.)j(Th)o(e)d(t)o(e)q(st)0 2243 y(i)q(s)g(a)h(bit)f(sh)o(arp)q (er)i(wh)o(en)f(w)o(e)g(kno)o(w)g(t)n(h)o(e)g(v)n(ar)q(iance.)62 2293 y(Here)i(i)q(s)e(a)g(pract)o(ical)g(example)f(of)h(t)n(h)o(e)h (OTSO)g(t)o(e)q(st.)21 b(A)15 b(ran)o(dom)e(n)n(u)o(m)n(b)q(er)h(gen)o (era)o(t)o(or)h(pro)o(p)q(os)q(e)q(d)h(\(an)o(d)0 2342 y(t)o(ou)o(t)o(e)q(d)i(on)f(in)o(t)o(er)q(n)o(et\))h(b)o(y)f(Haas)g([2) o(],)g(gen)o(era)o(t)o(e)q(s)i(4-digit)c(ordin)o(ary)i(d)o(ecim)o(al)f (in)o(t)o(egers.)28 b(Sup)o(p)q(os)q(e)19 b(w)o(e)e(as-)0 2392 y(su)o(m)o(e)d(an)h(alph)o(a)o(b)q(et)e(of)h Fg(\013)e Fl(=)h(100)h(c)o(h)o(aract)o(ers)i(an)o(d)e(let)h(t)n(h)o(e)g(last)g(t) o(w)o(o)f(digit)o(s)g(of)g(Haas-gen)o(era)o(t)o(e)q(d)i(n)n(u)o(m)n(b)q (ers)0 2442 y(d)o(et)o(ermin)o(e)d(our)h(monk)o(ey's)d(k)o(eystrok)o(e) q(s,)k(t)n(h)o(en)f(cons)q(id)o(er)g(3-let)n(t)o(er)g(w)o(ords.)k(If)13 b(w)o(e)h(let)f(t)n(h)o(e)h(monk)o(ey)e(pro)q(d)o(u)o(ce)0 2492 y(2,000,003)k(k)o(eystrok)o(e)q(s,)21 b(an)o(d)e(h)o(ence)h(2)f (milli)o(on)d(3-let)n(t)o(er)k(w)o(ords,)g(w)o(e)f(exp)q(ect)h(t)n(h)o (ere)g(sh)o(ould)f(b)q(e)g(arou)o(n)o(d)0 2542 y Fg(\013)27 2527 y Fh(3)45 2542 y Fg(e)64 2527 y Fe(\000)p Fh(2000000)p Fd(=)p Fh(100)o(00)o(00)353 2542 y Fl(=)12 b(135)p Fg(;)7 b Fl(335)12 b(mi)q(ss)q(in)o(g)g(3-let)n(t)o(er)i(w)o(ords.)62 2592 y(Th)o(e)k(\014rst)h(t)n(hree)h(ru)o(ns)f(pro)q(d)o(u)o(ce)q(d)g (147,440,)d(t)n(h)o(en)j(147,922,)d(t)n(h)o(en)i(147,691.)28 b(Th)o(e)q(s)q(e)19 b(s)q(eem)f(som)o(e)e(43)0 2641 y(s)q(igm)o(as)f(f) q(rom)f(t)n(h)o(e)k(m)o(ean|v)o(ery)e(bad,)h(as)g(a)f(more)g(ext)o(ens) q(iv)o(e)h(t-t)o(e)q(st)h(w)o(ould)e(sh)o(o)o(w.)27 b(\(An)17 b(empir)q(ical)d(ap-)0 2691 y(pro)o(xim)o(a)o(t)o(ion)f(for)k(t)n(h)o (e)g(v)n(ar)q(iance)f(sugge)q(st)o(s)i Fg(\033)f Fl(=)g(283)e(for)h(t)n (hi)q(s)h(part)o(icular)f(OTSO)h(t)o(e)q(st.)27 b(Bu)o(t)17 b(of)f(cours)q(e,)0 2741 y(t)n(h)o(anks)e(t)o(o)g(Goss)q(et)n(t's)i (t-t)o(e)q(st,)f(w)o(e)f(can)g(t)o(e)q(st)h(for)e(t)n(h)o(e)i(m)o(ean)e (wit)n(h)o(ou)o(t)h(kno)o(win)o(g)f(t)n(h)o(e)i(v)n(ar)q(iance.\))845 2978 y(5)p eop %%Page: 6 6 6 5 bop 0 45 a Fi(8)88 b(Th)n(e)22 b(OQSO)e(T)-6 b(e)r(st)0 136 y Fl(OQSO)10 b(m)o(eans)f(Ov)o(erlap)o(pin)o(g-Quadruple)q(s-Spars) q(e-Occupancy|t)n(h)o(e)j(n)n(u)o(m)n(b)q(er)d(of)g(mi)q(ss)q(in)o(g)e (4-let)n(t)o(er)j(w)o(ords)0 186 y(in)16 b(a)g(lon)o(g)g(str)q(in)o(g)g (of)g(k)o(eystrok)o(e)q(s.)26 b(W)m(e)16 b(us)q(e)h(an)f(alph)o(a)o(b)q (et)f(of)h Fg(\013)f Fl(=)h(2)1115 171 y Fh(5)1150 186 y Fl(let)n(t)o(ers)i(an)o(d)e(a)g(str)q(in)o(g)g(of)g Fg(n)f Fl(=)h(2)1675 171 y Fh(21)0 236 y Fl(k)o(eystrok)o(e)q(s.)28 b(Th)n(us)18 b(s)q(elect)o(in)o(g)g(an)o(y)e(\014v)o(e)h(bit)o(s)h(f)q (rom)d(t)n(h)o(e)i(in)o(t)o(eger)g(pro)q(d)o(u)o(ce)q(d)h(b)o(y)f(t)n (h)o(e)h(RNG)e(pro)o(vid)o(e)q(s)h(t)n(h)o(e)0 285 y(re)q(sul)o(t)o(in) o(g)e(k)o(eystrok)o(e)g(for)e(our)h(RNG)f(monk)o(ey)m(.)62 335 y(By)j(en)n(u)o(m)o(era)o(t)o(in)o(g)f(t)n(h)o(e)h(p)q(oss)q(ible)g (kin)o(ds)f(of)f(4-let)n(t)o(er)j(w)o(ords,)e(\014n)o(din)o(g)g(t)n(h)o (e)q(ir)h(gen)o(era)o(t)o(in)o(g)g(fu)o(nct)o(ions)f(an)o(d)0 385 y(asympt)o(ot)o(ic)g(forms)f(for)i(t)n(h)o(e)h(co)q(e\016cien)o(t)o (s)g(of)f Fg(z)749 370 y Fd(n)771 385 y Fl(,)g(t)n(h)o(en)h(com)n (binin)o(g)d(t)n(h)o(em)i(wit)n(h)g(t)n(h)o(e)g(pro)o(p)q(er)h(f)q (requencie)q(s,)0 435 y(t)n(h)o(e)g(true)g(exp)q(ect)o(e)q(d)h(n)n(u)o (m)n(b)q(er)e(of)f(mi)q(ss)q(in)o(g)g(4-let)n(t)o(er)i(w)o(ords)f(in)g (a)g(str)q(in)o(g)g(of)g Fg(n)f Fl(=)h(2)1321 420 y Fh(21)1372 435 y Fl(k)o(eystrok)o(e)q(s)h(m)o(ay)e(b)q(e)0 485 y(fou)o(n)o(d)i(t)o (o)g(b)q(et)n(t)o(er)h(t)n(h)o(an)e(40)h(digit)o(s)f(of)g(accuracy)m(.) 27 b(T)m(o)16 b(t)n(h)o(e)i(\014rst)f(11)f(digit)o(s,)h(it)g(i)q(s)f Fg(\026)g Fl(=)g(141909)p Fg(:)p Fl(47365)7 b Fg(:)g(:)f(:)s Fl(.)0 535 y(Th)o(e)14 b(ap)o(pro)o(xim)o(a)o(t)o(ion)d(bas)q(e)q(d)j (on)g(t)n(h)o(e)g(lac)o(k-of-m)o(emo)o(ry)d(pro)o(p)q(ert)o(y)j(yields) g(141909.33.)62 584 y(Th)o(e)h(b)q(o)o(x)f(b)q(elo)o(w)f(giv)o(e)q(s)i (d)o(et)o(ails)f(of)g(t)n(h)o(a)o(t)g(en)n(u)o(m)o(era)o(t)o(ion:)19 b(F)m(or)14 b(eac)o(h)h(t)o(yp)q(e)f(of)g(w)o(ord,)g(t)n(h)o(e)h(f)q (requency)m(,)f(t)n(h)o(e)0 634 y(gen)o(era)o(t)o(in)o(g)f(fu)o(nct)o (ion)g(an)o(d)f(t)n(h)o(e)i(proba)o(bilit)o(y)d(t)n(h)o(a)o(t)h(a)h (str)q(in)o(g)g(of)f Fg(n)f Fl(=)h(2)1096 619 y Fh(21)1144 634 y Fl(k)o(eystrok)o(e)q(s)i(will)d(not)i(con)o(t)o(ain)f(t)n(h)o(a)o (t)0 684 y(w)o(ord.)18 b(Th)o(e)c(not)o(a)o(t)o(ion)f(A)397 669 y Fe(0)422 684 y Fl(m)o(eans)h(not-A,)f(X)h(an)o(d)g(Y)g(d)o(e)q(s) q(ign)o(a)o(t)o(e)g(an)o(y)f(let)n(t)o(ers)j(of)d(t)n(h)o(e)i(alph)o(a) o(b)q(et.)104 775 y(Th)o(e)f(Exp)q(ect)o(e)q(d)h(Nu)o(m)n(b)q(er)f(of)f (Mi)q(ss)q(in)o(g)g(W)m(ords)h(f)q(rom)104 825 y(A)g(Str)q(in)o(g)g(of) f Fg(n)e Fl(=)h(2)422 810 y Fh(21)471 825 y Fl(4-Let)n(t)o(er)j(W)m (ords.)104 875 y(Th)o(e)f(Alph)o(a)o(b)q(et)f(Has)h Fg(\013)e Fl(=)f(32)j(Let)n(t)o(ers.)104 966 y(F)m(orm)e(of)h(w)o(ord:)18 b(AXY)m(A)500 951 y Fe(0)512 966 y Fl(,)13 b(\()p Fg(\013)580 951 y Fh(4)608 966 y Ff(\000)c Fg(\013)676 951 y Fh(3)708 966 y Fl(of)14 b(t)n(h)o(e)q(s)q(e\))104 1016 y Fg(N)5 b Fl(\()p Fg(z)r Fl(\))12 b(=)f(1)p Fg(=)p Fl(\(1)e Ff(\000)h Fg(z)h Fl(+)e Fg(p)472 1001 y Fh(4)491 1016 y Fg(z)512 1001 y Fh(4)531 1016 y Fl(\))104 1065 y(Domin)o(an)o(t)i(ro)q(ot:)18 b Fg(r)12 b Fl(=)g Fg(:)p Fl(99999904632295)o(5096)o(63)c Ff(\030)k Fl(1)d Ff(\000)h Fg(p)1052 1050 y Fh(4)1079 1065 y Ff(\000)g Fl(3)p Fg(p)1163 1050 y Fh(8)104 1115 y Fl(Co)q(e\016cien)o(t:)17 b Fg(c)12 b Fl(=)g(1)p Fg(:)p Fl(00000381472)o(2731)o(6674)o(7)d Ff(\030)j Fl(1)d(+)g(4)p Fg(p)1014 1100 y Fh(4)1042 1115 y Fl(+)g(28)p Fg(p)1146 1100 y Fh(8)104 1165 y Fl(Con)o(tr)q(ibu)o(t)o(ion)k(t)o(o)h Fg(\026)p Fl(:)k(\()p Fg(\013)499 1150 y Fh(4)527 1165 y Ff(\000)9 b Fg(\013)595 1150 y Fh(3)613 1165 y Fl(\))p Fg(cr)667 1150 y Fd(n)701 1165 y Fl(=)j(137474)p Fg(:)p Fl(27007432)o(8924)o(16)104 1256 y(F)m(orm)g(of)h(w)o(ord:)18 b(AXY)m(A,)13 b(wit)n(h)h(XY)g(not)g(AA)g(\()p Fg(\013)887 1241 y Fh(3)915 1256 y Ff(\000)9 b Fg(\013)14 b Fl(of)f(t)n(h)o(e)q(s)q (e\))104 1306 y Fg(N)5 b Fl(\()p Fg(z)r Fl(\))12 b(=)f(\(1)f(+)f Fg(p)359 1291 y Fh(3)378 1306 y Fg(z)399 1291 y Fh(3)417 1306 y Fl(\))p Fg(=)p Fl(\(1)g Ff(\000)h Fg(z)h Fl(+)f Fg(p)635 1291 y Fh(3)653 1306 y Fg(z)674 1291 y Fh(3)702 1306 y Fl(+)g(\()p Fg(p)781 1291 y Fh(4)809 1306 y Ff(\000)f Fg(p)871 1291 y Fh(3)890 1306 y Fl(\))p Fg(z)927 1291 y Fh(4)945 1306 y Fl(\))104 1356 y(Domin)o(an)o(t)i(ro)q(ot:)18 b Fg(r)12 b Fl(=)g Fg(:)p Fl(99999904635205)o(8288)o(73)c Ff(\030)k Fl(1)d Ff(\000)h Fg(p)1052 1341 y Fh(4)1079 1356 y Fl(+)g Fg(p)1142 1341 y Fh(7)104 1406 y Fl(Co)q(e\016cien)o(t:) 17 b Fg(c)12 b Fl(=)g(1)p Fg(:)p Fl(00000381451)o(9010)o(6827)o(9)d Ff(\030)j Fl(1)d(+)g(4)p Fg(p)1014 1391 y Fh(4)1042 1406 y Ff(\000)g Fl(7)p Fg(p)1125 1391 y Fh(7)104 1455 y Fl(Con)o(tr)q(ibu)o (t)o(ion)k(t)o(o)h Fg(\026)p Fl(:)k(\()p Fg(\013)499 1440 y Fh(3)527 1455 y Ff(\000)9 b Fg(\013)p Fl(\))p Fg(cr)649 1440 y Fd(n)683 1455 y Fl(=)j(4430)p Fg(:)p Fl(5935638)o(34475)o(83)104 1547 y(F)m(orm)g(of)h(w)o(ord:)18 b(AAAA,)c(\()p Fg(\013)g Fl(of)f(t)n(h)o(e)q(s)q(e\))104 1596 y Fg(N)5 b Fl(\()p Fg(z)r Fl(\))12 b(=)f(\(1)c(+)g Fg(pz)h Fl(+)f Fg(p)441 1581 y Fh(2)460 1596 y Fg(z)481 1581 y Fh(2)506 1596 y Fl(+)g Fg(p)566 1581 y Fh(3)584 1596 y Fg(z)605 1581 y Fh(3)624 1596 y Fl(\))p Fg(=)p Fl(\(1)g Ff(\000)g Fl(\(1)g Ff(\000)g Fg(p)p Fl(\))p Fg(z)g Ff(\000)g Fl(\()p Fg(p)g Ff(\000)g Fg(p)1033 1581 y Fh(2)1051 1596 y Fl(\))p Fg(z)1088 1581 y Fh(2)1113 1596 y Ff(\000)g Fl(\()p Fg(p)1189 1581 y Fh(2)1214 1596 y Ff(\000)g Fg(p)1274 1581 y Fh(3)1292 1596 y Fl(\))p Fg(z)1329 1581 y Fh(3)1355 1596 y Ff(\000)g Fl(\()p Fg(p)1431 1581 y Fh(3)1456 1596 y Ff(\000)g Fg(p)1516 1581 y Fh(4)1534 1596 y Fl(\))p Fg(z)1571 1581 y Fh(4)1590 1596 y Fl(\))104 1646 y(Domin)o(an)o(t)k(ro)q(ot:)18 b Fg(r)12 b Fl(=)g Fg(:)p Fl(99999907612459)o(1803)o(097)c Ff(\030)k Fl(1)d Ff(\000)g Fg(p)1072 1631 y Fh(4)1100 1646 y Fl(+)h Fg(p)1163 1631 y Fh(5)104 1696 y Fl(Co)q(e\016cien)o(t:)17 b Fg(c)12 b Fl(=)g(1)p Fg(:)p Fl(00000366571)o(6133)o(5900)o(77)c Ff(\030)k Fl(1)d(+)h Fg(p)1014 1681 y Fh(4)1042 1696 y Ff(\000)f Fl(5)p Fg(p)1125 1681 y Fh(5)104 1746 y Fl(Con)o(tr)q(ibu)o (t)o(ion)k(t)o(o)h Fg(\026)p Fl(:)k Fg(\013cr)521 1731 y Fd(n)554 1746 y Fl(=)12 b(4)p Fg(:)p Fl(6100168562260)o(0658)o(8130)o (7)104 1837 y(T)m(ot)o(al:)k Fg(\026)c Fl(=)g(141909)p Fg(:)p Fl(47365)104 1887 y(Lac)o(k-of-m)o(em)o(ory)f(ap)o(pro)o(xim)o (a)o(t)o(ion:)k Fg(\013)726 1872 y Fh(4)744 1887 y Fg(e)763 1872 y Fe(\000)p Fd(n=\013)849 1859 y Fb(4)878 1887 y Fl(=)d(141909)p Fg(:)p Fl(33)62 1978 y(I)20 b(don't)f(kno)o(w|an)o(d)g (dou)n(bt)h(t)n(h)o(a)o(t)g(I)g(ev)o(er)h(will)d(kno)o(w|t)n(h)o(e)h (true)i(v)n(ar)q(iance.)35 b(Th)o(ere)21 b(are)g(just)f(t)o(o)q(o)0 2028 y(m)o(an)o(y)10 b(kin)o(ds)h(of)g(pairs)h(of)f(4-let)n(t)o(er)i(w) o(ords)e(t)o(o)h(u)o(n)o(d)o(ert)o(ak)o(e)i(\014n)o(din)o(g)d(all)f(t)n (h)o(e)j(n)o(ece)q(ssary)h(gen)o(era)o(t)o(in)o(g)e(fu)o(nct)o(ions.)0 2077 y(Ext)o(ens)q(iv)o(e)j(s)q(im)n(ula)o(t)o(ion)e(sugge)q(st)o(s)k (t)n(h)o(a)o(t)e(us)q(in)o(g)g Fg(\033)g Fl(=)f(295)g(will)g(s)q(erv)o (e)j(w)o(ell)d(for)h(t)o(e)q(st)o(in)o(g)h(a)f(ran)o(dom)e(n)n(u)o(m)n (b)q(er)0 2127 y(gen)o(era)o(t)o(or:)18 b(t)n(h)o(e)13 b(v)n(alue)q(s)g(\(mi)q(ss)q(in)o(gw)o(ords-141909\)/2)o(95)c(sh)o (ould)j(lo)q(ok)f(lik)o(e)h(in)o(d)o(ep)q(en)o(d)o(en)o(t)h(st)o(an)o (d)o(ard)g(norm)o(al)0 2177 y(v)n(ar)q(ia)o(t)o(e)q(s.)32 b(Th)o(e)19 b(al)o(t)o(er)q(n)o(a)o(t)o(iv)o(e)f(i)q(s)g(t)o(o)h(t)o (ak)o(e)g(a)f(larger)h(sample)e(an)o(d)h(do)h(a)f(t-t)o(e)q(st)i(for)e (t)n(h)o(e)i(kno)o(wn)e(m)o(ean)g(of)0 2227 y(141,909.)0 2364 y Fi(9)88 b(Th)n(e)22 b(DNA)f(T)-6 b(e)r(st)0 2455 y Fl(If)11 b(w)o(e)h(h)o(a)o(v)o(e)g(an)f(alph)o(a)o(b)q(et)g(of)g(4)h (let)n(t)o(ers:)19 b(C,G,A,T,)9 b(t)n(h)o(en)k(a)e(su)o(cce)q(ss)q(ion) j(of)d(k)o(eystrok)o(e)q(s)i(f)q(rom)d(t)n(h)o(a)o(t)i(alph)o(a)o(b)q (et)0 2505 y(will)h(lo)q(ok)g(lik)o(e)h(t)n(h)o(e)h(m)o(ap)o(pin)o(g)e (of)g(a)h(s)q(egm)o(en)o(t)g(of)g(DNA.)g(Hence)h(t)n(h)o(e)h(n)o(am)o (e.)i(Our)d(monk)o(ey)e(gen)o(era)o(t)o(e)q(s)i(lon)o(g)0 2555 y(str)q(in)o(gs)j(an)o(d)e(w)o(e)h(lo)q(ok)f(for)h(t)n(h)o(e)g (incid)o(ence)h(of)f(10-let)n(t)o(er)g(w)o(ords.)27 b(Th)n(us)18 b(w)o(e)f(h)o(a)o(v)o(e)f(2)1348 2540 y Fh(20)1400 2555 y Fl(p)q(oss)q(ible)h(10-let)n(t)o(er)0 2605 y(w)o(ords,)h(an)o(d)e(w)o (e)i(n)o(ee)q(d)g(an)f(array)g(of)f(2)627 2589 y Fh(15)679 2605 y Fl(32-bit)g(w)o(ords)i(for)e(m)o(ap)o(pin)o(g)f(t)n(h)o(e)j(pre) q(s)q(ence)i(or)d(a)o(bs)q(ence)i(of)d(all)0 2654 y(p)q(oss)q(ible)e (10-let)n(t)o(er)h(w)o(ords.)62 2704 y(As)d(wit)n(h)e(OTSO)i(an)o(d)e (OQSO,)h(w)o(e)g(can)g(\014n)o(d)g(t)n(h)o(e)h(exact)f(exp)q(ect)o(e)q (d)h(n)n(u)o(m)n(b)q(er)f(of)f(mi)q(ss)q(in)o(g)f(10-let)n(t)o(er)j(w)o (ords)0 2754 y(f)q(rom)g(a)h(str)q(in)o(g)i(of,)d(say)m(,)h Fg(n)f Fl(=)g(2)493 2739 y Fh(21)541 2754 y Fl(k)o(eystrok)o(e)q(s,)j (bu)o(t)g(\014n)o(din)o(g)e(t)n(h)o(e)i(exact)g(v)n(ar)q(iance)e(lo)q (oks)g(h)o(o)o(p)q(ele)q(ss.)62 2804 y(T)m(o)18 b(\014n)o(d)g(t)n(h)o (e)h(true)g(exp)q(ect)o(e)q(d)g(n)n(u)o(m)n(b)q(er)f(of)g(mi)q(ss)q(in) o(g)e(10-let)n(t)o(er)j(w)o(ords,)g(w)o(e)g(m)n(ust)e(cons)q(id)o(er)j (22)d(kin)o(ds)0 2854 y(of)d(10-let)n(t)o(er)h(w)o(ords)g(\(d)o(ep)q (en)o(din)o(g)g(on)f(h)o(o)o(w)g(m)o(an)o(y)e(leadin)o(g)j(s)q(egm)o (en)o(t)o(s)f(of)g(eac)o(h)h(w)o(ord)g(m)o(a)o(t)o(c)o(h)e(equal-len)o (gt)n(h)845 2978 y(6)p eop %%Page: 7 7 7 6 bop 0 45 a Fl(trailin)o(g)14 b(s)q(egm)o(en)o(t)o(s\),)i(\014n)o(d) f(t)n(h)o(e)q(ir)h(gen)o(era)o(t)o(in)o(g)g(fu)o(nct)o(ions,)g(t)n(h)o (e)g(proba)o(bilit)o(y)d(t)n(h)o(e)j(w)o(ord)g(will)e(not)h(ap)o(p)q (ear)g(in)0 95 y Fg(n)c Fl(=)h(2)101 80 y Fh(21)150 95 y Fl(k)o(eystrok)o(e)q(s,)j(t)n(h)o(en)g(com)n(bin)o(e)d(all)h(t)n(h)o (os)q(e)i(proba)o(bilit)o(ie)q(s,)d(wit)n(h)i(ap)o(pro)o(pr)q(ia)o(t)o (e)f(f)q(requencie)q(s.)62 145 y(Th)o(e)i(re)q(sul)o(t)h(i)q(s)e (141910.5378411)o(,)e(t)n(h)o(e)j(exp)q(ect)o(e)q(d)h(n)n(u)o(m)n(b)q (er)e(of)g(mi)q(ss)q(in)o(g)f(10-let)n(t)o(er)i(w)o(ords)g(in)f(a)h (ran)o(dom)0 195 y(DNA)c(s)q(egm)o(en)o(t)f(of)h(2)328 179 y Fh(21)374 195 y Fl(C's,G's,A's)e(an)o(d)i(T's.)17 b(Th)o(e)12 b(exp)q(ect)o(e)q(d)g(v)n(alue)f(f)q(rom)e(t)n(h)o(e)j(lac) o(k-of-m)o(em)o(o)o(ry)d(pro)o(p)q(ert)o(y)0 244 y(i)q(s)k(t)n(h)o(e)i (sam)o(e)e(as)h(t)n(h)o(a)o(t)g(for)f(OPSO)i(an)o(d)f(OQSO,)g(wit)n(h)g Fg(\013)889 229 y Fd(k)920 244 y Fl(=)e(2)985 229 y Fh(20)1034 244 y Fl(an)o(d)i Fg(\025)d Fl(=)h(2:)18 b(141909.)62 294 y(It)10 b(ap)o(p)q(ears)g(a)g(formid)o(a)o(ble)d(t)o(ask)j(t)o(o)g (\014n)o(d)f(t)n(h)o(e)i(exact)f(v)n(ar)q(iance)g(for)f(t)n(h)o(e)h (DNA)g(t)o(e)q(st.)18 b(A)10 b(t-t)o(e)q(st)g(m)o(ay)e(b)q(e)i(us)q(e)q (d)0 344 y(t)o(o)i(t)o(e)q(st)g(t)n(h)o(a)o(t)g(t)n(h)o(e)g(m)o(ean)e (i)q(s)h(141,910.)k(It)d(will)e(require)i(a)f(larger)h(sample)d(t)n(h)o (an)j(on)o(e)f(us)q(in)o(g)h(t)n(h)o(e)g(true)g(v)n(ar)q(iance.)0 394 y(Bu)o(t)j(ext)o(ens)q(iv)o(e)g(s)q(im)n(ula)o(t)o(ion)d(sugge)q (st)o(s)k(us)q(e)f(of)f(a)g(s)q(igm)o(a)e(of)i(339.)19 b(So)14 b(a)h(reason)n(ble)g(implem)n(en)o(t)o(a)o(t)o(i)o(on)c(of)j(t) n(h)o(e)0 444 y(DNA)h(t)o(e)q(st)h(i)q(s)f(t)n(hi)q(s:)20 b(Gen)o(era)o(t)o(e)c(2)530 429 y Fh(21)580 444 y Fl(k)o(eystrok)o(e)q (s)h(f)q(rom)c(t)n(h)o(e)j(alph)o(a)o(b)q(et)e Ff(f)p Fl(C,G,A,T)p Ff(g)f Fl(\(us)q(in)o(g)i(t)o(w)o(o)f(bit)o(s)i(f)q(rom)0 493 y(eac)o(h)d(ran)o(dom)d(in)o(t)o(eger\),)j(an)o(d)f(let)g Fg(x)f Fl(b)q(e)i(t)n(h)o(e)f(n)n(u)o(m)n(b)q(er)g(of)g(mi)q(ss)q(in)o (g)e(10-let)n(t)o(er)j(w)o(ords.)k(Do)12 b(t)n(hi)q(s,)g(say)g(4,)g(t)o (im)o(e)q(s.)0 543 y(Th)o(e)j(re)q(sul)o(t)o(in)o(g)g(v)n(alue)q(s)f (\()p Fg(x)420 549 y Fh(1)448 543 y Ff(\000)c Fl(141911\))p Fg(=)p Fl(339)p Fg(;)d(:)g(:)f(:)s(;)h Fl(\()p Fg(x)846 549 y Fh(4)874 543 y Ff(\000)j Fl(141911\))p Fg(=)p Fl(339\))i(sh)o (ould)i(lo)q(ok)f(lik)o(e)h(a)g(sample)f(of)g(4)0 593 y(in)o(d)o(ep)q(en)o(d)o(en)o(t)i(st)o(an)o(d)o(ard)f(norm)o(al)e(v)n (ar)q(ia)o(ble)q(s.)0 730 y Fi(10)88 b(Di\013erence)r(s)20 b(in)h(t)m(h)n(e)h(T)-6 b(e)r(st)o(s)0 821 y Fl(Ho)o(w)18 b(do)f(t)n(h)o(e)i(t)o(e)q(st)o(s)h(OPSO,)e(OTSO,)g(OQSO)h(an)o(d)e (DNA)h(di\013er?)31 b(All)17 b(of)h(t)n(h)o(em)f(cou)o(n)o(t)h(t)n(h)o (e)h(n)n(u)o(m)n(b)q(er)f(of)0 871 y(mi)q(ss)q(in)o(g)13 b Fg(k)q Fl(-let)n(t)o(er)j(w)o(ords)f(in)f(a)g(lon)o(g)h(str)q(in)o(g) g(of)f Fg(n)g Fl(k)o(eystrok)o(e)q(s)j(f)q(rom)12 b(an)j(alph)o(a)o(b)q (et)f(of)g Fg(\013)g Fl(let)n(t)o(ers,)i(an)o(d)f(t)n(h)n(us)0 921 y(t)o(e)q(st)g(b)q(ot)n(h)f(u)o(niformit)o(y)e(an)o(d)h(in)o(d)o (ep)q(en)o(d)o(ence)j(in)e(t)n(h)o(e)g(ou)o(t)o(pu)o(t)h(of)f(a)f(ran)o (dom)f(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(or.)62 971 y(OPSO)f(us)q(e)q(s)h(more)d(of)h(eac)o(h)h(ran)o(dom)e(n)n(u)o(m)n(b)q (er,)h(10)g(bit)o(s,)g(bu)o(t)h(space)h(an)o(d)e(t)o(im)o(e)e(limit)o (a)o(t)o(io)o(ns)g(only)i(allo)o(w)0 1020 y(t)o(e)q(st)o(in)o(g)i (2-let)n(t)o(er)h(w)o(ords,)f(t)n(h)o(a)o(t)g(i)q(s,)e(in)o(d)o(ep)q (en)o(d)o(ence)k(for)d(pairs)h(\(2)g(dim)o(ens)q(ions\).)i(On)e(t)n(h)o (e)g(ot)n(h)o(er)h(h)o(an)o(d,)e(DNA)0 1070 y(can)f(t)o(e)q(st)h(10-t)o (uple)q(s)f(\(10)f(dim)o(ens)q(ion)o(al)e(b)q(e)o(h)o(a)o(viour\))j(bu) o(t,)g(again)f(f)q(rom)f(t)o(im)o(e)g(an)o(d)i(space)h(cons)q(id)o(era) o(t)o(ions,)f(a)o(t)0 1120 y(a)g(d)o(ept)n(h)h(of)f(only)f(2)h(bit)o(s) g(p)q(er)h(ran)o(dom)d(n)n(u)o(m)n(b)q(er.)18 b(Som)o(e)10 b(RNG's)i(m)o(ay)e(do)i(w)o(ell)f(in)h(on)o(e)g(of)f(t)n(h)o(e)i(t)o(e) q(st)o(s)h(an)o(d)e(not)0 1170 y(in)g(t)n(h)o(e)i(ot)n(h)o(er.)19 b(OTSO)13 b(an)o(d)g(OQSO)g(are)h(in)e(b)q(et)o(w)o(een,)i(us)q(in)o(g) e(6)h(bit)o(s)g(f)q(rom)e(eac)o(h)j(n)n(u)o(m)n(b)q(er)f(for)f(b)q(e)o (h)o(a)o(viour)g(in)0 1220 y(3)i(dim)o(ens)q(ions)e(or)h(5)h(bit)o(s)h (f)q(rom)c(eac)o(h)k(n)n(u)o(m)n(b)q(er)f(for)f(4)h(dim)o(ens)q(ions.) 62 1270 y(Of)g(cours)q(e)h(a)f(go)q(o)q(d)g(RNG)f(monk)o(ey)f(sh)o (ould)i(pass)h(all)e(t)n(h)o(e)q(s)q(e)i(t)o(e)q(st)o(s.)21 b(W)m(e)13 b(n)o(ext)i(giv)o(e)e(example)q(s)g(of)g(go)q(o)q(d)0 1319 y(an)o(d)h(not)f(so)h(go)q(o)q(d)g(RNG)f(monk)o(eys.)0 1457 y Fi(11)88 b(Re)r(sul)o(t)o(s)21 b(of)h(Ext)n(ens)q(iv)n(e)f(Monk) n(ey)g(T)-6 b(e)r(st)o(s)0 1548 y Fl(I)15 b(h)o(a)o(v)o(e)h(ap)o(plie)q (d)e(v)n(ar)q(ious)g(monk)o(ey)g(t)o(e)q(st)o(s)k(t)o(o)d(m)o(an)o(y)f (di\013eren)o(t)i(RNG's.)22 b(I)16 b(\014n)o(d)f(OPSO,OQSO)i(an)o(d)e (DNA)0 1597 y(t)o(o)e(b)q(e)g(t)n(h)o(e)g(most)f(e\013ect)o(iv)o(e.)19 b(Simple)10 b(t)o(e)q(st)o(s)15 b(su)o(c)o(h)e(as)g(t)n(h)o(e)g(CA)m(T) g(t)o(e)q(st)g(of)f(Sect)o(ion)h(1)g(are)g(eas)q(ily)f(programm)o(e)q (d,)0 1647 y(bu)o(t)17 b(more)f(complica)o(t)o(e)q(d)f(programs)g(su)o (c)o(h)i(as)g(t)n(h)o(os)q(e)h(for)e(OPSO,)h(OQSO)h(or)e(DNA)h(are)g (really)f(not)h(t)n(h)o(a)o(t)0 1697 y(complica)o(t)o(e)q(d,)10 b(an)o(d)h(t)n(h)o(e)h(read)o(er)i(m)o(ay)c(\014n)o(d)h(it)h(eas)q(ier) g(t)o(o)g(program)e(hi)q(s)h(o)o(wn)g(v)o(ers)q(ions)h(ra)o(t)n(h)o(er) h(t)n(h)o(an)f(get)g(t)n(h)o(em)0 1747 y(f)q(rom)g(m)o(e)h(an)o(d)g (\014gure)i(ou)o(t)f(h)o(o)o(w)f(t)o(o)h(us)q(e)h(t)n(h)o(em.)62 1797 y(Next,)e(let)f(us)g(sugge)q(st)h(v)n(ar)q(ious)e(lev)o(els)h(of)f (str)q(in)o(gency)i(for)f(t)o(e)q(st)o(s)i(of)d(a)h(ran)o(dom)e(n)n(u)o (m)n(b)q(er)i(gen)o(era)o(t)o(or.)18 b(F)m(or)0 1846 y(most)10 b(ap)o(plica)o(t)o(ions,)f(t)n(h)o(e)j(leadin)o(g)e(bit)o(s,) i(say)f(t)n(h)o(e)g(t)n(h)o(e)h(\014rst)f(10{16)f(bit)o(s,)h(of)g(a)f (RNG)g(are)h(t)n(h)o(e)h(most)e(imp)q(ort)o(an)o(t)0 1896 y(an)o(d)16 b(sh)o(ould)h(pass)g(all)f(t)o(e)q(st)o(s.)28 b(Th)n(us,)17 b(for)f(monk)o(ey)g(t)o(e)q(st)o(s,)i(k)o(eystrok)o(e)q (s)g(d)o(et)o(ermin)o(e)q(d)f(b)o(y)g(t)n(h)o(e)g(leadin)o(g)f(bit)o(s) 0 1946 y(of)h(t)n(h)o(e)i(ran)o(dom)d(n)n(u)o(m)n(b)q(er)h(m)n(ust)h(b) q(e)f(sa)o(t)o(i)q(sf)q(act)o(or)q(ily)f(ran)o(dom)g(an)o(d)i(in)o(d)o (ep)q(en)o(d)o(en)o(t.)31 b(Su)o(c)o(h)18 b(RNG's)f(will)f(b)q(e)0 1996 y(sa)o(t)o(i)q(sf)q(act)o(ory)d(for)h(most)f(purp)q(os)q(e)q(s.)62 2046 y(Th)o(ere)20 b(are)e(an)g(increas)q(in)o(g)h(n)n(u)o(m)n(b)q(er)f (of)g(ap)o(plica)o(t)o(ions,)f(h)o(o)o(w)o(ev)o(er,)i(wh)o(ere)g(ad)o (equa)o(t)o(e)g(ran)o(domn)o(e)q(ss)f(in)0 2096 y(t)n(h)o(e)d(most)f(s) q(igni\014can)o(t)f(bit)o(s)i(of)f(a)g(ran)o(dom)e(in)o(t)o(eger)j(or)f (u)o(niform)f(v)n(ar)q(ia)o(t)o(e)g(on)h([0,1\))f(i)q(s)h(not)h (enough.)k(Mon)o(t)o(e)0 2145 y(Carlo)f(s)q(im)n(ula)o(t)o(ions)e(us)q (in)o(g)j(sample)q(s)e(of)i(s)q(ev)o(eral)g(millio)o(ns)e(are)i (example)q(s,)f(an)o(d)h(anot)n(h)o(er)g(i)q(s)g(us)q(e)g(of)f(t)n(h)o (e)0 2195 y(trailin)o(g)13 b(b)o(yt)o(e)g(of)g(a)h(ran)o(dom)e(in)o(t)o (eger)i(t)o(o)g(pro)o(vid)o(e)f(t)n(h)o(e)i(domin)o(an)o(t)c(st)o(ep)k (in)e(gen)o(era)o(t)o(in)o(g)h(a)f(di)q(scret)o(e)i(ran)o(dom)0 2245 y(v)n(ar)q(ia)o(ble.)h(\(Proba)o(bly)c(t)n(h)o(e)i(f)q(ast)o(e)q (st)g(m)o(et)n(h)o(o)q(d)e(for)h(gen)o(era)o(t)o(in)o(g)g(a)g(di)q (scret)o(e)h(v)n(ar)q(ia)o(t)o(e)e(i)q(s)h(t)o(o)g(expre)q(ss)j(eac)o (h)e(of)e(it)o(s)0 2295 y(proba)o(bilit)o(ie)q(s)f(as)i(a)f(su)o(m)g Fg(p)425 2301 y Fd(i)451 2295 y Fl(=)f Fg(k)516 2301 y Fd(i)530 2295 y Fg(=)p Fl(256)c(+)g Fg(r)679 2301 y Fd(i)691 2295 y Fl(.)17 b(Th)o(en)c(t)n(h)o(e)g(require)q(d)h(v)n(ar)q (ia)o(t)o(e)e(i)q(s)g(gen)o(era)o(t)o(e)q(d)h(most)f(of)g(t)n(h)o(e)i (t)o(im)o(e)0 2345 y(b)o(y)g(fet)o(c)o(hin)o(g)g(a)g(v)n(alue)g(f)q (rom)e(a)i(t)o(a)o(ble)g(wit)n(h)g(in)o(d)o(ex)g(a)g(ran)o(dom)f(b)o (yt)o(e)h(d)o(et)o(ermin)o(e)q(d)h(b)o(y)f(t)n(h)o(e)h(trailin)o(g)e(8) h(bit)o(s)h(of)0 2394 y(a)f(ran)o(dom)e(32-bit)h(in)o(t)o(eger.\))62 2444 y(So,)19 b(a)e(really)h(go)q(o)q(d)f(ran)o(dom)g(n)n(u)o(m)n(b)q (er)g(gen)o(era)o(t)o(or)i(m)n(ust)f(pass)h(monk)o(ey)d(t)o(e)q(st)o(s) k(wit)n(h)e(k)o(eystrok)o(e)q(s)h(d)o(e-)0 2494 y(t)o(ermin)o(e)q(d)e (b)o(y)g(all)f(p)q(oss)q(ible)i(su)n(bstr)q(in)o(gs)h(of)e(bit)o(s)h (of)f(it)o(s)g(ran)o(dom)f(n)n(u)o(m)n(b)q(ers.)29 b(Most,)19 b(bu)o(t)f(not)f(all,)f(of)h(t)n(h)o(e)0 2544 y(st)o(an)o(d)o(ard)12 b(RNG's)f(h)o(a)o(v)o(e)g(sa)o(t)o(i)q(sf)q(act)o(ory)g(leadin)o(g)h (bit)o(s,)g(bu)o(t)g(it)g(i)q(s)f(quit)o(e)g(di\016cul)o(t)g(t)o(o)h(f) q(ashion)f(gen)o(era)o(t)o(ors)i(wit)n(h)0 2594 y(sa)o(t)o(i)q(sf)q (act)o(ory)g(trailin)o(g)g(bit)o(s.)62 2643 y(Th)n(us,)g(for)f (example,)f(a)h(really)g(go)q(o)q(d)g(RNG)f(m)n(ust)h(pass)h(OPSO)h (wit)n(h)e(k)o(eystrok)o(e)q(s)i(d)o(et)o(ermin)o(e)q(d)e(b)o(y)g(bit)o (s)0 2693 y(1-10,)f(2-11,...,23-3)o(2.)k(Similarl)o(y)m(,)9 b(it)j(m)n(ust)g(pass)i(OQSO)f(wit)n(h)g(bit)o(s)g(1-5,2-6,...)o(,28)o (-32)c(an)o(d)j(DNA)h(wit)n(h)f(bit)o(s)0 2743 y(1-2,2-3,...)o(,31)o (-32.)62 2793 y(A)k(few)g(gen)o(era)o(t)o(ors)i(are)e(t)n(h)o(a)o(t)g (go)q(o)q(d,)g(ot)n(h)o(ers)h(are)f(not.)24 b(Here)17 b(i)q(s)f(a)f(su)o(mm)o(ary)f(of)h(kin)o(ds)h(of)f(gen)o(era)o(t)o(ors) 0 2843 y(an)o(d)h(t)n(h)o(e)h(ext)o(en)o(t)g(t)o(o)g(whic)o(h)f(t)n(h)o (ey)h(pass)h(monk)o(ey)d(t)o(e)q(st)o(s.)27 b(More)17 b(d)o(et)o(aile)q(d)g(d)o(e)q(scr)q(ipt)o(ions)g(of)f(t)n(h)o(e)h (class)q(e)q(s)i(of)845 2978 y(7)p eop %%Page: 8 8 8 7 bop 0 45 a Fl(gen)o(era)o(t)o(ors)16 b(are)e(in)f([4,)g(5,)g(6,)g (7])0 182 y Fi(12)88 b(Su)o(mm)n(ary)21 b(for)h(v)l(ar)q(ious)f(clas)q (s)q(e)r(s)h(of)g(RNG's)0 282 y Fa(12.1)56 b(Con)o(gruen)n(t)n(ial)19 b(Gen)n(era)o(t)o(ors)0 358 y Fl(Th)o(e)q(s)q(e)d(pro)q(d)o(u)o(ce)g(s) q(equence)q(s)i Fg(x)495 364 y Fd(n)530 358 y Fl(=)c Fg(ax)622 364 y Fd(n)p Fe(\000)p Fh(1)697 358 y Fl(+)c Fg(b)h Fl(mo)q(d)g Fg(m)p Fl(.)21 b(Th)o(e)16 b(mo)q(d)o(ulus)d Fg(m)j Fl(i)q(s)e(b)q(e)q(st)i(t)o(ak)o(en)f(t)o(o)g(b)q(e)g(2)1610 343 y Fh(32)1660 358 y Fl(for)0 408 y(sp)q(ee)q(d)j(an)o(d)e(con)o(v)o (enience)i(in)e(mo)q(d)o(er)q(n)g(CPU's,)h(bu)o(t)g(a)f(pr)q(im)o(e)f (mo)q(d)o(ulus)g(pro)q(d)o(u)o(ce)q(s)j(b)q(et)n(t)o(er)g(trailin)o(g)e (bit)o(s.)0 458 y(Th)o(os)q(e)f(wit)n(h)f(pr)q(im)o(e)f(mo)q(d)o(ulus)f (s)q(eem)i(t)o(o)g(do)g(w)o(ell)g(on)g(all)f(su)n(bstr)q(in)o(gs)j(of)d (bit)o(s)i(for)f(t)n(h)o(e)h(OPSO,)f(OQSO)h(an)o(d)0 508 y(DNA)g(t)o(e)q(st)o(s.)24 b(Th)o(ey)16 b(w)o(ould)e(b)q(e)i(t)n(h) o(e)g(con)o(gruen)o(t)o(ial)f(gen)o(era)o(t)o(ors)i(of)e(c)o(h)o(oice)g (if)g(t)n(h)o(ey)g(w)o(ere)i(not)e(so)g(awkw)o(ard)0 557 y(t)o(o)f(implem)n(en)o(t.)62 607 y(Con)o(gruen)o(t)o(ial)i(gen)o (era)o(t)o(ors)i(wit)n(h)e(mo)q(d)o(ulus)f(a)h(p)q(o)o(w)o(er)h(of)f(2) g(usually)f(do)h(w)o(ell)g(if)f(str)q(in)o(gs)i(of)f(bit)o(s)h(f)q(rom) 0 657 y(t)n(h)o(e)f(\014rst)h(10)e(or)g(12)g(are)h(us)q(e)q(d)g(t)o(o)g (d)o(et)o(ermin)o(e)g(a)f(k)o(eystrok)o(e.)24 b(Bu)o(t)16 b(not)o(e,)g(f)q(rom)d(a)o(b)q(o)o(v)o(e,)i(t)n(h)o(a)o(t)h(t)n(h)o(e)g (Ber)o(k)o(eley)0 707 y(con)o(gruen)o(t)o(ial)c(RNG)f(f)q(aile)q(d)g (OPSO)i(wit)n(h)f(k)o(eystrok)o(e)q(s)i(d)o(et)o(ermin)o(e)q(d)e(b)o(y) g(t)n(h)o(e)h(leadin)o(g)f(t)o(en)h(bit)o(s.)18 b(Th)o(e)12 b(wid)o(ely)0 757 y(us)q(e)q(d)g(gen)o(era)o(t)o(or)h Fg(x)298 763 y Fd(n)332 757 y Fl(=)e(69069)p Fg(x)504 763 y Fd(n)p Fe(\000)p Fh(1)579 757 y Fl(mo)q(d)g(2)692 742 y Fh(32)738 757 y Fl(\(t)n(h)o(e)h(syst)o(em)f(gen)o(era)o(t)o(or)h (for)f(V)m(ax's\))g(s)q(eems)g(t)o(o)h(pass)g(all)e(t)o(e)q(st)o(s)0 807 y(d)o(et)o(ermin)o(e)q(d)17 b(b)o(y)g(leadin)o(g)g(bit)o(s,)g(bu)o (t)h(it)e(f)q(ails)f(badly)i(on)f(OPSO,)h(OQSO)h(an)o(d)f(DNA)f(if)g (bit)o(s)i(b)q(ey)o(on)o(d)e(t)n(h)o(e)0 856 y(\014rst)f(13)e(are)i(us) q(e)q(d.)0 973 y Fa(12.2)56 b(Shift)18 b(Regi)q(st)n(er)g(Gen)n(era)o (t)o(ors)0 1049 y Fl(Pract)o(ical)d(v)o(ers)q(ions)g(of)f(t)n(h)o(e)q (s)q(e)i(gen)o(era)o(t)o(ors)h(are)e(p)q(erh)o(aps)h(b)q(e)q(st)f(d)o (e)q(scr)q(ib)q(e)q(d)i(b)o(y)d(viewin)o(g)h(a)f(compu)o(t)o(er)h(w)o (ord)0 1099 y(as)i(a)h(bin)o(ary)f(v)o(ect)o(or)h Fg(\014)r Fl(.)29 b(Th)o(en)18 b(t)n(h)o(e)g(s)q(equence)i(i)q(s)c Fg(\014)r(;)7 b(\014)r(T)s(;)g(\014)r(T)994 1084 y Fh(2)1015 1099 y Fg(;)g(:)g(:)g(:)n Fl(,)17 b(wit)n(h)h Fg(T)23 b Fl(a)17 b(bin)o(ary)g(m)o(a)o(tr)q(ix.)27 b(Su)o(c)o(h)17 b(a)0 1149 y Fg(T)j Fl(i)q(s)14 b(c)o(h)o(os)q(en)i(t)o(o)e(m)o(ak)o(e) f(t)n(h)o(e)i(p)q(er)q(io)q(d)f(lon)o(g)g(an)o(d)g(implem)n(en)o(t)o(a) o(t)o(i)o(on)d(reason)o(a)o(ble;)k(amon)o(g)d(t)n(h)o(e)j(most)f (common)0 1199 y Fg(T)6 b Fl('s)17 b(are)h(t)n(h)o(os)q(e)g(of)f(t)n(h) o(e)h(example)q(s)e(a)o(b)q(o)o(v)o(e:)24 b Fg(T)f Fl(=)18 b(\()p Fg(I)d Fl(+)c Fg(R)924 1184 y Fh(15)959 1199 y Fl(\)\()p Fg(I)16 b Fl(+)11 b Fg(L)1096 1184 y Fh(17)1132 1199 y Fl(\))17 b(for)g(32-bit)f(bin)o(ary)h(v)o(ect)o(ors,)i(an)o(d)0 1248 y Fg(T)f Fl(=)11 b(\()p Fg(I)h Fl(+)c Fg(R)203 1233 y Fh(28)238 1248 y Fl(\)\()p Fg(I)k Fl(+)c Fg(L)368 1233 y Fh(3)387 1248 y Fl(\))13 b(or)h Fg(T)j Fl(=)12 b(\()p Fg(I)g Fl(+)c Fg(L)666 1233 y Fh(18)701 1248 y Fl(\)\()p Fg(I)k Fl(+)c Fg(R)835 1233 y Fh(13)870 1248 y Fl(\))14 b(for)f(31-bit)f(v)o(ect)o(ors.)19 b Fg(R)13 b Fl(an)o(d)g Fg(L)h Fl(are)f(m)o(a)o(tr)q(ice)q(s)g(t)n(h)o(a)o(t)0 1298 y(e\013ect)j(a)f(r)q(igh)o(t)f(\(left\))h(shift)f(of)h(on)o(e)f(p) q(os)q(it)o(ion)h(in)f(t)n(h)o(e)h(bin)o(ary)g(v)o(ect)o(or,)g(an)o(d)g (addit)o(ion)e(of)i(bin)o(ary)f(v)o(ect)o(ors)j(i)q(s)0 1348 y(t)n(h)o(e)e(exclus)q(iv)o(e-or)g(o)o(p)q(era)o(t)o(ion.)20 b(Shift)14 b(regi)q(st)o(er)i(gen)o(era)o(t)o(ors)g(do)f(p)q(o)q(orly)f (on)h(most)f(monk)o(ey)f(t)o(e)q(st)o(s,)k(wit)n(h)d(t)n(h)o(e)0 1398 y(except)o(ion)h(of)e Fg(T)k Fl(=)12 b(\()p Fg(I)h Fl(+)d Fg(L)434 1383 y Fh(18)469 1398 y Fl(\)\()p Fg(I)j Fl(+)d Fg(R)606 1383 y Fh(13)641 1398 y Fl(\))k(or)f(it)o(s)i(transp)q (os)q(e,)g(whic)o(h)e(do)h(w)o(ell)f(on)h(most,)f(bu)o(t)h(not)g(all|s) q(ee,)0 1448 y(for)g(example,)d(it)o(s)k(p)q(o)q(or)f(p)q(erform)o (ance)f(on)h(OPSO)g(a)o(t)g(t)n(h)o(e)h(en)o(d)f(of)f(Sect)o(ion)h(4.)0 1564 y Fa(12.3)56 b(Lagge)r(d)18 b(Fib)r(on)o(acci)f(Gen)n(era)o(t)o (ors)0 1641 y Fl(Th)o(e)q(s)q(e)d(gen)o(era)o(t)o(ors)g(us)q(e)g(an)e (init)o(ial)f(s)q(et)i(of)f(elem)o(en)o(t)o(s)h Fg(x)864 1647 y Fh(1)882 1641 y Fg(;)7 b(x)925 1647 y Fh(2)943 1641 y Fg(;)g(:)g(:)g(:)e(;)i(x)1060 1647 y Fd(r)1090 1641 y Fl(an)o(d)12 b(t)o(w)o(o)h(\\lags")e Fg(r)j Fl(an)o(d)e Fg(s)h Fl(wit)n(h)g Fg(r)f(>)g(s)p Fl(.)0 1690 y(Su)o(cce)q(ss)q(iv)o (e)18 b(elem)o(en)o(t)o(s)e(are)h(gen)o(era)o(t)o(e)q(d)h(b)o(y)e(t)n (h)o(e)h(recurs)q(ion,)g(for)f Fg(n)f(>)h(r)q Fl(:)22 b Fg(x)1190 1696 y Fd(n)1228 1690 y Fl(=)16 b Fg(x)1300 1696 y Fd(n)p Fe(\000)p Fd(r)1375 1690 y Ff(\005)11 b Fg(x)1431 1696 y Fd(n)p Fe(\000)p Fd(s)1495 1690 y Fl(,)16 b(wh)o(ere)i Ff(\005)e Fl(i)q(s)0 1740 y(som)o(e)10 b(bin)o(ary)h(o)o (p)q(era)o(t)o(ion.)16 b(Th)o(e)c(init)o(ial)d(\(s)q(ee)q(d\))k(elem)o (en)o(t)o(s)e(are)g(compu)o(t)o(er)h(w)o(ords)f(an)o(d)g(t)n(h)o(e)h (bin)o(ary)f(o)o(p)q(era)o(t)o(ion)0 1790 y(migh)o(t)g(b)q(e)i(+,)p Ff(\000)p Fl(,)p Ff(\003)g Fl(or)g Ff(\010)g Fl(\(exclus)q(iv)o (e-or\).)18 b(F)m(or)13 b(+)g(or)g Ff(\000)p Fl(,)g(t)n(h)o(e)h Fg(x)p Fl('s)f(migh)o(t)d(b)q(e)k(in)o(t)o(egers)f(mo)q(d)f(2)1461 1775 y Fd(k)1494 1790 y Fl(or)h(s)q(in)o(gle-)g(or)0 1840 y(dou)n(ble-preci)q(s)q(ion)d(reals)h(mo)q(d)f(1.)16 b(F)m(or)11 b Ff(\003)p Fl(,)f(o)q(dd)h(in)o(t)o(egers)h(mo)q(d)d(2)992 1825 y Fd(k)1012 1840 y Fl(.)17 b(W)m(e)10 b(d)o(e)q(s)q(ign)o(a)o(t)o (e)h(su)o(c)o(h)h(a)e(gen)o(era)o(t)o(or)i(lo)q(os)q(ely)0 1890 y(as)f(F\(r,s,)p Ff(\005)p Fl(\),)g(al)o(t)n(h)o(ough)g(eac)o(h)h (lagge)q(d-Fib)q(on)o(acci)e(gen)o(era)o(t)o(or)i(d)o(ep)q(en)o(ds)g (on)f(d)o(et)o(ails)g(of)f(t)n(h)o(e)i(part)o(icular)e(bin)o(ary)0 1939 y(o)o(p)q(era)o(t)o(ion)j(an)o(d)h(t)n(h)o(e)g(\014nit)o(e)g(s)q (et)h(of)e(elem)o(en)o(t)o(s)h(it)f(o)o(p)q(era)o(t)o(e)q(s)i(on.)62 1989 y(Gen)o(era)o(t)o(ors)i(us)q(in)o(g)e(m)n(ul)o(t)o(iplica)o(t)o (ion)d(on)j(o)q(dd)g(in)o(t)o(egers,)h(a)n(u)o(t)o(om)o(a)o(t)o(ically) d(mo)q(d)o(ulo)g(2)1382 1974 y Fh(32)1417 1989 y Fl(,)j(are)f(t)n(h)o (e)h(b)q(e)q(st)h(of)0 2039 y(t)n(h)o(e)g(lagge)q(d)e(Fib)q(on)o(acci)h (gen)o(era)o(t)o(ors,)i(pass)q(in)o(g)f(ot)n(h)o(er)g(t)o(e)q(st)o(s)h (as)e(w)o(ell)g(as)g(monk)o(ey)e(t)o(e)q(st)o(s.)27 b(\(Th)o(e)17 b(last)f(bit)g(i)q(s)0 2089 y(alw)o(ays)g(1,)h(so)g(of)f(cours)q(e)i(t) n(h)o(ey)f(cannot)g(pass)h(OPSO,)f(OQSO)h(or)f(DNA)f(if)g(t)n(h)o(e)i (last)e(bit)h(con)o(tr)q(ibu)o(t)o(e)q(s)h(t)o(o)0 2139 y(t)n(h)o(e)c(k)o(eystrok)o(e.\))19 b(Ov)o(erall,)13 b(F\(r,s,+\))h(an)o(d)f(F\(r,s,-\))h(an)o(d)f(F\(r,s,)p Ff(\010)p Fl(\))h(do)f(v)o(ery)h(w)o(ell)f(on)g(monk)o(ey)f(t)o(e)q(st) o(s)k(for)d(all)0 2188 y(str)q(in)o(gs)j(of)f(bit)o(s.)24 b(Bu)o(t)17 b(F\(r,s,)p Ff(\010)p Fl(\))f(m)o(ay)e(f)q(ail)f(for)j (pairs)f(\(r,s\))h(su)o(c)o(h)h(as)e(\(31,13\))g(or)h(\(17,5\))e(b)q (eca)n(us)q(e)j(of)e(t)n(h)o(e)q(ir)0 2238 y(t)n(h)o(e)q(ir)i(in)o(ad)o (equa)o(t)o(e)g(p)q(er)q(io)q(d,)g(2)476 2223 y Fd(r)494 2238 y Fl(,)g(in)f(con)o(trast)h(t)o(o)g(t)n(h)o(e)g(ot)n(h)o(er)h (lagge)q(d)e(Fib)q(on)o(acci)g(gen)o(era)o(t)o(ors,)j(whic)o(h)d(h)o(a) o(v)o(e)0 2288 y(p)q(er)q(io)q(ds)e(a)o(b)q(ou)o(t)g(2)284 2273 y Fh(32+)p Fd(r)361 2288 y Fl(.)k(See)c([5].)0 2404 y Fa(12.4)56 b(A)-6 b(W)n(C)19 b(an)n(d)h(SWB)e(Gen)n(era)o(t)o(ors)0 2481 y Fl(Th)o(e)j(recen)o(t)n(ly)g(d)o(ev)o(elo)o(p)q(e)q(d)g(add-wit) n(h-carry)g(\(A)-5 b(W)o(C\))21 b(an)o(d)f(su)n(btract-wit)n(h-b)q (orro)o(w)h(\(SWB\))g(gen)o(era)o(t)o(ors)0 2531 y([7)o(])16 b(h)o(a)o(v)o(e)h(rem)o(ar)o(ka)o(bly)d(lon)o(g)i(p)q(er)q(io)q(ds)h (an)o(d)f(s)q(eem)g(t)o(o)h(pass)h(OPSO,)e(OQSO)i(an)o(d)e(DNA)h(t)o(e) q(st)o(s)h(for)e(str)q(in)o(gs)0 2581 y(of)j(bit)o(s)i(f)q(rom)d(all)h (part)o(s)i(of)e(t)n(h)o(e)i(ran)o(dom)d(in)o(t)o(eger.)37 b(Th)o(ey)21 b(are)f(bas)q(e)q(d)h(on)f(recurs)q(ions)h(su)o(c)o(h)f (as)h Fg(x)1634 2587 y Fd(n)1678 2581 y Fl(=)0 2630 y Fg(x)24 2636 y Fd(n)p Fe(\000)p Fd(r)97 2630 y Fl(+)9 b Fg(x)162 2636 y Fd(n)p Fe(\000)p Fd(s)235 2630 y Fl(+)g Fg(c)i Fl(mo)q(d)f Fg(b)p Fl(,)j(wh)o(ere)i(t)n(h)o(e)f(`)p Fg(c)p Fl(')f(i)q(s)g(not)g(a)g(const)o(an)o(t,)h(bu)o(t)g(t)n(h)o(e)h (carry)f(bit:)j(1)d(or)f(0,)g(d)o(ep)q(en)o(din)o(g)h(on)0 2680 y(wh)o(et)n(h)o(er)i(t)n(h)o(e)g(previous)f(addit)o(ion)e(did,)h (or)h(did)f(not,)h(excee)q(d)i(t)n(h)o(e)e(mo)q(d)o(ulus)e Fg(b)p Fl(.)21 b(Th)o(a)o(t)14 b(d)o(e)q(scr)q(ib)q(e)q(s)i(an)f(A)-5 b(W)o(C)0 2730 y(gen)o(era)o(t)o(or.)19 b(An)14 b(SWB)g(gen)o(era)o(t)o (or)h(forms)d Fg(x)695 2736 y Fd(n)729 2730 y Fl(=)g Fg(x)797 2736 y Fd(n)p Fe(\000)p Fd(s)870 2730 y Ff(\000)d Fg(x)935 2736 y Fd(n)p Fe(\000)p Fd(r)1009 2730 y Ff(\000)g Fg(c)j Fl(mo)q(d)e Fg(b)p Fl(,)j(wit)n(h)h Fg(c)f Fl(1)h(or)g(0,)f(d)o (ep)q(en)o(din)o(g)h(on)0 2780 y(wh)o(et)n(h)o(er)h(t)n(h)o(e)g (previous)f(su)n(btract)o(ion)h(w)o(as)f(n)o(ega)o(t)o(iv)o(e.)845 2978 y(8)p eop %%Page: 9 9 9 8 bop 62 45 a Fl(An)16 b(example:)k(t)n(h)o(e)c(SWB)g(gen)o(era)o(t)o (or)h Fg(x)703 51 y Fd(n)740 45 y Fl(=)e Fg(x)811 51 y Fd(n)p Fe(\000)p Fh(24)903 45 y Ff(\000)10 b Fg(x)969 51 y Fd(n)p Fe(\000)p Fh(37)1061 45 y Ff(\000)h Fg(c)g Fl(mo)q(d)f(2)1245 30 y Fh(32)1296 45 y Fl(h)o(as)16 b(p)q(er)q(io)q(d)f(a)o(b)q(ou)o(t)h(2)1642 30 y Fh(1178)0 95 y Fl(an)o(d)d(pass)q(e)q(s)j(all)c(t)n(h)o(e)j(CA)m(T,)e(OPSO,)h (OQSO)h(an)o(d)e(DNA)h(t)o(e)q(st)o(s)i(pu)o(t)e(t)o(o)g(it,)f(for)g (all)g(su)n(bstr)q(in)o(gs)j(of)d(it)o(s)h(32-bit)0 145 y(in)o(t)o(egers.)27 b(\(Ho)o(w)o(ev)o(er,)18 b(it)e(i)q(s)g(not)g(p)q (erfect;)j(it)d(f)q(ails)f(t)n(h)o(e)j(birt)n(h)o(d)o(ay-spacin)o(g)f (t)o(e)q(st)h(d)o(e)q(scr)q(ib)q(e)q(d)g(in)e([4)o(],)g(as)h(do)0 195 y(ot)n(h)o(er)e(A)-5 b(W)o(C)14 b(an)o(d)f(SWB)h(gen)o(era)o(t)o (ors)i(an)o(d)d(lagge)q(d-Fib)q(on)o(acci)g(gen)o(era)o(t)o(ors)j(us)q (in)o(g)e(+,{)f(or)h Ff(\010)p Fl(.\))0 311 y Fa(12.5)56 b(MW)n(C)19 b(gen)n(era)o(t)o(ors)0 387 y Fl(Th)o(e)13 b(most)e(sa)o(t)o(i)q(sf)q(act)o(ory)h(of)g(all)f(gen)o(era)o(t)o(ors)j (I)e(h)o(a)o(v)o(e)g(cons)q(id)o(ere)q(d)i(in)e(t)n(h)o(e)h(past)g(35)f (y)o(ears)h(are)g(m)n(ul)o(t)o(iply-wit)n(h-)0 437 y(carry)i(gen)o(era) o(t)o(ors,)i(d)o(e)q(scr)q(ib)q(e)q(d)f(in)f(a)f(p)q(ost)o(scr)q(ipt)j (\014le)e(\(m)o(wc1.ps\))f(includ)o(e)q(d)h(in)g(t)n(h)o(e)g(DIEHARD)g (pac)o(kage.)0 487 y(Th)o(ey)j(pass)h(all)e(t)o(e)q(st)o(s)j(pu)o(t)f (t)o(o)f(t)n(h)o(em,)g(h)o(a)o(v)o(e)g(v)o(ery)h(lon)o(g)e(p)q(er)q(io) q(ds)h(an)o(d)g(are)g(part)o(icularly)f(w)o(ell)h(suit)o(e)q(d)g(for)0 537 y(compu)o(t)o(er)c(implem)n(en)o(t)o(a)o(t)o(io)o(n.)0 653 y Fa(12.6)56 b(Com)m(bin)o(a)o(t)n(ion)17 b(Gen)n(era)o(t)o(ors)0 730 y Fl(Th)o(ere)j(i)q(s)f(t)n(h)o(eoret)o(ical)g(an)o(d)g(empir)q (ical)d(sup)o(p)q(ort)k(for)f(t)n(h)o(e)g(id)o(ea)h(t)n(h)o(a)o(t)f (com)n(binin)o(g)e(t)o(w)o(o)i(ran)o(dom)e(n)n(u)o(m)n(b)q(er)0 779 y(gen)o(era)o(t)o(ors)f(pro)q(d)o(u)o(ce)q(s)g(a)e(gen)o(era)o(t)o (or)h(wit)n(h)g(b)q(et)n(t)o(er)g(ran)o(domn)o(e)q(ss)g(t)n(h)o(an)f(e) q(it)n(h)o(er)i(of)d(it)o(s)i(comp)q(on)o(en)o(t)o(s)f([4].)k(F)m(or)0 829 y(example,)10 b(cons)q(id)o(er)j(t)n(h)o(e)f(s)q(imple)e(con)o (gruen)o(t)o(ial)h(gen)o(era)o(t)o(or)j Fg(x)963 835 y Fd(n)996 829 y Fl(=)e(69069)p Fg(x)1169 835 y Fd(n)p Fe(\000)p Fh(1)1244 829 y Fl(mo)q(d)e(2)1356 814 y Fh(32)1403 829 y Fl(ap)o(plie)q(d)h(t)o(o)h(OPSO)0 879 y(for)i(bit)o(s)h(15-24,)e (OQSO)j(for)e(bit)o(s)h(15-18)e(an)o(d)i(DNA)f(for)g(bit)o(s)h(15-16.)k (It)c(f)q(ails)e(all)g(of)h(t)n(h)o(em)g(sp)q(ect)o(acularly)m(,)0 929 y(pro)q(d)o(u)o(cin)o(g,)c(re)q(sp)q(ect)o(iv)o(ely)m(,)h(984,860)d (an)o(d)i(983,840)e(an)o(d)h(983,840)f(mi)q(ss)q(in)o(g)g(w)o(ords)j (wh)o(en)f(141,909)e(are)i(exp)q(ec-)0 979 y(t)o(e)q(d.)18 b(Bu)o(t)13 b(if)d(w)o(e)i(com)n(bin)o(e)f(it)g(\(b)o(y)h(addit)o (ion\))e(wit)n(h)i(t)n(h)o(e)g(shift)g(regi)q(st)o(er)g(gen)o(era)o(t)o (or)h Fg(\014)h Fl(=)e Fg(\014)r Fl(\()p Fg(I)d Fl(+)c Fg(L)1495 964 y Fh(17)1531 979 y Fl(\)\()p Fg(I)k Fl(+)c Fg(R)1659 964 y Fh(15)1694 979 y Fl(\))0 1029 y(on)12 b(32)g(bit)o(s)g(\(whic)o(h)g(f)q(ails)f(sp)q(ect)o(acularly)h(on)g (all)f(su)n(bstr)q(in)o(gs)j(of)e(bit)o(s\),)h(w)o(e)f(get)h(t)n(h)o(e) q(s)q(e)g(mi)q(ss)q(in)o(g-w)o(ord)e(cou)o(n)o(t)o(s)0 1078 y(for)j(OPSO,bit)o(s)h(15-24:)i(141909;)12 b(OQSO,)i(bit)o(s)h (15-18:)i(142116;)12 b(an)o(d)i(DNA,)f(bit)o(s)i(15-16:)i(141,524.)g(V) m(ery)0 1128 y(go)q(o)q(d,)c(b)q(e)q(in)o(g)h(0,.762)e(an)o(d)h(-.092)g (st)o(an)o(d)o(ard)h(d)o(evia)o(t)o(ions)g(f)q(rom)e(t)n(h)o(e)i(m)o (ean.)62 1178 y(Thi)q(s)k(example)e(i)q(s)i(for)g(t)n(h)o(e)g(wid)o (ely)g(us)q(e)q(d)h(com)n(bin)o(a)o(t)o(ion)d(gen)o(era)o(t)o(or)j(Sup) q(er-Dup)q(er,)g(com)n(binin)o(g)e Fg(I)22 b Fl(=)0 1228 y(69069)11 b Ff(\003)h Fg(I)22 b Fl(wit)n(h)c Fg(\014)k Fl(=)d Fg(\014)r Fl(\()p Fg(I)e Fl(+)12 b Fg(L)530 1213 y Fh(17)566 1228 y Fl(\)\()p Fg(I)k Fl(+)c Fg(R)708 1213 y Fh(15)743 1228 y Fl(\).)32 b(Bu)o(t)19 b(ev)o(en)g(t)n(h)o(a)o(t)g (com)n(bin)o(a)o(t)o(ion)c(f)q(ails)i(monk)o(ey)g(t)o(e)q(st)o(s)j(on)0 1278 y(trailin)o(g)f(bit)o(s.)38 b(Th)o(e)20 b(KISS)h(gen)o(era)o(t)o (or)g(\(K)o(eep-It-Simple-St)o(upid\))e(i)q(s)h(an)g(example)e(of)i(a)g (com)n(bin)o(a)o(t)o(ion)0 1327 y(gen)o(era)o(t)o(or)f(t)n(h)o(a)o(t)f (i)q(s)f(a)o(b)q(ou)o(t)h(as)g(s)q(imple)d(as)j(on)o(e)g(can)g(b)q(e)g (an)o(d)f(h)o(a)o(v)o(e)g(v)o(ery)i(lon)o(g)e(p)q(er)q(io)q(d,)h(a)o(b) q(ou)o(t)g(2)1563 1312 y Fh(127)1614 1327 y Fl(,)g(an)o(d)0 1377 y(pass)d(all)e(t)o(e)q(st)o(s)i(on)f(all)f(str)q(in)o(gs)h(of)g (bit)o(s.)k(It)c(com)n(bin)o(e)q(s)f(a)h(con)o(gruen)o(t)o(ial,)f(a)h (tr)q(iple-shift)e(regi)q(st)o(er)j(gen)o(era)o(t)o(or,)0 1427 y(an)o(d)g(a)g(m)n(ul)o(t)o(iply-wit)n(h-carry)e(gen)o(era)o(t)o (or:)23 b Fg(I)18 b Fl(=)c(69069)9 b Ff(\003)h Fg(I)d Fl(+)s(1,)16 b Fg(\014)h Fl(=)d Fg(\014)r Fl(\()p Fg(I)h Fl(+)10 b Fg(L)1250 1412 y Fh(13)1286 1427 y Fl(\)\()p Fg(I)k Fl(+)c Fg(R)1424 1412 y Fh(17)1459 1427 y Fl(\)\()p Fg(I)k Fl(+)d Fg(L)1594 1412 y Fh(5)1613 1427 y Fl(\))k(an)o(d)0 1477 y Fg(z)19 1483 y Fd(n)53 1477 y Fl(=)d(2)p Fg(z)137 1483 y Fd(n)p Fe(\000)p Fh(1)212 1477 y Fl(+)d Fg(z)272 1483 y Fd(n)p Fe(\000)p Fh(2)347 1477 y Fl(+)g(carry)j(mo)q(d)f(2)606 1462 y Fh(32)640 1477 y Fl(.)0 1614 y Fi(Reference)r(s)0 1705 y Fl([1])20 b(Gra)o(h)o(am,)26 b(Ron)o(ald)e(L.,)j(Kn)n(u)o(t)n (h,)j(Don)o(ald)24 b(E.)i(an)o(d)f(P)o(a)o(t)o(ashnik,)i(Oren)g Fk(Concr)n(ete)e(Mathematics)p Fl(,)65 1755 y(Addi)q(son-W)m(e)q(sley)m (,)12 b(Readin)o(g,)h(MA)h(1989)0 1838 y([2])20 b(Haas,)h(Alexan)o(d)o (er,)h(Th)o(e)e(m)n(ul)o(t)o(iple)e(pr)q(im)o(e)g(ran)o(dom)h(n)n(u)o (m)n(b)q(er)h(gen)o(era)o(t)o(or,)i Fk(A)o(CM)e(T)m(r)n(ansactions)g (on)65 1888 y(Mathematic)n(al)14 b(Softwar)n(e)p Fl(,)f Fj(13)p Fl(,)g(No.)h(4,)f(1987.)0 1971 y([3])20 b(Marsaglia,)26 b(George,)i(Ran)o(dom)23 b(n)n(u)o(m)n(b)q(ers)i(f)q(all)e(m)o(ainly)g (in)i(t)n(h)o(e)h(plan)o(e)q(s,)h Fk(Pr)n(o)n(c)n(e)n(e)n(dings)e (National)65 2021 y(A)n(c)n(ademy)15 b(Scienc)n(e)g Fj(61,)h Fl(25-28,)c(1968.)0 2104 y([4])20 b(Marsaglia,)f(George,)i(K)o(eynot)o (e)f(Addre)q(ss:)32 b(A)20 b(Curren)o(t)h(View)e(of)g(Ran)o(dom)f(Nu)o (m)n(b)q(er)h(Gen)o(era)o(t)o(ors,)65 2153 y Fk(Pr)n(o)n(c)n(e)n(e)n (dings,)c(Computer)h(Scienc)n(e)g(and)h(Statistics:)j(16th)c(Symp)n (osium)g(on)g(the)g(Interfac)n(e,)g Fl(Els)q(evier,)65 2203 y(1985)0 2286 y([5])k(Marsaglia,)9 b(George)i(an)o(d)g(Tsay)m(,)g (L.)f(H.,)g(Ma)o(tr)q(ice)q(s)i(an)o(d)e(t)n(h)o(e)i(stru)o(ct)o(ure)h (of)d(ran)o(dom)f(n)n(u)o(m)n(b)q(er)i(s)q(equence)q(s,)65 2336 y Fk(Line)n(ar)j(A)o(lgebr)n(a)g(and)i(its)e(Applic)n(ations,)h Fj(67,)h Fl(147{156,)11 b(1985.)0 2419 y([6])20 b(Marsaglia,)10 b(George,)h(Th)o(e)g(m)o(a)o(t)n(h)o(em)o(a)o(t)o(ics)e(of)h(ran)o(dom) f(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(ors,)i Fk(Pr)n(o)n(c)n(e)n(e)n (dings)f(of)g(Symp)n(osia)65 2469 y(on)j(Applie)n(d)g(Mathematics,)g Fj(46,)g Fl(73{89,)e(1992.)0 2552 y([7])20 b(Marsaglia,)13 b(George)j(an)o(d)f(Zam)o(an,)e(Ar)q(if,)h(A)i(n)o(ew)f(class)h(of)f (ran)o(dom)e(n)n(u)o(m)n(b)q(er)i(gen)o(era)o(t)o(ors,)i Fk(A)o(nnals)f(of)65 2602 y(Applie)n(d)e(Pr)n(ob)n(ability,)g Fj(1,)i Fl(No.)d(3,)g(462{480,)f(1991.)0 2685 y([8])20 b(Whit)n(t)n(le)q(s)q(ey)m(,)15 b(J.)g(R.)f(B.,)h(On)h(t)n(h)o(e)g(m)n (ul)o(t)o(idim)n(ens)q(ion)o(al)11 b(u)o(niformit)o(y)i(of)i(ps)q (eudoran)o(dom)f(n)n(u)o(m)n(b)q(er)h(gen)o(er-)65 2734 y(a)o(t)o(ors,)f Fk(Communic)n(ations)h(of)g(the)g(A)o(CM,)f Fj(12)p Fl(,)f(p.)h(247,)e(1969.)845 2978 y(9)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF source/mwc1.ps100644 765 144 174540 6074265563 12040 0ustar geousers%!PS-Adobe-2.0 %%Creator: dvipsk 5.58a Copyright 1986, 1994 Radical Eye Software %%Title: mwc1.dvi %%Pages: 4 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%DocumentPaperSizes: a4 %%EndComments %DVIPSCommandLine: dvips mwc1 %DVIPSParameters: dpi=300, compressed, comments removed %DVIPSSource: TeX output 1996.01.08:1407 %%BeginProcSet: texc.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} {adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] }if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict /eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 300 300 (mwc1.dvi) @start /Fa 9 122 df<1238127C12FEA3127C123807077C8610>46 D<13181378EA01F812FFA21201B3A7387FFFE0A213207C9F1C>49 D<14E013011303A21307130F131FA21337137713E7EA01C71387EA03071207120E120C12 181238127012E0B6FCA2380007E0A790B5FCA218207E9F1C>52 D<3801FE023807FF8638 1F01FE383C007E007C131E0078130EA200F81306A27E1400B4FC13E06CB4FC14C06C13F0 6C13F86C13FC000313FEEA003F1303EB007F143FA200C0131FA36C131EA26C133C12FCB4 13F838C7FFE00080138018227DA11F>83 D97 D<3AFF07F007F090391FFC1FFC3A1F303E303E01401340496C487EA20100 1300AE3BFFE0FFE0FFE0A22B167E9530>109 D114 D<38FF01FEA2381F003EAF147E14FE380F 81BE3907FF3FC0EA01FC1A167E951F>117 D<39FFE01FE0A2391F800700000F1306EBC0 0E0007130C13E000035BA26C6C5AA26C6C5AA2EB7CC0A2137F6D5AA26DC7FCA2130EA213 0CA25B1278EAFC3813305BEA69C0EA7F80001FC8FC1B207F951E>121 D E /Fb 13 120 df<13C0EA01E0A313C01203A21380A313005AA21206A31204120CA212 08A2C7FCA5123012785A12600B1E7C9D0D>33 D97 D<123F1207A2120EA45A A4EA39E0EA3A18EA3C0C12381270130EA3EAE01CA31318133813301360EA60C0EA3180EA 1E000F1D7C9C13>I<13F8EA0304120EEA1C0EEA181CEA30001270A25AA51304EA600813 10EA3060EA0F800F127C9113>II<13F8 EA0704120CEA1802EA38041230EA7008EA7FF0EAE000A5EA60041308EA30101360EA0F80 0F127C9113>I105 D107 D110 D114 DI<12035AA3120EA4EAFFE0EA1C00A35AA45AA4EAE080A2EAE100A212661238 0B1A7C990E>I<381E0183382703871247148338870701A2120EA2381C0E02A31404EA18 0C131C1408EA1C1E380C26303807C3C018127C911C>119 D E /Fc 1 28 df<1302131E137EEA01FE120F12FFA2120F1201EA007E131E13020F0C7E852A>27 D E /Fd 13 104 df0 D<126012F0A2126004047C8B0C>I<0040 132000C01360006013C03830018038180300EA0C066C5A6C5AEA01B0EA00E0A2EA01B0EA 0318EA060C487E487E38300180386000C04813600040132013147A9320>I<1203A4EAC3 0CEAE31CEA7338EA1FE0EA0780A2EA1FE0EA7338EAE31CEAC30CEA0300A40E127D9215> I20 D<13C0485AA348C9FCA212065A121C1230B712F0A200 30C9FC121C120C7E7EA26C7EA36C7E24167D942A>32 D<153081A381A281811680ED00C0 B712F8A2C912C0ED0380160015065DA25DA35D25167E942A>I<134013C0A3487EA2487E EA06D8EA0CCCEA38C738F0C3C0EAC0C000001300B3A712257F9C15>I<13C0B3A700C013 C0EAF0C33838C700EA0CCCEA06D8EA03F06C5AA26C5AA3134012257F9C15>I<124012C0 B3B3A3EAFF80127F092A7A9E12>98 D<13801201B3B3A312FFA2092A7E9E12>I<133C13 E0EA01C013801203AD13005A121C12F0121C12077E1380AD120113C0EA00E0133C0E297D 9E15>102 D<12F0121C12077E1380AD120113C0EA00E0133C13E0EA01C013801203AD13 005A121C12F00E297D9E15>I E /Fe 13 58 df<12021204120812181210123012201260 1240A212C0AA1240A212601220123012101218120812041202071E7D950D>40 D<1280124012201230121012181208120C1204A21206AA1204A2120C1208121812101230 122012401280071E7E950D>I<1360AAB512F0A238006000AA14167E9119>43 D<120FEA30C0EA6060A2EA4020EAC030A9EA4020EA6060A2EA30C0EA0F000C137E9211> 48 D<120C121C12EC120CAFEAFFC00A137D9211>I<121FEA60C01360EAF07013301260EA 0070A2136013C012011380EA02005AEA08101210EA2020EA7FE012FF0C137E9211>II<136013E0A2EA016012021206120C120812101220126012 C0EAFFFCEA0060A5EA03FC0E137F9211>III<1240EA7FFC13F8EA4010EA80301320EA00401380EA0100A25A12 021206A2120EA512040E147E9311>II<120FEA 3080EA6040EA4060EAC0201330A31240EA6070EA30B0EA0F30120013201360EAE0401380 EA4100123E0C137E9211>I E /Ff 4 100 df0 D<1204120EA2121CA31238A212301270A21260A212C0A2070F7F8F0A>48 D<124012C0B3A912FF127F081E7B950F>98 D<12011203B3A912FFA2081E80950F>I E /Fg 8 121 df<13201360A213C0A3EA0180A3EA0300A31206A25AA35AA35AA35AA35A A30B1D7E9511>61 D97 D<123C120C5AA45AEA3380EA3C60EA3020EA6030A4EAC060A2EA40C0 EA6080EA2300121E0C147F930F>II<1206120712061200A41238124CA2128C12981218 A212301232A21264A2123808147F930C>105 D110 D114 D120 D E /Fh 27 123 df<131EEB7180EBC0C0 EA01801203EB00E05AA2380E01C0A31480EA1C0314001306EA1E0CEA3A18EA39E00038C7 FCA25AA45AA25A131B7F9115>26 D<126012F0A2126004047C830C>58 D<126012F0A212701210A41220A212401280040C7C830C>II<130113031306A3130CA31318A31330A3 1360A213C0A3EA0180A3EA0300A31206A25AA35AA35AA35AA35AA210297E9E15>I<12E0 1278121EEA0780EA01E0EA0078131EEB0780EB01E0EB0078141EEC0780A2EC1E001478EB 01E0EB0780011EC7FC1378EA01E0EA0780001EC8FC127812E019187D9520>I<48B512F0 38003C00013813301520A35BA214081500495AA21430EBFFF03801C020A448485A91C7FC A348C8FCA45AEAFFF01C1C7E9B1B>70 D83 D97 D<123F1207A2120EA45AA4EA39E0EA3A30EA3C1812381270131CA3EAE038A31330137013 6013C01261EA2300121E0E1D7E9C12>III102 DIII<1307130FA213061300 A61378139CEA010C1202131C12041200A21338A41370A413E0A4EA01C01261EAF180EAF3 0012E6127C1024809B11>II<39381F81F0394E20C618394640E81CEB80F0EA8F00008E13E0120EA2391C01 C038A315703938038071A215E115E23970070064D83003133820127E9124>109 DI<13F8EA030CEA0E06487E1218123000701380 A238E00700A3130EA25BEA60185BEA30E0EA0F8011127E9114>I114 DI118 D<001CEBC080392701C1C0124714C03987038040A2120EA2391C070080A3EC0100EA1806 A2381C0E02EB0F04380E13083803E1F01A127E911E>I<380787803808C8403810F0C038 20F1E0EBE3C03840E1803800E000A2485AA43863808012F3EB810012E5EA84C6EA787813 127E9118>I122 D E /Fi 71 125 df<137E3801C180EA0301380703C0120EEB018090C7FCA5B512C0EA0E01B0 387F87F8151D809C17>12 D<90383F07E03901C09C18380380F0D80701133C000E13E001 00131892C7FCA5B612FC390E00E01CB03A7FC7FCFF80211D809C23>14 D<121C121EEA07801203A3EAFF00128009087B7E12>24 D<13E0EA0310EA0608A2120EA4 5BA25B6C5AEC3FE09038800F80EC06000003130412073809C00800115BEA30E03820F020 EA607038E03840EB3C80131C90380F00207F0070EB8040383009C0391830E180390FC03F 001B1F7E9D20>38 D<126012F012F812681208A31210A2122012401280050C7C9C0C>I< 1380EA0100120212065AA25AA25AA35AA412E0AC1260A47EA37EA27EA27E12027EEA0080 092A7C9E10>I<7E12407E12307EA27EA27EA37EA41380AC1300A41206A35AA25AA25A12 205A5A092A7E9E10>I<1306ADB612E0A2D80006C7FCAD1B1C7E9720>43 D<126012F0A212701210A41220A212401280040C7C830C>II<12 6012F0A2126004047C830C>I48 D<5A1207123F12C71207B3A5EAFFF80D1C7C9B15>III<130CA2131C133CA2135C13DC139CEA011C12 0312021204120C1208121012301220124012C0B512C038001C00A73801FFC0121C7F9B15 >II<13F0EA030CEA0404 EA0C0EEA181E1230130CEA7000A21260EAE3E0EAE430EAE818EAF00C130EEAE0061307A5 1260A2EA7006EA300E130CEA1818EA0C30EA03E0101D7E9B15>I<1240387FFF801400A2 EA4002485AA25B485AA25B1360134013C0A212015BA21203A41207A66CC7FC111D7E9B15 >III<126012F0A212601200AA126012F0A2126004127C910C>I<126012F0A212601200 AA126012F0A212701210A41220A212401280041A7C910C>I<007FB512C0B612E0C9FCA8 B612E06C14C01B0C7E8F20>61 D<1306A3130FA3EB1780A2EB37C01323A2EB43E01341A2 EB80F0A338010078A2EBFFF83802003CA3487FA2000C131F80001E5BB4EBFFF01C1D7F9C 1F>65 DI<90381F8080EBE061380180193807000700 0E13035A14015A00781300A2127000F01400A8007014801278A212386CEB0100A26C1302 6C5B380180083800E030EB1FC0191E7E9C1E>IIII<39FFF0FFF0390F000F00AC90B5FC EB000FAD39FFF0FFF01C1C7F9B1F>72 DI<39 FFF01FE0390F000780EC060014045C5C5C5C5C49C7FC13021306130FEB17801327EB43C0 EB81E013016D7E1478A280143E141E80158015C039FFF03FF01C1C7F9B20>75 DIIIII82 D<3807E080EA1C19EA30051303EA600112E01300A36C13007E127CEA7FC0EA3FF8EA1FFE EA07FFC61380130FEB07C0130313011280A300C01380A238E00300EAD002EACC0CEA83F8 121E7E9C17>I<007FB512C038700F010060130000401440A200C014201280A300001400 B1497E3803FFFC1B1C7F9B1E>I<39FFF01FF0390F000380EC0100B3A26C130213800003 5BEA01C03800E018EB7060EB0F801C1D7F9B1F>I<3AFFE1FFC0FF3A1F003E003C001E01 3C13186C6D1310A32607801F1320A33A03C0278040A33A01E043C080A33A00F081E100A3 9038F900F3017913F2A2017E137E013E137CA2013C133C011C1338A20118131801081310 281D7F9B2B>87 D<1208121012201240A21280A312B012F812781230050C7D9C0C>96 DI<12FC121CAA137CEA1D87381E0180381C00C014E014 601470A6146014E014C0381E018038190700EA10FC141D7F9C17>IIII<13F8EA018CEA071E1206EA 0E0C1300A6EAFFE0EA0E00B0EA7FE00F1D809C0D>II<12FC121CAA13 7C1387EA1D03001E1380121CAD38FF9FF0141D7F9C17>I<1218123CA21218C7FCA712FC 121CB0EAFF80091D7F9C0C>I<13C0EA01E0A2EA00C01300A7EA07E01200B3A21260EAF0 C012F1EA6180EA3E000B25839C0D>I<12FC121CAAEB0FE0EB0780EB06005B13105B5B13 E0121DEA1E70EA1C781338133C131C7F130F148038FF9FE0131D7F9C16>I<12FC121CB3 A9EAFF80091D7F9C0C>I<39FC7E07E0391C838838391D019018001EEBE01C001C13C0AD 3AFF8FF8FF8021127F9124>IIII<3803E0 80EA0E19EA1805EA3807EA7003A212E0A61270A2EA38071218EA0E1BEA03E3EA0003A7EB 1FF0141A7F9116>III<1204A4120CA2121C123CEAFFE0EA1C00A91310A5 120CEA0E20EA03C00C1A7F9910>I<38FC1F80EA1C03AD1307120CEA0E1B3803E3F01412 7F9117>I<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA0388A213C8EA 01D0A2EA00E0A3134013127F9116>I<39FF3FC7E0393C0703C0001CEB01801500130B00 0E1382A21311000713C4A213203803A0E8A2EBC06800011370A2EB8030000013201B127F 911E>I<38FF0FE0381E0700EA1C06EA0E046C5AEA039013B0EA01E012007F12011338EA 021C1204EA0C0E487E003C138038FE1FF014127F9116>I<38FF07E0383C0380381C0100 A2EA0E02A2EA0F06EA0704A2EA0388A213C8EA01D0A2EA00E0A31340A25BA212F000F1C7 FC12F312661238131A7F9116>II124 D E /Fj 25 122 df<1306130C13181330137013E0EA01C012031380120713 005AA2121EA2123E123CA2127CA4127812F8AE1278127CA4123CA2123E121EA27EA27E13 80120313C01201EA00E0137013301318130C13060F3C7AAC1A>40 D<12C012607E7E121C7E7E1380120313C0120113E0A2EA00F0A213F81378A2137CA4133C 133EAE133C137CA41378A213F813F0A2EA01E0A213C01203138012071300120E5A12185A 5A5A0F3C7CAC1A>I45 D<130C131C137CEA07FC12FF12F81200B3 ADB512FCA216277BA621>49 D51 D<141C143CA2147C14FC1301A213031307130E130C131813381370136013 C01201EA038013001206120E5A12185A12705AB612F0A2C7EAFC00A990383FFFF0A21C27 7EA621>I<91387FE002903907FFF80690391FE01E0E90397F00039E01FCEB01FE4848EB 007ED807F0143E5B4848141E001F150E485AA21606127F90C8FC16005AA97EA26D140612 3FA36C6C140C120F6C6C14186D1438D801F814306C6C14E0017FEB03C090391FE00F0090 3807FFFC9038007FE027297CA830>67 D<91387FE002903907FFF80690391FE01E0E9039 7F00039E01FCEB01FE4848EB007ED807F0143E5B4848141E001F150E485AA21606127F90 C8FC93C7FC5AA892B512E07E923800FE007F123FA27F121F120F6C7E7FEA01F86C6C1301 017FEB03BE90391FF00F1E903907FFFC0E9039007FE0022B297CA834>71 D77 D82 D87 D<3803FF80000F13E0381F01F8383F80FC147EA280EA1F00C7FCA4EB3FFF3801FE3FEA0F E0EA1F80EA3F005A12FE150CA3145F007F139F393F831FF8391FFE0FF03903F807C01E1B 7E9A21>97 D99 D101 D104 D<120FEA1F8013C0123FA2121F 1380EA0F00C7FCA8EAFFC0A2120FB3A5EAFFF8A20D2B7EAA13>I108 D<38FFC0FE9038C3FF80390FC60FC09038C807E0EBD00301 F013F013E0A213C0B139FFFC3FFFA2201B7E9A25>110 DI<38FFC1FE9038C7FF80 390FDE0FE09038F003F09038E001F801C013FC140015FEA2157FA8157E15FEA215FC1401 01E013F89038F007F09038DC0FE09038C7FF809038C1FC0001C0C7FCAAEAFFFCA220277E 9A25>I<38FF83E0EB8FF8380F8C7CEB98FE13B013A0A2EBE07CEBC000B1EAFFFEA2171B 7E9A1B>114 D<3803FC60381FFFE0EA3C03EA7801EA700000F01360A300FC1300B47EEA 7FFC13FF6C13C0000F13E0000313F0EA003FEB03F8EAC00014787EA27E14706C13E0EAFE 0338E7FF803881FE00151B7E9A1A>I<1360A413E0A21201A212031207121FB512E0A238 07E000AE1430A73803F0603801F8C03800FF80EB3F0014267FA51A>I<39FFC03FF0A200 0F1303B21407A2140F0007131B3803E0333901FFE3FF38007F83201B7E9A25>I<39FFF8 01FFA2390FC000707F000714606D13E0000314C07F0001EB0180A23900FC0300A26D5AEB 7E06EB7F0EEB3F0C148CEB1F98A2EB0FF0A36D5AA26D5AA26D5AA249C7FCA25BEA3006EA FC0E130C5B1338EA7870EA3FE0EA1F8020277F9A23>121 D E end %%EndProlog %%BeginSetup %%Feature: *Resolution 300dpi TeXDict begin %%PaperSize: a4 %%BeginPaperSize: a4 a4 %%EndPaperSize %%EndSetup %%Page: 35 1 35 0 bop 150 -42 a Fj(13)66 b(Mul)o(t)n(ip)o(ly-Wi)o(t)m(h-Car)o(ry)19 b(\(MW)n(C\))i(Gen)n(era)n(t)o(ors)150 49 y Fi(T)m(o)13 b(\014x)h(id)o(eas,)g(st)o(art)h(wit)n(h)f(an)f(example.)j(Cons)q(id)o (er)f(t)n(h)o(e)f(m)n(ul)o(t)o(iply-wit)n(h-carry)e(gen)o(era)o(t)o(or) 644 140 y Fh(x)668 146 y Fg(n)702 140 y Fi(=)g(6)p Fh(x)791 146 y Fg(n)p Ff(\000)p Fe(1)865 140 y Fi(+)d(carry)j(mo)q(d)f(10)p Fh(:)150 230 y Fi(Th)o(e)k(`m)n(ul)o(t)o(iplier')d(i)q(s)i Fh(a)f Fi(=)g(6)h(an)o(d)h(t)n(h)o(e)g(`bas)q(e')f(i)q(s)h Fh(b)d Fi(=)i(10.)20 b(T)m(o)14 b(implem)n(en)o(t)e(t)n(hi)q(s)i (recurs)q(ion,)i(w)o(e)150 280 y(n)o(ee)q(d)f(an)f(init)o(ial)e(carry)j Fh(c)f Fi(an)o(d)g(an)g(init)o(ial)f Fh(x)p Fi(.)18 b(If)c(t)n(h)o(e)h (init)o(ial)e(carry)h(i)q(s)g(le)q(ss)i(t)n(h)o(an)e Fh(a)p Fi(,)g(so)g(will)f(b)q(e)150 330 y(all)g(su)n(bs)q(equen)o(t)j (carr)q(ie)q(s)e(an)o(d)g(t)n(h)o(e)h(s)q(equence)g(will)e(b)q(e)h(str) q(ict)n(ly)g(p)q(er)q(io)q(dic.)212 380 y(Th)o(e)g(rule)h(for)e(formin) o(g)f(a)i(n)o(ew)g(pair)f(\()p Fh(c;)7 b(x)p Fi(\))13 b(i)q(s:)254 462 y(Th)o(e)h(n)o(ew)g Fh(x)g Fi(i)q(s)f Fh(ax)c Fi(+)g Fh(c)j Fi(mo)q(d)e Fh(b)p Fi(.)254 512 y(Th)o(e)j(n)o(ew)h Fh(c)f Fi(i)q(s)g Fd(b)p Fi(\()p Fh(ax)8 b Fi(+)g Fh(c)p Fi(\))p Fh(=b)p Fd(c)p Fi(,)13 b(\(t)n(h)o(e)h(n)n(u)o(m)n(b)q(er)f(of)g Fh(b)p Fi('s)g(dro)o(p)o(p)q (e)q(d)g(wh)o(en)h(formin)o(g)d Fh(x)p Fi(\).)212 595 y(St)o(art)o(in)o(g)j(wit)n(h,)f(say)m(,)g Fh(c)f Fi(=)g(4)p Fh(;)7 b(x)694 601 y Fe(0)723 595 y Fi(=)k(4,)j(t)n(h)o(e)g(s)q (equence)i Fh(x)1078 601 y Fe(0)1096 595 y Fh(;)7 b(x)1139 601 y Fe(1)1157 595 y Fh(;)g(x)1200 601 y Fe(2)1218 595 y Fh(;)g(x)1261 601 y Fe(3)1279 595 y Fh(;)g(:)g(:)g(:)k Fi(b)q(ecom)o(e)q(s)582 685 y(4)p Fh(;)c Fi(8)p Fh(;)g Fi(0)p Fh(;)g Fi(5)p Fh(;)g Fi(0)o Fh(;)g Fi(3)p Fh(;)f Fi(8)p Fh(;)g Fi(9)p Fh(;)g Fi(8)p Fh(;)h Fi(3)o Fh(;)g Fi(3)p Fh(;)f Fi(0)p Fh(;)g Fi(2)p Fh(;)g Fi(2)p Fh(;)h Fi(3)o Fh(;)g(:)f(:)h(:)150 776 y Fi(wit)n(h)14 b(p)q(er)q(io)q(d)f (58,)g(t)n(h)o(e)i(ord)o(er)g(of)e(b)h(in)g(t)n(h)o(e)g(group)g(of)f (re)q(s)q(id)o(ue)q(s)i(pr)q(im)o(e)e(t)o(o)h Fh(ab)9 b Fd(\000)g Fi(1)j(=)f(59.)212 825 y(If)i(t)n(h)o(e)i(pair)e(\()p Fh(c;)7 b(x)p Fi(\))13 b(i)q(s)f(wr)q(it)n(t)o(en)i(wit)n(h)g Fh(c)f Fi(a)g(left-sup)q(erscr)q(ipt)i(of)e(t)n(h)o(e)h(ou)o(t)o(pu)o (t)h(elem)o(en)o(t)d Fh(x)p Fi(,)h(full)150 875 y(d)o(et)o(ails)h(of)f (t)n(h)o(e)i(s)q(equence)h(t)o(ak)o(e)d(t)n(h)o(e)i(form)433 949 y Fe(4)451 966 y Fi(4)p Fh(;)484 949 y Fe(2)509 966 y Fi(8)p Fh(;)542 949 y Fe(5)567 966 y Fi(0)p Fh(;)600 949 y Fe(0)625 966 y Fi(5)p Fh(;)658 949 y Fe(3)683 966 y Fi(0)p Fh(;)716 949 y Fe(0)741 966 y Fi(3)p Fh(;)774 949 y Fe(1)798 966 y Fi(8)p Fh(;)831 949 y Fe(4)856 966 y Fi(9)p Fh(;)889 949 y Fe(5)914 966 y Fi(8)p Fh(;)947 949 y Fe(5)972 966 y Fi(3)p Fh(;)1005 949 y Fe(2)1030 966 y Fi(3)p Fh(;)1063 949 y Fe(2)1088 966 y Fi(0)p Fh(;)1121 949 y Fe(0)1145 966 y Fi(2)p Fh(;)1178 949 y Fe(1)1203 966 y Fi(2)p Fh(;)1236 949 y Fe(1)1261 966 y Fi(3)p Fh(;)7 b(:)g(:)g(:)e(;)150 1056 y Fi(f)q(rom)15 b(whic)o(h)i(t)n(h)o(e)g(form) o(a)o(t)o(ion)e(rule)i(i)q(s)g(eas)q(ily)f(d)o(e)q(d)o(u)o(ce)q(d:)26 b(t)n(h)o(e)18 b(n)o(ew)1228 1041 y Fg(c)1245 1056 y Fh(x)f Fi(i)q(s)f(just)i(t)n(h)o(e)g(t)o(w)o(o-digit)150 1106 y(n)n(u)o(m)n(b)q(er)f(form)o(e)q(d)g(b)o(y)g Fh(ax)11 b Fi(+)h Fh(c)18 b Fi(of)f(t)n(h)o(e)h(previous)g(pair.)28 b(Th)o(a)o(t,)18 b(in)f(t)o(ur)q(n,)h(sugge)q(st)o(s)i(wh)o(y)d(t)n(hi) q(s)150 1156 y(i)q(s)i(su)o(c)o(h)h(a)f(promi)q(s)q(in)o(g)e(m)o(et)n (h)o(o)q(d)i(for)g(compu)o(t)o(er)h(implem)n(en)o(t)o(a)o(t)o(i)o(on|w) o(e)c(n)o(ee)q(d)21 b(only)e(let)g(t)n(h)o(e)150 1206 y(sup)q(erscr)q(ipt)c Fh(c)e Fi(b)q(e)h(t)n(h)o(e)g(t)o(o)o(p)g(h)o (alf)e(of)h(a)h(w)o(ord)f Fh(w)h Fi(an)o(d)g(t)n(h)o(e)g(elem)o(en)o(t) f Fh(x)g Fi(t)n(h)o(e)h(b)q(ot)n(t)o(om)f(h)o(alf.)k(Th)o(en,)150 1256 y(for)d(example,)d(in)j(C)f(wit)n(h)h Fh(b)e Fi(=)f(2)666 1241 y Fe(16)701 1256 y Fi(,)j(t)n(h)o(e)g(n)o(ew)g(w)o(ord)g Fh(w)h Fi(com)o(e)q(s)e(f)q(rom)f(t)n(h)o(e)j(st)o(a)o(t)o(em)o(en)o(t) 318 1346 y Fh(w)d Fi(=)g Fh(a)d Fd(\003)g Fi(\()p Fh(w)q Fi(&65535\))g(+)g(\()p Fh(w)k(>>)f Fi(16\);)20 b(follo)o(w)o(e)q(d)12 b(b)o(y)i(ret)o(ur)q(n\()p Fh(w)q Fi(&65535\);)212 1437 y(F)m(or)h(pract)o(ical)g(us)q(e,)h(t)n(h)o(e)g(ou)o(t)o(pu)o(t)g(of)f (a)g(MW)o(C)g(gen)o(era)o(t)o(or)h(i)q(s)f(a)g(s)q(equence)j(of)c Fh(x)p Fi('s.)22 b(Bu)o(t)16 b(in)150 1487 y(ord)o(er)c(t)o(o)f(d)o (e\014n)o(e)h(an)o(d)f(e)q(st)o(a)o(bli)q(sh)f(t)n(h)o(e)i(p)q(er)q(io) q(d,)e(it)h(i)q(s)f(n)o(ece)q(ssary)j(t)o(o)f(pro)o(vid)o(e)f(a)f(sp)q (eci\014c)i(stru)o(ct)o(ure)150 1536 y(of)h(elem)o(en)o(t)o(s)h Fh(z)i Fi(in)e(a)f(s)q(et)i Fh(S)r Fi(,)f(an)o(d)g(a)f(fu)o(nct)o(ion)h Fh(f)19 b Fi(wh)o(os)q(e)14 b(it)o(era)o(t)o(e)q(s,)150 1586 y Fh(z)r(;)7 b(f)t Fi(\()p Fh(z)r Fi(\))p Fh(;)g(f)t Fi(\()p Fh(f)t Fi(\()p Fh(z)r Fi(\)\)\(=)25 b Fh(f)516 1571 y Fe(2)535 1586 y Fi(\()p Fh(z)r Fi(\)\))p Fh(;)7 b(f)647 1571 y Fe(3)667 1586 y Fi(\()p Fh(z)r Fi(\))p Fh(;)g(:)g(:)g(:)18 b Fi(form)g(e)q(it)n(h)o(er)k(a)d(p)q(er)q(io)q (dic)h(s)q(equence)i(or)e(a)g Fh(r)q(ho)g Fi(s)q(e-)150 1636 y(quence:)f(a)14 b(t)o(ail)f(leadin)o(g)g(t)o(o)i(a)e(lo)q(o)o(p)g (\(cycle\).)212 1686 y(F)m(or)k(t)n(h)o(e)i(MW)o(C)e(s)q(equence,)j(t)n (h)o(e)e(\014nit)o(e)g(s)q(et)g Fh(S)i Fi(i)q(s)d(t)n(h)o(e)i(s)q(et)f (of)f(ord)o(ere)q(d)i(pairs)f(\()p Fh(c;)7 b(x)p Fi(\),)17 b(t)n(h)o(e)150 1736 y(curren)o(t)k(`carry')f(an)o(d)f(t)n(h)o(e)i (curren)o(t)g Fh(x)f Fi(\(ou)o(t)o(pu)o(t\))h(v)n(alue.)35 b(As)20 b(a)o(b)q(o)o(v)o(e,)h(it)e(i)q(s)h(con)o(v)o(enien)o(t)g(t)o (o)150 1785 y(d)o(e)q(s)q(ign)o(a)o(t)o(e)14 b(t)n(h)o(a)o(t)f(ord)o (ere)q(d)i(pair)e(in)g(t)n(h)o(e)h(form)863 1770 y Fg(c)880 1785 y Fh(x)p Fi(.)j(Th)o(en)d(t)n(h)o(e)g(\014nit)o(e)f(s)q(et)h Fh(S)i Fi(an)o(d)d(t)n(h)o(e)h(fu)o(nct)o(ion)f Fh(f)150 1835 y Fi(o)o(p)q(era)o(t)o(in)o(g)g(on)h(it)g(are)265 1926 y Fh(S)g Fi(=)e Fd(f)369 1909 y Fg(c)386 1926 y Fh(x)f Fi(:)25 b(0)11 b Fd(\024)h Fh(c)g(<)f(a;)c Fi(0)k Fd(\024)h Fh(x)f(<)h(b)p Fd(g)p Fh(;)89 b(f)t Fi(\()983 1909 y Fg(c)1001 1926 y Fh(x)p Fi(\))11 b(=)1084 1909 y Ff(b)p Fe(\()p Fg(ax)p Fe(+)p Fg(c)p Fe(\))p Fg(=b)p Ff(c)1256 1926 y Fi(\()p Fh(ax)e Fi(+)h Fh(c)h Fi(mo)q(d)g Fh(b)p Fi(\))p Fh(:)212 2016 y Fi(F)m(or)j(pract)o(ical)f(ap)o(plica)o (t)o(ions)f(of)i(t)n(h)o(e)g(MW)o(C)g(gen)o(era)o(t)o(ors,)h Fh(x)1157 2022 y Fg(n)1191 2016 y Fi(=)d Fh(ax)1281 2022 y Fg(n)p Ff(\000)p Fe(1)1355 2016 y Fi(+)24 b(carry)i(mo)q(d)10 b Fh(b)p Fi(,)150 2066 y(w)o(e)16 b(will)d(alw)o(ays)i(c)o(h)o(o)q(os)q (e)h Fh(a)f Fi(an)o(d)g Fh(b)g Fi(so)h(t)n(h)o(a)o(t)f Fh(m)g Fi(=)f Fh(ab)c Fd(\000)g Fi(1)15 b(i)q(s)g(a)g(pr)q(im)o(e.)21 b(Th)o(a)o(t)15 b(i)q(s)g(b)q(eca)n(us)q(e)h(t)n(h)o(e)150 2116 y(p)q(er)q(io)q(d)e(of)f(t)n(h)o(e)i(MW)o(C)e(s)q(equence)j(d)o (ep)q(en)o(ds)f(on)f(t)n(h)o(e)h(init)o(ial)c(s)q(ee)q(d)16 b(pair)1273 2101 y Fg(c)1290 2116 y Fh(x)p Fi(,)d(an)o(d)h(i)q(s)f(alw) o(ays)g(t)n(h)o(e)150 2166 y(ord)o(er)19 b(of)f Fh(b)g Fi(in)g(t)n(h)o(e)h(group)f(of)f(re)q(s)q(id)o(ue)q(s)j(rela)o(t)o(iv)o (ely)d(pr)q(im)o(e)g(t)o(o)h(som)o(e)f Fh(j)r Fi(,)j(wit)n(h)e Fh(j)i Fi(on)o(e)f(of)e(t)n(h)o(e)150 2216 y(divi)q(sors)12 b(of)g Fh(m)p Fi(.)18 b(If)13 b Fh(m)g Fi(i)q(s)f(pr)q(im)o(e,)f(t)n(h) o(ere)j(are)f(only)f(t)o(w)o(o)h(divi)q(sors,)e Fh(m)j Fi(an)o(d)e(1,)g(t)n(h)o(e)i(la)o(t)n(t)o(er)f(leadin)o(g)150 2265 y(t)o(o)j(\(t)o(w)o(o\))g(tr)q(ivial)e(s)q(equence)q(s)19 b(of)c(p)q(er)q(io)q(d)h(1)f(t)n(h)o(a)o(t)h(are)h(eas)q(ily)e(a)o(v)o (oid)o(e)q(d.)24 b(F)m(or)15 b(an)o(y)h(non-tr)q(ivial)150 2315 y(s)q(ee)q(ds)255 2300 y Fg(c)272 2315 y Fh(x)10 b Fi(t)n(h)o(e)h(s)q(equence)i(i)q(s)d(str)q(ict)n(ly)g(p)q(er)q(io)q (dic)g(wit)n(h)h(p)q(er)q(io)q(d)f(t)n(h)o(e)h(sm)o(alle)q(st)e(p)q(os) q(it)o(iv)o(e)h Fh(i)h Fi(for)f(whic)o(h)150 2365 y Fh(b)168 2350 y Fg(i)193 2365 y Fi(=)i(1)f(mo)q(d)f Fh(m)p Fi(.)212 2415 y(T)m(o)15 b(illustra)o(t)o(e)f(t)n(h)o(e)i(complexit)o(ie)q(s)d (of)i(t)n(h)o(e)h(gen)o(eral)f(cas)q(e)h(for)f(comp)q(os)q(it)o(e)f Fh(m)p Fi(,)h(cons)q(id)o(er)h(t)n(h)o(e)150 2465 y(MW)o(C)d(gen)o(era) o(t)o(or)j Fh(x)480 2471 y Fg(n)513 2465 y Fi(=)c(5)p Fh(x)602 2471 y Fg(n)p Ff(\000)p Fe(1)676 2465 y Fi(+)23 b(carry)j(mo)q(d)10 b(13.)212 2515 y(Here)j Fh(m)f Fi(=)g Fh(ab)t Fd(\000)t Fi(1)e(=)i(64,)e(wit)n(h)h(divi)q(sors)g(1,2,4,8,16,) o(32,)o(64.)j(Th)o(e)d(ord)o(ers)i(of)d(13)h(for)f(mo)q(d)o(uli)150 2564 y(1,2,4,8,16,)o(64)j(are)j(1,1,2,4,8,16)o(.)22 b(Th)o(ere)17 b(will)e(b)q(e)h(s)q(ee)q(ds)1072 2549 y Fg(c)1089 2564 y Fh(x)g Fi(whic)o(h)g(pro)q(d)o(u)o(ce)h(s)q(equence)q(s)h(for)150 2614 y(eac)o(h)d(of)e(t)n(h)o(e)i(p)q(er)q(io)q(ds)f(1,2,4,8,16)o(.)212 2664 y(Thi)q(s)i(can)h(b)q(e)g(s)q(een)g(b)o(y)f(examinin)o(g)f(t)n(h)o (e)i(direct)o(e)q(d)h(graph)e(of)g(t)n(h)o(e)i(fu)o(nct)o(ion)e Fh(f)21 b Fi(o)o(v)o(er)c Fh(S)i Fi(=)150 2714 y Fd(f)171 2699 y Fg(c)188 2714 y Fh(x)g Fi(:)38 b(0)20 b Fd(\024)g Fh(c)g(<)g Fi(5)p Fh(;)7 b Fi(0)19 b Fd(\024)h Fh(x)g(<)g Fi(13)p Fd(g)p Fi(.)32 b(Th)o(a)o(t)19 b(graph)f(h)o(as)h(13)g(comp)q (on)o(en)o(t)o(s,)g(eac)o(h)h(a)f(cycle.)150 2764 y(Dep)q(en)o(din)o(g) 14 b(on)f(t)n(h)o(e)i(init)o(ial)d(s)q(ee)q(d)693 2749 y Fg(c)710 2764 y Fh(x)p Fi(,)h(s)q(equence)q(s)j(of)e(p)q(er)q(io)q(d) f(1,2,4,8,)e(or)j(16)f(are)i(a)o(t)n(t)o(ain)o(e)q(d.)879 2888 y(35)p eop %%Page: 36 2 36 1 bop 152 -67 a Fe(0)171 -52 y Fi(1)t Fd(!)243 -67 y Fe(0)261 -52 y Fi(5)5 b Fd(!)333 -67 y Fe(0)352 -52 y Fi(12)t Fd(!)444 -67 y Fe(4)463 -52 y Fi(9)t Fd(!)534 -67 y Fe(3)553 -52 y Fi(10)t Fd(!)646 -67 y Fe(4)664 -52 y Fi(1)g Fd(!)746 -67 y Fe(0)765 -52 y Fi(9)15 b Fd(!)847 -67 y Fe(3)866 -52 y Fi(6)162 -2 y Fd(")673 b(#)152 33 y Fe(1)171 48 y Fi(0)t Fd( )243 33 y Fe(3)261 48 y Fi(2)5 b Fd( )343 33 y Fe(1)362 48 y Fi(8)15 b Fd( )444 33 y Fe(1)463 48 y Fi(4)t Fd( )545 33 y Fe(2)563 48 y Fi(3)g Fd( )646 33 y Fe(4)664 48 y Fi(5)5 b Fd( )736 33 y Fe(2)755 48 y Fi(11)t Fd( )847 33 y Fe(2)866 48 y Fi(7)995 -67 y Fe(0)1013 -52 y Fi(3)g Fd(!)1085 -67 y Fe(1)1104 -52 y Fi(2)t Fd(!)1175 -67 y Fe(0)1194 -52 y Fi(11)t Fd(!)1297 -67 y Fe(4)1316 -52 y Fi(3)14 b Fd(!)1408 -67 y Fe(1)1427 -52 y Fi(6)h Fd(!)1509 -67 y Fe(2)1527 -52 y Fi(5)5 b Fd(!)1599 -67 y Fe(2)1618 -52 y Fi(1)t Fd(!)1689 -67 y Fe(0)1708 -52 y Fi(7)1004 -2 y Fd(")674 b(#)995 33 y Fe(3)1013 48 y Fi(0)5 b Fd( )1085 33 y Fe(4)1104 48 y Fi(7)t Fd( )1175 33 y Fe(4)1194 48 y Fi(11)t Fd( )1287 33 y Fe(3)1305 48 y Fi(12)t Fd( )1398 33 y Fe(1)1416 48 y Fi(10)g Fd( )1509 33 y Fe(3)1527 48 y Fi(4)g Fd( )1599 33 y Fe(3)1618 48 y Fi(8)t Fd( )1689 33 y Fe(2)1708 48 y Fi(9)152 152 y Fe(0)171 167 y Fi(2)t Fd(!)243 152 y Fe(0)261 167 y Fi(10)g Fd(!)354 152 y Fe(3)372 167 y Fi(11)g Fd(!)465 152 y Fe(4)484 167 y Fi(6)162 217 y Fd(")291 b(#)152 252 y Fe(2)171 267 y Fi(0)t Fd( )253 252 y Fe(1)272 267 y Fi(5)15 b Fd( )364 252 y Fe(3)383 267 y Fi(3)g Fd( )465 252 y Fe(2)484 267 y Fi(8)542 152 y Fe(0)560 167 y Fi(6)5 b Fd(!)632 152 y Fe(2)651 167 y Fi(4)t Fd(!)723 152 y Fe(1)741 167 y Fi(9)g Fd(!)823 152 y Fe(3)842 167 y Fi(7)551 217 y Fd(")261 b(#)542 252 y Fe(1)560 267 y Fi(1)5 b Fd( )632 252 y Fe(4)651 267 y Fi(2)t Fd( )723 252 y Fe(4)741 267 y Fi(1)g Fd( )813 252 y Fe(2)831 267 y Fi(12)911 152 y Fe(0)929 167 y Fi(4)g Fd(!)1011 152 y Fe(1)1030 167 y Fi(7)920 217 y Fd(")80 b(#)911 252 y Fe(4)929 267 y Fi(0)5 b Fd( )1001 252 y Fe(2)1020 267 y Fi(10)1099 152 y Fe(0)1117 167 y Fi(12)t Fd(!)1210 152 y Fe(4)1228 167 y Fi(8)1118 217 y Fd(")80 b(#)1109 252 y Fe(2)1128 267 y Fi(2)14 b Fd( )1210 252 y Fe(3)1228 267 y Fi(5)1288 146 y Fe(0)1306 161 y Fi(8)1287 211 y Fd("#)1288 257 y Fe(3)1306 273 y Fi(1)1366 146 y Fe(1)1384 161 y Fi(11)1375 211 y Fd("#)1376 257 y Fe(4)1395 273 y Fi(4)1449 152 y Fe(1)1468 167 y Fi(3)p 1491 143 34 2 v 1523 159 2 17 v 1491 160 34 2 v 1492 159 a Fc(\033)1641 152 y Fe(2)1660 167 y Fi(6)p 1683 143 V 1715 159 2 17 v 1683 160 34 2 v 1684 159 a Fc(\033)1540 202 y Fe(0)1559 217 y Fi(0)p 1582 193 V 1614 209 2 17 v 1582 210 34 2 v 1583 209 a Fc(\033)1449 252 y Fe(3)1468 267 y Fi(9)p 1491 243 V 1523 258 2 17 v 1491 260 34 2 v 1492 259 a Fc(\033)1631 252 y Fe(4)1649 267 y Fi(12)p 1693 243 V 1725 258 2 17 v 1693 260 34 2 v 1694 259 a Fc(\033)277 389 y Fi(Direct)o(e)q(d)h(graph)f(of)f(t)n(h)o(e)h(MW)o(C)g(gen)o(era)o (t)o(or)h Fh(x)1008 395 y Fg(n)1042 389 y Fi(=)d(5)p Fh(x)1131 395 y Fg(n)p Ff(\000)p Fe(1)1204 389 y Fi(+)24 b(carry)i(mo)q(d)10 b(13)p Fh(:)212 486 y Fi(T)m(o)k(illustra)o(t)o(e)h (t)n(h)o(e)h(t)n(h)o(eory)f(b)q(e)o(hin)o(d)g(t)n(h)o(e)h(MW)o(C)e(gen) o(era)o(t)o(or)i(wh)o(en)g Fh(m)d Fi(=)h Fh(ab)c Fd(\000)g Fi(1)15 b(i)q(s)f(pr)q(im)o(e,)150 536 y(cons)q(id)o(er)j(t)n(h)o(e)f (\014rst)h(example)d(a)o(b)q(o)o(v)o(e,)i Fh(x)791 542 y Fg(n)828 536 y Fi(=)f(6)p Fh(x)920 542 y Fg(n)p Ff(\000)p Fe(1)995 536 y Fi(+)c Fh(c)h Fi(mo)q(d)e(10,)15 b(wit)n(h)h Fh(m)f Fi(=)g Fh(ab)10 b Fd(\000)h Fi(1)k(=)g(59.)150 585 y(Lo)q(ok)c(a)o(t)h(t)n(h)o(e)g(\014rst)h(few)f(of)f(t)n(h)o(e)i (bas)q(e-10)e(expans)q(ions)h(of)f Fh(k)q(=)p Fi(59,)g(wit)n(h)h Fh(k)g Fi(t)n(h)o(e)h(su)o(cce)q(ss)q(iv)o(e)h(p)q(o)o(w)o(ers)150 635 y(of)f(10)e(mo)q(d)f(59)h(:)h(10)p Fh(;)7 b Fi(41)p Fh(;)g Fi(56)p Fh(;)f Fi(29)p Fh(;)g(:)h(:)f(:)182 758 y Fi(10)p Fh(=)p Fi(59)k(=)i Fh(:)p Fi(169491525423)o(7288)o(1355)o (9322)o(0338)o(9830)o(5084)o(74576)o(2711)o(8644)o(0677)o(9661)o(0169) 182 833 y(41)p Fh(=)p Fi(59)e(=)i Fh(:)p Fi(694915254237)o(2881)o(3559) o(3220)o(3389)o(8305)o(0847)o(45762)o(7118)o(6440)o(6779)o(6610)o(1694) 182 908 y(56)p Fh(=)p Fi(59)e(=)i Fh(:)p Fi(949152542372)o(8813)o(5593) o(2203)o(3898)o(3050)o(8474)o(57627)o(1186)o(4406)o(7796)o(6101)o(6949) 212 983 y(Th)o(e)q(s)q(e)18 b(expans)q(ions)e(all)f(h)o(a)o(v)o(e)h (cycle)q(s)h(of)f(len)o(gt)n(h)h(58,)f(t)n(h)o(e)h(ord)o(er)g(of)f(10)f (for)h(mo)q(d)o(ulus)f(59.)150 1032 y(Su)o(cce)q(ss)q(iv)o(e)k(expans)q (ions)d(h)o(a)o(v)o(e)h(t)n(h)o(e)g(cycle)h(of)e(digit)o(s)h (left-shift)o(e)q(d-1,)f(s)q(ince)h(eac)o(h)h(of)e(t)n(h)o(em)h(i)q(s) 150 1082 y(just)d(t)n(h)o(e)h(f)q(ract)o(ion)o(al)d(part)i(of)f(10)h(t) o(im)o(e)q(s)f(t)n(h)o(e)h(previous)g(on)o(e.)19 b(Bu)o(t)14 b(ev)o(en)h(more:)150 1132 y(Our)g(m)n(ul)o(t)o(iply-wit)n(h-carry)d(s) q(equence)17 b(4)p Fh(;)7 b Fi(8)p Fh(;)g Fi(0)p Fh(;)g Fi(5)p Fh(;)f Fi(0)p Fh(;)h Fi(3)o Fh(;)g Fi(8)p Fh(;)f Fi(9)p Fh(;)g Fi(8)p Fh(;)g Fi(3)p Fh(;)h Fi(3)o Fh(;)g Fi(0)p Fh(;)f Fi(2)p Fh(;)g Fi(2)p Fh(;)g Fi(3)p Fh(;)h(:)f(:)h(:)k Fi(ap)o(p)q(ears)k(as)f(a)150 1182 y(s)q(equence)20 b(of)d(digit)o(s)g (in)g(eac)o(h)i(of)e(t)n(h)o(os)q(e)i(expans)q(ions,)f Fb(written)f(b)n(ackwar)n(ds!)p Fi(.)29 b(Th)o(e)18 b(digit)o(s)f(in) 150 1232 y(t)n(h)o(e)q(s)q(e)g(n)n(u)o(m)n(b)q(ers)f(of)f(t)n(h)o(e)h (form)d Fh(k)q(=)p Fi(59)i(sa)o(t)o(i)q(sfy)g(t)n(h)o(e)h(sam)o(e)e (recurs)q(ion)j(as)e(t)n(h)o(a)o(t)h(of)f(t)n(h)o(e)h(m)n(ul)o(t)o (iply-)150 1281 y(wit)n(h-carry)e(s)q(equence,)i(bu)o(t)e(bac)o(kw)o (ards.)212 1331 y(On)i(t)n(h)o(e)g(ot)n(h)o(er)g(h)o(an)o(d,)f(s)q (ince)h Fh(a)e Fi(=)g(6)h(i)q(s)g(t)n(h)o(e)h(in)o(v)o(ers)q(e)g(of)f Fh(b)f Fi(=)g(10)h(mo)q(d)o(ulo)e Fh(ab)d Fd(\000)g Fi(1)k(=)g(59,)h (if)150 1381 y(w)o(e)h(expan)o(d)g Fh(k)q(=)p Fi(59)f(t)o(o)h(t)n(h)o (e)h(bas)q(e)f(10)g(for)f Fh(k)h Fi(=)g(6)p Fh(;)7 b Fi(6)947 1366 y Fe(2)964 1381 y Fh(;)g Fi(6)1004 1366 y Fe(3)1034 1381 y Fi(mo)q(d)j(59)15 b(t)n(h)o(en)i(eac)o(h)g(cycle)f (i)q(s)g(rot)o(a)o(t)o(e)q(d)150 1431 y(left-1:)182 1522 y(6)p Fh(=)p Fi(59)10 b(=)i Fh(:)p Fi(1016949152542)o(3728)o(8135)o (5932)o(2033)o(8983)o(0508)o(47457)o(6271)o(1864)o(4067)o(7966)o(1016) 171 1614 y(36)p Fh(=)p Fi(59)f(=)g Fh(:)p Fi(61016949152542)o(37288)o (1355)o(9322)o(0338)o(9830)o(5084)o(7457)o(6271)o(1864)o(4067)o(7966)o (101)171 1688 y(39)p Fh(=)p Fi(59)g(=)g Fh(:)p Fi(66101694915254)o (23728)o(8135)o(5932)o(2033)o(8983)o(0508)o(4745)o(7627)o(1186)o(4406)o (7796)o(610)150 1763 y(an)o(d)i(once)g(again)f(t)n(h)o(e)h(MW)o(C)g (digit)o(s)f(ap)o(p)q(ear)h(in)g(rev)o(ers)q(e)h(ord)o(er,)g(an)o(d)f (t)n(h)o(e)g(digit)o(s,)g(li)q(st)o(e)q(d)f(bac)o(k-)150 1813 y(w)o(ards,)i(sa)o(t)o(i)q(sfy)f(t)n(h)o(e)h(m)n(ul)o(t)o (iply-wit)n(h-carry)e(recurs)q(ion.)212 1863 y(Thi)q(s)i(giv)o(e)q(s)f (an)h(id)o(ea)h(of)e(t)n(h)o(e)h(gen)o(eral)h(m)n(ul)o(t)o(iply-wi)o(t) n(h-carry)d(s)q(equence:)p 279 1910 1243 2 v 279 2368 2 459 v 431 1972 a Fh(x)455 1978 y Fg(n)489 1972 y Fi(=)g Fh(ax)579 1978 y Fg(n)p Ff(\000)p Fe(1)653 1972 y Fi(+)d(carry)j(mo)q (d)e Fh(b;)90 b(m)12 b Fi(=)f Fh(ab)e Fd(\000)h Fi(1)j(pr)q(im)o(e)g Fh(:)293 2047 y Fi(Th)o(e)20 b Fh(x)p Fi('s)f(m)o(ay)f(b)q(e)h(cons)q (id)o(ere)q(d)i(`digit)o(s')d(for)i(t)n(h)o(e)g(bas)q(e)g Fh(b)p Fi(.)34 b(F)m(or)19 b(an)o(y)g(ini-)293 2097 y(t)o(ial)14 b(`s)q(ee)q(d')484 2081 y Fg(c)501 2097 y Fh(x)h Fi(except)672 2081 y Fe(0)690 2097 y Fi(0)g(or)779 2081 y Fe(\()p Fg(a)p Ff(\000)p Fe(1\))867 2097 y Fi(\()p Fh(b)10 b Fd(\000)h Fi(1\),)k(t)n(h)o(e)h(s)q(equence)h Fh(x)1286 2103 y Fe(0)1305 2097 y Fh(;)7 b(x)1348 2103 y Fe(1)1365 2097 y Fh(;)g(x)1408 2103 y Fe(2)1426 2097 y Fh(;)g(:)g(:)g(:)293 2146 y Fi(i)q(s)28 b(str)q(ict)n(ly)g(p)q(er)q(io)q(dic)g(wit)n(h)g(p)q (er)q(io)q(d)g(t)n(h)o(e)h(ord)o(er)h(of)d Fh(b)h Fi(in)g(t)n(h)o(e)h (group)293 2196 y Fd(f)p Fi(1)p Fh(;)7 b Fi(2)p Fh(;)g(:)g(:)g(:)t(;)g (m)f Fd(\000)i Fi(1)j(mo)q(d)f Fh(m)p Fd(g)p Fi(.)18 b(F)m(urt)n(h)o(ermore,)13 b(t)n(h)o(e)g Fh(x)p Fi('s,)f(wr)q(it)n(t)o (en)h(bac)o(kw)o(ards,)293 2246 y(are)g(t)n(h)o(e)h(cycle)f(of)g(digit) o(s)f(in)h(t)n(h)o(e)g(bas)q(e-)p Fh(b)g Fi(expans)q(ion)f(of)h Fh(k)q(=m)g Fi(for)f(som)o(e)g Fh(k)h Fi(in)293 2296 y Fd(f)p Fh(b;)7 b(b)369 2281 y Fe(2)387 2296 y Fh(;)g(b)424 2281 y Fe(3)441 2296 y Fh(;)g(:)g(:)g(:)j Fi(mo)q(d)g Fh(m)p Fd(g)p Fi(.)18 b(Th)o(e)13 b(t)o(w)o(o)g(s)q(equence)q(s)i(of)e (p)q(er)q(io)q(d)f(1)h(ar)q(i)q(s)q(e)g(f)q(rom)e(0)1475 2281 y Fe(0)293 2346 y Fi(an)o(d)373 2331 y Fe(\()p Fg(a)p Ff(\000)p Fe(1\))461 2346 y Fi(\()p Fh(b)e Fd(\000)h Fi(1\),)j(whic)o(h)h(are)g(\014xe)q(d)g(p)q(oin)o(t)o(s)h(for)e(t)n(h)o (e)i(fu)o(nct)o(ion)f Fh(f)t Fi(.)p 1519 2368 V 279 2370 1243 2 v 212 2439 a(T)m(o)f(pro)o(v)o(e)h(t)n(hi)q(s:)k(Wit)n(h)c Fh(m)e Fi(=)g Fh(ab)d Fd(\000)g Fi(1,)k(if)g(t)n(h)o(e)i(bas)q(e-)p Fh(b)f Fi(expans)q(ion)f(of)g Fh(k)q(=m)h Fi(i)q(s)637 2523 y Fh(k)p 630 2542 37 2 v 630 2580 a(m)683 2552 y Fi(=)e Fh(:d)761 2558 y Fe(1)779 2552 y Fh(d)801 2558 y Fe(2)819 2552 y Fh(d)841 2558 y Fe(3)859 2552 y Fh(d)881 2558 y Fe(4)900 2552 y Fh(d)922 2558 y Fe(5)940 2552 y Fh(d)962 2558 y Fe(6)980 2552 y Fh(d)1002 2558 y Fe(7)1020 2552 y Fh(d)1042 2558 y Fe(8)1061 2552 y Fh(d)1083 2558 y Fe(9)1108 2552 y Fh(:)7 b(:)g(:)e(;)150 2654 y Fi(t)n(h)o(en)15 b(m)n(ul)o(t)o(iplyin)o(g)c(b)q(ot)n(h)j(s)q(id)o(e)q(s)h(b)o(y)e Fh(m)f Fi(=)g Fh(ab)d Fd(\000)h Fi(1)j(an)o(d)h(collect)o(in)o(g)f(t)o (erms)h(yields)386 2746 y Fh(k)q(:d)443 2752 y Fe(1)461 2746 y Fh(d)483 2752 y Fe(2)501 2746 y Fh(d)523 2752 y Fe(3)542 2746 y Fh(d)564 2752 y Fe(4)582 2746 y Fh(d)604 2752 y Fe(5)622 2746 y Fh(d)644 2752 y Fe(6)662 2746 y Fh(d)684 2752 y Fe(7)702 2746 y Fh(d)724 2752 y Fe(8)743 2746 y Fh(d)765 2752 y Fe(9)790 2746 y Fh(:)7 b(:)g(:)j Fi(=)i Fh(a)d Fd(\002)g Fh(d)988 2752 y Fe(1)1006 2746 y Fh(:d)1040 2752 y Fe(2)1058 2746 y Fh(d)1080 2752 y Fe(3)1098 2746 y Fh(d)1120 2752 y Fe(4)1139 2746 y Fh(d)1161 2752 y Fe(5)1179 2746 y Fh(d)1201 2752 y Fe(6)1219 2746 y Fh(d)1241 2752 y Fe(7)1259 2746 y Fh(d)1281 2752 y Fe(8)1300 2746 y Fh(d)1322 2752 y Fe(9)1347 2746 y Fh(:)e(:)g(:)e(:)879 2888 y Fi(36)p eop %%Page: 37 3 37 2 bop 212 -45 a Fi(If)14 b(w)o(e)g(wr)q(it)o(e)g(t)n(hi)q(s)f(as)h (in)g(gramm)o(a)o(r)e(sc)o(h)o(o)q(ol)h(m)n(ul)o(t)o(iplica)o(t)o(i)o (on,)665 37 y Fh(d)687 43 y Fe(1)710 37 y Fh(:)5 b(d)749 43 y Fe(2)772 37 y Fh(d)794 43 y Fe(3)816 37 y Fh(d)838 43 y Fe(4)861 37 y Fh(d)883 43 y Fe(5)906 37 y Fh(d)928 43 y Fe(6)951 37 y Fh(d)973 43 y Fe(7)996 37 y Fh(d)1018 43 y Fe(8)1041 37 y Fh(d)1063 43 y Fe(9)1086 37 y Fh(:)i(:)g(:)1004 87 y Fd(\002)e Fh(a)p 663 103 474 2 v 683 138 a(k)g(:)g(d)749 144 y Fe(1)772 138 y Fh(d)794 144 y Fe(2)816 138 y Fh(d)838 144 y Fe(3)861 138 y Fh(d)883 144 y Fe(4)906 138 y Fh(d)928 144 y Fe(5)951 138 y Fh(d)973 144 y Fe(6)996 138 y Fh(d)1018 144 y Fe(7)1041 138 y Fh(d)1063 144 y Fe(8)1086 138 y Fh(:)i(:)g(:)150 221 y Fi(eac)o(h)12 b Fh(d)263 227 y Fg(n)296 221 y Fi(i)q(s)e(s)q(een)i(t)o(o)f(b)q(e)g(t)n(h)o(e)h(pro)q (d)o(u)o(ct)f Fh(ad)783 227 y Fg(n)p Fe(+1)858 221 y Fi(plus)g(t)n(h)o(e)g(carry:)17 b(t)n(h)o(e)12 b(n)n(u)o(m)n(b)q(er)f (of)f(exce)q(ss)j Fh(b)p Fi('s)e(f)q(rom)150 271 y(t)n(h)o(e)16 b(previous)g(m)n(ul)o(t)o(iplica)o(t)o(ion,)c(all)j(re)q(d)o(u)o(ce)q (d)i(mo)q(d)o(ulo)d Fh(b)p Fi(|exact)n(ly)h(t)n(h)o(e)h(m)n(ul)o(t)o (iply-wit)n(h-carry)150 321 y(rule,)e(bu)o(t)g(in)g(rev)o(ers)q(e)i (ord)o(er.)212 370 y(Th)o(e)c(direct)o(e)q(d)i(graph)d(of)h(t)n(h)o(e)g (fu)o(nct)o(ion)g Fh(z)i Fd(!)d Fh(f)t Fi(\()p Fh(z)r Fi(\))i(h)o(as)f Fh(n)f Fi(=)h Fh(ab)g Fi(no)q(d)o(e)q(s.)18 b(It)12 b(h)o(as)g(t)o(w)o(o)g(tr)q(ivial)150 420 y(comp)q(on)o(en)o(t) o(s,)i Fh(z)f Fi(=)g Fh(f)t Fi(\()p Fh(z)r Fi(\))i(for)f Fh(z)f Fi(=)686 405 y Fe(0)710 420 y Fi(0)h(an)o(d)g Fh(z)g Fi(=)890 405 y Fe(\()p Fg(a)p Ff(\000)p Fe(1\))983 420 y Fi(\()p Fh(b)c Fd(\000)f Fi(1\).)19 b(If)13 b(t)n(h)o(e)i(ord)o (er)h(of)d Fh(b)h Fi(for)g(mo)q(d)o(ulus)150 470 y Fh(m)e Fi(i)q(s)f Fh(k)q Fi(,)g(t)n(h)o(en)h(t)n(h)o(e)g(direct)o(e)q(d)h (graph)e(of)g Fh(f)16 b Fi(on)11 b Fh(S)j Fi(h)o(as)d(\()p Fh(ab)t Fd(\000)t Fi(2\))p Fh(=k)i Fi(comp)q(on)o(en)o(t)o(s,)e(eac)o (h)h(cons)q(i)q(st)o(in)o(g)150 520 y(of)g(a)h(lo)q(o)o(p)f(of)g Fh(k)i Fi(elem)o(en)o(t)o(s,)e(t)o(oget)n(h)o(er)j(wit)n(h)e(t)n(h)o(e) g(t)o(w)o(o)g(tr)q(ivial)e(lo)q(o)o(ps)h(of)h(s)q(in)o(gle)f(elem)o(en) o(t)o(s)1532 505 y Fe(0)1551 520 y Fi(0)g(an)o(d)150 555 y Fe(\()p Fg(a)p Ff(\000)p Fe(1\))239 570 y Fi(\()p Fh(b)d Fd(\000)g Fi(1\).)212 619 y(Not)o(e)21 b(also)f(a)g(cert)o(ain)h (stru)o(ct)o(ure)h(in)e(t)n(h)o(e)i(direct)o(e)q(d)f(graph)g(of)e Fh(f)t Fi(:)32 b(If)20 b Fh(f)t Fi(\()p Fh(z)r Fi(\))k(=)f Fh(w)e Fi(t)n(h)o(en)150 669 y Fh(f)t Fi(\()p Fh(z)211 654 y Ff(0)224 669 y Fi(\))11 b(=)h Fh(w)326 654 y Ff(0)338 669 y Fi(,)h(wh)o(ere)i(t)n(h)o(e)g(pr)q(im)o(e)d(m)o(eans)794 654 y Fg(c)811 669 y Fh(x)g Fd(!)889 654 y Fe(\()p Fg(a)p Ff(\000)p Fe(1)p Ff(\000)p Fg(c)p Fe(\))1029 669 y Fi(\()p Fh(b)d Fd(\000)h Fi(1)f Fd(\000)g Fh(x)p Fi(\).)212 719 y(In)21 b(pract)o(ical)f(ap)o(plica)o(t)o(ions,)g(w)o(e)h(c)o(h)o(o)q (os)q(e)h Fh(b)e Fi(f)q(rom)f(2)1066 704 y Fe(8)1084 719 y Fh(;)7 b Fi(2)1124 704 y Fe(16)1159 719 y Fh(;)g Fi(2)1199 704 y Fe(32)1254 719 y Fi(\(or)21 b(ev)o(en)g(2)1450 704 y Fe(64)1506 719 y Fi(in)f(som)o(e)150 769 y(adv)n(ance)q(d)d (CPU's\).)26 b(W)m(e)16 b(t)n(h)o(en)h(c)o(h)o(o)q(os)q(e)g Fh(a)g Fi(so)f(t)n(h)o(a)o(t)h Fh(m)f Fi(=)g Fh(ab)10 b Fd(\000)i Fi(1)k(i)q(s)f(a)i(safepr)q(im)o(e|b)q(ot)n(h)e Fh(m)150 819 y Fi(an)o(d)f(\()p Fh(m)c Fd(\000)g Fi(1\))p Fh(=)p Fi(2)j(are)i(pr)q(im)o(e.)i(Th)o(en)e(t)n(h)o(e)g(ord)o(er)g(of) f Fh(b)d Fi(mo)q(d)g Fh(m)j Fi(will)f(b)q(e)h(\()p Fh(m)c Fd(\000)g Fi(1\))p Fh(=)p Fi(2.)18 b(It)d(cannot)150 868 y(b)q(e)f(\(m-1\),)e(t)n(h)o(a)o(t)i(i)q(s,)f(a)g(pr)q(imit)o(iv)o (e)e(ro)q(ot,)j(b)q(eca)n(us)q(e)h Fh(b)f Fi(i)q(s)f(a)h(square.)212 918 y(Cem)o(al)g(Ko\030)-18 b(c)16 b(h)o(as)g(sh)o(o)o(wn)f(t)n(h)o(a)o (t)h(t)n(h)o(e)g(m)n(ul)o(t)o(iply-wit)n(h-carry)d(m)o(et)n(h)o(o)q(d)i (can)h(b)q(e)g(ext)o(en)o(d)o(e)q(d)h(t)o(o)150 968 y(lin)o(ear)d(com)n (bin)o(a)o(t)o(ions)417 1053 y Fh(x)441 1059 y Fg(n)475 1053 y Fi(=)e Fh(a)541 1059 y Fe(1)559 1053 y Fh(x)583 1059 y Fg(n)p Ff(\000)p Fe(1)657 1053 y Fi(+)e Fh(a)721 1059 y Fe(2)739 1053 y Fh(x)763 1059 y Fg(n)p Ff(\000)p Fe(2)837 1053 y Fi(+)g Fd(\001)d(\001)g(\001)g Fi(+)j Fh(a)1000 1059 y Fg(r)1018 1053 y Fh(x)1042 1059 y Fg(n)p Ff(\000)p Fg(r)1116 1053 y Fi(+)g(carry)i(mo)q(d)e Fh(b:)150 1189 y Fj(14)66 b(Recurs)q(ion)21 b(Wit)m(h)g(Carry)g(\(R)n(CW\))g(Gen) n(era)n(t)o(ors)150 1280 y Fi(W)m(e)12 b(no)o(w)f(d)o(e)q(scr)q(ib)q(e) j(an)e(ext)o(ens)q(ion)g(of)f(add-wit)n(h-carry)i(an)o(d)e(m)n(ul)o(t)o (iply-wit)n(h-carry)f(gen)o(era)o(t)o(ors)150 1329 y(t)o(o)16 b(recurs)q(ion-wit)n(h-carry)m(,)g(in)g(whic)o(h)f(eac)o(h)i(n)o(ew)f Fh(x)f Fi(i)q(s)g(a)g(lin)o(ear)h(com)n(bin)o(a)o(t)o(ion)d(of)i Fh(r)i Fi(previous)150 1379 y Fh(x)p Fi('s,)c(plus)g(carry)m(,)h(mo)q (d)o(ulo)e(t)n(h)o(e)i(bas)q(e)g Fh(b)p Fi(.)k(Th)o(e)c(ext)o(ens)q (ion)g(i)q(s)g(d)o(ue)g(t)o(o)g(Cem)o(al)e(Ko\030)-18 b(c.)212 1429 y(Th)o(e)14 b(gen)o(era)o(t)o(or)i(i)q(s)386 1514 y Fh(x)p Fi(\()p Fh(n)p Fi(\))11 b(=)h Fh(a)544 1520 y Fe(1)563 1514 y Fh(x)587 1520 y Fg(n)p Ff(\000)p Fe(1)661 1514 y Fi(+)d Fh(a)724 1520 y Fe(2)743 1514 y Fh(x)767 1520 y Fg(n)p Ff(\000)p Fe(2)841 1514 y Fi(+)g Fd(\001)e(\001)g(\001)h Fi(+)h Fh(a)1003 1520 y Fg(r)1022 1514 y Fh(x)1046 1520 y Fg(n)p Ff(\000)p Fg(r)1119 1514 y Fi(+)24 b(carry)i(mo)q(d)10 b Fh(b;)150 1598 y Fi(wh)o(ere,)18 b(as)f(b)q(efore,)h(t)n(h)o(e)f(carry)h(i)q(s)e(t)n(h)o(e)i(n)n(u)o(m)n (b)q(er)f(of)f Fh(b)p Fi('s)h(dro)o(p)o(p)q(e)q(d)g(in)f(re)q(d)o(u)o (cin)o(g)i(t)n(h)o(e)g(previous)150 1648 y(lin)o(ear)h(com)n(bin)o(a)o (t)o(ion)d(mo)q(d)o(ulo)h(t)n(h)o(e)j(bas)q(e)f Fh(b)p Fi(.)33 b(Th)o(e)20 b(la)o(t)n(t)o(er)f(i)q(s)g(calle)q(d)g(t)n(h)o(e)g (bas)q(e)h(b)q(eca)n(us)q(e,)h(as)150 1698 y(b)q(efore,)13 b(pro)q(of)f(an)o(d)g(stru)o(ct)o(ure)j(d)o(ep)q(en)o(d)e(on)f(viewin)o (g)h(t)n(h)o(e)g Fh(x)p Fi('s)f(as)h(digit)o(s)f(in)g(bas)q(e-)p Fh(b)h Fi(expans)q(ions)150 1748 y(of)g(a)h(ra)o(t)o(ion)o(al)e Fh(k)q(=m)p Fi(.)212 1797 y(Here)19 b Fh(m)d Fi(=)h Fh(a)437 1803 y Fg(r)455 1797 y Fh(b)473 1782 y Fg(r)503 1797 y Fi(+)11 b Fh(a)568 1803 y Fg(r)q Ff(\000)p Fe(1)629 1797 y Fh(b)647 1782 y Fg(r)q Ff(\000)p Fe(1)719 1797 y Fi(+)h Fd(\001)7 b(\001)g(\001)i Fi(+)j Fh(a)888 1803 y Fe(1)906 1797 y Fh(b)f Fd(\000)h Fi(1,)17 b(an)o(d)f(w)o(e)h(assu)o (m)o(e)g(t)n(h)o(e)h Fh(a)p Fi('s)e(are)i(c)o(h)o(os)q(en)150 1847 y(so)h(t)n(h)o(a)o(t)g Fh(m)g Fi(i)q(s)f(pr)q(im)o(e.)32 b(Th)o(en)19 b Fh(b)f Fi(h)o(as)h(an)g(in)o(v)o(ers)q(e)h(in)e(t)n(h)o (e)h(group)g(of)f(re)q(s)q(id)o(ue)q(s)i(of)f Fh(m)p Fi(:)28 b(it)19 b(i)q(s)150 1897 y Fh(b)168 1882 y Ff(\000)p Fe(1)224 1897 y Fi(=)12 b Fh(a)290 1903 y Fg(r)308 1897 y Fh(b)326 1882 y Fg(r)q Ff(\000)p Fe(1)396 1897 y Fi(+)d Fh(a)459 1903 y Fg(r)q Ff(\000)p Fe(2)520 1897 y Fh(b)538 1882 y Fg(r)q Ff(\000)p Fe(2)608 1897 y Fi(+)h Fd(\001)d(\001)g(\001)g Fi(+)j Fh(a)771 1903 y Fe(1)789 1897 y Fi(,)k(s)q(ince)g Fh(bb)953 1882 y Ff(\000)p Fe(1)1009 1897 y Fi(=)e Fh(m)d Fi(+)h(1.)212 1947 y(Th)o(e)15 b(p)q(er)q(io)q(d)f(of)g(t)n(h)o(e)h (gen)o(era)o(t)o(or)h(i)q(s)e(t)n(h)o(e)h(ord)o(er)h(of)e Fh(b)g Fi(for)g(mo)q(d)o(ulus)f Fh(m)p Fi(,)h(except)i(for)e(t)n(h)o(e) h(t)o(w)o(o)150 1997 y(tr)q(ivial)d(s)q(ee)q(d)j(s)q(et)o(s)h(0)p Fh(;)7 b Fi(0)p Fh(;)g(:)g(:)g(:)t(;)g Fi(0)13 b(an)o(d)g Fh(a)736 2003 y Fe(1)764 1997 y Fi(+)c Fd(\001)e(\001)g(\001)h Fi(+)i Fh(a)927 2003 y Fg(r)954 1997 y Fd(\000)g Fi(1)p Fh(;)d(b)h Fd(\000)h Fi(1)p Fh(;)e(b)i Fd(\000)g Fi(1)p Fh(;)e(:)g(:)g(:)e(;)i(b)h Fd(\000)i Fi(1.)212 2047 y(Th)o(e)16 b(s)q(et)f(of)g(p)q(oss)q(ible)g(`carr)q(ie)q(s')g(for)g(R)-5 b(W)o(C)15 b(s)q(equence)q(s)i(i)q(s)e(0)e Fd(\024)h Fh(c)g(<)f(a)1321 2053 y Fe(1)1350 2047 y Fi(+)d Fd(\001)d(\001)g(\001) i Fi(+)h Fh(a)1515 2053 y Fg(r)1548 2047 y Fi(an)o(d)15 b(a)150 2096 y(s)q(ee)q(d)g(s)q(et)g(i)q(s)e(on)o(e)h(su)o(c)o(h)g Fh(c)g Fi(wit)n(h)g Fh(x)666 2102 y Fe(1)684 2096 y Fh(;)7 b(:)g(:)g(:)e(;)i(x)801 2102 y Fg(r)819 2096 y Fi(,)13 b(t)n(h)o(e)i Fh(x)p Fi('s)e(in)h(0)d Fd(\024)h Fh(x)f(<)h(b)p Fi(.)212 2146 y(Not)o(e)18 b(h)o(o)o(w)o(ev)o(er,)g(t)n(h)o(a)o(t)g(u)o (nlik)o(e)f(MW)o(C)g(s)q(equence)q(s,)j(whic)o(h)d(are)h(str)q(ict)n (ly)f(p)q(er)q(io)q(dic)g(for)g(all)150 2196 y(s)q(ee)q(ds)259 2181 y Fg(c)276 2196 y Fh(x)d Fi(wit)n(h)g(0)f Fd(\024)f Fh(c)h(<)f(a;)7 b Fi(0)12 b Fd(\024)h Fh(x)f(<)g(b)p Fi(,)i(t)n(h)o(e)h(recurs)q(ion-wit)n(h-carry)h(s)q(equence)q(s)h(m)o (ay)c(not)h(b)q(e)150 2246 y(str)q(ict)n(ly)g(p)q(er)q(io)q(dic.)j(Th)o (ey)d(will)e(b)q(e)h(ul)o(t)o(im)o(a)o(t)o(ely)f(p)q(er)q(io)q(dic,)g (of)h(cours)q(e.)19 b(Non)o(et)n(h)o(ele)q(ss,)d(t)n(h)o(ey)e(can)150 2296 y(eas)q(ily)e(b)q(e)h(m)o(ad)o(e)f(str)q(ict)n(ly)h(p)q(er)q(io)q (dic)f(b)o(y)h(it)o(era)o(t)o(in)o(g)f(t)n(h)o(e)i(recurs)q(ion)f Fh(r)h Fi(t)o(im)o(e)q(s)d(on)i(a)f(pro)o(p)q(os)q(e)q(d)i(s)q(et)150 2345 y(of)f(s)q(ee)q(ds)j(t)o(o)e(get)g(on)o(e)g(t)n(h)o(a)o(t)g (ensure)q(s)i(str)q(ict,)e(ra)o(t)n(h)o(er)h(t)n(h)o(an)f(just)g(ul)o (t)o(im)o(a)o(t)o(e,)e(p)q(er)q(io)q(dicit)o(y)m(.)212 2395 y(T)m(o)j(a)o(v)o(oid)g(not)o(a)o(t)o(ion)o(al)e(di\016cul)o(t)o (ie)q(s)j(an)o(d)g(y)o(et)g(giv)o(e)f(t)n(h)o(e)h(e)q(ss)q(en)o(t)o (ial)g(id)o(eas)h(of)e(a)h(pro)q(of,)f(con-)150 2445 y(s)q(id)o(er,)f(say)m(,)399 2530 y Fh(x)p Fi(\()p Fh(n)p Fi(\))e(=)f(3)p Fh(x)580 2536 y Fg(n)p Ff(\000)p Fe(1)654 2530 y Fi(+)f(2)p Fh(x)741 2536 y Fg(n)p Ff(\000)p Fe(2)814 2530 y Fi(+)g(4)p Fh(x)901 2536 y Fg(n)p Ff(\000)p Fe(3)975 2530 y Fi(+)23 b(carry)j(mo)q(d)10 b Fh(b)k Fi(\(=)e(10\))p Fh(:)150 2614 y Fi(Here,)18 b Fh(m)f Fi(=)g(4)p Fh(b)404 2599 y Fe(3)433 2614 y Fi(+)11 b(2)p Fh(b)515 2599 y Fe(2)545 2614 y Fi(+)g(3)p Fh(b)g Fd(\000)g Fi(1)16 b(=)g(4229)g(an)o (d)h Fh(b)967 2599 y Ff(\000)p Fe(1)1022 2614 y Fi(mo)q(d)11 b Fh(m)17 b Fi(i)q(s)f(4)p Fh(b)1251 2599 y Fe(2)1280 2614 y Fi(+)11 b(2)p Fh(b)g Fi(+)h(3)k(=)g(423.)26 b(\(It)150 2664 y(h)o(ap)o(p)q(ens)14 b(t)n(h)o(a)o(t)g(10)f(i)q(s)h(a)f(pr)q (imit)o(iv)o(e)e(ro)q(ot)j(of)f(4229,)g(bu)o(t)h(t)n(h)o(a)o(t)g(i)q(s) g(of)f(no)g(imp)q(ort.)k(As)d(lon)o(g)g(as)g Fh(m)150 2714 y Fi(i)q(s)i(a)g(pr)q(im)o(e,)e(p)q(er)q(io)q(dic)i(s)q(ect)o (ions)h(of)f(t)n(h)o(e)h(R)o(CW)e(s)q(equence)j(will)d(h)o(a)o(v)o(e)h (len)o(gt)n(h)h(t)n(h)o(e)g(ord)o(er)h(of)d Fh(b)150 2764 y Fi(for)f(mo)q(d)o(ulus)e Fh(m)p Fi(.\))879 2888 y(37)p eop %%Page: 38 4 38 3 bop 212 -45 a Fi(As)15 b(b)q(efore,)e(if)g Fh(k)i Fi(i)q(s)e(on)o(e)h(of)g Fh(b;)7 b(b)704 -60 y Fe(2)721 -45 y Fh(;)g(b)758 -60 y Fe(3)776 -45 y Fh(;)g(:)g(:)g(:)j Fi(mo)q(d)g Fh(m)k Fi(w)o(e)g(m)o(ay)e(expre)q(ss)k Fh(k)q(=m)e Fi(t)o(o)h(t)n(h)o(e)f(bas)q(e)h Fh(b)p Fi(:)618 30 y Fh(k)q(=m)c Fi(=)h Fh(:d)787 36 y Fe(1)805 30 y Fh(d)827 36 y Fe(2)845 30 y Fh(d)867 36 y Fe(3)885 30 y Fh(d)907 36 y Fe(4)926 30 y Fh(d)948 36 y Fe(5)966 30 y Fh(d)988 36 y Fe(6)1006 30 y Fh(d)1028 36 y Fe(7)1046 30 y Fh(d)1068 36 y Fe(8)1087 30 y Fh(d)1109 36 y Fe(9)1134 30 y Fh(:)7 b(:)g(:)150 105 y Fi(An)o(d)14 b(t)n(h)o(a)o(t)g(expans)q(ion)f(i)q(s)h (p)q(er)q(io)q(dic)f(wit)n(h)h(cycle)q(s)h(of)e(len)o(gt)n(h)i(t)n(h)o (e)g(p)q(er)q(io)q(d)e(of)h Fh(b)f Fi(mo)q(d)g Fh(m)p Fi(.)18 b(Let)d Fh(F)150 155 y Fi(b)q(e)f(t)n(h)o(a)o(t)g(bas)q(e-)p Fh(b)g Fi(expans)q(ion.)j(Mul)o(t)o(iply)c(b)q(ot)n(h)h(s)q(id)o(e)q(s) h(b)o(y)e Fh(m)i Fi(an)o(d)e(arran)o(ge)i(t)o(o)f(get)640 229 y Fh(k)c Fi(+)g Fh(F)17 b Fi(=)11 b(4)p Fh(b)840 212 y Fe(4)859 229 y Fh(F)j Fi(+)c(2)p Fh(b)981 212 y Fe(2)999 229 y Fh(F)15 b Fi(+)9 b(3)p Fh(bF)q(:)150 304 y Fi(No)o(w,)15 b(inst)o(ead)h(of)e(doin)o(g)h(m)n(ul)o(t)o(iplica)o(t) o(io)o(n,)d(us)q(e)k(su)o(cce)q(ss)q(iv)o(e)i(addit)o(ion)c(of)g(four)h (3-shift)o(e)q(d)g Fh(F)6 b Fi('s,)150 354 y(t)o(w)o(o)13 b(2-shift)o(e)q(d)h Fh(F)6 b Fi('s)13 b(an)o(d)h(t)n(hree)h(1-shift)o (e)q(d)f Fh(F)6 b Fi('s:)704 418 y Fh(d)726 424 y Fe(1)744 418 y Fh(d)766 424 y Fe(2)784 418 y Fh(d)806 424 y Fe(3)825 418 y Fh(:d)859 424 y Fe(4)876 418 y Fh(d)898 424 y Fe(5)917 418 y Fh(d)939 424 y Fe(6)957 418 y Fh(d)979 424 y Fe(7)997 418 y Fh(d)1019 424 y Fe(8)1037 418 y Fh(d)1059 424 y Fe(9)1085 418 y Fh(:)h(:)g(:)667 468 y Fi(+)e Fh(d)726 474 y Fe(1)744 468 y Fh(d)766 474 y Fe(2)784 468 y Fh(d)806 474 y Fe(3)825 468 y Fh(:d)859 474 y Fe(4)876 468 y Fh(d)898 474 y Fe(5)917 468 y Fh(d)939 474 y Fe(6)957 468 y Fh(d)979 474 y Fe(7)997 468 y Fh(d)1019 474 y Fe(8)1037 468 y Fh(d)1059 474 y Fe(9)1085 468 y Fh(:)i(:)g(:)667 518 y Fi(+)e Fh(d)726 524 y Fe(1)744 518 y Fh(d)766 524 y Fe(2)784 518 y Fh(d)806 524 y Fe(3)825 518 y Fh(:d)859 524 y Fe(4)876 518 y Fh(d)898 524 y Fe(5)917 518 y Fh(d)939 524 y Fe(6)957 518 y Fh(d)979 524 y Fe(7)997 518 y Fh(d)1019 524 y Fe(8)1037 518 y Fh(d)1059 524 y Fe(9)1085 518 y Fh(:)i(:)g(:)667 567 y Fi(+)e Fh(d)726 573 y Fe(1)744 567 y Fh(d)766 573 y Fe(2)784 567 y Fh(d)806 573 y Fe(3)825 567 y Fh(:d)859 573 y Fe(4)876 567 y Fh(d)898 573 y Fe(5)917 567 y Fh(d)939 573 y Fe(6)957 567 y Fh(d)979 573 y Fe(7)997 567 y Fh(d)1019 573 y Fe(8)1037 567 y Fh(d)1059 573 y Fe(9)1085 567 y Fh(:)i(:)g(:)667 617 y Fi(+)45 b Fh(d)766 623 y Fe(1)784 617 y Fh(d)806 623 y Fe(2)825 617 y Fh(:d)859 623 y Fe(3)876 617 y Fh(d)898 623 y Fe(4)917 617 y Fh(d)939 623 y Fe(5)957 617 y Fh(d)979 623 y Fe(6)997 617 y Fh(d)1019 623 y Fe(7)1037 617 y Fh(d)1059 623 y Fe(8)1085 617 y Fh(:)7 b(:)g(:)667 667 y Fi(+)45 b Fh(d)766 673 y Fe(1)784 667 y Fh(d)806 673 y Fe(2)825 667 y Fh(:d)859 673 y Fe(3)876 667 y Fh(d)898 673 y Fe(4)917 667 y Fh(d)939 673 y Fe(5)957 667 y Fh(d)979 673 y Fe(6)997 667 y Fh(d)1019 673 y Fe(7)1037 667 y Fh(d)1059 673 y Fe(8)1085 667 y Fh(:)7 b(:)g(:)667 717 y Fi(+)85 b Fh(d)806 723 y Fe(1)825 717 y Fh(:d)859 723 y Fe(2)876 717 y Fh(d)898 723 y Fe(3)917 717 y Fh(d)939 723 y Fe(4)957 717 y Fh(d)979 723 y Fe(5)997 717 y Fh(d)1019 723 y Fe(6)1037 717 y Fh(d)1059 723 y Fe(7)1085 717 y Fh(:)7 b(:)g(:)667 767 y Fi(+)85 b Fh(d)806 773 y Fe(1)825 767 y Fh(:d)859 773 y Fe(2)876 767 y Fh(d)898 773 y Fe(3)917 767 y Fh(d)939 773 y Fe(4)957 767 y Fh(d)979 773 y Fe(5)997 767 y Fh(d)1019 773 y Fe(6)1037 767 y Fh(d)1059 773 y Fe(7)1085 767 y Fh(:)7 b(:)g(:)667 817 y Fi(+)85 b Fh(d)806 823 y Fe(1)825 817 y Fh(:d)859 823 y Fe(2)876 817 y Fh(d)898 823 y Fe(3)917 817 y Fh(d)939 823 y Fe(4)957 817 y Fh(d)979 823 y Fe(5)997 817 y Fh(d)1019 823 y Fe(6)1037 817 y Fh(d)1059 823 y Fe(7)1085 817 y Fh(:)7 b(:)g(:)p 665 833 471 2 v 667 868 a Fi(=)103 b Fh(k)q(:d)859 874 y Fe(1)876 868 y Fh(d)898 874 y Fe(2)917 868 y Fh(d)939 874 y Fe(3)957 868 y Fh(d)979 874 y Fe(4)997 868 y Fh(d)1019 874 y Fe(5)1037 868 y Fh(d)1059 874 y Fe(6)1085 868 y Fh(:)7 b(:)g(:)212 941 y Fi(As)18 b(in)f(gramm)o(ar)d(sc)o(h)o(o)q(ol)j (addit)o(ion,)g(su)o(mmin)o(g)e(colu)o(mns)h(f)q(rom)f(r)q(igh)o(t)i(t) o(o)h(left,)f(eac)o(h)i Fh(d)1628 947 y Fg(n)150 991 y Fi(com)o(e)q(s)13 b(f)q(rom)501 1041 y Fh(d)523 1047 y Fg(n)557 1041 y Fi(=)e(3)p Fh(d)643 1047 y Fg(n)p Fe(+3)717 1041 y Fi(+)e(2)p Fh(d)801 1047 y Fg(n)p Fe(+2)874 1041 y Fi(+)h(4)p Fh(d)959 1047 y Fg(n)p Fe(+3)1032 1041 y Fi(+)g(carry)i(mo)q(d)e Fh(b;)150 1105 y Fi(wit)n(h)k(`carry')g(t)n(h)o (e)g(n)n(u)o(m)n(b)q(er)g(of)g(exce)q(ss)i Fh(b)p Fi('s)e(in)g(formin)o (g)e(t)n(h)o(e)j(previous)f Fh(d)p Fi(|exact)n(ly)f(t)n(h)o(e)i(rule)g (of)150 1155 y(t)n(h)o(e)g(recurs)q(ion-wit)n(h-carry)g(gen)o(era)o(t)o (or,)f(bu)o(t)h(wit)n(h)f(in)o(dice)q(s)g(rev)o(ers)q(e)q(d.)150 1269 y Fa(14.1)56 b(Su)o(mm)o(ary)150 1345 y Fi(In)14 b(gen)o(eral,)g(wh)o(en)g Fh(m)e Fi(=)g Fh(ab)d Fd(\000)g Fi(1)14 b(i)q(s)f(pr)q(im)o(e,)f(t)n(h)o(e)i(p)q(er)q(io)q(d)g(of)f(t)n (h)o(e)i(R)-5 b(W)o(C)13 b(gen)o(era)o(t)o(or)386 1420 y Fh(x)p Fi(\()p Fh(n)p Fi(\))e(=)h Fh(a)544 1426 y Fe(1)563 1420 y Fh(x)587 1426 y Fg(n)p Ff(\000)p Fe(1)661 1420 y Fi(+)d Fh(a)724 1426 y Fe(2)743 1420 y Fh(x)767 1426 y Fg(n)p Ff(\000)p Fe(2)841 1420 y Fi(+)g Fd(\001)e(\001)g(\001)h Fi(+)h Fh(a)1003 1426 y Fg(r)1022 1420 y Fh(x)1046 1426 y Fg(n)p Ff(\000)p Fg(r)1119 1420 y Fi(+)24 b(carry)i(mo)q(d)10 b Fh(b;)150 1495 y Fi(i)q(s)15 b(t)n(h)o(e)h(ord)o(er)h(of)e Fh(b)h Fi(for)f(mo)q(d)o(ulus)f Fh(m)h Fi(=)f Fh(a)809 1501 y Fg(r)828 1495 y Fh(b)846 1480 y Fg(r)874 1495 y Fi(+)d Fh(a)939 1501 y Fg(r)q Ff(\000)p Fe(1)1000 1495 y Fh(b)1018 1480 y Fg(r)q Ff(\000)p Fe(1)1089 1495 y Fi(+)g Fd(\001)c(\001)g(\001)h Fi(+)j Fh(a)1255 1501 y Fe(1)1274 1495 y Fh(b)f Fd(\000)h Fi(1.)22 b(It)16 b(require)q(s)h(an)150 1545 y(init)o(ial)12 b(carry)i(an)o(d)g(s)q(ee)q (ds)h Fh(x)588 1551 y Fe(1)607 1545 y Fh(;)7 b(x)650 1551 y Fe(2)667 1545 y Fh(;)g(:)g(:)g(:)e(;)i(x)784 1551 y Fg(r)802 1545 y Fi(.)212 1594 y(F)m(orm)o(ally)m(,)i(t)n(h)o(e)j(p)q (er)q(io)q(d)g(i)q(s)f(t)n(h)o(a)o(t)h(of)f(t)n(h)o(e)i(s)q(equence)g Fh(z)r(;)7 b(f)t Fi(\()p Fh(z)r Fi(\))p Fh(;)g(f)1153 1579 y Fe(2)1173 1594 y Fi(\()p Fh(z)r Fi(\))p Fh(;)g(:)g(:)g(:)n Fi(,)12 b(wh)o(ere)h Fh(z)h Fi(i)q(s)d(a)h(v)o(ect)o(or)150 1644 y(wit)n(h)i(elem)o(en)o(t)o(s)g(brac)o(k)o(et)o(e)q(d)h(b)o(y)e Fh(<>)p Fi(:)651 1719 y Fh(z)h Fi(=)p Fh(<)5 b(c;)i(z)809 1725 y Fg(r)827 1719 y Fh(;)g(z)865 1725 y Fg(r)q Ff(\000)p Fe(1)926 1719 y Fh(;)g(:)g(:)g(:)t(;)g(z)1037 1725 y Fe(2)1056 1719 y Fh(;)g(z)1094 1725 y Fe(1)1117 1719 y Fh(>)150 1794 y Fi(an)o(d)291 1869 y Fh(f)t Fi(\()p Fh(<)e(c;)i(z)424 1875 y Fg(r)443 1869 y Fh(;)g(z)481 1875 y Fg(r)q Ff(\000)p Fe(1)541 1869 y Fh(;)g(:)g(:)g(:)e(;)i(z)653 1875 y Fe(2)672 1869 y Fh(;)g(z)710 1875 y Fe(1)733 1869 y Fh(>)p Fi(\))12 b(=)p Fh(<)5 b Fd(b)p Fh(v)q(=b)p Fd(c)p Fh(;)i(v)13 b Fi(mo)q(d)e Fh(b;)c(z)1158 1875 y Fg(r)1175 1869 y Fh(;)g(z)1213 1875 y Fg(r)q Ff(\000)p Fe(1)1274 1869 y Fh(;)g(:)g(:)g(:)e(;)i(z)1386 1875 y Fe(3)1404 1869 y Fh(;)g(z)1442 1875 y Fe(2)1465 1869 y Fh(>;)150 1944 y Fi(wit)n(h)14 b Fh(v)f Fi(=)f Fh(a)342 1950 y Fe(1)360 1944 y Fh(z)379 1950 y Fe(1)407 1944 y Fi(+)e Fh(a)471 1950 y Fe(2)490 1944 y Fh(z)509 1950 y Fe(2)537 1944 y Fi(+)f Fd(\001)e(\001)g(\001)h Fi(+)h Fh(a)699 1950 y Fg(r)718 1944 y Fh(z)737 1950 y Fg(r)755 1944 y Fi(.)212 1993 y(Thi)q(s)19 b(s)q(equence)j(m)o(ay)c(b)q(e)i(a)f Fh(r)q(ho)h Fi(s)q(equence|t)n(h)o(a)o(t)h(i)q(s,)f(lik)o(e)f(t)n(h)o (e)i(let)n(t)o(er)g Fh(\032)p Fi(,)g(wit)n(h)f(a)f(t)o(ail)150 2043 y(leadin)o(g)e(t)o(o)f(a)h(lo)q(o)o(p.)25 b(F)m(or)16 b(t)n(h)o(e)h(recurs)q(ion-wit)n(h-carry)h(s)q(equence,)h(t)n(h)o(a)o (t)e(t)o(ail)e(i)q(s)h(n)o(ev)o(er)i(lon)o(ger)150 2093 y(t)n(h)o(an)13 b Fh(r)q Fi(,)f(so)h(for)f(a)g(giv)o(en)g(s)q(ee)q(d)i (s)q(et,)f(it)o(era)o(t)o(in)o(g)f Fh(r)i Fi(t)o(im)o(e)q(s)d(wit)n(h)i Fh(f)k Fi(will)11 b(pro)q(d)o(u)o(ce)j(a)e(n)o(ew)h(s)q(ee)q(d)h(t)n(h) o(a)o(t)150 2143 y(ensure)q(s)i(a)e(str)q(ict)n(ly)g(p)q(er)q(io)q(dic) f(s)q(equence.)212 2193 y(Th)o(ere)i(i)q(s)f(a)f(cert)o(ain)i(stru)o (ct)o(ure)h(in)d(t)n(h)o(e)i(direct)o(e)q(d)g(graph)f(of)f(t)n(h)o(e)i (fu)o(nct)o(ion)f Fh(z)g Fd(!)d Fh(f)t Fi(\()p Fh(z)r Fi(\))k(wit)n(h)150 2242 y(no)q(d)o(e)q(s)404 2292 y Fh(z)f Fi(=)p Fh(<)5 b(c;)i(x)567 2298 y Fg(r)585 2292 y Fh(;)g(x)628 2298 y Fg(r)q Ff(\000)p Fe(1)688 2292 y Fh(;)g(:)g(:)g(:)e(;)i(x)805 2298 y Fe(2)822 2292 y Fh(;)g(x)865 2298 y Fe(1)888 2292 y Fh(>;)90 b Fi(0)11 b Fd(\024)h Fh(c)f(<)h(s;)7 b Fi(0)k Fd(\024)h Fh(x)1309 2298 y Fg(i)1334 2292 y Fd(\024)g Fh(b)150 2357 y Fi(an)o(d)i Fh(s)f Fi(=)f Fh(a)328 2363 y Fe(1)356 2357 y Fi(+)e Fd(\001)d(\001)g(\001)h Fi(+)i Fh(a)520 2363 y Fg(r)538 2357 y Fi(.)19 b(Th)o(ere)d(are)e Fh(n)f Fi(=)f Fh(sb)877 2342 y Fg(r)910 2357 y Fi(no)q(d)o(e)q(s.)20 b(Th)o(ere)c(are)f(t)o(w)o (o)e(tr)q(ivial)g(comp)q(on)o(en)o(t)o(s)150 2407 y(of)g(t)n(h)o(e)i (graph:)j Fh(z)13 b Fi(=)f Fh(f)t Fi(\()p Fh(z)r Fi(\))j(for)f Fh(z)f Fi(=)p Fh(<)5 b Fi(0)p Fh(;)i Fi(0)p Fh(;)g(:)g(:)g(:)t(;)g Fi(0)e Fh(>)13 b Fi(an)o(d)h Fh(<)5 b(s)10 b Fd(\000)f Fi(1)p Fh(;)e(b)h Fd(\000)i Fi(1)p Fh(;)d(b)h Fd(\000)i Fi(1)p Fh(;)d(:)g(:)g(:)t(;)g(b)i Fd(\000)g Fi(1)c Fh(>)p Fi(.)212 2457 y(If)14 b Fh(g)h Fi(i)q(s)e(t)n(h)o(e)h(ord)o(er)h(of)e Fh(b)h Fi(for)f(mo)q(d)o(ulus)f Fh(m)p Fi(,)i(t)n(h)o(en)g(t)n(h)o(e)g (direct)o(e)q(d)h(graph)f(h)o(as)g(\()p Fh(n)9 b Fd(\000)g Fi(2\))p Fh(=g)14 b Fi(non-)150 2506 y(tr)q(ivial)8 b(comp)q(on)o(en)o (t)o(s)h(\(conn)o(ect)o(e)q(d)j(su)n(bgraphs\).)17 b(F)m(urt)n(h)o (ermore)10 b(if)f Fh(f)t Fi(\()p Fh(z)r Fi(\))j(=)g Fh(w)e Fi(t)n(h)o(en)h Fh(f)t Fi(\()p Fh(z)1512 2491 y Ff(0)1524 2506 y Fi(\))h(=)g Fh(w)1627 2491 y Ff(0)1638 2506 y Fi(,)150 2556 y(wh)o(ere)h Fh(z)288 2541 y Ff(0)312 2556 y Fi(i)q(s)f(a)g(sort)g(of)g(`complem)n(en)o(t')d(of)j Fh(z)r Fi(:)17 b(t)n(h)o(e)c Fh(c)f Fi(comp)q(on)o(en)o(t)f(of)h Fh(z)i Fi(i)q(s)d(replace)q(d)i(b)o(y)f Fh(s)6 b Fd(\000)g Fi(1)g Fd(\000)g Fh(c)150 2606 y Fi(an)o(d)14 b(eac)o(h)g Fh(x)347 2612 y Fg(i)375 2606 y Fi(i)q(s)f(replace)q(d)i(b)o(y)e Fh(b)c Fd(\000)h Fi(1)f Fd(\000)g Fh(x)803 2612 y Fg(i)817 2606 y Fi(.)212 2656 y(Eac)o(h)18 b(of)g(t)n(h)o(e)g(non-tr)q(ivial)e (comp)q(on)o(en)o(t)o(s)i(of)f(t)n(h)o(e)i(graph)e(can)h(b)q(e)g(pict)o (ure)q(d)h(as)f(a)f(sort)i(of)150 2706 y(cilia)o(t)o(e)q(d)13 b(cell,)h(t)n(h)o(e)g(n)n(u)o(cleus)h(a)f(lo)q(o)o(p)f(of)g(s)q(ize)i Fh(g)g Fi(an)o(d)f(v)n(ar)q(ious)e(cilia)h(of)h(len)o(gt)n(hs)h(1)e(t)o (o)h Fh(r)h Fi(d)o(an)o(glin)o(g)150 2756 y(f)q(rom)d(t)n(h)o(e)i(cell) g(b)q(o)q(dy)m(.)879 2888 y(38)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF