Practical Applications and Uses: See Also References Further Reading External Links

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

21/6/2020 Random number generation - Wikipedia

See also
References
Further reading
External links

Practical applications and uses


Random number generators have applications in gambling, statistical sampling, computer
simulation, cryptography, completely randomized design, and other areas where producing an
unpredictable result is desirable. Generally, in applications having unpredictability as the
paramount, such as in security applications, hardware generators are generally preferred over
pseudo-random algorithms, where feasible.

Random number generators are very useful in developing Monte Carlo-method simulations, as
debugging is facilitated by the ability to run the same sequence of random numbers again by
starting from the same random 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.

The generation of pseudo-random numbers is an important and common task in computer


programming. While cryptography and certain numerical algorithms require a very high degree
of apparent randomness, many other operations only need a modest amount of unpredictability.
Some simple examples might be presenting a user with a "Random Quote of the Day", or
determining which way a computer-controlled adversary might move in a computer game.
Weaker forms of randomness are used in hash algorithms and in creating amortized searching
and sorting algorithms.

Some applications which appear at first sight to be suitable for randomization are in fact not
quite so simple. For instance, a system that "randomly" selects music tracks for a background
music system must only appear random, and may even have ways to control the selection of
music: a true random system would have no restriction on the same item appearing two or three
times in succession.

"True" vs. pseudo-random numbers


There are two principal methods used to generate random numbers. The first method measures
some physical phenomenon that is expected to be random and then compensates for possible
biases in the measurement process. Example sources include measuring atmospheric noise,
thermal noise, and other external electromagnetic and quantum phenomena. For example,
cosmic background radiation or radioactive decay as measured over short timescales represent
sources of natural entropy.

The speed at which entropy can be harvested from natural sources is dependent on the
underlying physical phenomena being measured. Thus, sources of naturally occurring "true"
entropy are said to be blocking – they are rate-limited until enough entropy is harvested to meet
the demand. On some Unix-like systems, including most Linux distributions, the pseudo device
file /dev/random will block until sufficient entropy is harvested from the environment.[1] Due to
this blocking behavior, large bulk reads from /dev/random, such as filling a hard disk drive with
random bits, can often be slow on systems that use this type of entropy source.

https://en.wikipedia.org/wiki/Random_number_generation 2/10

You might also like