Random Number Generator: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
→‎PCG family: Describe PCG
Copy Entropy from Nullplan's
Line 1: Line 1:
Random number generators (RNG) can be implemented in lots of different ways. This article explains some of them.
Random number generators (RNG) can be implemented in lots of different ways. This article explains some of them.


== Entropy ==
Computers are deterministic devices. If the program is the same and all inputs are the same, the same result will be calculated every time. How, then, can a computer generate random numbers? The computer cannot, but the physical world around it can. Many physical events are random to some degree, or more technically, have some degree of entropy. A sound recording will contain some level of noise even in the best shielded recording rooms on the planet. Humans type on keyboards with an inconsistent timing, and type quasi-random text like the article you are currently reading. Even other computers can provide entropy: while most network traffic is entirely machine generated, the exact relative timing of network packets in the end derives from the moment the power button was pressed, another human action. Therefore the timing and nature of input events can provide us with some entropy.


== Types of random number generators ==
== Types of random number generators ==