chess:programming:prng_pseudo_random_number_generator:linear_congruential_generator
This is an old revision of the document!
Chess - Programming - PRNG (Pseudo Random Number Generator) - Linear Congruential Generator
Linear Congruential Generator is most common and oldest algorithm for generating pseudo-randomized numbers.
The generator is defined by the recurrence relation:
Xn+1 = (aXn + c) mod c
NOTE: where
- X is the sequence of pseudo-random values.
- m, 0< m- modulus.
- a, 0< a <m- multiplier.
- c, 0< = c<m- increment.
- x0, 0⇐x0<m- the seed or start value.
The next random integer is generated using the previous random integer, the integer constants, and the integer modulus.
- To get started, the algorithm requires an initial Seed, which must be provided by some means.
- The appearance of randomness is provided by performing modulo arithmetic.
References
chess/programming/prng_pseudo_random_number_generator/linear_congruential_generator.1635708498.txt.gz · Last modified: 2021/10/31 19:28 by peter