# Cumulative distribution function with 3 variables

Let $$X$$ be the random variable whose cumulative distribution function is $$F_X (x) = \begin{cases} 0, & \text{for} \space x\lt 0 \\ \frac{1}{2}, & \text{for} \space 0\le x\le 1 \\ 1, & \text{for} \space x\gt 1 \\ \end{cases}.$$ Let $$Y$$ be a random variable independent of $$X$$ and uniformly distributed over the interval $$(0,1)$$. Define the random variable $$Z$$ as $$Z = \begin {cases} X, & \text{if} \space X\le \frac{1}{2} \\ Y, & \text{if} \space X\gt \frac{1}{2} \\ \end{cases}$$ Determine $$\mathbb{P} (Z\le \frac{1}{5})$$.

I believe that $$X$$ only takes the discrete values $$0$$ and $$1$$ with equal probability, but I'm not entirely sure. By intuition, I think that the answer is $$\frac{1}{2}$$. I'm unsure about this question, so any advice would be appreciated.

• Cumulative distribution function of $X$ is not right continuous at $1$, how come? Commented Mar 1, 2021 at 23:01
• Indeed, that is a little bad behaved. It should be $\begin{cases} 0&:&~~~~~~~ x<0\\1/2&:& 0\leq x< 1\\1&:& 1\leq x\end{cases}$ Commented Mar 1, 2021 at 23:39

You should define $$F(1)$$ as $$1$$ instead of $$\frac 1 2$$.

$$P(Z \leq \frac 1 5)$$ $$=P(X \leq \frac 1 5)+P(Y \leq \frac 1 5, X>\frac 1 2)$$ $$=P(X \leq \frac 1 5)+P(Y \leq \frac 1 5)P( X>\frac 1 2)$$

$$=\frac 1 2 +\frac 1 5 (1-\frac 1 2 )=\frac 3 5.$$

I believe that $$X$$ only takes the discrete values $$0$$ and $$1$$ with equal probability, but I'm not entirely sure.

Yes, that is what the cumulative distribution function is saying: as it increases suddenly at $$0$$ and $$1$$, and remains constant elsewhere.  Thus $$X$$ has the probability mass function of:

$$\qquad\mathsf P(X=x)=\begin{cases}1/2 &:& x=0~\text{or}~ x=1\\0&:&\text{elsewhere}\end{cases}$$

So you should see that when $$X=0$$ then $$Z=0$$, or when $$X=1$$ then $$Z=Y$$, so: $$\mathsf P(Z\leq 1/5)=\mathsf P(X = 0)+\mathsf P(X=1\cap Y\leq 1/5)$$