Journal of Computational North-Holland
and Applied Mathematics -ri) (1992) 345-349
345
CAM 1115
Construction of inversive congruential orandom number generators with maximal perio Jiirgen Eichenauer-Herrmann Fachbereich Mathematik, Technische Hochschule, Darmstadt, Germany Received 25 March 1991 Revised 21 May 1991
Abstract Eichenauer-Herrmann, J., Construction of inversive congruential pseudorandom number generators maximal period length, Journal of Computational and Applied Mathematics 40 (1992) 345-349.
with
The inversive congruential method for generating uniform pseudorandom numbers is a particularly attractive alternative to linear congruential generators with their well-known inherent deficiencies like the unfavourable coarse lattice structure in higher dimensions. In the present paper the modulus in the inversive congruential method is chosen as a power of an arbitrary odd prime. The existence of inversive congruential generators with maximal period length is proved by a new constructive characterization of these generators. Keywords: Pseudorandom iength.
numbers,
inversive congruential
method, prime power modulus, maximal period
1. Introduction The linear congruential method for generating uniform pseudorandom numbers in the interval [0, 1) shows a lot of undesirable regularities which are due to the linearity of the underlying recursion (cf. [12,13,18,19]). Therefore several nonlinear congruential generators have been proposed and analysed (cf. [ l-l 1,14- 17,193). A particularly promising method is based on achieving nonlinearity by employing the operation of multiplicative inversion with respect to a given modulus. In case the modulus is a prime (cf. [1,3,6,14,16,17]) or a power of two (cf. [5,8,10,16]), several results on the corresponding inversive congruential sequences are available. When the modulus iq a power of an arbitrary odd prime, inversive congruential sequences with maximal period length have been characterized (cf. [ll]) and their statistical independence pra;nerties have been analysed (cf. [7]). However, the existence of inversive Correspondence to. Dr. J. Eichenauer-Herrmann, straBe 7, W-6100 Darmstadt, Germany. 0377-0427/92/$05.00
Fachbereich
Mathematik,
Technische Hochschule, SchloBgarten-
0 1992 - Elsevier Science Publishers B.V. All rights reserved
,346
congruenti sequences with maximal period length could not yet be proved for moduli being a power of an arbitrary odd prime. This was the motivation for the present paper, where inversive congruential generators with maximal period length are explicitly constructed. Let p a 3 be a prime, and let m 2 2 be an integer. For integers CI, 6 with a f 0 (mod p) a sequence (x,),,, of integers with xn + 0 (mod p) for n 2 0 is called an inversive congruentiai sequmce if the recursion x ?z+\ =ax;‘+b
(mod pm),
n20,
is satisfied. where X,-’ denotes the multiplicative
inverse of x, mol;Jo
p”. Let
h = min(n 2 I Ix,, =x0 (mod pj\ be the period length of (x,1, z ,, medulo p. A method for computing the period length A is described in [3]. In the present paper the existence of inversive congn;ential sequences with maximal period length hpm- ’ modulo pm is prover; by an explicit construction. In the second section the main result is stated precisely. Its comprehensive proof is sketched in the third section.
2. Sequences with maximal period length First, a characterization of inversive congruential sequences with maximal period length hP m-1 modulo pm is given, which can easily be deduced from [al, Theorem 121. Proposition 1. (a) Suppose that A = 1, i.e., x0’- bx, - a = 0 (XXX! p), and 8m> 3. Then the incersire congruential sequence (xnJn a 0 has maximal period length pm- 1 modulo pm if and only if (I) (11)
a=2
(mod3)
and
Q = -x0’ (mod p)
xz-b.y,-a=6 and
(mod9)
xi-bx,-af0
forp=?
(mod p2)
or
forp>5.
(b) Suppose that A > 2, i.e., xi - bx, - a f 0 (mod p>. Then the inversive congruential sequence (x,), a 0 hn.o maximal period length Ap”- ’ module pm if and only if x, f x, (mod p2). Proposition 1 shows that inversive congruential sequences with maximal hp”-’ can be characterized by simple explicit conditions for A = 1, whereas crucial condition x, f x, (mod p2) is only implicit. The difficulty in evaluating arises from the nonlinearity of the underlying recursion. Nevertheless, in the result an explicit characterization is established.
period length for A > 2 the this condition following main
Theorem 2. Suppose that A 2 2. Let c be an integer with x, = x0 + pt (mod p2 ). For integers cy, #%let (Y,!. 20 be a sequence of integers with y, =x0 (mod p) and Yn-L1 . = (a +par)y;’
+b +p/? (mod pm),
n 20.
3en the inversive congruential sequence ( y,), ~ C has maximal period length A pm - ’ module pm if and only if A(xg - &x0
-
a)(ba - 2ap) + [a(4a + b2) f 0 (mod p).
J. Eichenauer-Herrmann
3. Proof of Thwem
/ Pseudorandom number generator
347
2
(i) First, observe that the sequence ( y,), , 0 is well defined since y, =x, (mod I;) for n 3 0. In the following presentation the integer ma&ix A=
(
;
a 01
plays an important role. Let I denote the unit matrix and let (q,Jn 3 o be a sequence of integers with q0 = 0, qr - 1 and 4, =lyn+ +aqn_2 for n 2 2. Then A” =aq,_,I+q,A and -’
X,=-((4,+1xo+a4~j(4~Xo+Q4n-1)
(mod pm)
for n 2 1 can easily be proved by induction. Therefore x0 +~5
=q
= (qA+Ixo
+ w&7,x0
one obtains
+ w,_,)-’
(mod
p2),
which yields qh( xu”- 5x0 -a) Now, the assumption hence
+pt(q*x,
+aq,_,)
= 0 (mod p’).
A 3 2, i.e., xi - bx, - a f 0 (mod p), implies that qA=puo (mod p2) and
Ah = aq,_,Z +pv,A
(mod p”),
where v. denotes an Integer with v. = -5(x: (ii) Let vl, v2 be integers with 1/I = h(4a -Fb2)-l(2a
+ b@qh_r
- !xo - a!-‘aq, _ 1 (mod p). (mod p)
and v2 = h(4a + b2)-‘(2@ Plate th:t 4.a + b2 f 0 (mod pi
- bcx)q,_, follows
(mod p).
from part (ii) of the Theorem
be an integer matrix with (4a + b2)B = (ICY+ b@A + (2ap - ba)I
(mod
Then, according to (i), one obtains (A+pB)A=AA+pAAh-lB=aq,,_,I+p(uoA+haq,_,A-lB) =aq,d+p( =aq,_,I+p
uoA+au,I+av,A-‘) b:), + au, uo + u2
p).
in 131.Furthermore,
let
J. Eichenauer-Herrmann / Pseudorandom number generator
,343
iet ( zJn 2 o be a sequence of integers with
(iii) Subsequently,
z. 15(1 -p&)y,
(mod p’)
-p/S3
and z n+1= (V +P&k
+ u‘ +p&)((l
+P&)z,
+P&) -’ (mod P’),
n a 0.
ote that the sequence (z,!, 2o is well defined since z,, =xX, (mod p) for n 2 0. Furthermore, let ri”‘, . . . , ypJ be integers with (A +pB)”
=
for n 2 0. Then z, =
($)z~
+ y~))(y~)zo
+ yr))-’
(mod p”)
for N 2 0 can easily be proved by induction. Hence, it follows from (ii) that z, = ((WA-l +P(6v,+av,))zo+Pa(VO+VZ)) l
+ “2J~n
{Pi+J
= (aqA-lz,
+
aq,_,
+pjav,
- 6~2))
+p[(6vo+av,)zo+ajvoi
c2>3)
-P(aq,-,)-2[(vo+
- b?*-J1
-1
+o+av,
+,I)
=zo-p(aq,_,)-1(vo+vI)(z~-6zo-a) =zzo +-pa-‘(4a
+ 6’)-I[
A(x,’ -6x,
- a)(ba
- 2@)
+ ea(4a
+
b’)] (mod p’).
(iv) Finally, a short calculation and an induction argument show that yn: 3 (1 +PP3)Zn
+Ppa
(mod
P’),
n 3 0,
where the relations ar = & + a& - 6p4 (mod p) and p = PI + & (mod p) are used. Therefore y’hfy, ‘\mod p’) if and only if t, f z. (mod p2), i.e., according to (iii), if and only if A(xi -6x,
- a)(ba
- 2ap)
+ ca(4a
+
b2) f 0 (mod p).
Hence, the desired result follows from Proposition
l(b).
terenrces ill J. Eichenauer. H. Grothe and J. Lehn, Marsaglia’s lattice test and non-linear congruential
pseudo random number generators, Metrika 35 (1988) 241-250. if21J. Eichenauer, H. Grothe, J. Lehn and A. Topuzoj$~, A multiple recursive non-linear congruential pseudo random number generator, Manuscripta Math. 59 (1987) 331-346. 31 J. Eichenauer and J. Lehn, A non-linear congruential pseudo random number generator, Statist. Papers 27 t !986) 315-326. 141 J. Eichenauer and J. Lehn, On the structure of quadratic congruential sequences, Manuscripta Math. 58 (1987) 129-140.
J. Eichenauer-Herrmann / Pseudorandom number generator
349
[5] J. Eichenauer, J. Lehn and A. Topuzoglu, A nonlinear con E -:lential pseudorandom number generator with power of two modulus, Math. Comp. 51 (1988) 757-759. [6] J. Eichen auer-Herrmann, Inversive congruential pseudorandom numbers avoid the planes, Math, Camp. 56 (1991) 297-301. [7] J. Eichenauer-Herrmann, On the discrepancy of inversive congruential pseudorandom numbers with prime power modulus, Manuscripta Math. 71 0991) 153-161. [8] J. Eichenauer-Herrmann, H. Grothe, H. Niederreiter and A. Topuzoglu, On the lattice structure of a nonlinear generator with modulus 2*, J. Comput. Appl. Math. 31 (1) i1990) 81-85. [9] J. Eichenauer-Herrmann and H. Niederreiter, On the discrepancy of quadratic congruential pseudorandom numbers, J. Comput. Appf. Math. 34 (2) (1991) 243-249. [lo] J. Eichenauer-Herrmann and H. Niederreiter, Lower bounds for the discrepancy of inversive congruential pseudorandom numbers with power of two modulus, Math. Comp., to appear. [ll] J. Eichenauer-Herrmann and A. Topuzoglu, On the period length of congruential pseudorandom number sequences generated by inversions, .I. Comput. Appl. Math. 31(l) (1990) 87-96. [12] G. Marsaglia, Random numbers fall mainly in the planes, Proc. Nat. Acad. Sci. 61 (1968) 25-28. [13] G. Marsaglia, Regularities in congruential random number generators, Numer. Math. 16 (1970) 8-10. [14] H. Niederreiter, Remarks on nonlinear congruential pseudorandom numbers, Metrika 35 (1988) 321-328. [ 151 H. Niederreiter, Statistical independence of nonlinear congruential pseudorandom numbers, Monatsh. Math. 106 (1988) 149-159. [16] H. Niederreite:, The serial test for congruential pseudorandom numbers generated by inversions, Math. Camp. 52 (1989) 135-144. [17] H. Niederreiter, Lower bounds for the discrepancy of inversive congruential pseudorandom numbers, Math. Comp. 55 (1990) 277-287. [18] H. Niederreiter, Recent trends in random number and random vector generation, Ann. Oper. Res. 31 (1991) 323-346. [19] H. Niederreiter, Nonlinear methods for pseudorandom number and vector generation, in: Proc. Internat. Rorkshtg on Computationally-Intensive Methods in Simulation and Stochastic Optimization, Laxenburg, 1990, to appear.