Welcome to our community

Be a part of something great, join today!

[SOLVED] Calculate probability

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,718
Hello!!! (Wave)

Suppose that $X$ has the uniform distribution on the interval $[0,2]$ and $Y$ has the uniform distribution on the interval $[2,4]$. If $X,Y$ are independent, I want to find the probability that the difference $Y-X$ is $\leq 1$.

I have thought the following.


The density function of $X$ is

$$p_1(x)=\left\{\begin{matrix}
\frac{1}{2} &, 0 \leq x \leq 2 \\
0 & , \text{ otherwise}
\end{matrix}\right.$$

while the density function of $Y$ is

$$p_2(x)=\left\{\begin{matrix}
\frac{1}{2} &, 2 \leq x \leq 4 \\
0 & , \text{ otherwise}
\end{matrix}\right.$$


How can we find the probability that the difference $Y-X$ is $\leq 1$ ? Do we use the above density functions? (Thinking)
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
8,684
Hey evinda !! (Smile)

Yep, we use those density functions.

$X$ and $Y$ have a so called joint probability distribution $f_{X,Y}(x,y)$.
If means that:
$$P(Y-X\le 1) = \iint_{y-x\le 1} f_{X,Y}(x,y)\,dx\,dy$$
And since they are independent, we have:
$$f_{X,Y}(x,y) = f_X(x)f_Y(y) = p_1(x)p_2(y)$$
(Thinking)
 

Klaas van Aarsen

MHB Seeker
Staff member
Mar 5, 2012
8,684
Just for fun, here's the corresponding graph.


The blue area corresponds to the part where the joint probability density is non-zero.
And the red area corresponds to the part where $Y-X \le 1$. (Thinking)
 

evinda

Well-known member
MHB Site Helper
Apr 13, 2013
3,718
Nice, thank you!!! (Smirk)