A random number is a numerical value drawn from a specified statistical distribution . When a sequence of draws is required,
the draws are commonly taken to be independent .
Computer-generated random numbers are often called pseudorandom
numbers to distinguish deterministic algorithms
from unpredictable physical processes. When used without qualification, the word
"random" usually means "random with a uniform
distribution ." Other distributions are of course possible. For example,
the Box-Muller transformation allows
pairs of independent random numbers
with a uniform distribution on the unit
interval to be transformed to corresponding random numbers having a two-dimensional
normal distribution .
It is impossible to produce an arbitrarily long string of random digits and prove it is random. Strangely, it is also very difficult for humans to produce a string of random digits, and computer programs can be written which, on average, actually predict some of the digits humans will write down based on previous ones.
There are a number of common methods used for generating pseudorandom numbers , the simplest of which is the linear
congruence method . Another simple and elegant method is elementary
cellular automaton rule 30 , whose central column,
starting from a single 1 with all other cells 0, is given by 1, 1, 0, 1, 1, 1, 0,
0, 1, 1, 0, 0, 0, 1, ... (OEIS A051023 ), and
which underlies the Wolfram Language
method "Rule30CA" and integer generation in the "Legacy"
method. The default generator "ExtendedCA" instead uses a five-neighbor
cellular automaton . Most random number generators
require specification of an initial number used as the starting point, which is known
as a "seed ." The goodness of random numbers generated
by a given algorithm can be analyzed by examining its
noise sphere .
When generating random numbers over some specified boundary, it is often necessary to normalize the distributions so that each differential area is equally populated.
For example, picking
and from uniform distributions does
not give a uniform distribution for sphere
point picking .
To generate a power law probability density function
on an interval from a uniform
distribution , first suppose and is a real number other than
. The density is zero outside this interval , and is also allowed when . Then normalization gives
(1)
so
(2)
Let
be a random variate with a uniform
distribution on the unit interval . For , the distribution
function is
and the random variate given by
has probability density function .
For ,
normalization requires ,
and the corresponding random variate is
(8)
where
and
on .
See also Bays' Shuffle ,
Box-Muller Transformation ,
Cliff Random Number
Generator ,
Quasirandom Sequence ,
Random
Variable ,
Schrage's Algorithm ,
Stochastic ,
Uniform Distribution
Explore with Wolfram|Alpha
References Bassein, S. "A Sampler of Randomness." Amer. Math. Monthly 103 , 483-490, 1996. Bennett, D. J. Randomness.
Cambridge, MA: Harvard University Press, 1998. Bratley, P.; Fox, B. L.;
and Schrage, L. E. A
Guide to Simulation, 2nd ed. New York: Springer-Verlag, 1996. Dahlquist,
G. and Bjorck, A. Ch. 11 in Numerical
Methods. Englewood Cliffs, NJ: Prentice-Hall, 1974. Deak, I.
Random
Number Generators and Simulation. New York: State Mutual Book & Periodical
Service, 1990. Evans, M.; Hastings, N.; and Peacock, B. Statistical
Distributions, 3rd ed. New York: Wiley, p. 5, 2000. Forsythe,
G. E.; Malcolm, M. A.; and Moler, C. B. Ch. 10 in Computer
Methods for Mathematical Computations. Englewood Cliffs, NJ: Prentice-Hall,
1977. Gardner, M. "Random Numbers." Ch. 13 in Mathematical
Carnival: A New Round-Up of Tantalizers and Puzzles from Scientific American.
New York: Vintage, pp. 161-172, 1977. James, F. "A Review of
Pseudorandom Number Generators." Computer Physics Comm. 60 , 329-344,
1990. Kac, M. "What Is Random?" Amer. Sci. 71 ,
405-406, 1983. Kenney, J. F. and Keeping, E. S. Mathematics
of Statistics, Pt. 2, 2nd ed. Princeton, NJ: Van Nostrand, pp. 151-154,
1951. Kenney, J. F. and Keeping, E. S. Mathematics of Statistics,
Pt. 1, 3rd ed. Princeton, NJ: Van Nostrand, pp. 200-201 and 205-207,
1962. Knuth, D. E. Ch. 3 in The
Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed.
Reading, MA: Addison-Wesley, 1998. Marsaglia, G. "A Current View
of Random Number Generators." In Computer
Science and Statistics: Proceedings of the Symposium on the Interface, 16th, Atlanta,
Georgia, March 1984 (Ed. L. Billard). New York: Elsevier, 1985. Marsaglia,
G. "DIEHARD: A Battery of Tests for Random Number Generators." https://ani.stat.fsu.edu/diehard/ . Mascagni,
M. "Random Numbers on the Web." http://archive.ncsa.uiuc.edu/Apps/CMP/RNG/mascagni/www-rng.html . Niederreiter,
H. Random
Number Generation and Quasi-Monte Carlo Methods. Philadelphia, PA: SIAM,
1992. Nijenhuis, A. and Wilf, H. Combinatorial
Algorithms for Computers and Calculators, 2nd ed. New York: Academic Press,
1978. Numberphile. "Random Numbers." Apr. 10, 2013. https://www.youtube.com/watch?v=SxP30euw3-0 . Park,
S. and Miller, K. "Random Number Generators: Good Ones are Hard to Find."
Comm. ACM 31 , 1192-1201, 1988. Peterson, I. The
Jungles of Randomness: A Mathematical Safari. New York: Wiley, 1997. Pickover,
C. A. "Computers, Randomness, Mind, and Infinity." Ch. 31 in
Keys
to Infinity. New York: Wiley, pp. 233-247, 1995. Press,
W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T.
"Random Numbers." Ch. 7 in Numerical
Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England:
Cambridge University Press, pp. 266-306, 1992. Schrage, L. "A
More Portable Fortran Random Number Generator." ACM Trans. Math. Software 5 ,
132-138, 1979. Schroeder, M. "Random Number Generators." In
Number
Theory in Science and Communication, with Applications in Cryptography, Physics,
Digital Information, Computing and Self-Similarity, 3rd ed. New York: Springer-Verlag,
pp. 289-295, 1990. Sloane, N. J. A. Sequence A051023
in "The On-Line Encyclopedia of Integer Sequences." Weisstein,
E. W. "Books about Randomness." http://www.ericweisstein.com/encyclopedias/books/Randomness.html . Wilf,
H. S. Combinatorial
Algorithms: An Update. Philadelphia, PA: SIAM, 1989. Wolfram
Research. "Random Number Generation." Wolfram Language Documentation. https://reference.wolfram.com/language/tutorial/RandomNumberGeneration.html . Referenced
on Wolfram|Alpha Random Number
Cite this as:
Weisstein, Eric W. "Random Number." From
MathWorld --A Wolfram Resource. https://mathworld.wolfram.com/RandomNumber.html
Subject classifications