# Probability of new random variables that depent in 2 other random independent variable

You have 2 independent random variables with pdfs $$f_X(x)=0.25[u(x)-u(x-4)] \quad \text{and} \quad f_Y(y)=e^{-y}u(y).$$

Define new random variable by $$Z= \begin{cases} Y, & X \le 2\\ X, & X >2\end{cases}$$ Calculate: $$\mathbb{P}(Z\le2)$$.

So here I am stuck and do not know how to proceed, the only hint my lecturer said: using in "Law of total probability",I dont know how to connect the new r/v Z to X Y and . Please help

## 1 Answer

HINT

Compute $$\mathbb{P}[X\le 2]$$ from the pdf. Then you have $$\begin{split} \mathbb{P}[Z \le 2] &= \mathbb{P}[Z \le 2, X > 2] + \mathbb{P}[Z \le 2, X \le 2] \\ &= \mathbb{P}[Z \le 2| X > 2] \mathbb{P}[X>2] + \mathbb{P}[Z \le 2| X \le 2] \mathbb{P}[X\le 2]\\ \end{split}$$ Now plug in the definition of $$Z$$ and it should convert nicely to what you can deal with.

• first of all thanks. the problem I have is to define the probability of Z, I know how to proceed from what you wrote, but the big problem is to get the idea of P(z≤2)=P[Z≤2,X>2]+P[Z≤2,X≤2], why? where is it come from? – Knowledge May 28 at 15:04
• @Knowledge The trick to condition on the interesting event is a classic one. The missing step in the middle is $\mathbb{P}[Z \le 2] = \mathbb{P}[Z \le 2, X \le 2 \text{ or } X > 2]$ where the second event partitions the entirety of the event universe, i.e. exactly one of $X \le 2 \text{ or } X > 2$ must always be true. – gt6989b May 28 at 15:19
• okay but what about Y and X? sorry, I can't understand this issue..maybe you have some other example or sample idea to explain this please? the paramaters X and Y very confused me, and I can't understand why we ignore them for first steps of the equations above. – Knowledge May 28 at 15:25
• @Knowledge in order to understand whether $Z$ is defined with the top branch (and depends on $Y$) or on the bottom branch (and depends on $X$), you need to know the status of an additional event (which here is $X \le 2$). You condition on that event, which gives you 2 different branches to consider, and then convert your expressions in $Z$ to $X$ or $Y$, depending on which branch you are in. – gt6989b May 28 at 16:26