Can Computers Generate True Random Numbers?
Fact

Computers can produce true random numbers.

Can a Computer Generate a Truly Random Numbers?

Computers can’t generate truly random numbers in the purest sense with software alone. However, computers can generate truly random numbers with the help of natural random events.

How a Computer Can Produce a Truly Random Number

Although one day this may change, computer software alone currently can only generate pseudo-random numbers based on programmed algorithms. Even though these algorithms can produce numbers that are as good as random for almost all purposes, they aren’t truly random.

To generate a truly random number, a computer has to use hardware to observe a natural random event (like atmospheric noise) and then create a random number from that data.

Some will argue this process isn’t “truly random,” but it is close enough to consider the idea that a computer can produce a truly random number a fact. It is just important that we understand the nuance. The nuance being that the computer is essentially borrowing the randomness from nature and then using a deterministic algorithm to create further randomization (which some would consider, “not truly random”).

TIP: This argument assumes that anything in the universe is actually random, and specifically that what a computer observes to create a Random Number Generator (RNG) is random. If the natural random event isn’t actually random, then the random number produced from it via an RNG isn’t truly random either.

A video discussing “what is random“?

FACT: Some argue that neither computers or humans can be random, and that both are deterministic machines. In both cases, the argument is that humans and computers lack the ability to be truly random due to their hard wiring and programming (a human, like a computer, can only draw from what it knows, and thus it is to an extent predictable). One can argue that nature isn’t deterministic at a quantum level however. And, this is why we measure random events like atomic decay to get random “seed” numbers.

Random Numbers Simplified

In it’s simplest form:

  • Random means unpredictable or determinable (non-deterministic).
  • Non-random means predictable or not determinable (deterministic).

Everything that computers or humans do is predictable to some extent, so neither can produce truly random numbers (they produce pseudo or “fake” random numbers instead). To get truly random numbers, we have to look to nature and hope nature doesn’t have a bias (the logic above assumes nature can be random).

Although we aren’t sure that anything in the universe is truly random, scientists agree that when it comes to fluctuations of the smallest particles (like the movement of quarks, radioactive decay, or atomic noise) randomness occurs. We can measure the randomness of tiny natural events and get a random “seed” number. But the second we apply a computer algorithm to the seed, or get too involved as humans, we all but remove the true randomness from the result.

Randomness is important in everything from the lottery to security software, but in a practical sense a pseudo random number, with a truly random seed, typically gets the job done (sometimes even better than a truly random number). From here the discussion on determinism and randomness gets more philosophical and technical.

Determinism and “Deterministic” Machines

Computers and humans are “deterministic“, meaning that their outputs are predetermined by some set of existing values and thus predictable to some extent.

If a Random Number Generator is deterministic, it implies that a generated sequence of numbers can be reproduced at a later date if the starting point in the sequence is known.[2]

Computers use code to run programs, and that means the outcome is programmed to some extent and determined by a set of starting values (the algorithm of the code). Humans, in a more philosophical sense, are the same way as our behavior is usually predictable. We can refer to anything that is deterministic as a deterministic machine.

FUN FACT: According to “the infinite monkey theorem”, given enough time, a monkey punching random letters on a keyboard would eventually type all of Shakespeare’s plays. Monkeys (like humans and computers) are “deterministic” and thus wouldn’t technically type truly random letters, but for the purpose of argument, one might say they could. If they were truly random, any given monkey might type Edward Albee’s plays instead.

Non-Deterministic Machines

Although a deterministic machine like a computer can’t produce a truly random number, non-deterministic machines can.

A non-deterministic machine can measure something that is thought to be truly random, like radioactive decay, and produce a random value based on that natural process. We don’t know if anything in the universe is, in fact, random, or to what extent the measuring process effects randomness. We think that machines (not computer software) can produce truly random numbers by measuring random natural occurrences on the atomic or quantum level (the smaller, the better).

A video on “True Random Number Generators“.

Hybrid Machines Aren’t Random Either

The problem with true random number generation comes when we consider the uses to which we plan to put the random numbers. Most of the time we want results to be unique or have some other property (we don’t want results to repeat, or we want numbers in a certain range), but truly random numbers have a rule set governing them. To get a very random, but still useful number, we have to use a deterministic pseudo random number generator that uses the non-deterministic machine’s value as a starting point or “seed”.

“True Random Number Generators” that “harvest” randomness from the environment for a random starting value still aren’t truly random in the purest sense as they still rely on computers and humans to process the starting value.[1][3]

If a human or computer builds the measurement tool and observes the measurement, it calls into question the role of the observer or the entity that measures the randomness of an event. Even if a human or computer isn’t involved in the process of getting a number, some argue that the random physical phenomenon of providing the “seed” may not be truly random. For instance, atomic noise may not be truly random. Although we have a heck of a time proving randomness as fact; It’s easier to prove non-randomness.

