


So - do you think now there is a tradeoff between quality of randomness and computation effort? Wrong! For example, a common implementation of the algorithm requires an array of 624 numbers. While this algorithm passes most of the Dieharder tests, the implementation has also grown in its complexity. In 1997, Makoto Matsumoto and Takuji Nishimura came up with a very good algorithm, the Mersenne Twister. Although the C64 algorithm was considered practically useful in a publication from Bowman, the Diehard test quickly shows a lot of deficiencies of the algorithm. The famous home computer Commodore 64 had a different algorithm for random number generation, which was simpler: The last seed is multiplied with a big number, a small number is added and the resulting number (given in a floating point format) is mixed up by switching bytes. This means a higher implementation effort, but the test passes most statistical tests on randomness, such as for example are given ba the Dieharder random test suite. For generating one number, the algorithm linearly combines several terms based on constants derived from the seed. Worse, once the seed becomes zero, the algorithm gets stuck.Ī few decades after Neumann, the programming language C came with a library function for generating random numbers using the functions rand (to pull a number) and srand (to set the seed). The algorithm is fast, but statistic tests on the generated random numbers show that the distribution of numbers significantly differs from true random numbers. Von Neumann's algorithm is simple: take a number as the "seed", square it, remove the middle digits of the resulting number (when viewed in decimal format) and take the remaining digits as your "random number". In 1946, John von Neumann suggested such an algorithm named the middle-square method. So, typically pseudo random number generators are used to generate number sequences similar to random ones. Typically, a computer operating on defined binary states that only change at particular clock instants has no true randomness - its operations are deterministic. Many computer programs, like for example games or Monte Carlo simulation require a random function. Actually, this aspect has a strong application in computers that has been around for a long time: random number generators. In the previous post, we learned that a complex system can exhibit deterministic, but unpredictable behavior.
