About the Linear Congruential Generator

History

The Lehmer Generator attracted significant attention due to its simple design and general effectiveness. In 1958, it was elaborated upon by W. E. Thomson and A. Rotenberg, who added a new variable to Lehmer's equation. This new variable, called c, is used to increment the Seed value each time the generator is called, resulting in much longer periods.

Some developers have also added bit shifting and masking to their implementations, which helps scramble the random numbers their PRNGs generate.


Concept

The formula for this generator is X1 = (aX0 + c) mod M.

While the values for a, M and c are generally chosen by the person implementing the Pseudo-Random Number Generator, better results are obtained if a is a primitive root of M.

Note that if c is 0, then the PRNG is better categorized as a Lehmer PRNG.


Tested Variants



A WFTID Website