= Linear congruential generator
{title2=$S_{n+1}=(aS_n+c)\bmod M$}
Choose integers $M>1$, $a$, $c$ and a seed $S_0$. Iterate $S_{n+1}=(aS_n+c)\bmod M$ and return $U_n=S_n/M$. This gives a deterministic finite-state <pseudorandom number generator> with output in $[0,1)$. A nonzero increment gives a mixed generator; $c=0$ gives a multiplicative generator. Its period is at most $M$, but even a full period does not guarantee good multidimensional uniformity or statistical <independence>.
Back to article page