chess:programming:prng_pseudo_random_number_generator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
chess:programming:prng_pseudo_random_number_generator [2021/10/31 19:26] – peter | chess:programming:prng_pseudo_random_number_generator [2021/10/31 20:28] (current) – peter | ||
---|---|---|---|
Line 12: | Line 12: | ||
Widely used PRNG algorithms include: Lagged Fibonacci generators, linear feedback shift registers, Blum Blum Shub. | Widely used PRNG algorithms include: Lagged Fibonacci generators, linear feedback shift registers, Blum Blum Shub. | ||
- | |||
- | ---- | ||
- | |||
- | ===== How PRNG works? ===== | ||
- | |||
- | **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: | ||
- | |||
- | * **X** is the sequence of pseudo-random values. | ||
- | * **m**, 0< m- modulus. | ||
- | * **a**, 0< a <m- multiplier. | ||
- | * **c**, 0< = c<m- increment. | ||
- | * **x0**, 0< | ||
- | |||
- | 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. | ||
---- | ---- | ||
Line 74: | Line 49: | ||
https:// | https:// | ||
+ | https:// |
chess/programming/prng_pseudo_random_number_generator.1635708391.txt.gz · Last modified: 2021/10/31 19:26 by peter