10 RANDOM NUMBERS 3.2.1 (Web hosting india) The special case c
Monday, December 17th, 200710 RANDOM NUMBERS 3.2.1 The special case c = 0 deserves explicit mention, since the number gener- ation process is a little faster when c = 0 than it is when c # 0. We shall see later that the restriction c = 0 cuts down the length of the period of the sequence, but it is still possible to make the period reasonably long. Lehmer s original generation method had c = 0, although he mentioned c # 0 as a possibility; the idea of taking c # 0 to obtain longer periods is due to Thomson [Comp. J. 1 (1958), 83, 861 and, independently, to Rotenberg [JACM 7 (1960), 75-77. The terms multiplicative congruential method and mixed congruential method are used by many authors to denote linear congruential sequences with c = 0 and c # 0, respectively. The letters m, a, c, and X0 will be used throughout this chapter in the sense described above. Furthermore, we will find it useful to define b=a-1, (4) in order to simplify many of our formulas. We can immediately reject the case a = 1, for this would mean that X, = (X0 + nc) modm, and the sequence would certainly not behave as a random sequence. The case a = 0 is even worse. Hence for practical purposes we may assume that a 2 2, b> 1. (5) Now we can prove a generalization of Eq. (2), X n+k = (akXn + (a -l)c/b) mod m, k 2 0, n 2 0, (6) which expresses the (n+k)th term directly in terms of the nth term. (The special case 12 = 0 in this equation is worthy of note.) It follows that the subsequence consisting of every kth term of (Xn) is another linear congruential sequence, having the multiplier ak mod m and the increment ((a -l)c/b) mod m. An important corollary of (6) is that the general sequence defined by m, a, c, and X0 can be expressed very simply in terms of the special case where c = 1 and X0 = 0. Let YO = 0, Y,+, = (au, + 1) mod m. (7) According to Eq. (6) we will have Yk = (a -1)/b (modulo m), hence the general sequence defined in (2) satisfies X, = (AY, + X0) mod m, where A = (Xob + c) mod m. 63) EXERCISES 1. [IO] Example (3) shows a situation in which X4 = X0, so the sequence begins again from the beginning. Give an example of a linear congruential sequence with m = 10 for which X0 never appears again in the sequence.