chess:programming:prng_pseudo_random_number_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
chess:programming:prng_pseudo_random_number_generator [2021/10/31 19:16] – created peterchess:programming:prng_pseudo_random_number_generator [2021/10/31 20:28] (current) peter
Line 1: Line 1:
 ====== Chess - Programming - PRNG (Pseudo Random Number Generator) ====== ====== Chess - Programming - PRNG (Pseudo Random Number Generator) ======
  
-Pseudo Random Number Generator(PRNG) refers to an algorithm that uses mathematical formulas to produce sequences of random numbers.+**Pseudo Random Number Generator(PRNG)** refers to an algorithm that uses mathematical formulas to produce sequences of random numbers.
  
   * PRNGs generate a sequence of numbers approximating the properties of random numbers.   * PRNGs generate a sequence of numbers approximating the properties of random numbers.
Line 11: Line 11:
   * Hence, the numbers are deterministic and efficient.   * Hence, the numbers are deterministic and efficient.
  
----- +Widely used PRNG algorithms includeLagged Fibonacci generatorslinear feedback shift registersBlum 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: +
- +
-<code> +
-Xn+1 = (aXn + c) mod c +
-</code> +
- +
-**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 startedthe algorithm requires an initial Seedwhich must be provided by some means. +
-  * The appearance of randomness is provided by performing modulo arithmetic.+
  
 ---- ----
Line 61: Line 38:
  
 [[Chess:Programming:PRNG (Pseudo Random Number Generator):A Pseudo Random Number Generator using srand()|A Pseudo Random Number Generator using srand()]] [[Chess:Programming:PRNG (Pseudo Random Number Generator):A Pseudo Random Number Generator using srand()|A Pseudo Random Number Generator using srand()]]
 +
 +[[Chess:Programming:PRNG (Pseudo Random Number Generator):Linear Congruential Generator|Linear Congruential Generator]]
 +
 +
 +
 +----
 +
 +===== References =====
 +
 +https://en.wikipedia.org/wiki/Linear_congruential_generator
 +
 +https://www.pcg-random.org/index.html
chess/programming/prng_pseudo_random_number_generator.1635707819.txt.gz · Last modified: 2021/10/31 19:16 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki