Random numbers come in two fundamentally different types: pseudo‑random numbers, which are generated by deterministic algorithms, and true random numbers, which come from unpredictable physical processes. The core distinction is predictability: pseudo‑random numbers look random but are reproducible; true random numbers are random because their source is inherently unpredictable.
Definition
A random number is a value chosen from a set of numbers where every number has the exact same chance of being picked. You cannot guess the number before it appears because it does not follow a pattern. A random number is generated by a random (stochastic) process such as throwing dice. Individual numbers cannot be predicted, but the likely result of generating a large quantity of numbers can be predicted by specific mathematical series and statistics. [1]
Pseudorandom numbers are defined as numbers generated by a deterministic algorithm that, while they may appear random, are not genuinely random because they can be reproduced and are produced from a defined process. A pseudorandom sequence of numbers is one that appears to be statistically random, despite having been produced by a completely deterministic and repeatable process. Pseudorandom number generators are often used in computer programming, as traditional sources of randomness available to humans (such as rolling dice) rely on physical processes not readily available to computer programs, although developments in hardware random number generator technology have challenged this. [2]
Who & What
Random numbers can be used for playfulness and precision, and many other pursuits. In board games, dice rolls or number generators are used to introduce chance, strategy, and excitement, embracing unpredictability as part of the fun. In professional pursuits, individuals turn to randomness for tasks like statistical sampling, cryptography, simulations, or quality testing, where unbiased results and variability are essential. Whether at the game table or on the job, controlled randomness can shape outcomes and reveal patterns.
- Casino and Lottery Operators: Use certified random numbers to pick fair lottery winners, run fair digital slot machines, and card shuffling that provides sufficiently random for fairness.
- Cryptographers: Use true random number generators to make secure digital keys that keep private data safe online.
- Science & Statistics:
- Used for testing ideas and running math simulations.
- Use random numbers to pick random samples from a large group for surveys and scientific polls.
- Random sampling to estimate probabilities. (Monte Carlo simulations)
- Random resampling for statistical confidence intervals. (Bootstrapping)
- Video Game Programmers: Use random numbers to place loot drops, spawn enemies, random decisions for non-player characters (NPCs), and create random maps so every game feels new.
- Program Testing and Debugging: Used to test a program with a wide variety of input data.
- Simulation: Used to simulate events that are not totally predictable, e.g.,
- the outcome of a coin flip or roll of a die.
- arrivals of customers for a service:
- to help decide how many tellers a bank should have on duty at different times of day.
- to help decide when to switch workers from one kind of service to another.
- to understand and improve computer network services based on ‘typical’ usage patterns.
- Games: Used to provide a unique situation each time a game is played.
- Dice rolls: Random 1–6
- Card shuffle: Random order for 52 cards
“A good random number generator is useful in these situations and can provide statistically reliable results.” [3]
Dice

