Difference between revisions of "Pseudorandom Number Generator"

From Chessprogramming wiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
PRNGs maintain a state variable, a bitwise superset of the random number, initialized by a [https://en.wikipedia.org/wiki/Random_seed random seed] - a constant for the same sequence each time, i.e. for Zobrist keys, otherwise, something like [https://en.wikipedia.org/wiki/System_time system time] to produce varying pseudo randoms. Each call of the PRNG routine performs certain operations or [[Bit-Twiddling|bit-twiddling]] on that state, leaving the next pseudo random number. For various applications more or less important features are [https://en.wikipedia.org/wiki/Randomness randomness], resolution, ([https://en.wikipedia.org/wiki/Equidistributed_sequence uniform]) [https://en.wikipedia.org/wiki/Probability_distribution distribution], and [https://en.wikipedia.org/wiki/Periodicity periodicity] - topic of various [https://en.wikipedia.org/wiki/Randomness_tests randomness tests] - and further performance, and [https://en.wikipedia.org/wiki/Software_portability portability].  
 
PRNGs maintain a state variable, a bitwise superset of the random number, initialized by a [https://en.wikipedia.org/wiki/Random_seed random seed] - a constant for the same sequence each time, i.e. for Zobrist keys, otherwise, something like [https://en.wikipedia.org/wiki/System_time system time] to produce varying pseudo randoms. Each call of the PRNG routine performs certain operations or [[Bit-Twiddling|bit-twiddling]] on that state, leaving the next pseudo random number. For various applications more or less important features are [https://en.wikipedia.org/wiki/Randomness randomness], resolution, ([https://en.wikipedia.org/wiki/Equidistributed_sequence uniform]) [https://en.wikipedia.org/wiki/Probability_distribution distribution], and [https://en.wikipedia.org/wiki/Periodicity periodicity] - topic of various [https://en.wikipedia.org/wiki/Randomness_tests randomness tests] - and further performance, and [https://en.wikipedia.org/wiki/Software_portability portability].  
  
A common method used in many library functions, such as [[C]]/[[Cpp|C++]] rand() is the [https://en.wikipedia.org/wiki/Linear_congruential_generator linear congruential generator] based on multiply, add, [https://en.wikipedia.org/wiki/Modulo_operation modulo] with integers, where some past implementations had serious shortcomings in the randomness, distribution and period of the sequence <ref>"In the past, some implementations of rand() have had serious shortcomings in the randomness, distribution and period of the sequence produced (in one well-known example, the low-order bit simply alternated between 1 and 0 between calls) rand() is not recommended for serious random-number generation needs, like cryptography. It is recommended to use C++11's random number generation facilities to replace rand()."  [http://en.cppreference.com/w/cpp/numeric/random/rand rand - cppreference.com]</ref>. Due to such issues in rand() implementations, where lower bits are less random than higher bits, it is recommended not to use [https://en.wikipedia.org/wiki/Modulo_operation modulo] X to reduce the integer range from RAND_MAX to X, but division by (RAND_MAX div X) <ref>[https://www.stmintz.com/ccc/index.php?id=88293 Re: random book moves/ random generator] by [[Thorsten Greiner]], [[CCC]], January 13, 2000</ref> - or to use C++11's random number generation facilities to replace rand <ref>[http://en.cppreference.com/w/cpp/numeric/random Pseudo-random number generation - cppreference.com]</ref>.
+
[[Zobrist Hashing|Zobrist hashing]] with about 12*64 keys has less issues with randomness and period, but with distribution, and requires [https://en.wikipedia.org/wiki/Linear_independence linear independence] so that a small subset of all keys doesn't xor to zero. Despite selected hard-coded random constants used at compile time, many programs use an own PRNG based on [https://en.wikipedia.org/wiki/Recurrence_relation recurrence relation] in [https://en.wikipedia.org/wiki/GF%282%29 GF(2)] such as [https://en.wikipedia.org/wiki/Mersenne_twister Mersenne Twister] or [https://en.wikipedia.org/wiki/Xorshift Xorshift].  
  
[[Zobrist Hashing|Zobrist hashing]] with about 12*64 keys has less issues with randomness and period, but with distribution, and requires [https://en.wikipedia.org/wiki/Linear_independence linear independence] so that a small subset of all keys doesn't xor to zero. Despite selected hard-coded random constants used at compile time, many programs use an own PRNG based on [https://en.wikipedia.org/wiki/Recurrence_relation recurrence relation] in [https://en.wikipedia.org/wiki/GF%282%29 GF(2)] such as [https://en.wikipedia.org/wiki/Mersenne_twister Mersenne Twister] or [https://en.wikipedia.org/wiki/Xorshift Xorshift]. [[Stockfish]] (since 2.0) uses an implementation by [[Heinz van Saanen]] based on [[Bob Jenkins|Bob Jenkins']] [[Bob Jenkins#RKISS|RKISS]], a member of [[Mathematician#GMarsaglia|George Marsaglia's]] Xorshift familly. [[Amy]] by [[Thorsten Greiner]] <ref>amy-0.8.7.tar.gz /src/random.c</ref> uses an implementation of Agner Fog's RANROT B3 <ref>[http://www.agner.org/ Agner Fog] ('''2001'''). ''Chaotic Random Number Generators with Random Cycle Lengths''. [http://www.agner.org/random/theory/chaosran.pdf pdf]</ref>, also recommended by [[Stefan Meyer-Kahlen]] as used in [[Shredder]] <ref>[https://www.stmintz.com/ccc/index.php?id=88309 Re: random book moves/ random generator] by [[Stefan Meyer-Kahlen]], [[CCC]], January 13, 2000</ref>. [[Arasan]] 20.x switched to C++11 random number support using std::mt19937_64 <ref>[https://github.com/jdart1/arasan-chess/blob/master/src/movegen.h arasan-chess/movegen.h at master · jdart1/arasan-chess · GitHub]</ref> <ref>[http://www.cplusplus.com/reference/random/mt19937_64/ mt19937_64 - C++ Reference]</ref>
+
==LCG==
 +
A common method used in many library functions, such as [[C]]/[[Cpp|C++]] rand() is the [https://en.wikipedia.org/wiki/Linear_congruential_generator linear congruential generator] (LCG) based on multiply, add, [https://en.wikipedia.org/wiki/Modulo_operation modulo] with integers, where some past implementations had serious shortcomings in the randomness, distribution and period of the sequence <ref>"In the past, some implementations of rand() have had serious shortcomings in the randomness, distribution and period of the sequence produced (in one well-known example, the low-order bit simply alternated between 1 and 0 between calls) rand() is not recommended for serious random-number generation needs, like cryptography. It is recommended to use C++11's random number generation facilities to replace rand()."  [http://en.cppreference.com/w/cpp/numeric/random/rand rand - cppreference.com]</ref>. Due to such issues in rand() implementations, where lower bits are less random than higher bits, it is recommended not to use [https://en.wikipedia.org/wiki/Modulo_operation modulo] X to reduce the integer range from RAND_MAX to X, but division by (RAND_MAX div X) <ref>[https://www.stmintz.com/ccc/index.php?id=88293 Re: random book moves/ random generator] by [[Thorsten Greiner]], [[CCC]], January 13, 2000</ref> - or to use C++11's random number generation facilities to replace rand <ref>[http://en.cppreference.com/w/cpp/numeric/random Pseudo-random number generation - cppreference.com]</ref>.
 +
 
 +
==RKISS==
 +
[[Stockfish]] (since 2.0) uses an implementation by [[Heinz van Saanen]] based on [[Bob Jenkins|Bob Jenkins']] [[Bob Jenkins#RKISS|RKISS]], a member of [[Mathematician#GMarsaglia|George Marsaglia's]] Xorshift familly.  
 +
 
 +
==RANROT B3==
 +
[[Amy]] by [[Thorsten Greiner]] <ref>amy-0.8.7.tar.gz /src/random.c</ref> uses an implementation of Agner Fog's RANROT B3 <ref>[http://www.agner.org/ Agner Fog] ('''2001'''). ''Chaotic Random Number Generators with Random Cycle Lengths''. [http://www.agner.org/random/theory/chaosran.pdf pdf]</ref>, also recommended by [[Stefan Meyer-Kahlen]] as used in [[Shredder]] <ref>[https://www.stmintz.com/ccc/index.php?id=88309 Re: random book moves/ random generator] by [[Stefan Meyer-Kahlen]], [[CCC]], January 13, 2000</ref>.  
 +
 
 +
==MT==
 +
[[Arasan]] 20.x switched to C++11 random number support using [https://en.wikipedia.org/wiki/Mersenne_twister Mersenne Twister] std::mt19937_64 <ref>[https://github.com/jdart1/arasan-chess/blob/master/src/movegen.h arasan-chess/movegen.h at master · jdart1/arasan-chess · GitHub]</ref> <ref>[http://www.cplusplus.com/reference/random/mt19937_64/ mt19937_64 - C++ Reference]</ref>.
 +
 
 +
==ChaCha==
 +
The [[Rust]] engine [[Asymptote]] uses the [https://en.wikipedia.org/wiki/Salsa20#ChaCha_variant ChaCha] [https://en.wikipedia.org/wiki/Stream_cipher stream cipher] developed by [[Mathematician#DJBernstein|Daniel J. Bernstein]], built on a [https://en.wikipedia.org/wiki/Pseudorandom_function_family pseudorandom function] based on [https://en.wikipedia.org/wiki/Salsa20#ChaCha_variant add-rotate-xor (ARX)] operations <ref>[https://doc.rust-lang.org/1.0.0/rand/chacha/struct.ChaChaRng.html rand::chacha::ChaChaRng - Rust]</ref>.
  
 
=Applications=
 
=Applications=
Line 60: Line 73:
 
* [[Mathematician#KEntacher|Karl Entacher]] ('''2000'''). ''[http://random.mat.sbg.ac.at/results/karl/server/server.html A collection of classical pseudorandom number generators with linear structures - advanced version]''.  
 
* [[Mathematician#KEntacher|Karl Entacher]] ('''2000'''). ''[http://random.mat.sbg.ac.at/results/karl/server/server.html A collection of classical pseudorandom number generators with linear structures - advanced version]''.  
 
* [http://www.agner.org/ Agner Fog] ('''2001'''). ''Chaotic Random Number Generators with Random Cycle Lengths''. [http://www.agner.org/random/theory/chaosran.pdf pdf]  
 
* [http://www.agner.org/ Agner Fog] ('''2001'''). ''Chaotic Random Number Generators with Random Cycle Lengths''. [http://www.agner.org/random/theory/chaosran.pdf pdf]  
 +
* [[Julio César Hernández-Castro]], [https://scholar.google.es/citations?user=0q4BhD8AAAAJ&hl=en Arturo Ribagorda], [https://scholar.google.com/citations?user=BHf4l7wAAAAJ&hl=en Pedro Isasi], [https://dblp.org/pid/56/6864.html José M. Sierra] ('''2001'''). ''[https://www.tandfonline.com/doi/abs/10.1080/0161-110191889897 Genetic Algorithms Can be Used to Obtain Good Linear Congruential Generators]''. [https://en.wikipedia.org/wiki/Cryptologia Cryptologia], Vol. 25, No. 3
 
* [[Mathematician#GMarsaglia|George Marsaglia]] ('''2002'''). ''[http://digitalcommons.wayne.edu/jmasm/vol2/iss1/2/ Random number generators]''. [https://en.wikipedia.org/wiki/Journal_of_Modern_Applied_Statistical_Methods Journal of Modern Applied Statistical Methods], Vol. 2, No. 2.
 
* [[Mathematician#GMarsaglia|George Marsaglia]] ('''2002'''). ''[http://digitalcommons.wayne.edu/jmasm/vol2/iss1/2/ Random number generators]''. [https://en.wikipedia.org/wiki/Journal_of_Modern_Applied_Statistical_Methods Journal of Modern Applied Statistical Methods], Vol. 2, No. 2.
 
* [[Mathematician#GMarsaglia|George Marsaglia]] ('''2003'''). ''[https://www.jstatsoft.org/article/view/v008i14 Xorshift RNGs]''. [https://en.wikipedia.org/wiki/Journal_of_Statistical_Software Journal of Statistical Software], Vol. 8, No. 14
 
* [[Mathematician#GMarsaglia|George Marsaglia]] ('''2003'''). ''[https://www.jstatsoft.org/article/view/v008i14 Xorshift RNGs]''. [https://en.wikipedia.org/wiki/Journal_of_Statistical_Software Journal of Statistical Software], Vol. 8, No. 14
 
* [[Mathematician#PLEcuyer|Pierre L'Ecuyer]] ('''2004'''). ''Random Number Generation''. [http://www.iro.umontreal.ca/~lecuyer/myftp/papers/handstat.pdf pdf]
 
* [[Mathematician#PLEcuyer|Pierre L'Ecuyer]] ('''2004'''). ''Random Number Generation''. [http://www.iro.umontreal.ca/~lecuyer/myftp/papers/handstat.pdf pdf]
 +
* [[Julio César Hernández-Castro]], [https://en.wikipedia.org/wiki/Andr%C3%A9_Seznec André Seznec], [https://scholar.google.com/citations?user=BHf4l7wAAAAJ&hl=en Pedro Isasi] ('''2004'''). ''On the design of state-of-the-art pseudorandom number generators by means of genetic programming''. [https://dblp.org/db/conf/cec/cec2004.html#HernandezSI04 CEC 2004], [https://core.ac.uk/download/pdf/29399623.pdf pdf]
 
* [[Donald Eastlake]], [[Stephen D. Crocker]], [https://jis.qyv.name/ Jeffrey I. Schiller] ('''2005'''). ''Randomness Requirements for Security''. [https://tools.ietf.org/html/rfc4086 RFC 4086]
 
* [[Donald Eastlake]], [[Stephen D. Crocker]], [https://jis.qyv.name/ Jeffrey I. Schiller] ('''2005'''). ''Randomness Requirements for Security''. [https://tools.ietf.org/html/rfc4086 RFC 4086]
 
* [[Mathematician#WHPress|William H. Press]], [[Mathematician#SATeukolsky|Saul A. Teukolsky]], [https://de.wikipedia.org/wiki/William_T._Vetterling William T. Vetterling], [https://en.wikipedia.org/wiki/Brian_P._Flannery Brian P. Flannery] ('''2007'''). ''[https://en.wikipedia.org/wiki/Numerical_Recipes Numerical Recipes. The Art of Scientific Computing], 3rd edition''. (C++ code)
 
* [[Mathematician#WHPress|William H. Press]], [[Mathematician#SATeukolsky|Saul A. Teukolsky]], [https://de.wikipedia.org/wiki/William_T._Vetterling William T. Vetterling], [https://en.wikipedia.org/wiki/Brian_P._Flannery Brian P. Flannery] ('''2007'''). ''[https://en.wikipedia.org/wiki/Numerical_Recipes Numerical Recipes. The Art of Scientific Computing], 3rd edition''. (C++ code)
 +
* [[Mathematician#DJBernstein|Daniel J. Bernstein]] ('''2007'''). ''The Salsa20 family of stream ciphers''. [https://en.wikipedia.org/wiki/University_of_Illinois_at_Chicago University of Illinois at Chicago], [https://cr.yp.to/snuffle/salsafamily-20071225.pdf pdf] <ref>[https://en.wikipedia.org/wiki/Salsa20 Salsa20 from Wikipedia]</ref>
 +
* [[Mathematician#DJBernstein|Daniel J. Bernstein]] ('''2008'''). ''ChaCha, a variant of Salsa20''. [https://en.wikipedia.org/wiki/University_of_Illinois_at_Chicago University of Illinois at Chicago], [http://cr.yp.to/chacha/chacha-20080128.pdf pdf]
 
==2010 ...==
 
==2010 ...==
 +
* [[Maciej Szmit]], [https://dblp.uni-trier.de/pers/hd/s/Szmit:Anna Anna Szmit] ('''2011'''). ''[https://link.springer.com/chapter/10.1007/978-3-642-21771-5_32 DNS Pseudo-Random Number Generators Weakness]''. [https://dblp.uni-trier.de/db/conf/cn/cn2011.html CN 2011], [https://en.wikipedia.org/wiki/Springer_Science%2BBusiness_Media Springer]
 
* [[Jeff Rollason]] ('''2015'''). ''[http://www.aifactory.co.uk/newsletter/2014_02_completely_random.htm When Completely Random is Just not Random Enough]''. [[AI Factory]], February 2015
 
* [[Jeff Rollason]] ('''2015'''). ''[http://www.aifactory.co.uk/newsletter/2014_02_completely_random.htm When Completely Random is Just not Random Enough]''. [[AI Factory]], February 2015
  
Line 112: Line 130:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=49807 rkiss and other dependencies in syzygy] by [[Don Dailey]], [[CCC]], October 23, 2013
 
* [http://www.talkchess.com/forum/viewtopic.php?t=49807 rkiss and other dependencies in syzygy] by [[Don Dailey]], [[CCC]], October 23, 2013
 
==2015 ...==
 
==2015 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=56225 A simple PRNG using /dev/urandom] by [[Steven Edwards]], [[CCC]], May 04, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56328 Revised source for the random game generator] by [[Steven Edwards]], [[CCC]], May 12, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56328 Revised source for the random game generator] by [[Steven Edwards]], [[CCC]], May 12, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56364 Random playout vs evaluation] by [[Robert Pope]], [[CCC]], May 15, 2015
 
* [http://www.talkchess.com/forum/viewtopic.php?t=56364 Random playout vs evaluation] by [[Robert Pope]], [[CCC]], May 15, 2015
Line 117: Line 136:
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61315 Adding a random small number to the evaluation function] by [[Uri Blass]], [[CCC]], September 03, 2016
 
* [http://www.talkchess.com/forum/viewtopic.php?t=61315 Adding a random small number to the evaluation function] by [[Uri Blass]], [[CCC]], September 03, 2016
 
* [http://www.talkchess.com/forum/viewtopic.php?t=63803 random evaluation perturbation factor] by [[Stuart Cracraft]], [[CCC]], April 24, 2017
 
* [http://www.talkchess.com/forum/viewtopic.php?t=63803 random evaluation perturbation factor] by [[Stuart Cracraft]], [[CCC]], April 24, 2017
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=70050 xiphos 64 bit random number] by [[Pedro Castro]], [[CCC]], February 28, 2019 » [[Xiphos]]
 +
==2020 ...==
 +
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=74028 Rolling dice] by [[Harm Geert Muller]], [[CCC]], May 27, 2020 » [[Chess Engine Communication Protocol|CECP]], [[EinStein würfelt nicht!]]
  
 
=External Links=  
 
=External Links=  
Line 149: Line 171:
 
* [http://www.stat.tugraz.at/stadl/random.html Random Number Generation] by [[Mathematician#EStadlober|Ernst Stadlober]]
 
* [http://www.stat.tugraz.at/stadl/random.html Random Number Generation] by [[Mathematician#EStadlober|Ernst Stadlober]]
 
* [http://www.paulm.org/random.html Random Number Generators]
 
* [http://www.paulm.org/random.html Random Number Generators]
 +
* [https://en.wikipedia.org/wiki/Salsa20 Salsa20 from Wikipedia]
 
==Language Support==
 
==Language Support==
 
===[[Basic]]===
 
===[[Basic]]===
Line 199: Line 222:
 
==Misc==
 
==Misc==
 
* [[:Category:Van der Graaf Generator|Van der Graaf Generator]] - Theme One (1972),  [https://en.wikipedia.org/wiki/YouTube YouTube] Video
 
* [[:Category:Van der Graaf Generator|Van der Graaf Generator]] - Theme One (1972),  [https://en.wikipedia.org/wiki/YouTube YouTube] Video
: {{#evu:https://www.youtube.com/watch?v=rGHat7IeNaA|alignment=left|valignment=top}}
+
: {{#evu:https://www.youtube.com/watch?v=WWcJ7WeAK78|alignment=left|valignment=top}}
  
 
=References=  
 
=References=  

Latest revision as of 18:52, 30 June 2021

Home * Programming * Algorithms * Pseudorandom Number Generator

Dice players [1]

Pseudorandom Number Generator (PRNG),
an algorithmic gambling device for generating pseudorandom numbers, a deterministic sequence of numbers which appear to be random with the property of reproducibility. They are useful in simulation, sampling, computer programming, decision making, cryptography, aesthetics and recreation [2] - in computer chess, beside randomization of game playing, primarily used to generate keys for Zobrist hashing.

Games of chance, such as Backgammon and EinStein würfelt nicht! require PRNGs for rolling a dice. Chess and game playing programs use PRNGs to randomly choose one of several possible moves of a position from an opening book, or use random fluctuations in learning and automated tuning tasks. Game playing programs performing a Monte-Carlo Tree Search, use random playouts in their simulation phase. Don Beal and Martin C. Smith demonstrated that deeper search with random leaf values in chess yields to better play, with some interesting insights in minimax search and implications for designing and testing evaluation terms [3].

Methods

PRNGs maintain a state variable, a bitwise superset of the random number, initialized by a random seed - a constant for the same sequence each time, i.e. for Zobrist keys, otherwise, something like system time to produce varying pseudo randoms. Each call of the PRNG routine performs certain operations or bit-twiddling on that state, leaving the next pseudo random number. For various applications more or less important features are randomness, resolution, (uniform) distribution, and periodicity - topic of various randomness tests - and further performance, and portability.

Zobrist hashing with about 12*64 keys has less issues with randomness and period, but with distribution, and requires linear independence so that a small subset of all keys doesn't xor to zero. Despite selected hard-coded random constants used at compile time, many programs use an own PRNG based on recurrence relation in GF(2) such as Mersenne Twister or Xorshift.

LCG

A common method used in many library functions, such as C/C++ rand() is the linear congruential generator (LCG) based on multiply, add, modulo with integers, where some past implementations had serious shortcomings in the randomness, distribution and period of the sequence [4]. Due to such issues in rand() implementations, where lower bits are less random than higher bits, it is recommended not to use modulo X to reduce the integer range from RAND_MAX to X, but division by (RAND_MAX div X) [5] - or to use C++11's random number generation facilities to replace rand [6].

RKISS

Stockfish (since 2.0) uses an implementation by Heinz van Saanen based on Bob Jenkins' RKISS, a member of George Marsaglia's Xorshift familly.

RANROT B3

Amy by Thorsten Greiner [7] uses an implementation of Agner Fog's RANROT B3 [8], also recommended by Stefan Meyer-Kahlen as used in Shredder [9].

MT

Arasan 20.x switched to C++11 random number support using Mersenne Twister std::mt19937_64 [10] [11].

ChaCha

The Rust engine Asymptote uses the ChaCha stream cipher developed by Daniel J. Bernstein, built on a pseudorandom function based on add-rotate-xor (ARX) operations [12].

Applications

See also

Selected Publications

1950 ...

1960 ...

1970 ...

1980 ...

1990 ...

2000 ...

2010 ...

Forum Posts

1982 ...

1990 ...

Re: Hash tables - Clash!!! What happens next? by Jonathan Schaeffer, March 17, 1994

1995 ...

2000 ...

Re: random book moves/ random generator by Thorsten Greiner, CCC, January 13, 2000
Re: About random numbers and hashing by Sven Reichard, CCC, December 05, 2001

2005 ...

2010 ...

2015 ...

2020 ...

External Links

Randomness

Methods

Lehmer random number generator from Wikipedia
Park-Miller-Carta Pseudo-Random Number Generators
RANDU from Wikipedia
Mersenne Twister - Home Page

Language Support

Basic

C

C++

C#

D

Fortran

Go

Java

Lisp

Pascal

Python

Tests

Misc

References

  1. Dice players - Roman fresco from the Osteria della Via di Mercurio (VI 10,1.19, room b) in Pompeii, Source: Filippo Coarelli (ed.) (2002). Pompeji. Hirmer Verlag, Munich, ISBN: 3-7774-9530-1, p. 146, Wikimedia Commons, History of randomness from Wikipedia
  2. Donald Knuth (1997). The Art of Computer Programming (TAOCP) - Volume 2 - Seminumerical Algorithms. Chapter 3 – Random numbers
  3. Don Beal, Martin C. Smith (1994). Random Evaluations in Chess. Advances in Computer Chess 7
  4. "In the past, some implementations of rand() have had serious shortcomings in the randomness, distribution and period of the sequence produced (in one well-known example, the low-order bit simply alternated between 1 and 0 between calls) rand() is not recommended for serious random-number generation needs, like cryptography. It is recommended to use C++11's random number generation facilities to replace rand()." rand - cppreference.com
  5. Re: random book moves/ random generator by Thorsten Greiner, CCC, January 13, 2000
  6. Pseudo-random number generation - cppreference.com
  7. amy-0.8.7.tar.gz /src/random.c
  8. Agner Fog (2001). Chaotic Random Number Generators with Random Cycle Lengths. pdf
  9. Re: random book moves/ random generator by Stefan Meyer-Kahlen, CCC, January 13, 2000
  10. arasan-chess/movegen.h at master · jdart1/arasan-chess · GitHub
  11. mt19937_64 - C++ Reference
  12. rand::chacha::ChaChaRng - Rust
  13. Salsa20 from Wikipedia
  14. Mersenne twister from Wikipedia

Up one Level