Random number generation Created 2026-10-20 Updated 2026-11-05
Random number generation produces values intended to follow a prescribed probability distribution. A physical source uses a measured uncertain process; a pseudorandom number generator deterministically expands a seed into a reproducible sequence. For a uniform integer on , reducing a uniform -bit integer modulo is biased unless divides . Rejection sampling fixes this by accepting only values below before taking the remainder. For , accept : each residue then has exactly two preimages.
Remainder recycling 2026-10-20
A random number generation technique that retains the unused equally likely outcomes after a rejected trial in rejection sampling. Instead of discarding those outcomes, it uses their conditional probability to obtain a new uniform distribution on a finite set for the input state of the next trial.