I have the following problem:
Two stochastic variables $X\sim U(0,2)$ and $Y\sim U(1,3)$ are independent. What is $P(X>Y)$?
The answers is $\frac18$, but I don't know how to solve.
I did the following:
- I drew both distributions in one plot with height 1/2 --> (1/(2-0))
I see that the distributions have a overlap on interval $[1,2]$, so if $X$ is going to be bigger than $Y$, its going to be in that interval. So I know that the probability of $X$ being in that interval is $(2-1)\times\frac12 = 0.5$.
I don't know how to proceed. Can I have some feedback?
Ter
As commented a picture is a good idea here.
If you want a proof that does not depend on a picture then the following might help.
For independent $X,Y$ where $Y$ has a PDF we have the equalities:
$$P\left(X>Y\right)=\int P\left(X>Y\mid Y=y\right)f_{Y}\left(y\right)dy=\int P\left(X>y\mid Y=y\right)f_{Y}\left(y\right)dy=$$$$\int P\left(X>y\right)f_{Y}\left(y\right)dy$$
Here the last equality rests on independence.