# Linear Congruence Method

One of the early pseudo-random number generators that is still used today due to its speed and ease of implementation. Not recommended for cryptographic use as the ``quality'' of generated numbers is insufficient. Linear Congruence Generators (LCGs) should also be avoided in geometrical simulations where there is a need to generate random points in $N$ dimensions due to serial correlations in the pseudo-random sequence ${X}_{n}$ .

The sequence ${X}_{n}$ is constructed using the following recursive equation:

where the ``multiplier'' $a$ , ``increment'' $c$ and ``modulus'' $m$ are heuristic constants. The quality of pseudo-random sequences generated by LCGs depends crucially on the good choice of $a$ , $c$ and $m$ . The maximum period after which the sequence ${X}_{n}$ will start repeating itself is equal to $m$ . In order to speed up computer implementations, traditionally the value of $m$ was chosen to be a power of 2. Values ${X}_{n}$ lie in the interval [ $\mathrm{0,}m$ ). To obtain a pseudo-random floating-point number from the range [ $\mathrm{0,1}$ ) , values ${X}_{n}$ need to be divided by $m$ .

▲Back to this TOP