# How to generate a continuous random variable with the density $f(x) = 1.5x^2, -1 < x < 1$?

Let $U$ be a Standard Uniform random variable. Show all the steps required to generate a continuous random variable with the density $f(x) = 1.5x^2$, $-1 < x < 1$.

I'm not looking for exact answers as much as proper solutions for future reference. Thanks!

-

Denote new random variable as V and its distribution function as F(x). Then:

F(x)=(x^3+1)/2=G( G (F(x) ) )=G( (x^3+1)/2 )=P( U <= (x^3+1)/2 ) =P( 2U-1 <= x^3 )=P( (2U-1)^(1/3) <= x ). So, (2*U-1)^(1/3) is that random variable you need.

(As G(x) I denote inverse function for G(x). G(x) is distribution function for U)

-

Hint: You want to solve $F(X) = U$, where $F$ is the cumulative distribution function.

-
So would I just integrate 1.5x^2 between -1 and 1 for the answer? –  jonelliot Dec 3 '12 at 20:21
No, integrate between $-1$ and $X$. –  Robert Israel Dec 3 '12 at 20:43