Dice appear in an impressive range of games because they offer a quick, tactile way to introduce chance, tension, and surprise. In classic board games like Monopoly or Risk, dice determine movement or combat outcomes, keeping play unpredictable. Role‑playing games such as Dungeons & Dragons rely on many types of dice to resolve actions, shaping the story through probability. Even simple party and gambling games—from Yahtzee to craps—use dice as the central mechanic, turning random rolls into strategy, excitement, and sometimes high stakes.
D&D Dice
A standard D&D dice set contains seven polyhedral dice: D4, D6, D8, D10, D12, D20, and a percentile die (D100). Each die has a specific role in the game, from rolling attacks to dealing damage to generating characters. [4]
The D20 — The Star of D&D
The twenty-sided die is the most important die in D&D. You roll it for attack rolls (to see if you hit an enemy), ability checks (climbing a wall, picking a lock, persuading a guard), and saving throws (dodging a fireball, resisting a charm spell).
The D12 — The Barbarian’s Best Friend
The twelve-sided die is used less frequently than other dice but has important roles. It’s the Hit Die for barbarians and the damage die for greataxes (1d12). The D12 represents the upper range of single-die damage in D&D.
The D10 and D100 — Percentile Dice
The ten-sided die (D10) is used for certain weapon damage and class features. A pair of D10s can create a D100 (percentile dice): one die represents tens (00-90) and the other units (0-9). The D100 is used for random tables. Rolling 00 and 0 equals 100, not 0.
The D8 — Versatile and Common
The eight-sided die is one of the most frequently rolled damage dice.
The D6 — The Universal Die
The six-sided die is the most familiar and the most rolled die in D&D.
The D4 — Small but Mighty
The four-sided die (tetrahedron) represents the smallest damage dice. The D4 is also infamous for being painful to step on due to its pyramid shape.
6-Sided Die
A six‑sided die is a beautifully simple engine of randomness. Each face has an equal chance of landing upward, so every roll is an independent event with no memory of what came before. That symmetry makes the d6 feel fair and intuitive yet the outcome is completely unpredictable once it leaves your fingers. Its small number of outcomes also makes patterns tempting to imagine—“I’m due for a six”—but mathematically, every roll is as fresh and uncertain as the last.
Card Deck
A shuffled deck of 52 cards is one of the most surprisingly rich sources of randomness in everyday life. The number of possible arrangements is 52!, which is about different orders—so many that if every person on Earth shuffled a deck every second for the age of the universe, they still wouldn’t come close to repeating them all. A good riffle shuffle produces a sequence that is effectively unpredictable, giving card games their tension and fairness. Because each card is unique, every shuffle creates a distinct pattern of possibilities, making the deck a compact, elegant generator of randomness.
Why
Random numbers are useful for a variety of purposes, such as generating data encryption keys, simulating and modeling complex phenomena and for selecting random samples from larger data sets. They have also been used aesthetically, for example in literature and music, and are of course ever popular for games and gambling. When discussing single numbers, a random number is one that is drawn from a set of possible values, each of which is equally probable, i.e., a uniform distribution. When discussing a sequence of random numbers, each number drawn must be statistically independent of the others.
With the advent of computers, programmers recognized the need for a means of introducing randomness into a computer program. However, surprising as it may seem, it is difficult to get a computer to do something by chance. A computer follows its instructions blindly and is therefore completely predictable. (A computer that doesn’t follow its instructions in this manner is broken.) There are two main approaches to generating random numbers using a computer: Pseudo-Random Number Generators (PRNGs) and True Random Number Generators (TRNGs). The approaches have quite different characteristics and each has its pros and cons. [5]
A value in a set of numbers that has an equal probability of being selected from the total population of possibilities and, in that sense, is unpredictable. A random number is an instance of an unbiased random variable, that is, the output produced by a uniformly distributed random process. Random numbers may, e.g., be obtained by converting suitable stings of random bits. [6]
The Need for Random Numbers
Randomness can be quite useful for a computer program. If you were playing a game, for example, you probably wouldn’t want it to be exactly the same every time, so you could use random numbers for things like starting position, speed and angle. You might want to simulate a die roll or a coin toss, or you might want to quickly generate lots of data to test your program. You can even use random numbers and the Monte Carlo method to do things like calculate the value of pi.
Computers aren’t very good at generating random numbers, because they can only do things if you tell them exactly how to do it with a program or algorithm. They do their best by using things that change, such as the system time, to help them make the numbers different every time, but they’re never truly random. That’s why you often see random numbers generated by computers described as pseudorandom (pseudo means false or mock). [7]
See Theoretical Knowledge Vs Practical Application.
How
True Random Number Generator (TRNG)
Here is a single, cohesive version that blends the ideas smoothly while keeping all the important points:
Truly random numbers require tapping into unpredictable physical phenomena rather than relying on algorithms. Computers must draw on external variables—such as the radioactive decay of isotopes, airwave static, or other quantum‑level behaviors—to obtain genuine randomness. At the subatomic scale, particles behave unpredictably, making quantum processes ideal sources for true random number generation. More broadly, physical and real‑world processes like radioactive decay or even the outcomes of a fair roulette wheel produce randomness in the strictest sense. One could even argue, under the efficient market hypothesis, that asset prices contain genuine randomness: despite understanding underlying principles, the exact outcome remains fundamentally unpredictable. [8][9]
TRNGs rely on physical entropy sources, such as:
- Thermal noise
- Radioactive decay
- Quantum effects
- Atmospheric noise
TRNGs produce numbers that cannot be predicted, even in principle.
Pseudo Random Number Generator (PRNG)
Random numbers generated by computers are not truly random, because computers operate deterministically. Genuine randomness typically requires measuring unpredictable physical phenomena, such as background radiation. In contrast, software‑generated random numbers come from algorithms, so they are called pseudorandom numbers. Although this might seem like a limitation, high‑quality pseudorandom number generators (PRNGs) offer important advantages: their output can be reproduced for controlled, replicable experiments, and their behavior can be tailored to produce specific probability distributions.
A PRNG is an algorithm that starts from an initial value called a seed and produces a sequence of numbers that mimic true randomness. Because the process is deterministic, the sequence can be reproduced exactly if the seed is known—useful for debugging and experimentation, but also a reminder that pseudorandom numbers are not secure when predictability matters. If you have ever used random numbers in code, you were using a PRNG; if you didn’t set a seed explicitly, the system chose a default one.
PRNGs are widely available in software libraries and are essential for simulations, statistical experiments, Monte Carlo methods, probabilistic algorithms, computer games, cryptography, and even gambling machines. Typically, a basic uniform PRNG produces numbers that imitate independent samples from the uniform distribution on . Random variables from other distributions—normal, chi-square, exponential, Poisson, and many more—are then obtained by applying mathematical transformations to these uniform values. While computers cannot generate true randomness on their own, well‑designed PRNGs provide high‑quality pseudorandom sequences suitable for most practical applications, and understanding how they work helps us know when they are sufficient and when true randomness is required. [8][9][10][11]
Generating high‑quality random numbers is inherently challenging. Pseudorandom number generators (PRNGs), though sufficient for most everyday applications, rely on deterministic algorithms and therefore cannot produce truly random values. This limitation becomes significant in contexts such as cryptography and gaming, where unpredictability is essential. Truly random numbers, derived from physical processes, are more reliable but can be costly to produce and may degrade in quality over time. To improve randomness and strengthen security, systems often combine multiple sources—such as pairing true random number generators (TRNGs) with PRNGs or using ensembles of algorithms within a cipher suite—to create more robust and effective random number generation. [8][12]
“Random Number Generator.” Calculator.net. Accessed August 16, 2026. https://www.calculator.net/random-number-generator.html.
“Random Number Generator.” CalculatorSoup. Accessed August 17, 2026. https://www.calculatorsoup.com/calculators/statistics/random-number-generator.php.
Application
Different applications require different kinds of randomness.
| Use Case | Best Choice | Why |
|---|---|---|
| Simulations, games, Monte Carlo | PRNG | Fast, reproducible, statistically random enough |
| Cryptographic keys, tokens, secure protocols | TRNG or CSPRNG | Predictability is a vulnerability |
| Seeding secure PRNGs | TRNG | Ensures initial unpredictability |
| Lotteries, fairness systems | TRNG | Must avoid deterministic bias |
CSPRNG: Cryptographically Secure PseudoRandom Number Generator
A CSPRNG is a special random number generator designed for security. It produces number streams that look truly random and stay completely unpredictable, even if an attacker sees past outputs or learns the internal state
Many of the References and Additional Reading websites and Videos will assist you with understanding and applying random numbers.
As some professors say: “It is intuitively obvious to even the most casual observer.“
References
[1] “Random Number.” Wikipedia, May 12, 2026. https://en.wikipedia.org/wiki/Random_number.
[2] “Pseudorandomness.” Wikipedia, November 21, 2025. https://en.wikipedia.org/wiki/Pseudorandomness.
[3] Zoski, Paul, Jeffrey L. Popyack, Kurt Schmidt, Jeremy R. Johnson and Richard Ratmansky. “Random Number Generators.” School of Computer and Information Sciences, Drexel University, 2009. https://www.cs.drexel.edu/~popyack/Courses/DUCA/2009/CSharp/lectures/08.4_random/2UsingRNG.html?CurrentSlide=1.
[4] “Complete Guide to D&D Dice.” Roll My Dice. n.d. Accessed August 17, 2026. https://www.rollmydice.app/guides/complete-guide-dnd-dice.
[5] Haahr, Mads. “RANDOM.ORG – Introduction to Randomness and Random Numbers.” RANDOM.ORG, Accessed August 16, 2026. https://www.random.org/randomness/.
[6] CSRC. “Random Number – Glossary.” NIST. Accessed August 16, 2026. NIST SP 800-90A Rev. 1. https://csrc.nist.gov/glossary/term/random_number.
[7] Virnuls, Andrew. “Mathematics: Random Numbers.” Computing in a Nutshell. Accessed August 16, 2026. https://www.advanced-ict.info/interactive/random.html.
[8] DeGarmo, Rylie. “True Random vs. Pseudorandom Number Generation.” wolfSSL, July 13, 2021. https://www.wolfssl.com/true-random-vs-pseudorandom-number-generation/.
[9] “Generating Random Numbers.” ScienceDirect, 2011. https://www.sciencedirect.com/science/chapter/monograph/abs/pii/B9780123756626000067.
[10] Huynh, Duy. “How Computers Generate Random Numbers.” Level Up Coding, November 18, 2024. https://levelup.gitconnected.com/how-computers-generate-random-numbers-086f1d0ca05b.
[11] Clement, Riley. “What Is a Pseudorandom Number Generator?” Gurobi Help Center. Accessed August 17, 2026. https://support.gurobi.com/hc/en-us/articles/26988754022545-What-is-a-pseudorandom-number-generator.
[12] Team, Twingate. “What Is a Random Number Generator? Types & Importance.” Twingate, April 18, 2024. https://www.twingate.com/blog/glossary/random-number-generator.
Additional Reading
Allabadi, Yazeed. “What Makes a Good Cryptographic Random Number Generator?” Jordan Open Source Association, July 14, 2025. https://josa.ngo/blog/271.
Bhamra, Arjun. “Randomness and Pseudorandom Number Generators.” Georgia Institute of Technology, November 7, 2023. https://mccuan.math.gatech.edu/courses/3215/PNRGArjunBhamra.pdf.
Bwhiz. “Monte Carlo Method: How Random Numbers Solve Complex Problems.” Medium, January 2, 2025. https://medium.com/@Bwhiz/monte-carlo-method-how-random-numbers-solve-complex-problems-b7b2bff14e5e.
Calzivo Team. “Random Number Generator Guide: What It Is and How It Works.” Calzivo, n.d. Accessed August 17, 2026. https://calzivo.com/guides/random-number-generator-guide.
[ ℰ ] Haahr, Mads. “RANDOM.ORG – True Random Number Service.” RANDOM.ORG, Accessed August 17, 2026. https://www.random.org/.
Ishikiriyama, Shizuka. “Difference between Pseudorandom Number Generators and True Random Number Generators.” wolfSSL, June 13, 2024. https://www.wolfssl.com/difference_between_pseudorandom_number_generators_and_true_random_number_generators/.
Komura, Go. “Pseudo-Random vs. True Random Numbers – How Do You Actually Tell Them Apart?” KomuraSoft LLC, April 17, 2026. https://comcomponent.com/en/blog/2026/04/17/000-pseudo-random-vs-true-random-how-to-distinguish/.
“Math Review of Random Numbers.” School Tutoring, July 7, 2014. https://schooltutoring.com/help/math-review-of-random-numbers/.
Prado, Sergio. “What Are Random Numbers and How They Are Managed on Linux?” Embedded Labworks, February 20, 2024. https://sergioprado.blog/what-are-random-numbers-and-how-they-are-managed-on-linux/.
“Pseudorandom Number Generator.” Wikipedia, July 25, 2026. https://en.wikipedia.org/wiki/Pseudorandom_number_generator.
“Random Number — Definition, Formula & Examples.” Mathwords, Accessed August 17, 2026. https://www.mathwords.com/r/random_number.htm.
“Random Number Generation.” Wikipedia, July 24, 2026. https://en.wikipedia.org/wiki/Random_number_generation.
“Random Number Generation: True Random vs Pseudo-Random Explained (2026).” Hakaru, March 28, 2026. https://hakaru.io/guides/random-number-guide.
⭐ Saeed, Amjad. “Random Number: The Complete Guide to Understanding Randomness and Probability.” Medium, February 6, 2026. https://medium.com/@meetamjadsaeed/random-number-the-complete-guide-to-understanding-randomness-and-probability-cb15efcc7c03.
Samadov, Ismat. “Understanding Randomness, Entropy, and Random Number Generators: From Pseudo-RNGs to True RNGs.” Medium, October 25, 2024. https://ismatsamadov.medium.com/understanding-randomness-entropy-and-random-number-generators-from-pseudo-rngs-to-true-rngs-dddadaf5f21e.
“Table of Random Numbers – MathBitsNotebook.” MathBitsNotebook, Accessed August 16, 2026. https://mathbitsnotebook.com/Algebra2/Statistics/STrandomtable.html.
Tinsley, Felix. “Random Number Generators and Their Applications.” Medium, April 6, 2023. https://medium.com/@randomisergen/random-number-generators-and-their-applications-acafd36aea2e.
[ ℰ ] “True vs Pseudo-Randomness: When to Use Each and Why It Matters.” FormulaForge. Accessed August 17, 2026. https://www.formulaforge.org/math/true-vs-pseudo-randomness#google_vignette.
Weisstein, Eric. “Random Number.” Michigan State University, May 5, 1996. https://archive.lib.msu.edu/crcmath/math/math/r/r073.htm.
Weisstein, Eric W. “Random Number — from Wolfram MathWorld.” Wolfram MathWorld. Accessed August 16, 2026. https://mathworld.wolfram.com/RandomNumber.html.
“What Does Random Mean in Math? A Kid-Friendly Definition.” Mathnasium. Accessed August 16, 2026. https://www.mathnasium.com/math-terms/random.
Videos
“We avoid this problem by ignoring it” is one of many math quotes I see online often. I looked into this one and found it in a 1975 book by Ian Stewart called Concepts of Modern Mathematics. Today we dive into this quote, why it was written, and confront the problem that was avoided 50 years ago, which will take us into pseudo-random number generation (PRNG) and linear congruential generators (LCG).
Art of the Problem explores the distinction between true randomness derived from physical noise and algorithmic pseudo-randomness. The discussion highlights the history of simulating randomness for computing, focusing on the security implications of seed size and computational limits.
There is nothing truly random when it comes to computers. Computers do what they are told to do. In this video, we cover all about random numbers, pseudo-random numbers, and random number generators. After watching this video, you will be able to answer the below questions:
What are random numbers?
What are random number generators?
What are pseudo-random numbers?
How do random number generators work?
What is the initial seed?
Why is it important to pick a good initial seed?
Your security relies on randomness! Yes, when you’re scrolling TikTok or surfing the web, your security depends completely on randomization, and computers are set in their ways! These machines can’t actually make a fully random number. In your computer, there are bits that switch on and off. When we create a key to unlock and lock data, it’s generated based on a number of bits.
With just one bit, you can only create two keys. Today, making keys to encrypt and decrypt depend solely on how the key was generated using random data. Single bit isn’t enough as someone could easily guess if it’s on or off.
So we add more bits, which results in more possible keys. But, our computers don’t know which bits to switch when generating a key pair. You have to gather data from unpredictable sources, which are a bit scarce in a computer.
You could use the time of day, its network, the computer’s details, IDs, and serial numbers. This data can be used to generate a bunch of nearly random bits that can then be used to make a key pair for locking and unlocking your data or encrypting and decrypting it. But here’s the problem: much of this data is predictable.
Intruders can figure out how a key was made based on your system, for instance, and reproduce your key, allowing them to access data. So, we truly need a method that’s burglar-proof, something impossible to reproduce. That’s where randomness comes in.
A good way to create truly random data is Cloudflare’s unique wall of lava lamps. They shine a camera on it, and that camera snaps photos to gather plenty of random bits. That randomness can then be used to create secret key pairs to lock and unlock data.
Even with a randomness generator using a wall of lava lamps at Cloudflare, it’s possible to be hacked. To reduce this risk, you need many different sources of random data. Even then, you need to keep an eye out for possible threats.
Potential attacks can come from someone attempting to reproduce the picture Cloudflare is capturing, turning off the power to the wall of lamps, obscuring the camera with bright light or the lens cap, or physically altering the camera. Ultimately securing a source of randomness, like a wall of lava lamps, is only half the battle. You need multiple sources of random data.
Your computer, your phone, or a server can never be truly random and so we call them pseudo random. they can gather data that looks random but is actually reproducible. This pseudo randomness is used to create key pairs. The more random it is, the more secure you are because that means that your key can’t be copied.
Therefore, you can obtain randomness with multiple solutions. Observing the real world, as Cloudflare did with their lava lamps, can provide true randomness but pseudo randomness comes from your computer. Pseudo randomness is not sufficient for security with today’s computational power.
We need physical measurements of true randomness for real security.
[ ℰ ] This exceptional reference is highly recommended for your consideration.
⭐ I suggest that you read the entire reference. Other references can be read in their entirety but I leave that up to you.
The featured image on this page is from the WallpaperBat website.
