Finding the value of Pr(XConsider the joint density $f_{X,Y}(x,y)=1/40$ inside the rectangle 0< x <5 and 0< y< 8. How do I calculate $Pr[X<Y]$ ?
 A: The probability that $X$ is $\lt Y$ is $\frac{1}{40}$ times the area of the part of the rectangle that is above the line $y=x$. Finding this area is a simple geometric problem if one draws a picture.
Note that it is marginally easier to find the probability that $Y\le X$. For then we are dealing with an isosceles right triangle with leg $5$. The area is $\frac{25}{2}$, and therefore $\Pr(X\le Y)=\frac{25}{80}=\frac{5}{16}$. Thus $\Pr((X\lt Y)=\frac{11}{16}$.  
Remark: From general considerations the probability is $\iint_D f(x,y) \,dx\,dy$, where $D$ is the part of the plane that is above the line $y=x$. Since our density function is $0$ outside the rectangle, this integral is $\iint_T \frac{1}{40}\,dx\,dy$, where $T$ is the part of the rectangle that is above the line $y=x$.
To do the integration, we can integrate first with respect to $y$, then with respect to $x$. We get 
$$\int_{x=0}^5\left(\int_{y=x}^8 \frac{1}{40}\,dy\right)\,dx.$$
The geometric approach is easier, particularly since in any case we need the geometry to evaluate the integral. 
However, the integral approach would become necessary if we had a non-constant density function on the rectangle.
