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
p1,...,pr\ge5
Let
Zm=\{0,1,...,m-1\}
a,b\inZm
(yn)n
Zm
y0={\rmseed}
yn+1\equiva
\varphi(m)-1 | |
y | |
n |
+b\pmodm,n\geqslant0
where
\varphi(m)=(p1-1)...(pr-1)
Let take m = 15 =
3 x 5a=2,b=3
y0=1
\varphi(m)=2 x 4=8
(yn)n=(1,5,13,2,4,7,1,...)
The result below shows that these sequences are closely related to the following inversive congruential sequence with prime moduli.
For
1\lei\ler
Z | |
pi |
=\{0,1,...,pi-1\},mi=m/pi
ai,bi\in
Z | |
pi |
a\equiv
2 | |
m | |
i |
ai\pmod{pi
Let
(yn)n
Z | |
pi |
(i) | |
y | |
n+1 |
\equivai
(i) | |
(y | |
n |
pi-2 | |
) |
+bi\pmod{pi
Let
(i) | |
(y | |
n |
)n
1\lei\ler
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 |
Zm.
Proof:
First, observe that
mi\equiv0\pmod{pj
yn\equivm1
(1) | |
y | |
n |
+m2
(2) | |
y | |
n |
+...+mr
(r) | |
y | |
n |
\pmodm
yn\equivmi
(i) | |
(y | |
n |
)\pmod{pi
1\lei\ler
n\geqslant0
Recall that
y0\equivmi
(i) | |
(y | |
0 |
)\pmod{pi
1\lei\ler
1\lei\ler
yn\equivmi
(i) | |
(y | |
n |
)\pmod{pi
n\geqslant0
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
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.
We use the notation
s | |
D | |
m |
=Dm(x0,...,xm-1)
xn=(xn,xn+1,...,xn+s-1)
[0,1)s
s\ge2
Higher bound
Let
s\ge2
Then the discrepancy
s | |
D | |
m |
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 |
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 a fixed number r of prime factors of m, Theorem 2 shows that
(s) | |
D | |
m |
=O(m-1/2(logm)s)
(s) | |
D | |
m |
m-1/2
s\ge2
(logm)/loglogm
r | |
style\prod | |
i=1 |
(2s-2+
-1/2 | |
s(p | |
i) |
)=O{(m\epsilon)}
\epsilon>0
s | |
D | |
m |
=O(m-1/2+\epsilon)
\epsilon>0
Since
r | |
style\prod | |
i=1 |
((pi-3)/(pi-1))1/2\geqslant2-r/2
m-1/2
\epsilon>0
m-1/2(loglogm)1/2