Overview
An LCG repeatedly multiplies the current state, adds a constant, and reduces by a modulus.
Generates pseudorandom numbers with a simple linear recurrence.
Compact metadata for implementation and discovery.
An LCG repeatedly multiplies the current state, adds a constant, and reduces by a modulus.
Quick facts
Runtime and memory behavior at a glance.
Best
O(1)
Average
O(1)
Worst
O(1)
Space
O(1)
x_next = (a * x + c) mod mAdvances the generator's integer state.
Show a single state value cycling through generated outputs.
Linear Congruential Generator operates in O(1) time and O(1) space within the Pseudorandom Number Generator family. Key governing relation: x_next = (a * x + c) mod m. Often compared with Mersenne Twister and Box-Muller Transform.
What each reference supports for this entry.
Randomness reference for Linear Congruential Generator's uniformity argument, recurrence, or random-selection procedure.
Good next jumps from the relationship graph, ranked for useful discovery.
Randomness & Sampling · Core
Both are pseudorandom number generators with different quality and period tradeoffs.
Compare with thisRandomness & Sampling · Core
PCG uses a congruential state transition but adds an output permutation to improve statistical behavior.
Compare with thisRandomness & Sampling · Core
SplitMix64 advances a 64-bit state with a Weyl increment and applies a strong mixing function.
Compare with thisRandomness & Sampling · Core
Xorshift uses xor/shift linear-feedback transitions rather than modular affine recurrence.
Compare with thisShuffling requires random indices from a generator.
Both are pseudorandom number generators with different quality and period tradeoffs.