Let be $X$ a continuous random variable with distribution $F_X$. Let be $Y= \left\{ \begin{array}{cc} X & if \ X\leq a \\ a & if\ X >a \end{array} \right.$
find the distribution of $Y$ in terms of $F_X$. Is $Y$ a mixed random variable?
I want to know if my answer is correct:
By the definition of $Y$:
$F_Y(y)= \left\{ \begin{array}{cc} P(X<y) & if \ y\leq a \\ P(Y\leq a)+P(a<Y<y) & if\ y >a \end{array} \right.$
Since $P(a<Y<y)=0$ we can write
$F_Y(y)= \left\{ \begin{array}{cc} P(X<y)=F_X(y) & if \ y\leq a \\ P(Y< a)+P(Y=a)+0=P(X<a)+P(X>a) & if\ y >a \end{array} \right.$
Since $X$ is a continuous random variable:
$F_Y(y)= \left\{ \begin{array}{cc} P(X<y)=F_X(y) & if \ y\leq a \\ P(P(X<a)+P(X>a)=F(a)+(1-F(a)=1 & if\ y >a \end{array} \right.$
$F_Y(y)= \left\{ \begin{array}{cc} F_X(y) & if \ y\leq a \\ 1 & if\ y >a \end{array} \right.$
Finally, $Y$ is a mixed random variable because the set of discontinuities={a} and $F(a)-F(a-)=1-F(a)\in(0,1)$.
Use conditioning: \begin{align} F_Y(y)&=P(Y\leqslant y)\\ &=P(Y\leqslant y|X\leqslant a)P(X\leqslant a)+P(Y\leqslant y|X>a)P(X> a)\\ &=P(X\leqslant y|X\leqslant a)P(X\leqslant a)+P(Y\leqslant y|X>a)P(X> a)\\ &=P(X\leqslant y, X\leqslant a)+P(Y\leqslant y|X>a)P(X> a)\\ &=\begin{cases} P(X\leqslant y)&\text{if }\ y\leqslant a\\ P(X\leqslant a)+P(X>a)&\text{if }\ y> a \end{cases}\\ &=\begin{cases} F_X(y)&\text{if }\ y\leqslant a\\ 1&\text{if }\ y> a \end{cases} \end{align}