Finding $P(X < Y)$ where $X$ and $Y$ are independent uniform random variables Suppose $X$ and $Y$ are two independent uniform variables in the intervals $(0,2)$ and $(1,3)$ respectively. I need to find $P(X &lt; Y)$.

I've tried in this way:
$$
\begin{eqnarray}
P(X &lt; Y) &amp;=&amp; \int_1^3 \left\{\int_0^y f_X(x) dx\right\}g_Y(y) dy\\
&amp;=&amp; \frac{1}{4} \int_1^3 \int_0^y dx dy\\
&amp;=&amp; \frac{1}{4} \int_1^3 y dy\\
&amp;=&amp; \frac{1}{8} [y^2]_1^3\\
&amp;=&amp; 1
\end{eqnarray}
$$
But I'm suspicious about this result. It implies that $X&lt;Y$ is a sure event, which is not at all true.
This sketch might help.  You want the red area as a proportion of the red and blue areas.
Answer:

Divide the regions of X with respect to Y for the condition $X&lt;Y$.

For $0&lt;X&lt;1$, $P(X&lt;Y) = \frac{1}{2}$

For $1&lt;X&lt;2$ and $1&lt;Y&lt;2$ $P(X&lt;Y) = \int_{1}^{2}\int_{x}^{2} \frac{1}{2}\frac{1}{2}dydx = \frac{1}{8}$

For $1&lt;X&lt;2$, and $2&lt;Y&lt;3$ $P(X&lt;Y) = \frac{1}{2}.\frac{1}{2}=\frac{1}{4}$

Thus $P(X&lt;Y) = \frac{1}{2}+ \frac{1}{8}+\frac{1}{4} = \frac{7}{8}$