= Inverse transform sampling
{wiki}
= Method of inversion
{synonym}
If $U$ has a <uniform distribution> on $(0,1)$ and $Q$ is the <quantile function> of a <cumulative distribution function> $F$, then $Q(U)$ has the desired <probability distribution>. Indeed, <right continuity> gives
$$
Q(p)\leq x\quad\Longleftrightarrow\quad p\leq F(x),\qquad 0<p<1,
$$
so $\mathbb P(Q(U)\leq x)=\mathbb P(U\leq F(x))=F(x)$. This short argument works for both jumps and smooth <cumulative distribution functions>. MIT's continuous-probability notes introduce the inverse-transformation construction. https://ocw.mit.edu/courses/9-07-statistics-for-brain-and-cognitive-science-fall-2016/6dcc172f428fbfbded912ca8862ea340_MIT9_07F16_lec3.pdf[MIT 9.07, inverse transformation method]{ref}.
For the three-value example, send $U\leq0.2$ to $0$, $0.2<U\leq0.7$ to $1$, and $U>0.7$ to $3$. These <intervals> have exactly the desired widths $0.2$, $0.5$, $0.3$. For the density example, output $\sqrt U$: for $0\leq y\leq1$, $\mathbb P(\sqrt U\leq y)=\mathbb P(U\leq y^2)=y^2$. Independent uniform draws give <independent random variables> after this deterministic transformation. This direction of construction works even when $F$ has jumps; applying the <probability integral transform> in the other direction requires its own continuity hypotheses.
Back to article page