Where can I get an algorithm for an efficient random number generator?
A1. Pierre L’Ecuyer: Efficient and Portable Combined Random Number Generators, Communications of the ACM, vol. 31, no. 6, pp. 742-749. The RNG has a period of approximately 2.3E+18. Generating 1 000 000 numbers per second, that means that it would take over 73 000 years before it repeated a sequence. A2.Look in the PMOS library. This one uses the ‘Minimal standard random number generator’ described by Park & Miller, CACM 31,10,Oct 88 p1192. The code has been checked for the 10001st random as specified in Park & Miller p1195. One site is: ftp://ftp.psg.com/pub/modula-2/code/random/ A3. A pseudo random generator using the subtractive method taken from Knuth, Seminumerical Algorithms, 3.2.2 and 3.6, belongs to Ulm’s Modula-2 System that is distributed under the terms of the GPL (and in case of the library under the terms of the LGPL). More informations may be found at http://www.mathematik.uni-ulm.de/modula/ and http://www.mathematik.uni-ulm.de/modula/man/man3/RandomGenerator.
A1. Pierre L’Ecuyer: Efficient and Portable Combined Random Number Generators, Communications of the ACM, vol. 31, no. 6, pp. 742-749. The RNG has a period of approximately 2.3E+18. Generating 1 000 000 numbers per second, that means that it would take over 73 000 years before it repeated a sequence. A2.Look in the PMOS library. This one uses the ‘Minimal standard random number generator’ described by Park & Miller, CACM 31,10,Oct 88 p1192. The code has been checked for the 10001st random as specified in Park & Miller p1195. One site is: ftp://ftp.psg.com/pub/modula-2/code/random/ A3. A pseudo random generator using the subtractive method taken from Knuth, Seminumerical Algorithms, 3.2.2 and 3.6, belongs to Ulm’s Modula-2 System that is distributed under the terms of the GPL (and in case of the library under the terms of the LGPL).