LCG
Linear congruential generator (LCG) is a simple pseudorandom number generator used in computing. It produces a sequence of integers by the recurrence X_{n+1} = (a X_n + c) mod m, where m is the modulus, a is the multiplier, c is the increment, and X_0 is the seed. Each X_n lies in the range 0 to m−1. To obtain a real-valued sequence in the unit interval, X_n is often divided by m.
For the generator to have a full period of m, certain conditions must hold: c and m
Variants of LCG include the mixed or additive form (c ≠ 0) and the multiplicative form (c =
Properties and limitations: LCGs are fast and memory-efficient, making them suitable for simple simulations and games.
Usage: LCGs have historically been used in many programming languages’ standard libraries (for example, simple rand