Psychology Wiki

Random number generation

34,192pages on
this wiki



This article needs rewriting to enhance its relevance to psychologists..
Please help to improve this page yourself if you can..

It has been suggested that Random number generator be merged into this article or section. (Discuss)



Physical methods Edit

The earliest methods for generating random numbers - dice, coin flipping, roulette wheels are still used today, mainly in games and gambling as they tend to be too slow for applications in statistics and cryptography.

Some physical phenomena, such as thermal noise in zener diodes appear to be truly random and can be used as the basis for hardware random number generators. However, many mechanical phenomena feature asymmetries and systematic biases that make their outcomes not truly random. The many successful attempts to exploit such phenomena by gamblers, especially in roulette and blackjack are testimony to these effects.[1]

Completely randomized design falls within the category of true random number generation. The generation of true random numbers outside the computer environment is based on the theory of entropy[2]. Sources of entropy include nuclear decay and atmospheric conditions. HotBits uses radioactive decay, while uses radio noise to generate randomness.

Computational methods Edit

Pseudo-random number generators (PRNGs) are algorithms that can automatically create long runs (for example, millions of numbers long) with good random properties but eventually the sequence repeats exactly (or the memory usage grows without bound). One of the most common PRNG is the linear congruential generator which uses the recurrence

X_{n+1} = aX_n + b \pmod m

to generate numbers. The maximum number of numbers the formula can produce is the modulus, m.

A simple pen-and-paper method for generating random numbers is the so-called middle square method suggested by John Von Neumann. While simple to implement, its output is not guaranteed to be random.

A pen-and-paper method proven to generate truly random numbers exploits the fact that the decimal expansion of the reciprocal 1/q will produce a stream of random numbers of length q - 1 if q is such that q = 2S + 1 where S is a Sophie Germain prime, and both S and 2S + 1 are of the form 3, 9 or 11 mod 20. Thus “suitable” prime numbers q are 7, 23, 47, 59, 167, 179, etc (corresponding to S = 3, 11, 23, 29, 83, 89, etc.). The result is a stream of length q-1 digits (including leading zeros). So, for example, using q = 23 generates the random digits 0,4,3,4,7,8,2,6.....3,9,1,3

Practical applicationsEdit

Random number generators are very useful in developing Monte Carlo simulations as debugging is facilitated by the ability to run the same sequence of random numbers again by starting from the same seed. They are also used in cryptography so long as the seed is secret. Sender and receiver can generate the same set of numbers automatically to use as keys.



See also Edit


Around Wikia's network

Random Wiki