next up previous contents
Next: Statistical Tests Up: Generation of Pseudo-Random Numbers Previous: Simple Applications; Monte-Carlo Estimators   Contents


Linear Congruential Generators


As a next step we will solve the recursion equation (1), i.e., we will show how the number $ z_k$ that has been recursively defined in (1) can be expressed directly by the initial value $ z_0$ and the parameters $ m$, $ a$ and $ c$.

Theorem 3.1   $ \;$ For all $ k\in\{1,\ldots,n\}$

$\displaystyle z_k=\Bigl(a^k z_0+c\;\frac{a^k-1}{a-1}\Bigr)\,\mod (m)\,.$ (3)

Proof
 


Remarks
 

We will now mention some (sufficient and necessary) conditions for the parameters $ m$, $ a$, $ c$ and $ z_0$, respectively, ensuring that the maximal possible period $ m$ is obtained.

Theorem 3.2    
1.
If $ c>0$, then for every initial value $ z_0\in\{0,1,\ldots,m-1\}$ the linear congruential generator defined in % latex2html id marker 35582
$ (\ref{def.lin.kon})$ generates a sequence $ z_1,\ldots,z_n$ of numbers with maximal possible period $ m$ if and only if the following conditions are satisfied:
(a$ _1$)
The parameters $ c$ and $ m$ are relatively prime.
(a$ _2$)
For every prime number $ r$ dividing $ m$, $ a-1$ is a multiple of $ r$.
(a$ _3$)
If $ m$ is a multiple of $ 4$ then also $ a-1$ is multiple of $ 4$.

2.
If $ c=0$ then $ m_0=m-1$ for all $ z_0\in\{1,\ldots,m-1\}$ if and only if
(b$ _1$)
$ m$ is prime and
(b$ _2$)
for any prime $ r$ dividing $ m-1$ the number $ a^{(m-1)/r}-1$ is not divisible by $ m$.

3.
If $ c=0$ and if there is $ k\in\mathbb{N}$ such that $ m=2^k\ge 16$ then $ m_0=m/4$ if and only if $ z_0$ is an odd number and $ a\mod(8)=5$ or $ =3$ gilt.

A proof of Theorem 3.2 using results from number theory (one of them being Fermat's little theorem) can be found e.g.

Figure 3: Point patterns for pairs $ (u_{i-1},u_i)$ of consecutive pseudo-random numbers for $ m=256$

Figure 4: Point patterns for pairs $ (u_{i-1},u_i)$ of consecutive pseudo-random numbers for $ m=256$

Figure 5: Point patterns for pairs $ (u_{i-1},u_i)$ of consecutive pseudo-random numbers for $ m=2048$


next up previous contents
Next: Statistical Tests Up: Generation of Pseudo-Random Numbers Previous: Simple Applications; Monte-Carlo Estimators   Contents
Ursa Pantle 2006-07-20