Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

Thanks!

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Got it :) Inversion method rocks. :) –  Mathematics Lover Feb 29 '12 at 20:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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