# Function of Random Variable and Law of Total Probability

My solution for the third problem is, compute the CDF with Law of Total Probability,

\begin{align}F_{Y}(y) &= P[Y\leq y] = P[g(x)\leq y] \\ &=P[g(x)\leq y \mid x\in(1,2]]P[x\in(1,2]] + P[g(x)\leq y \mid x\in(2,4]]P[x\in(2,4]] \\ &= P[2x-1\leq y]P[x\in(1,2]] + P[5-x\leq y]P[x\in(2,4]]\end{align}.

Then the PDF,

$f_{Y}(y) = \displaystyle\frac{d}{dy}F_{Y}(y)$.

But this solution turns out incorrect.

Can someone help me to point out the error?

• One qustion: Isn´t $P(Y=1)=0$, since $Y$ is a continuous variable? – callculus Apr 23 '18 at 18:33

The error is that what you wrote is not a cdf. You cut the tail of the distribution $Y<1$ but you forgot to rescale it with Bayes formula. $$F_{Z}(y) = P[Y\leq y | Y>1] = \dfrac{P[Y\leq y \cap Y>1]}{P[Y>1]} = \dfrac{P[2x-1\leq y]P[x\in(1,2]] + P[5-x\leq y]P[x\in(2,4]]}{P[x\in(1,4]]}$$.