FACT: Minuscule things like quarks and photons change based on our observation, at least as far as we can tell with our tools of measurement. This makes it even harder to be sure that we have removed human determinism from the randomness of natural events.

Philosophical arguments aside, for practical purposes, the argument isn’t as much about the randomness of the physical phenomenon is it is about the processing of that phenomenon. As soon as a human or a computer is involved in the process the number necessarily loses its randomness.

FACT: Even when number generation is based on physical phenomena expected to be random, such as atmospheric noise, thermal noise, and other external electromagnetic and quantum phenomena, arguments can be made against it being truly “random”. Is anything truly random? Does observation affect results?[3]

Pseudo Random Numbers Versus Random Numbers

In simple terms, random numbers can’t be predicted, and pseudo-random numbers can be predicted by “backwards engineering”. (Backwards engineering = predicting a result by figuring out the algorithm used to create the result.)

  • Pseudo-random numbers are numbers that are essentially random but are generated using a computer algorithm. Since a human always programs an algorithm, it’s never truly random and resists backwards engineering.
  • Random numbers are numbers that are truly random and cannot be backwards engineered.

FACT: RNG stands for Random Number Generator, and PRNG stands for Pseudo-Random Number Generator. Typically, since all RNGs are PRNGs, RNG is used as an acronym for all random number generators.

A video describing the difference between Random and Pseudo-Random.

“Truly” Random Numbers and Computers

Some say a computer can never give a truly random result in the purest sense. Others (like Random.org) argue that HRNGs, (True Random Number Generators) have been alive and well since at least 1998.[2]

Basing Random Number Generators on Natural Unpredictable Processes

The key to what some claim as “true” computer-based random number generation is using physical phenomena like atmospheric noise, which is itself expected to be random, as a starting point and then compensating for possible biases in the measurement process.

Even though this method comes close to producing a truly random number (close enough to base lotteries and slot machines on it) to a purest, human and computer involvement in the process means the number isn’t truly random.

FACT: Random.org uses atmospheric noise for its RNG.

There is No Pure Computer Based True Random Number Generator

Today’s “true RNGs” come extremely close to producing truly random numbers, but the experts don’t agree that the results are truly random in the purest sense of the word. Also, they are only loosely computer based as the random values are obtained with hardware rather than software.



Conclusion

In the purest sense of the word computers can’t produce truly random numbers. However, computer can use an RNG based on something naturally random like atmospheric noise to create a number that is arguably truly random enough. The software creating the randomness is still deterministic, but the mix of using hardware and software and the natural unpredictable event together can create a number that is “truly random” enough for the idea that “a computer can generate a truly random number” to be accepted as fact.


References

  1. CAN A COMPUTER GENERATE A TRULY RANDOM NUMBER?“. Engineering.mit.edu. Retrieved Jan 7, 2016.
  2. Introduction to Randomness and Random Numbers“. Random.org. Retrieved Jan 7, 2016.
  3. Random number generation“. Wikipedia.org. Retrieved Jan 7, 2016.


"Computers Can Generate True Random Numbers" is tagged with: Bias, Probability and Odds, Quantum Mechanics, Randomness


Leave a Reply to John Cancel reply

Your Vote: {{ voteModel || 'no vote' | uppercase }}

John on
Supports this as a Fact.

“Neither computers or humans can be random, we are both deterministic machines.”

I would argue with you about that but I know you are not responsable for holding that belief.

caue rego on
Supports this as a Fact.

“Today’s “true RNGs” come extremely close to producing truly random numbers, but the experts don’t agree that the results are truly random in the purest sense of the word. Also, they are only loosely computer based as the random values are obtained with hardware rather than software.”

how is this even concluding it’s a myth?

computers don’t exist without hardware. it doesn’t matter if the practical randomness isn’t (yet) being generated by software (yes, ai will be able to do it), the computer is still generating a true random and unpredictable number for all practical purposes (such as cryptography).

as for being “truly random in the purest sense” is asking the wrong question. yes if the universe is completely deterministic, then everything in it is never purely random. but we have no reason to believe that’s the case, and if history is of any value we’ll probably never find such a reason. in our eyes, true randomness have always existed: it’s simply what we can’t predict, using whatever tools we have.

it doesn’t get any more pure than that.

Thomas DeMichele on

So in my opinion, and where the article was going, was more that “if for a computer to be random it has to watch a mouse, then the computer isn’t being random, the mouse is…. ish, because the mouse is also fundamentally deterministic… so there is that…” I But I see that you and Google disagree with me, so this is now a fact.

Congratulations skynet. 😉

Half joking. But really, sort of. Eh, I framed it as a fact and then explained the argument. We all know there are two schools of thought on this.

But we agree, current RNG algorithms are indeed pseudo random and not truly random. But yeah, also agree computers need hardware to exist and the hardware is the key to obtaining a random value.