# Find cdf for random variable with a mixed cdf

Problem

A professor asks her student to do a certain experiment and report some measurement. The measurement is a number between 0 and 1 with the following pdf:

$f(x)= \begin{cases} 4x&\, 0 \leq x < \frac{1}{2}\\ 4(1-x)&\, \frac{1}{2} \leq x\leq 1\\ \end{cases}$

With probability 1/2, the student actually does the experiment and reports the true measurement, and with probability 1/2 he feels too lazy to do the experiment and just reports 0.5.

Y denotes the measurement the student reports (with or without doing the experiment). I want to find the cdf of Y, but I'm confused on how to get cdf for $y=\frac{1}{2}$

My Work

My pdf for Y:

$f(y)= \begin{cases} \frac{1}{2}y&\, 0 \leq y < \frac{1}{2}\\ \frac{1}{2}(2-y) &\, y=\frac{1}{2}\\ \frac{1}{2}(1-y)&\, \frac{1}{2} < y\leq 1\\ \end{cases}$

My cdf for Y:

$F_Y(y)= \begin{cases} \frac{y^2}{4}, 0 \leq y < \frac{1}{2}\\ \int_{\frac{1}{2}}^{\frac{1}{2}} \frac{1}{2}(2-y) dy = 0 &\, y=\frac{1}{2}\\ \frac{1}{2}(y-\frac{y^2}{2}-\frac{3}{8})&\, \frac{1}{2} < y\leq 1\\ \end{cases}$

• You have a mixed density with an atom of weight $\frac 12$ at $x=\frac 12$ and $f_Y(\frac 12)$ does not equal $\frac 12(2-y)$. Nor does $f_Y(y)$ equal $\frac y2$ for $0\leq y < \frac 12$, it has value $2y$. The cdf value at $y$ equals the total probability mass to the left of $y$ or at $y$ itself and thus "jumps" from value $y^2=\frac 14$ just to the left of $y=\frac 12$ to value $\frac 34$ at $y=\frac 12$. The jump discontinuity accounts for the atom of weight $\frac 12$ sitting at $y=\frac 12$. – Dilip Sarwate Sep 13 '17 at 17:00

You have a mixed random variable; it is continuous everywhere except for a step discontinuity at $Y=1/2$.

$Y$ will not have a pdf unless you use the Dirac delta generalised function to represent that massive step at $Y=1/2$.   Though elsewhere it will partake half the density of $X$.

\begin{align} f_Y(y) ~&{= \begin{cases}0 &:& y\in(-\infty;0] \\ \tfrac 12 f_X(y) &:& y\in(0;1/2)\\ \tfrac 12\delta_{(y-1/2)} &:& y=1/2 \\ \tfrac 12f_X(y) &:& y\in(1/2;1] \\ 0 & :& y\in(1;\infty) \end{cases}}\end{align}

The CDF for $Y$ will likewise partake half of the probability mass of the CDF for $X$ everywhere, but with a step of probability mass $1/2$ at $Y=1/2$.

\begin{align} F_Y(y) ~&{= \begin{cases}0 &:& y\in(-\infty;0] \\ \tfrac 12 F_X(y) &:& y\in(0;1/2) \\ \tfrac 12+\tfrac 12F_X(y) &:& y\in[1/2;1] \\ 1 & :& y\in(1;\infty) \end{cases}}\end{align}

Now find the function $F_X$ for the relevant intervals.

• why did you combine the $y=\frac{1}{2}$ and $\frac{1}{2}<y<1$ cases for the cdf? I kept them separated - $cdf = \frac{1}{2}$ for $y=\frac{1}{2}$ and cdf = $\frac{1}{2}F_X(y)$ for $\frac{1}{2}<y<1$ – Alex Sep 14 '17 at 15:07