8
*Supported in part by the Australian Research Council. Finite Fields and Their Applications 5, 246 }253 (1999) Article ID !ta.1999.0257, available online at http://www.idealibrary.com on On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers Harald Niederreiter Institute of Discrete Mathematics, Austrian Academy of Sciences, Sonnenfelsgasse 19, A-1010 Vienna, Austria E-mail: niederreiter@oeaw.ac.at and Igor E. Shparlinski* School of Mathematics, Physics, Computing and Electronics, Macquarie University, New South Wales 2109, Australia E-mail: igor@mpce.mq.edu.au Communicated by Peter Jau-Shyong Shiue Received December 7, 1998; revised March 29, 1999 The nonlinear congruential method is an attractive alternative to the classical linear congruential method for pseudorandom number generation. In this paper we present a new type of discrepancy bound for sequences of s-tuples of successive nonlinear congruential pseudorandom numbers and a result on the s-dimensional lattice struc- ture. ( 1999 Academic Press 1. INTRODUCTION In this paper we study some distribution properties of pseudorandom number generators de"ned by a recurrence congruence modulo a prime p of the form u n‘1 ,f (u n ) (mod p), 04u n 4p!1, n"0, 1, 2 , (1) 246 1071-5797/99 $30.00 Copyright ( 1999 by Academic Press All rights of reproduction in any form reserved.

On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

Embed Size (px)

Citation preview

Page 1: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

Finite Fields and Their Applications 5, 246}253 (1999)

Article ID !ta.1999.0257, available online at http://www.idealibrary.com on

On the Distribution and Lattice Structure ofNonlinear Congruential Pseudorandom Numbers

Harald Niederreiter

Institute of Discrete Mathematics, Austrian Academy of Sciences, Sonnenfelsgasse 19,A-1010 Vienna, Austria

E-mail: [email protected]

and

Igor E. Shparlinski*

School of Mathematics, Physics, Computing and Electronics, Macquarie University,New South Wales 2109, AustraliaE-mail: [email protected]

Communicated by Peter Jau-Shyong Shiue

Received December 7, 1998; revised March 29, 1999

