Simulation from cdf

Give a method for simulating from

$$F(x) =\left\{\matrix{ \frac{(1-e^{-2x}+2x)}{3},& 0 < x < 1\cr \frac{3-e^{-2x}}{3}, & 1 < x < ∞}\right.$$

(Work out the pdf, and try to write it as a mixture, with one of the components being an $Exp(λ)$ pdf )

Can someone help me here? What should I do after I differentiate the respective $F(x)$ and get $f(x)$.

• Is this homework? What did you try? Commented May 6, 2014 at 9:20
• A sample question for my finals. I combined the two pdfs obtained from F'(x) and didn't know how to continue after that. Commented May 6, 2014 at 11:17
• How come we do not see what you did to follow the indication to "Work out the pdf, and try to write it as a mixture, with one of the components being an Exp(λ) pdf"?
– Did
Commented May 19, 2014 at 8:54

First differentiate $F$ to get the density function $f(x)$, then observe that the density can be writtes as $$f(x) = \frac23 e^{-2x} + \frac23I(0<x<1).$$ That is a mixture between an exponential distribution (with mean $1/2$) and a uniform distribution on the unit interval, and can be simulated as such.