Inverse transform sampling
Inverse transform sampling (also known as inversion sampling, the inverse probability integral transform, the inverse transformation method, or the Smirnov transform) is a basic method for pseudo-random number sampling, i.e., for generating sample numbers at random from any probability distribution given its cumulative distribution function. Inverse transformation sampling takes uniform samples of a number u {\displaystyle u} between 0 and 1, interpreted as a probability, and then returns the smallest number x ∈ R {\displaystyle x\in \mathbb {R} } such that F ( x ) ≥ u {\displaystyle F(x)\geq u} for the cumulative distribution function F {\displaystyle F} of a random variable.
Source: Wikipedia — Inverse transform sampling (CC BY-SA 4.0)