The nonlinear congruential method is an attractive alternative to the classical linearcongruential method for pseudorandom number generation. In this paper we presenta new type of discrepancy bound for sequences of s-tuples of successive nonlinearcongruential pseudorandom numbers and a result on the s-dimensional lattice struc-ture. ( 1999 Academic Press

1. INTRODUCTION

In this paper we study some distribution properties of pseudorandomnumber generators de"ned by a recurrence congruence modulo a prime p ofthe form

un`1

,f (un) (mod p), 04u

n4p!1, n"0, 1,2, (1)

*Supported in part by the Australian Research Council.

2461071-5797/99 $30.00Copyright ( 1999 by Academic PressAll rights of reproduction in any form reserved.

Page 2: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

DISCREPANCY OF PSEUDORANDOM NUMBERS 247

with some initial value u0, where f (X)3F

p(X) is a rational function over the

"eld Fp

of p elements. Composite moduli have also been considered in theliterature, but we will restrict our attention to prime moduli.

It is obvious that the sequence (1) eventually becomes periodic with someperiod t4p. Throughout this paper we assume that this sequence is purelyperiodic, that is, that u

n"u

n`tbeginning with n"0; otherwise we consider

a shift of the original sequence.These nonlinear congruential generators provide a very attractive alterna-

tive to linear congruential generators and have been extensively studied in theliterature. The two special cases where f (X)"aX2#bX#c, that is, thequadratic congruential generator, and where f (X)"aX~1#b, that is, theinversive congruential generator, are of special interest. In particular, severalresults about periods of such sequences have been obtained.

For sequences of the largest possible period t"p, a number of resultsabout the distribution of the fractions u

n/p in the interval [0, 1) and, more

generally, about the distribution of the points

Aunp

,2,un`s~1

p B (2)

in the s-dimensional unit cube [0, 1)s have been obtained in the case wheren runs through the full period, n"0,2 , p!1. Many of these results areessentially best possible. For parts of the period, analogous results have beenobtained only in the case where the numbers u

ncan be represented modulo

p as the values of a polynomial over Fpwhose degree is much smaller than p.

It is clear, however, that in most cases the degree of this polynomial will beclose to p, and so the known results cover only a minority of cases. In par-ticular, in the very important case where f is a polynomial of small degree whichgenerates a sequence of the largest possible period t"p, it is shown in theproof of Theorem 5 that the degree of the polynomial representing the num-bers u

nis of order p. We refer to [3, 4, 7, 8, 11}13] for more details and precise

references to original papers. The case of periods t(p is of interest as well.Here, in the case when f is a polynomial, we introduce a method which

allows us to give the "rst, rather weak but nontrivial bounds on the discrep-ancy of the points (2) when n runs over a part of the full period and there is norestriction on the degree of the polynomial representing the numbers u

n.

The inversive congruential generator with f (X)"aX~1#b (where we setf (0)"b) has been studied in [14] by using similar ideas. In this caseessentially stronger results have been obtained. For a di!erent type ofinversive generator, the explicit inversive generator, discrepancy bounds forparts of the period are also known (see [13]).

In another special case, where f (X)"Xe, that is, for the power generator,alternative approaches have been proposed in [5, 6]. These approaches,

Page 3: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

248 NIEDERREITER AND SHPARLINSKI

although they have produced quite strong results for the power generator,cannot be extended to other nonlinear generators.

We also study the lattice structure of sequences generated by (1). Inparticular, we show that sequences of the largest possible period t"p passthe s-dimensional lattice test (see [10, 11]) for quite large values of s.

2. DEFINITIONS AND AUXILIARY RESULTS

For a sequence of N points

!"(c1,n

,2 , cs, n

)Nn/1

(3)

of the half-open interval [0, 1)s, denote by *! its discrepancy, that is,

*!" supB-*0, 1)s

K¹!(B)

N!DB D K ,

where ¹!(B) is the number of points of the sequence ! which hit the box

B"[a1, b

1)]2][a

s, b

s)-[0, 1)s

and the supremum is taken over all such boxes.For an integer vector a"(a

1,2 , a

s)3Zs we put

Da D" maxi/1 ,2, s

DaiD, r(a)"

s<i/1

maxM DaiD, 1N. (4)

We need the Erdo? s}¹uraH n}Koksma inequality (see Theorem 1.21 of [2]) forthe discrepancy of a sequence of points of the s-dimensional unit cube, whichwe present in the following form.

LEMMA 1. ¹here exists a constant Cs'0 depending only on the dimension

s such that, for any integer ¸51, for the discrepancy of a sequence of points (3)the bound

*!(Cs A

1

¸

#

1

N+

0:Da D4L

1

r(a) KN+n/1

expA2nis+j/1

ajcj,nB KB

holds, where Da D, r(a) are de,ned by (4) and the sum is taken over all integervectors

a"(a1,2 , a

s)3Zs

with 0(Da D4¸.

Page 4: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

DISCREPANCY OF PSEUDORANDOM NUMBERS 249

The currently best value of Csis given in [1]. We put

e(z)"exp(2niz/p).

Our second main tool is the Weil bound on exponential sums which wepresent in the following form (see Chap. 5 of [9]).

LEMMA 2. For any polynomial F(X)3Fp[X] of degree D51, the bound

Kp+x/1

e(F(x)) K(Dp1@2

holds.

Finally, we recall that a periodic sequence (wn) over a "eld F with period t is

said to pass the s-dimensional lattice test if the vectors

(wn!w

0,2 , w

n`s~1!w

s~1), n"0,2 , t!1,

span the vector space Fs; see [10, 11].

3. DISCREPANCY BOUND

Let the sequence (un) generated by (1) be purely periodic with an arbitrary

period t. For an integer vector a"(a0,2 , a

s~1)3Zs we introduce the

