Let take m = 15 = 3 × 5 a = 2 , b = 3 {\displaystyle 3\times 5\,a=2,b=3} and y 0 = 1 {\displaystyle y_{0}=1} . Hence φ ( m ) = 2 × 4 = 8 {\displaystyle \varphi (m)=2\times 4=8\,} and the sequence ( y n ) n ⩾ 0 = ( 1 , 5 , 13 , 2 , 4 , 7 , 1 , … ) {\displaystyle (y_{n})_{n\geqslant 0}=(1,5,13,2,4,7,1,\dots )} is not maximum.
The result below shows that these sequences are closely related to the following inversive congruential sequence with prime moduli.
For 1 ≤ i ≤ r {\displaystyle 1\leq i\leq r} let Z p i = { 0 , 1 , … , p i − 1 } , m i = m / p i {\displaystyle \mathbb {Z} _{p_{i}}=\{0,1,\dots ,p_{i}-1\},m_{i}=m/p_{i}} and a i , b i ∈ Z p i {\displaystyle a_{i},b_{i}\in \mathbb {Z} _{p_{i}}} be integers with
Let ( y n ) n ⩾ 0 {\displaystyle (y_{n})_{n\geqslant 0}} be a sequence of elements of Z p i {\displaystyle \mathbb {Z} _{p_{i}}} , given by
Let ( y n ( i ) ) n ⩾ 0 {\displaystyle (y_{n}^{(i)})_{n\geqslant 0}} for 1 ≤ i ≤ r {\displaystyle 1\leq i\leq r} be defined as above. Then
This theorem shows that an implementation of Generalized Inversive Congruential Generator is possible, where exact integer computations have to be performed only in Z p 1 , … , Z p r {\displaystyle \mathbb {Z} _{p_{1}},\dots ,\mathbb {Z} _{p_{r}}} but not in Z m . {\displaystyle \mathbb {Z} _{m}.}
Proof:
First, observe that m i ≡ 0 ( mod p j ) , for i ≠ j , {\displaystyle m_{i}\equiv 0{\pmod {p_{j}}},\;{\text{for}}\;i\neq j,} and hence y n ≡ m 1 y n ( 1 ) + m 2 y n ( 2 ) + ⋯ + m r y n ( r ) ( mod m ) {\displaystyle y_{n}\equiv m_{1}y_{n}^{(1)}+m_{2}y_{n}^{(2)}+\dots +m_{r}y_{n}^{(r)}{\pmod {m}}} if and only if y n ≡ m i ( y n ( i ) ) ( mod p i ) {\displaystyle y_{n}\equiv m_{i}(y_{n}^{(i)}){\pmod {p_{i}}}} , for 1 ≤ i ≤ r {\displaystyle 1\leq i\leq r} which will be shown on induction on n ⩾ 0 {\displaystyle n\geqslant 0} .
Recall that y 0 ≡ m i ( y 0 ( i ) ) ( mod p i ) {\displaystyle y_{0}\equiv m_{i}(y_{0}^{(i)}){\pmod {p_{i}}}} is assumed for 1 ≤ i ≤ r {\displaystyle 1\leq i\leq r} . Now, suppose that 1 ≤ i ≤ r {\displaystyle 1\leq i\leq r} and y n ≡ m i ( y n ( i ) ) ( mod p i ) {\displaystyle y_{n}\equiv m_{i}(y_{n}^{(i)}){\pmod {p_{i}}}} for some integer n ⩾ 0 {\displaystyle n\geqslant 0} . Then straightforward calculations and Fermat's Theorem yield
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.
We use the notation D m s = D m ( x 0 , … , x m − 1 ) {\displaystyle D_{m}^{s}=D_{m}(x_{0},\dots ,x_{m}-1)} where x n = ( x n , x n + 1 , … , x n + s − 1 ) {\displaystyle x_{n}=(x_{n},x_{n}+1,\dots ,x_{n}+s-1)} ∈ [ 0 , 1 ) s {\displaystyle [0,1)^{s}} of Generalized Inversive Congruential Pseudorandom Numbers for s ≥ 2 {\displaystyle s\geq 2} .
Higher bound
Lower bound:
For a fixed number r of prime factors of m, Theorem 2 shows that D m ( s ) = O ( m − 1 / 2 ( log m ) s ) {\displaystyle D_{m}^{(s)}=O(m^{-1/2}(\log m)^{s})} for any Generalized Inversive Congruential Sequence. In this case Theorem 3 implies that there exist Generalized Inversive Congruential Generators having a discrepancy D m ( s ) {\displaystyle D_{m}^{(s)}} which is at least of the order of magnitude m − 1 / 2 {\displaystyle m^{-1/2}} for all dimension s ≥ 2 {\displaystyle s\geq 2} . However, if m is composed only of small primes, then r can be of an order of magnitude ( log m ) / log log m {\displaystyle (\log m)/\log \log m} and hence ∏ i = 1 r ( 2 s − 2 + s ( p i ) − 1 / 2 ) = O ( m ϵ ) {\displaystyle \textstyle \prod _{i=1}^{r}(2s-2+s(p_{i})^{-1/2})=O{(m^{\epsilon })}} for every ϵ > 0 {\displaystyle \epsilon >0} .1 Therefore, one obtains in the general case D m s = O ( m − 1 / 2 + ϵ ) {\displaystyle D_{m}^{s}=O(m^{-1/2+\epsilon })} for every ϵ > 0 {\displaystyle \epsilon >0} .
Since ∏ i = 1 r ( ( p i − 3 ) / ( p i − 1 ) ) 1 / 2 ⩾ 2 − r / 2 {\displaystyle \textstyle \prod _{i=1}^{r}((p_{i}-3)/(p_{i}-1))^{1/2}\geqslant 2^{-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 − ϵ {\displaystyle m^{-1/2-\epsilon }} for every ϵ > 0 {\displaystyle \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 ( log log m ) 1 / 2 {\displaystyle m^{-1/2}(\log \log m)^{1/2}} according to the law of the iterated logarithm for discrepancies.2 In this sense, Generalized Inversive Congruential Pseudo-random Numbers model true random numbers very closely.
G. H. Hardy and E. M. Wright, An introduction to the theory of numbers, 5th ed., Clarendon Press, Oxford, 1979. ↩
J. Kiefer, On large deviations of the empiric d.f. Fo vector chance variables and a law of the iterated logarithm, PacificJ. Math. 11(1961), pp. 649-660. ↩