The Linear Congruential Generator Family



History

D. H. Lehmer's generator attracted significant attention due to its simple design and general effectiveness. Only a few years later, it was elaborated upon by W. E. Thomson and A. Rotenberg, who added a new variable, c to Lehmer's equation. This new variable is used to increment the Seed value, creating much longer periods.

Thus, the new equation is:

X1 = ( aX0 + c ) mod M

Also note that some variants also added bit shifting and masking to their output, which helps scramble the random numbers they generate.

Tested Variants

Borland C/C++
Borland C/C++ was a popular compiler; here we see how well its lrand() function works.

glibc
Likewise, the GNU C Library also features a LCG.

java.util.Random
Yet another popular LCG is the one implemented by Java's java.util.Random.

Sinclair ZX81
On the other hand, the Sinclair ZX81 home computer used a LCG to create random numbers, with mixed results.



A WFTID Website