exponential sum

Sa (N)"N~1+n/0

eAs~1+j/0

ajun`jB .

THEOREM 3. If the sequence (un), given by (1) with a polynomial

f (X)3Fp[X] of degree d52, is purely periodic with period t and t5N51,

then the bound

max'#$ (a0,2 , as~1,p)/1

DSa (N) D"O (N1@2p1@2 log~1@2p)

holds, where the implied constant depends only on d and s.

Proof. Select any a"(a0,2 , a

s~1)3Zs with gcd(a

0,2, a

s~1, p)"1. It

is obvious that for any integer k50 we have

K Sa (N)!N~1+n/0

e As~1+j/0

ajun`k`jB K42k.

Page 5: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

250 NIEDERREITER AND SHPARLINSKI

Therefore, for any integer K51,

K DSa (N) D4=#K2,

where

="KN~1+n/0

K~1+k/0

eAs~1+j/0

ajun`k`jB K4

N~1+n/0KK~1+k/0

eAs~1+j/0

ajun`k`jB K .

De"ne the sequence of polynomials fk(X)3F

p[X] by the recurrence relation

fk(X)"f ( f

k~1(X)), k"1, 2,2 ,

where f0(X)"X. It is clear that deg f

k"dk and that u

n`k"f

k(u

n).

Accordingly, we obtain

=24NN~1+n/0KK~1+k/0

eAs~1+j/0

ajfk`j

(un)B K

2

4Np+x/1KK~1+k/0

e As~1+j/0

ajfk`j

(x)B K2

"NK~1+k/0

K~1+l/0

p+

x/1

eAs~1+j/0

aj( f

k`j(x)!f

l`j(x))B.

If k"l, then the inner sum is trivially equal to p. There are K such sums.Otherwise we can apply Lemma 2 to the inner sum, getting the upper bounddK`s~2p1@2 for at most K2 sums. Hence,

=24KNp#dK`s~2K2Np1@2.

Select

K" 0.4log p

log d.

Then it is easy to see that the "rst term dominates the second one, and aftersimple calculations we obtain the desired result. j

Let Ds(N) denote the discrepancy of the points (2) for n"0,2, N!1.

THEOREM 4. If the sequence (un), given by (1) with a polynomial

f (X)3Fp[X] of degree d52, is purely periodic with period t and t5N51,

Page 6: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

DISCREPANCY OF PSEUDORANDOM NUMBERS 251

then the bound

Ds(N)"O(N~1@2p1@2 log~1@2p (log log p)s)

holds, where the implied constant depends only on d and s.

Proof. The statement follows from Lemma 1, taken with

¸"vN1@2p~1@2 log1@2pw ,

and the bound of Theorem 3. j

4. LATTICE STRUCTURE

Now we show that a nonlinear congruential pseudorandom number gener-ator which has the largest possible value of the period t"p (and thus is mostinteresting from the practical point of view) passes the s-dimensional latticetest for quite large values of s.

THEOREM 5. If the sequence (un), given by (1) with a polynomial

f (X)3Fp[X] of degree d52, is purely periodic with period t"p, then this

sequence passes the s-dimensional lattice test for all positive s4vp/dw.

Proof. Let g (X)3Fp[X] be the unique polynomial of degree D4p!1

for which

un"g(n), n"0,2, p!1.

We see that g is a nonconstant polynomial. Note that f (g(n))"g (n#1) forn"0,2 , p!1. Therefore the polynomial F (X )"f (g (X!1))!g (X) has atleast p zeros. It is easy to see that F(X) is a polynomial of degree precisely dD(since d52) which has at least p zeros. Therefore dD5p, thus D5vp/dw.Applying Theorem 8.2 of [11], we obtain the desired result. j

5. REMARKS

