Adult web hosting - 104 RANDOM NUMBERS 3.3.4 small that the numbers
104 RANDOM NUMBERS 3.3.4 small that the numbers can hardly be called random; the vt values are terribly low. Line 6 is the generator discussed above; line 7 is a similar example, having an abnormally low value of p3. Line 8 shows a nonrandom multiplier for the same modulus m; all of its partial quotients are 1, 2, or 3. Such multipliers have been suggested by I. Borosh and H. Niederreiter because the Dedekind sums are likely to be especially small and because they produce best results in the two- dimensional serial test (cf. Section 3.3.3 and exercise 30). The particular example in line 8 has only one 3 as a partial quotient; there is no multiplier congruent to 1 modulo 20 whose partial quotients with respect to lOlo are only l s and 2 s. The generator in line 9 shows another multiplier chosen with malice aforethought, following a suggestion by A. G. Waterman that guarantees a reasonably high value of ~2 (see exercise 11). Lines 10 through 21 of Table 1 show further examples with m = 235, beginning with some random multipliers. The generators in lines 12 and 13 are reminders of the good old days-they were once used extensively since 0. Taussky first suggested them in the early 1950s. Lines 14 through 18 show various multipliers of maximum potency having only four l s in their binary representation. The point of having few l s is to replace multiplication by a few additions, but only line 16 comes near to being passable. Since these multipliers satisfy (a - 5)3 mod 2 35 = 0, all five of them achieve ~4 at the same point (zl,zz,zs,z4) = (-125, 75, -15,l). Another curiosity is the high value of ~3 following a very low ~2 in line 18 (see exercise
. Lines 19 and 20 are respectively the Borosh-Niederreiter and Waterman multipliers for modulus 235; and line 21 was found by M. Lavaux and F. Janssens, in a computer search for spectrally good multipliers having a very high ~2. Lines 22 through 28 apply to System/370 and other machines with 32-bit words; in this case the comparatively small word size calls for comparatively greater care. Line 22 is, regrettably, the generator that has actually been used on such machines in most of the world s scientific computing centers for about a decade; its very name RANDU is enough to bring dismay into the eyes and stomachs of many computer scientists! The actual generator is defined by X0 odd, Xn+i = (65539X,) mod 231, (38) and exercise 20 indicates that 22g is the appropriate modulus for the spectral test. Since 9X, + 6Xn+z +Xn+z E 0 (modulo 231), the generator fails most three- dimensional criteria for randomness, and it should never have been used. Almost any multiplier -5 (modulo
would be better. (A curious fact about RAND& noticed by R. W. Gosper, is that v4 = v5 = vs = ur = vs = vg = &i6, hence ps is a spectacular 11.98.) Lines 23 and 24 are the Borosh-Niederreiter and Waterman multipliers for modulus 232, lines 26 and 29 were found by Lavaux and Janssens, and line 30 (whose excellent multiplier 6364136223846793005 is too big to fit in the column) is due to C. E. Haynes. Line 25 was nominated by George Marsaglia as a candidate for the best of all multipliers, after a computer search