Generalized inversive congruential pseudorandom numbers explained

An approach to nonlinear congruential methods of generating uniform pseudorandom numbers in the interval [0,1) is the [[Inversive congruential generator]] with prime modulus. A generalization for arbitrary composite moduli

m=p1,...pr

with arbitrary distinct primes

p1,...,pr\ge5

will be present here.

Let

Zm=\{0,1,...,m-1\}

. For integers

a,b\inZm

with gcd (a,m) = 1 a generalized inversive congruential sequence

(yn)n

of elements of

Zm

is defined by

y0={\rmseed}

yn+1\equiva

\varphi(m)-1
y
n

+b\pmodm,n\geqslant0

where

\varphi(m)=(p1-1)...(pr-1)

denotes the number of positive integers less than m which are relatively prime to m.

Example

Let take m = 15 =

3 x 5a=2,b=3

and

y0=1

. Hence

\varphi(m)=2 x 4=8

and the sequence

(yn)n=(1,5,13,2,4,7,1,...)

is not maximum.

The result below shows that these sequences are closely related to the following inversive congruential sequence with prime moduli.

For

1\lei\ler

let
Z
pi

=\{0,1,...,pi-1\},mi=m/pi

and

ai,bi\in

Z
pi

be integers with

a\equiv

2
m
i

ai\pmod{pi

} \;\text\; b\equiv m_ b_\pmod \text

Let

(yn)n

be a sequence of elements of
Z
pi
, given by
(i)
y
n+1

\equivai

(i)
(y
n
pi-2
)

+bi\pmod{pi

}\; \textn \geqslant 0 \;\text \;y_\equiv m_ (y_^)\pmod \;\text

Theorem 1

Let

(i)
(y
n

)n

for

1\lei\ler

be defined as above.Then

yn\equivm1

(1)
y
n

+m2

(2)
y
n

+...+mr

(r)
y
n

\pmodm.

This theorem shows that an implementation of Generalized Inversive Congruential Generator is possible, where exact integer computations have to be performed only in

Z
p1

,...,

Z
pr
but not in

Zm.

Proof:

First, observe that

mi\equiv0\pmod{pj

}, \; \text \; i\ne j, and hence

yn\equivm1

(1)
y
n

+m2

(2)
y
n

+...+mr

(r)
y
n

\pmodm

if and only if

yn\equivmi

(i)
(y
n

)\pmod{pi

}, for

1\lei\ler

which will be shown on induction on

n\geqslant0

.

Recall that

y0\equivmi

(i)
(y
0

)\pmod{pi

} is assumed for

1\lei\ler

. Now, suppose that

1\lei\ler

and

yn\equivmi

(i)
(y
n

)\pmod{pi

} for some integer

n\geqslant0

. Then straightforward calculations and Fermat's Theorem yield

yn+1\equiva

\varphi(m)-1
y
n

+b\equivmi(ai

\varphi(m)
m
i
(i)
(y
n

)\varphi(m)-1+bi)\equivmi(ai

(i)
(y
n
pi-2
)

+bi)\equivmi

(i)
(y
n+1

)\pmod{pi

},which implies the desired result.

Generalized Inversive Congruential Pseudorandom Numbers are well equidistributed in one dimension. A reliable theoretical approach for assessing their statistical independence properties is based on the discrepancy of s-tuples of pseudorandom numbers.

Discrepancy bounds of the GIC Generator

We use the notation

s
D
m

=Dm(x0,...,xm-1)

where

xn=(xn,xn+1,...,xn+s-1)

[0,1)s

of Generalized Inversive Congruential Pseudorandom Numbers for

s\ge2

.

Higher bound

Let

s\ge2

Then the discrepancy

s
D
m
satisfies

Dm

s

<

m-1/2

(

2
\pi

logm+

7
5

)s

r
style\prod
i=1

(2s-2+

-1/2
s(p
i)

)+

-1
s
m

for any Generalized Inversive Congruential operator.

Lower bound:

There exist Generalized Inversive Congruential Generators with

Dm

s

1
2(\pi+2)

m-1/2

:
r
style\prod(
i=1
pi-3
pi-1

)1/2

for all dimension s 2.

For a fixed number r of prime factors of m, Theorem 2 shows that

(s)
D
m

=O(m-1/2(logm)s)

for any Generalized Inversive Congruential Sequence. In this case Theorem 3 implies that there exist Generalized Inversive Congruential Generators having a discrepancy
(s)
D
m

which is at least of the order of magnitude

m-1/2

for all dimension

s\ge2

. However, if m is composed only of small primes, then r can be of an order of magnitude

(logm)/loglogm

and hence
r
style\prod
i=1

(2s-2+

-1/2
s(p
i)

)=O{(m\epsilon)}

for every

\epsilon>0

. Therefore, one obtains in the general case
s
D
m

=O(m-1/2+\epsilon)

for every

\epsilon>0

.

Since

r
style\prod
i=1

((pi-3)/(pi-1))1/2\geqslant2-r/2

, similar arguments imply that in the general case the lower bound in Theorem 3 is at least of the order of magnitude

m-1/2

for every

\epsilon>0

. It is this range of magnitudes where one also finds the discrepancy of m independent and uniformly distributed random points which almost always has the order of magnitude

m-1/2(loglogm)1/2

according to the law of the iterated logarithm for discrepancies. In this sense, Generalized Inversive Congruential Pseudo-random Numbers model true random numbers very closely.

See also