# Cumulative distribution of mixed random variable function

Random variable $$X$$ has probability density function: $$f_X(x) = \begin{cases} 2e^{−2x}, & \text{for } x\geq 0,\\ 0, & \text{otherwise.}\\ \end{cases}$$

Furthermore, the random variable Y is defined as $$Y = \begin{cases} 2X, & \text{if } X < 1/2,\\ 0, & \text{if } X\geq 1/2.\\ \end{cases}$$ Determine the cumulative distribution $$F_Y(y)$$ of the random variable $$Y$$.

How do I solve this question? If $$Y$$ was simply defined as $$Y=2X$$ then it would simply be finding $$P[Y\leq y]=P[2X\leq y]=P[X\leq y/2]$$ and thus solving the integral $$\int^{y/2}_0{2e^{-2x}}dx$$

• Note $Y$ is supported on $[0,1)$. Try and show for $y\in [0,1)$ that $$\mathbb{P}\left(Y\leq y \right)=\mathbb{P}\left(X\leq \frac{y}{2}\right)+\mathbb{P}\left(X\geq \frac{1}{2}\right)$$
– user801306
Commented Jun 6, 2022 at 17:04
• Also note: this means that $\Bbb P(Y=0) = \Bbb P(X\geq 1/2)$ so there is a massive step in the CDF for $Y$. Commented Jun 7, 2022 at 23:52

You can rely on basic principles. Note that $$Y$$ is of the form

$$Y = g(X), \qquad \text{where} \quad g(x) = \begin{cases} 2x, & \text{if x < \frac{1}{2},} \\ 0, & \text{if x \geq \frac{1}{2}.} \end{cases}$$

From this and using the definition of CDF,

\begin{align*} F_Y(y) &= \mathbf{P}(Y \leq y) = \mathbf{P}(g(X) \leq y). \end{align*}

So the problem boils down to solving the inequality $$g(x) \leq y$$ for each given $$y$$. To this end, you may study the behavior of the function $$g(x)$$. Note that the graph of $$g(x)$$ looks like:

From this, we can solve the inequality $$g(x) \leq y$$ for $$x$$ for each given value of $$y$$:

Range of $$y$$ Sol. of $$g(x) \leq y$$ $$F_Y(y)$$ Graph
$$y < 0$$ $$x \leq y/2$$ \begin{aligned} \mathbf{P}(X \leq y/2) = 0 \end{aligned}
$$0 \leq y < 1$$ $$x \leq y/2$$ or $$x \geq \frac{1}{2}$$ \begin{aligned} &\mathbf{P}(X \leq y/2) + \mathbf{P}(X \geq \tfrac{1}{2}) \\ &= 1 - e^{-y} + e^{-1} \end{aligned}
$$y \geq 1$$ $$x \in \mathbb{R}$$ $$1$$

Summarizing, the CDF of $$Y$$ is given by

$$F_Y(y) = \begin{cases} 0, & y < 0, \\ 1 - e^{-y} + e^{-1}, & 0 \leq y < 1, \\ 1, & y \geq 1. \end{cases}$$

For fun, I also included the graph of $$F_Y$$ below:

• Thanks, the figures really helped me understand! Commented Jun 6, 2022 at 19:27
• @Aycapitan, Glad it helped :) Commented Jun 6, 2022 at 19:33

In these cases it is advisable to use the Iverson bracket which allows to easily manage propositions (in our case intervals). Alternatively you can use Bolean Algebra if you are more familiar with.

So we can write \eqalign{ & Y = \left\{ {\matrix{ {2X} \hfill & {\left| {\left( {0 \le } \right)X < 1/2} \right.} \hfill \cr 0 \hfill & {\left| {1/2 \le X} \right.} \hfill \cr } } \right.\quad \Rightarrow \cr & \Rightarrow \quad Y = 2X\left[ {0 \le X < 1/2} \right] = 2X\left[ {0 \le X} \right]\left[ {X < 1/2} \right] = \cr & = 2X\left[ {0 \le X} \right]\left( {1 - \left[ {1/2 < X} \right]} \right) = 2X\left[ {0 \le X} \right]\left( {1 - \left[ {1/2 \le X} \right]} \right) = \cr & = 2X\left( {\left[ {0 \le X} \right] - \left[ {1/2 \le X} \right]} \right) \cr}

So for instance we can write \eqalign{ & \Pr \left( {Y \le y} \right) = \Pr \left( {2X\left[ {0 \le X} \right]\left[ {X < 1/2} \right] \le y} \right) = \cr & = \Pr \left( {\left[ {0 \le X} \right]\left[ {X < 1/2} \right]\left[ {X \le y/2} \right]} \right) = \cr & = \left[ {y/2 < {1 \over 2}} \right]\Pr \left( {\left[ {0 \le X} \right]\left[ {X \le y/2} \right]} \right) \cr}

But .. there is some normalization to carry out on your starting equality.