1. ## Generating random variables

If $\displaystyle f(x)=ax^{-a-1}$ where a is positive, how do I generate random variables from a uniform random number generator? Any help would be greatly appreciated.

2. Originally Posted by brogers
If $\displaystyle f(x)=ax^{-a-1}$ where a is positive, how do I generate random variables from a uniform random number generator? Any help would be greatly appreciated.
Let $\displaystyle F(x)$ be the cumulative distribution for a continuous random variable $\displaystyle X$, and let $\displaystyle Y \sim U(0,1)$. Then:

$\displaystyle Z=F^{-1}(Y)$

has cumulative distribution $\displaystyle F(z)$.

Hence if $\displaystyle y$ is a sample from the $\displaystyle U(0,1)$, $\displaystyle z=F^{-1}(y)$ is a sample from the distribution with cumulative distribution $\displaystyle F(z)$

CB