1.2 KiB
1.2 KiB
| id | title | type | created | modified | tags |
|---|---|---|---|---|---|
| 20260114153529 | Random Number Generation | permanent | 2026-01-14T20:35:29Z | 2026-01-14T20:46:35Z |
Random Number Generation (RNG)
Random number generation is all about getting random numbers, and is easily defined as picking a number from a uniform distribution. Generally, there's two types:
True RNG
True RNG is systems that are truly random. Random systems are almost always derived from chaotic systems, which technically are deterministic, but as so final state sensitive they're basically intractable and 'random' values can be extracted. Sometimes lava lamps (turbulence) is used, sometimes isotope decay is the thing.
Pseudo RNG
Computers can't really do true RNG. They just can't handle non-deterministic outcomes. In addition, true RNG is slow.
As such computers build PRNG.
[!definition] Pseudo Random Number Generator
\text{Struct}(S, \mu, f, U, g)Where:
Sis a finite set of states\muis a distribution on S for the initial state (seed!)f:S \rightarrow S, the state transition functionUis the output space [0,1), or perhaps {0,...,m-1}g:S \rightarrow U, the output function