Although hardware based “true” random number generators are available, software-based pseudo-random number generators still remain the predominant method for generating random numbers in use today. Why do developers continue to rely on pseudo-random number generators?

  • $\begingroup$ "software-based pseudo-random number generators still remain the predominant method for generating random numbers in use today". This is a very broad claim. Do you care to support your claim with some facts and statistics in the question? $\endgroup$ – John L. Dec 9 '18 at 15:47

Pseudo-random number generators and "true" random number generators serve different purposes, though there are some areas where they can overlap.

Pseudo-random number generators are useful when you need a large sequence of bits that appear to be uniformly distributed (or sometimes distributed other ways) that can be deterministically generated. "Unpredictability" is usually unimportant in these applications. In fact, it's often useful to use quasi-random number generators which are even more predictable. Being deterministic is often a valuable, if not critical, benefit. It means that you can easily repeat a specific sequence which is good for debugging and replication among other things. For example, if I want to replicate a database query that involves (pseudo-)"random" numbers, I can just ship a seed to the replicas and they can replay the transaction rather than requiring that I ship the entire sequence of numbers generated. It's also nice that pseudo-random number generators don't require any special hardware or anything at all beyond the ability to compute.

"True" random number generators are used when you need unpredictability, usually in an adversarial (and particularly security) context. You need some "secret" that you know that no one else knows even if they know everything about how you think and could predict anything you could do if they knew what you were observing.1 Producing entropy is time-consuming though. Most of the time, if a large number of "random" bits are needed, a source of entropy will be stretched using cryptographic pseudo-random number generators. Even doing this, hardware instructions take on the order of hundreds of cycles and are usually slower than optimized (non-cryptographic) pseudo-random number generators. If you don't need bits that are unpredictable by an adversary, there is usually little reason to use "true" random numbers.

1 Bits of "true randomness" are powerful things. Being able to "flip a coin" provides solutions to problems that are otherwise unsolvable.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.