# Let $f(x) = ax^{-a-1}$ for $x \geq 1$ and $f(x) = 0$ otherwise …

Let $f(x) = ax^{-a-1}$ for $x \geq 1$ and $f(x) = 0$ otherwise, where '$a$' is a positive parameter. Show how to generate random variables from this density from a uniform random number generator.

Another question I came across when studying for an exam. Would like help.

For rv $X$ with cdf $F_{X}(t)$, $Y=F_{X}(X)\sim Uni(0,1)$
Proof: We will look at case that $F_{X}(t)$ is invertible, which you will see is true in with your example. So to find distribution of $Y$ we will see what cdf is. Thus we have $$F_{Y}(t)=P(Y<t)=P(F_{X}(X)<t)=P\left(F^{-1}_{X}(F_{X}(X))<F^{-1}_{X}(t)\right)=P(X<F^{-1}_{X}(t))=F_{X}(F^{-1}_{X}(t))=t$$ where $0<t<1$. Thus $Y\sim Uni(0,1)$
Now with this knowledge we see that $F^{-1}_{X}(Y)=F^{-1}_{X}(F_{X}(X))=X$. Thus the great result we have from this is that we can simulate from $X$ by essentially simulating from $Uni(0,1)$ variable then inputting that into the inverse cdf, $F^{-1}_{X}(t)$
You want some function $G$ so that, when $U$ is uniform on $[0,1]$, $G(U)$ has density $f$. If we let $F$ be the cumulative distribution corresponding to $f$, this means we want $P(G(U)<x)=F(x)$. But $P(G(U)<x)=P(U<G^{-1}(x))=G^{-1}(x)$, meaning $G^{-1}(x)=F(x)$, or $G(x)=F^{-1}(x)$. Thus, to find $G$, you need only compute $F$ and find its inverse.