A breakdown of true randomness vs algorithmic randomness.
Click the button on a random number generator and a number pops out. It feels like pure chance. But a computer is a machine built to follow instructions exactly, the same way every time. So where does the surprise come from? The answer lies in the difference between true randomness vs pseudorandomness, and it’s stranger, and more interesting, than most people expect.
There are really two kinds of “random” at work in the world. One comes from nature. The other is a very convincing imitation.
The problem with asking a computer to be unpredictable
Computers are deterministic. Give one the same input and it will give you the same output, today, tomorrow and in ten years. That’s exactly what you want from a calculator, and exactly what you don’t want from a dice roll.
Mathematician John von Neumann summed up the tension in 1951: “Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.” He wasn’t saying it couldn’t be done. He was saying that, whatever you produce with a formula, it isn’t really random.
He used formulas anyway, because they were fast. That compromise is where pseudorandomness begins.
Pseudorandomness: chance by recipe
A pseudorandom number generator (PRNG, for short) is a recipe. You give it a starting number called a seed, it does some arithmetic, and out comes a new number. Feed that result back in, and you get another one. Repeat forever.
Von Neumann’s own early recipe, the “middle-square” method, was charmingly simple. Take a number, square it, and keep the middle digits as your next number. Start with 1234, square it to get 1522756, take the middle four digits, 5227, and go again.
The results look jumbled, but there’s a catch hiding in plain sight. Use the same seed and you get the exact same sequence, every single time. The numbers aren’t random at all. They’re just hard to guess if you don’t know the recipe and the seed.
Good imitations and bad ones
Not all recipes are equal. In the 1960s, a popular generator called RANDU shipped on IBM mainframes and was used in scientific research for years. It later turned out that if you plotted its numbers in groups of three as points in a cube, they all fell onto just 15 flat planes. Years of research had leaned on a hidden pattern.
Modern PRNGs are far better. The widely used Mersenne Twister, created in 1997, repeats only after a number of steps about 6,000 digits long. Yet it has a weakness too: watch 624 of its outputs in a row and you can work out every number it will ever produce.
For a simulation or a video game, that doesn’t matter. For anything where someone might want to cheat, it matters a great deal. So let’s look at the other kind of randomness.
True randomness: borrowing chaos from nature
A true random number generator (TRNG) doesn’t follow a recipe. It measures something in the physical world that nobody can predict, and turns that measurement into numbers.
Nature is full of good sources:
- Radioactive decay. Physics says the exact moment a single atom decays is fundamentally unpredictable, not just unknown.
- Atmospheric noise. RANDOM.ORG has been generating numbers from the crackle of radio static since 1998.
- Electronic noise. Tiny, jittery fluctuations in circuits, which many modern computer chips now sample directly.
- Light. Some quantum devices fire single photons at a half-silvered mirror and record which way each one goes.
And then there are the lava lamps. In the lobby of Cloudflare’s San Francisco office, a wall of around 100 lava lamps is filmed by a camera. The shifting blobs make every frame unrepeatable. Those images feed into the randomness that helps secure a sizeable slice of internet traffic. Cloudflare explains the setup in its LavaRand write-up.
Why not use true randomness for everything?
Physical sources are slow, and they can be biased in subtle ways. A sensor might drift as it warms up, or favour ones over zeros slightly. So raw measurements have to be cleaned up before they’re useful, and even then they can’t keep up with a computer that needs millions of random numbers a second.
That’s why the best real-world answer is a blend of both.
The hybrid that powers your browser
Your phone and laptop quietly collect unpredictable scraps all the time, like the precise timing of hardware events and electrical noise from the processor. The operating system pools this “entropy” together and uses it to seed a cryptographically secure pseudorandom generator.
That generator is still a recipe, but it’s a very special one. Even if an attacker saw billions of its outputs, they couldn’t work backwards to the seed or predict the next number. And because it keeps topping itself up with fresh entropy, there’s no long-term pattern to find.
This is what sits behind the Web Crypto API in your browser, and it’s what Randomfella’s tools use for every result. If you want the details of how one of those numbers turns into a spin, we cover it in Is this wheel actually random?.
When “random enough” wasn’t
The difference between true randomness vs pseudorandomness sounds academic until it goes wrong. A few famous examples:
- Press Your Luck (1984). Michael Larson taped the American game show at home and noticed the “random” prize board cycled through only five patterns. He memorised them, avoided the dreaded Whammy, and won over $110,000.
- Netscape (1995). Early versions of the browser seeded their encryption with the time of day and process numbers. Researchers showed the keys could be guessed in under a minute.
- Debian OpenSSL (2006–2008). A small code change accidentally stripped out most of the entropy. For two years, affected systems could only generate around 32,768 possible keys per key type.
In every case the numbers looked random. The trouble was that someone could predict them.
How do you test whether something is random?
Here’s the slightly unsettling truth: you can never prove a sequence is random. You can only fail to find patterns in it.
Testers throw statistical checks at a generator. Are ones and zeros equally common? Do certain pairs appear too often? Are there too many long runs, or suspiciously few? Suites like the US government’s NIST tests run dozens of these. A good generator passes them all, but passing just means no flaw was spotted, not that none exists.
You can try a simple version yourself. Our randomness audit runs thousands of draws in your browser and shows you how evenly they land.
So, how random is random?
It depends on the source. Nature gives us true randomness, unpredictable down to the laws of physics, but it’s slow and messy. Algorithms give us pseudorandomness, fast and tidy, but only as unpredictable as their seed and design.
The real answer to true randomness vs pseudorandomness is that modern systems don’t choose. They capture a little genuine chaos from the world, then stretch it with clever mathematics into a stream nobody can predict.
Fancy seeing it in action? Pick a range on the Randomfella random number generator and see what comes out. Nobody, not even us, knows what it’ll be.