Let $X$ and $Y$ be random variables and suppose the joint density function of $X$ and $Y$ is given by
$$ f(x,y) = 2e^{-x}e^{-2y}, \quad 0<x<\infty, \: 0<y<\infty $$
When I calculated $P(X<Y)$ I performed the integral to get value: $$\tag{1} \int_{x=0}^{\infty}\int_{y=0}^{x} f(x,y) \;dydx = \frac{2}{3} $$
My textbook states you must swap the order and values of the integrals. Namely,
\begin{equation}\tag{2} \int_{y=0}^{\infty}\int_{x=0}^{y} f(x,y) \; dxdy = \frac{1}{3} \end{equation}
My problem is that I do not see why the order and values of the integrals on $(1)$ doesn't correspond to $P(X<Y)$ nor why $(2)$ corresponds to $P(X<Y).$
Any help on this would be greatly appreciated.
Thank you in advance.
The answer of your textbook is correct. You calculated $P(X>Y)$
Let's have a focus on the following drawing
The requested probability can be calculated in both the following ways
$$P(X<Y)=\int_{y=0}^{\infty}\int_{x=0}^{y}f(x,y)dxdy$$
$$P(X<Y)=\int_{x=0}^{\infty}\int_{y=x}^{\infty}f(x,y)dxdy$$