random number generation
-
What is a random number?
Random number generation is a process that arbitrarily produces one or more digits, and it can range from simple physical production to complex methods involving algorithms and software. A random sequence of numbers is uniform and independent, meaning a digit has an equal probability of occurring at each position in the sequence, and the outcome of generating a number has no bearing on past or future values.
There are two types of generators used today: true random number generation and pseudorandom number generation. True random number generation is based on a nondeterministic pattern produced by a physical source. Pseudorandom number generation uses an algorithm that produces a string of numbers from a predetermined sequence of digits.
Random number generation is used in cryptography, online security, experimental designs, simulations, sampling, and recreationally for gambling purposes.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
Why do people need random numbers?
Random numbers serve various essential functions across diverse fields. They are used in cryptography to generate encryption keys, which are vital for online security, and in two-factor authentication to provide one-time passwords. In academic research, random numbers are crucial for randomly sampling participants and assigning them to different experimental conditions. Statisticians utilize random numbers in simulations and sampling, such as Monte Carlo simulations, to model random processes. Additionally, random numbers are used in casino games and lotteries to ensure fairness.
3 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What is random number generation?
Random number generation is a process that produces arbitrary digits through methods ranging from rolling dice to complex algorithms. A random sequence is uniform, with each digit having an equal chance of occurring, and independent, where one number's generation doesn't affect others.
Modern technology employs two types of generators: true random number generators, which use unpredictable physical sources like radio static, and pseudorandom number generators, which rely on algorithms with predetermined sequences and inputs known as seeds.
Applications include cryptography, where random strings create encryption keys, and academic research, for sampling participants or assigning them to test conditions. Random numbers are also used in gaming for slot machines, dice, and lotteries.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How do computers create random numbers?
Computers generate random numbers using two main methods: true random number generation and pseudorandom number generation. True random number generation relies on unpredictable physical sources like radio static or radioactive decay. These sources produce non-deterministic patterns that are processed to create random digits.
Pseudorandom number generation uses algorithms to produce number sequences from predetermined digits. These algorithms use one or more inputs, called seeds, to determine the distribution of random digits. Because the sequence depends on the seed, the numbers are not truly random. For applications requiring unpredictability, pseudorandom number generation is often combined with true random number generation to randomly determine the seed.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What is the difference between true random numbers and pseudo-random numbers?
True random number generation uses a non-deterministic pattern from a physical source like radio static or radioactive decay to produce random digits. This unpredictable sequence is processed by a function.
Pseudorandom number generation, however, utilizes an algorithm that generates a string of numbers from a predetermined sequence using one or more inputs known as seeds. If the seed were known, the values could be predicted, which is why it is considered "pseudorandom." To achieve unpredictability, pseudorandom number generation is often combined with true random number generation to determine the seed randomly.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How are random numbers used in games, science, and security?
Random numbers are used diversely across games, science, and security.
In games, they introduce unpredictability through elements like dice rolls or card shuffling. In science, particularly in statistics and experimental design, random number generation helps researchers sample participants or assign them to different experimental conditions. Monte Carlo simulations rely on random values and repeated sampling to predict potential outcomes.
In online security and cryptography, random numbers are crucial. They generate encryption keys, which are random strings of bits that algorithms use to scramble and unscramble data. They also generate one-time passwords for two-factor authentication. True random number generation relies on unpredictable physical sources, while pseudorandom number generation uses algorithms with a seed value.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.
random number generation, process by which one or more digits are arbitrarily produced. Methods of random number generation can range from simple physical production, such as rolling dice, to complex methods involving algorithms and software. Although random numbers have been produced for thousands of years, modern technology has led to new, sophisticated ways of mass-producing them. Today, random number generation plays important roles in areas including cryptography and academic research, as well as recreation.
A random sequence of numbers is assumed to be both uniform, meaning a digit has an equal probability of occurring at each position in the sequence, and independent, meaning the outcome of generating a number has no bearing on past or future values. Although there is no way to unequivocally prove that a set of numbers is truly random, tests can check whether a sequence is nonrandom by detecting patterns. For example, the frequency test takes a sequence of zeros and ones and calculates whether the amount of the two numbers is roughly equal, while the runs test examines whether the total number of uninterrupted sequences of identical digits in a given set adheres to the expected number.
History
The first forms of random number generation can be traced to the earliest civilizations, as nearly every major civilization has had some form of generating random outcomes. Evidence of dice and their predecessors have been discovered around the world: 5,000-year-old dice have been found in Turkey, while others dating back 4,000 years have been uncovered in Egypt. Other forms of random number or outcome generation throughout history have included flipping coins, drawing cards, and picking balls from an urn.
While ancient devices were primarily used for fortune telling or gaming, random number generation became useful in modern times in mathematical and other scientific applications. The use of random numbers in statistics led to methods that could quickly produce long sequences of random digits. Initially, statisticians would consult lengthy tables of random digits that had been produced ahead of time. The first such resource, Random Sampling Numbers (1927) by British statistician L.H.C. Tippett, is a table composed of 41,600 digits taken from a 1925 census report. Other researchers followed suit in the following two decades, publishing tables of numbers created through methods such as picking digits from the results of logarithm tables up to 20 decimal places.
However, many of these early resources contained bias and disproportionate distributions of digits. British statisticians Maurice Kendall and Bernard Babington-Smith in 1938 proposed four tests (including the frequency test and a version of the runs test) to assess the uniformity and independence of a table of numbers and thus to determine whether it was truly random. The pair of statisticians also reportedly created the first table of random numbers using a machine: a rotating cardboard disk divided into 10 sections labeled with a single digit would be illuminated at random, and an observer would record the highlighted number.
The advent of computers in the 1940s heralded a revolution in random number generation. In 1947 the RAND Corporation created the first fully automated table of random digits using an electronic device that randomly emitted pulses, which were counted by a computer and punched into cards. (The table was published as a 400-page book, A Million Random Digits with 100,000 Normal Deviates [1955], with 50 lines of 50 digits per page.) Today, most random number generators involve some type of automation in their production process.
Types of random number generation
Two types of generators are used in modern times. The first, true random number generation, is based on a non-deterministic pattern produced by a physical source, such as radio static, voltage fluctuations from thermal motion in an electric circuit, or radioactive decay of an isotope. This unpredictable sequence is then processed and translated by a function to produce random digits.
The second method, pseudorandom number generation, uses an algorithm that produces a string of numbers from a predetermined sequence of digits. As a deterministic process, one or more inputs called seeds are used to determine which distribution of values the random digits are drawn from. The reliance on seeding is why the process is said to be “pseudorandom”; if the seed were known, the values could theoretically be predicted and would not be truly random. In cases where unpredictability is desired, pseudorandom number generation is typically combined with some form of true random number generation to randomly determine the seed.
Applications
Random number generation plays an important role in cryptography and online security. In encryption, the process is used to produce a random string of bits called the encryption key, which is processed by an algorithm to scramble and unscramble data. Another popular security-related application is two-factor authentication, where a randomly generated code is sent to the user as a one-time password.
In academic settings, random number generation is used in experimental designs to randomly sample participants from a population or randomly assign them to test conditions. Statisticians often employ random number generation in simulations and sampling. For example, Monte Carlo simulations rely on random values and repeated sampling to produce potential outcomes of random processes.
Recreationally, random number generation may be used for gambling purposes. Casino games often employ various types of random number generation, such as reels in slot machines or dice in craps. Historically, lotteries have relied on random number generation to produce winning values. In 1957 a machine called ERNIE (Electronic Random Number Indicator Equipment) famously began to be used to determine the winning values for the British Savings Bond Lottery.

" height="20" alt="HEW Logo">