I am interested to find out:

I want use where is drawn from (a density defined from 0<x<1).

The question is simple. How can I draw a random sample of let say 10000 from the density ?

What I did is to generate 10000 random uniform variable and subst into the equation.

For example:

x=runif(10000)

g=3(1-x^2)/2

but the answer is still wrong after computation

Meanwhile finding this inverse is hard