Geocities web hosting - 20 RANDOM NUMBERS 3.2.1.2 Theorem C. The number
Monday, December 24th, 200720 RANDOM NUMBERS 3.2.1.2 Theorem C. The number a is a primitive element module p if and only if i) pe = 2, a is odd; or pe = 4, amod = 3; orpe = 8, amod = 3,5,7; orp= 2, e 2 4, amod = 3,5; Or ii) p is odd, e = 1, a $ 0 (modulo p), and a(P- )lq $ :l (modulo p) for any prime divisor q of p -1; Or iii) p is odd, e > 1, a satisfies (ii), and ap- JZ 1 (modulo p2). 1 Conditions (ii) and (iii) of this theorem are readily tested on a computer for large values of p, by using the efficient methods for evaluating powers discussed in Section 4.6.3. Theorem C applies to powers of primes only; if we are given values a3 that are primitive modulo p;, it is possible to find a single value a such that a E a3 (modulo p;,~), for 1 5 j 5 t, using the Chinese remainder algorithm discussed in Se&on 4.3.2, and this number a will be a primitive element modulo pi . . . p, . Hence there is a reasonably efficient way to construct multipliers satisfying the condition of Theorem B, for any desired value of m, although the calculations can be somewhat lengthy in the general case. In the common case m = 2e, with e 2 4, the conditions above simplify to the single requirement that a G 3 or 5 (modulo
. In this case, one-fourth of all possible multipliers give the maximum period. The second most common case is when m = 10e. Using Lemmas P and Q, it is not difficult to obtain necessary and sufficient conditions for the achievement of the maximum period in the case of a decimal computer (cf. exercise 18): Theorem D. If m = 10e, e 2 5, c = 0, and X0 is not a multiple of 2 or 5, the period of the linear congruential sequence is 5 X 10ee2 if and only if a mod 200 equals one of the following 32 values: 3, 11, 13, 19, 21, 27, 29, 37, 53, 59, 61, 67, 69, 77, 83, 91, 109, 117, 123, 131, 133, 139, 141, 147, 163, 171, 173, 179, 181, 187, 189, 197. 1 (10) EXERCISES 1. [IO] What is the length of the period of the linear congruential sequence with X0 = 5772156648, a=3141592621, c= 2718281829,and m= 10000000000? 2. [IO] Are the following two conditions sufficient to guarantee the maximum length period, when m is a power of 2? (i) c is odd; (ii) a mod 4 = 1. 3. [IS] Suppose that m = 10e, where e 2 2, and suppose further that c is odd and not a multiple of 5. Show that the linear congruential sequence will have the maximum length period if and only if a mod 20 = 1.