# uniform distribution on [0,1] find function

Consider $$X∼unif [0,1]$$. Find a function $$g: \mathbb{R} \longrightarrow \mathbb{R}$$, such that g(X) has pdf $$f(t) = \begin{cases} {t+1}, & \text{-1 \leq t\leq 0} \\ {1-t}, & \text{0.

Can you help me, please? I do not know what I have to do.

Compute the cdf $$F$$ corresponding to $$f$$ (i.e. $$F(x)=\int_{-\infty}^x f(t)\, dt)$$ and use the fact that $$F^{-1}(X)$$ has the same distribution as $$F$$. So we can take $$g=F^{-1}$$.
• Thanks for your answer. So I have $F(x) = \begin{cases} 0 & x <-1\\ \frac12 + x + \frac{x^2}{2} & x \in[-1,0]\\ \frac12 + x - \frac{x^2}{2} & x \in(0,1]\\ 0 & x > 1\end{cases}$. Is that correct? Now I have to calculate $F^{-1}(x)$ for every case, right? – tommy_m Jan 3 at 18:36