The results of Theorems 3 and 4 are nontrivial only for su$ciently largevalues of N, namely for t5N5p log~1`ep with some "xed e'0, and itwould be very important to extend the range of N for which D

s(N)"o (1).

It would be very interesting to extend the results of this paper to the case ofnonlinear generators with rational functions f (X)3F

p(X). As we have men-

tioned, in the case f (X)"aX~1#b sharper results are given in [14].

Page 7: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

252 NIEDERREITER AND SHPARLINSKI

We also believe that our method is able to produce nontrivial results aboutthe distribution of sequences satisfying nonlinear recurrence relations oforder m52, that is, of the form

un`m

,f (un`m~1

,2 , un) (mod p), n"0, 1,2 ,

where f (X1,2, X

m)3F

p(X

1,2, X

m) is a rational function over F

p.

It will be an interesting question to study the lattice structure of generatorsof periods t(p, and also parts of the full period.

Finally we remark that our method works for generators modulo a com-posite number as well. But one should expect weaker results because insteadof the very powerful Weil bound one will have to use bounds on exponentialsums with composite denominator which are essentially weaker; see [15].

REFERENCES

1. T. Cochrane, Trigonometric approximation and uniform distribution modulo 1, Proc. Amer.Math. Soc. 103 (1988), 695}702.

2. M. Drmota and R. F. Tichy, &&Sequences, Discrepancies and Applications,'' Springer-Verlag,Berlin, 1997.

3. J. Eichenauer-Herrmann, E. Herrmann, and S. Wegenkittl, A survey of quadratic andinversive congruential pseudorandom numbers, in Lecture Notes in Statistics, Vol. 127,pp. 66}97, Springer-Verlag, New York, 1998.

4. M. Flahive and H. Niederreiter, On inversive congruential generators for pseudorandomnumbers, in &&Finite Fields, Coding Theory, and Advances in Communications and Comput-ing'' (G. L. Mullen and P. J.-S. Shiue, Eds.), pp. 75}80, Dekker, New York, 1993.

5. J. B. Friedlander, D. Lieman, and I. E. Shparlinski, On the distribution of the RSA generator,in &&Proc. SETA '98,'' Springer-Verlag, Singapore, to appear.

6. J. B. Friedlander and I. E. Shparlinski, On the distribution of the power generator, preprint,1999.

7. D. Knuth, &&The Art of Computer Programming,'' 3rd ed., Vol. 2, Addison}Wesley, Reading,MA, 1998.

8. R. Lidl and H. Niederreiter, Finite "elds and their applications, in &&Handbook of Algebra''(M. Hazewinkel, Ed.), Vol. 1, pp. 321}363, Elsevier, Amsterdam, 1996.

9. R. Lidl and H. Niederreiter, &&Finite Fields,'' Cambridge Univ. Press, Cambridge, UK, 1997.

10. G. Marsaglia, The structure of linear congruential sequences, in &&Applications of NumberTheory to Numerical Analysis'' (S. K. Zaremba, Ed.), pp. 249}285, Academic Press, NewYork, 1972.

11. H. Niederreiter, &&Random Number Generation and Quasi-Monte Carlo Methods,'' SIAM,Philadelphia, 1992.

12. H. Niederreiter, Finite "elds, pseudorandom numbers, and quasirandom points, in &&FiniteFields, Coding Theory, and Advances in Communications and Computing'' (G. L. Mullenand P. J.-S. Shiue, Eds.), pp. 375}394, Dekker, New York, 1993.

Page 8: On the Distribution and Lattice Structure of Nonlinear Congruential Pseudorandom Numbers

DISCREPANCY OF PSEUDORANDOM NUMBERS 253

13. H. Niederreiter, New developments in uniform pseudorandom number and vector genera-tion, in Lecture Notes in Statistics, Vol. 106, pp. 87}120, Springer-Verlag, New York, 1995.

14. H. Niederreiter and I. E. Shparlinski, On the distribution of inversive congruentialpseudorandom numbers in parts of the period, preprint, 1998.

15. S. B. Stec\ kin, An estimate of a complete rational exponential sum, ¹rudy Mat. Inst. Steklov.143 (1977), 188}207. [In Russian]