Math
Every distribution from the uniform
There are only a few ways to make a random number with a given distribution, and all of them start from a uniform. Push it through the inverse of the CDF (exponential, Cauchy, triangular). Take two and turn them into a pair of normals (Box-Muller). Throw darts at a box around the density and keep the ones under the curve (rejection - and the share kept is π/4 for the semicircle). Count exponential waits in a unit of time (Poisson) or heads in ten coins (binomial). Follow one numbered token through the machine, then hold the whole sample against its exact curve.

What happens
A computer makes one kind of random number, a uniform between 0 and 1; every other distribution has to be manufactured from it. Inversion feeds the uniform through the inverse of the target's cumulative curve. Box-Muller turns two uniforms into a normal with a square root, a log and a cosine. Rejection throws darts at a box and keeps the ones under the curve - and pays for it in wasted darts. Counting exponential gaps yields Poisson. Each recipe is drawn twenty thousand times and held against the exact curve. Pick a distribution, watch the recipe run, and read the distance to the truth.
Equations used in the module
Equations inversion: x = F^(−1)(u), u uniform on (0,1); exponential −ln u; Cauchy tan π(u − ½) Box-Muller: x = √(−2 ln u₁) cos 2πu₂ rejection: keep (x, y) uniform under the graph of f Poisson(λ): the count of exponential gaps in unit time


