If I want to generate a random variable with such a pdf: $f(x) = \frac{5}{12}[1+(x-1)^4], (0 \leq x \leq 2)$ by composition, what should I do?

Some of my thought is that I can first make it into $f(x) = \frac{5}{6}\frac{1}{2} + \frac{1}{6}[\frac{5}{2}(x-1)^4]$. But I'm not sure how to proceed.



HINT: You now generate Bernoulli random variable with $p=\frac{1}{6}$. If it is zero, you output uniform random variable on $(0,2)$, otherwise you output random variable with density $\frac{5}{2} (x-1)^4$, which you can generate by inversion method.

  • $\begingroup$ Got it :) Inversion method rocks. :) $\endgroup$ – Mathematics Lover Feb 29 '12 at 20:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.