# Probability question (CDF , PDF etc) [duplicate]

Possible Duplicate:

I have to calculate the density function of the random variable $Y= 1-X^2$, given that: $f(x) = \frac{1}{9}(x+1)^2$, where $-1 < x < 2$.

So I finally understood that the domain of Y is $-3 < Y < 1$.

But it seems that i cant continue further... My method is to find the distribution of Y by using the density function of X , and finally ill find the density function of Y by taking the derivative of Y's distribution func.

Its not working at all, i am taking wrong integral, wrong spaces, everything wrong...

Could someone please explain me what is the correct way?

Thanks

-

## marked as duplicate by Dilip Sarwate, Marvis, Did, t.b., Nate EldredgeMay 24 '12 at 17:15

Draw the graph and you see that $Y$ is a non-one-to-one function of $X$, and that's where the difficulty lies, and that's why the thing comes out as a piecewise defined density function. –  Michael Hardy May 24 '12 at 0:23

It is easiest to start with CDF: $$F_Y(y) = \mathbb{P}(Y \leqslant y) = \mathbb{P}(1-X^2 \leqslant y) = \mathbb{P}(X^2 \geqslant 1 - y) = \mathbb{P}(X \geqslant \sqrt{1 - y}) + \mathbb{P}(X \leqslant -\sqrt{1 - y})$$ Since $$F_X(x) = \begin{cases} 0 & x < -1 \\ 1 &x > 2 \\ \left(\frac{x+1}{3}\right)^3 & -1 \leqslant x \leqslant 2 \end{cases}$$ one easily arrives as $F_Y(y)$ $$F_Y(y) = F_X(-\sqrt{1-y}) + 1 - F_X(\sqrt{1-y}) = \begin{cases} 1 & y \geqslant 1 \\ 0 & y \leqslant -3 \\ \frac{23 + 3 y}{27} + \frac{y-4}{27} \sqrt{1-y} & y \leqslant 0 \\ 1 + 2 \sqrt{1-y} \frac{y-4}{27} & 0 < y < 1 \end{cases}$$ Now, differentiating with respect to $y$: $$f_Y(y) = \begin{cases} \frac{\left(1 + \sqrt{1-y}\right)^2}{18 \sqrt{1-y}} & -3 < y \leqslant 0 \\ \frac{2-y}{9 \sqrt{1-y}} & 0 < y< 1 \\ 0 & \text{otherwise}\end{cases}$$

-
Over at this identical question, @bgins came up with a different answer. –  Dilip Sarwate May 24 '12 at 1:26
@DilipSarwate Thanks for the pointer. I'm afraid the probability density function obtained by @bgins does not integrate to 1: In[2]:= Integrate[ Piecewise[{{(1 + Sqrt[1 - y])^2/(18 Sqrt[1 - y]), -3 < y <= 0}, {2/9, 0 < y < 1}}], {y, -3, 1}] Out[2]= 25/27. For mine it does In[1]:= Integrate[ Piecewise[{{(1 + Sqrt[1 - y])^2/(18 Sqrt[1 - y]), -3 < y <= 0}, {(2 - y)/(9 Sqrt[1 - y]), 0 < y < 1}}], {y, -3, 1}] Out[1]= 1 –  Sasha May 24 '12 at 1:39
bgins has corrected his answer and now it matches yours. –  Dilip Sarwate May 24 '12 at 12:16

Used wrong density function.${}{}{}{}{}$

-
The function $f$ is (also) a PDF. –  Did May 24 '12 at 5:35
@Didier: Yes, I added $-1$ and $1$ and did not get $0$. –  André Nicolas May 24 '12 at 5:47
@Didier Interestingly enough, in the previous incarnation of this question, bgins also mistook $f$ to be the CDF and gave an incorrect answer (which has since been corrected and matches Sasha's answer). The two questions and their answers really should be merged but there are still not enough votes to close this question. –  Dilip Sarwate May 24 '12 at 12:15
@Dilip Nice to know. –  Did May 24 '12 at 12:44