Here's a fun paradox: a computer is a machine built to do exactly what it's told, every single time. So how does it roll a random die or pick random lottery numbers? Strictly speaking, a deterministic machine can't invent randomness on its own — and yet the random draws we use every day work just fine.
The answer lies in one of the cleverest tricks in computing: the pseudo-random number generator.
PRNG: Randomness by Calculation
Most "random" numbers your computer produces are pseudo-random — the "pseudo" is right there in the name. They're actually the output of a math formula.
The recipe is surprisingly simple:
- Start with a seed — an initial value, often derived from the current time
- Feed the seed into an algorithm to produce a number
- Feed that result back in to produce the next one — repeat forever
Two properties define a PRNG:
| Property | What It Means |
|---|---|
| Deterministic | Same seed in → exact same sequence out, every time |
| Statistically random | The output shows no detectable pattern and is evenly distributed |
"Deterministic but random" sounds like a contradiction, but it isn't. The process is fully predictable if you know the seed — yet the output is statistically indistinguishable from true randomness. Modern PRNGs pass extensive batteries of statistical tests, which is why they're everywhere: games, simulations, shuffle buttons, and yes, dice apps.
Fun side effect: determinism is actually a feature sometimes. Game developers use fixed seeds to reproduce bugs, and Minecraft players share world seeds to generate identical maps.
TRNG: Harvesting Randomness from Nature
There's another approach: skip the math and measure something physically unpredictable. That's a True Random Number Generator (TRNG), also called hardware randomness.
Common sources include:
- Thermal noise in electronic circuits
- Radioactive decay timing
- Atmospheric noise (famously used by random.org)
- Human input timing — mouse jitter, keystroke intervals
No seed, no algorithm, no way to reproduce the sequence. This is randomness in the genuine, philosophical sense.
| PRNG | TRNG | |
|---|---|---|
| Source | Math algorithm | Physical measurement |
| Reproducible | Yes, with the seed | Never |
| Speed | Extremely fast | Comparatively slow |
| Hardware needed | None | Measurement device |
| Typical use | Games, simulations, draws | Cryptographic keys, security |
Why PRNG Is Plenty for Everyday Use
"Wait — if it's fake randomness, can I trust my dice app?" Yes. The right question isn't "is it truly random?" but "is it random enough for the job?"
✅ Everyday randomness (dice, draws, games)
What matters here is fair distribution and practical unpredictability. If each die face comes up equally often and nobody can guess the next roll, the job is done. Modern PRNGs clear that bar easily, and since the seed changes every run, users have no realistic way to predict outcomes.
🔒 Cryptographic randomness (passwords, keys, tokens)
Security is different, because the opponent is an attacker actively trying to reverse-engineer your next number. With some ordinary PRNGs, observing enough output can reveal the internal state — and then every future value is predictable. That's why cryptography uses CSPRNGs (cryptographically secure PRNGs): designed so that no amount of observed output lets you compute what comes next, typically seeded with hardware entropy.
Bottom line: draws and games → PRNG is the right tool; security → CSPRNG is non-negotiable. A lottery number generator running on a PRNG isn't cutting corners — it's using exactly the right tool.
The Big Misconception: "It's Due" (The Gambler's Fallacy)
No article about randomness is complete without this one.
- "The die hasn't rolled a six in five throws — a six is due."
- "These lottery numbers haven't appeared in ages — they're bound to come up."
Both are wrong, and the reason is simple: fair randomness has no memory. Every roll of a fair die is a fresh 1-in-6 chance for each face, completely unaffected by history. Those five six-less rolls already happened; they can't reach into the future and adjust probabilities.
The fallacy feels compelling because our intuition expects random results to "even out" quickly. In reality, genuine random sequences are full of streaks and clusters — the same number back to back, long droughts for another. That's not broken randomness; that's what randomness actually looks like. It's also why the same person losing a random draw twice in a row is completely normal, not evidence of rigging.
See It for Yourself
Theory is nice, but rolling is better. Try rolling a die a few dozen times and watch how often streaks appear — it's the fastest way to feel why "it's due" is an illusion.
Same goes for lottery numbers: instead of hunting for numbers that are "overdue," accept that every combination is equally likely and let a random generator do the picking.
👉 Try the Lotto Number Generator
Wrapping Up
Computer randomness is mostly calculated pseudo-randomness — and that's perfectly fine. A well-built PRNG is indistinguishable from true randomness for every everyday purpose, and when real security is at stake, CSPRNGs step in. Whatever generator you use, remember the golden rule: random numbers have no memory. The moment you feel like something is "due" is exactly the moment to trust the math instead of your gut.