Evaluate $Pr[Y - X < c, X \ge 0]$ Let $f(x,y) = Pr[X=x, Y=y]$ be the joint density of two random variables, $X$ and $Y$.
I have been given s = $Pr[Y - X < c, X \ge 0] = \int_0^\infty \int_{-\infty}^{c+y} f(x,y) dx dy $
I am a little confused about how to get the integral from the probability. If anyone could share some of the intuition that would be great. Thanks
 A: By definition, we have a double integral (double integral, not iterated integral) 
$$
Pr\left[X-Y<c,X\geq 0 \right]=
\iint_{D} 
f(x,y)\, dxdy
$$
where 
$$
D=\left\{(x,y):
\begin{array}{l}
-\infty< x <+\infty, & x\geq 0 \\
-\infty< y <+\infty, & x-y<c
\end{array} 
\right\}
$$
Note that
\begin{align}
\left\{
\begin{array}{rc}
-\infty< x <+\infty, & x\geq 0 \\
-\infty< y <+\infty, & x-y<c
\end{array}
\right. 
\Leftrightarrow 
&
\left\{
\begin{array}{rc}
0\leq  x <+\infty, & \\
-\infty< y <+\infty, & x<y+c
\end{array}
\right.
\\
\Leftrightarrow 
&
\left\{
\begin{array}{r}
-\infty< y<+\infty,  \\
0\leq x <c+y \,\,.
\end{array}
\right.
\end{align}
Then, by Fubini theorem, we finally have the iterated integral
\begin{align}
Pr\left[X-Y<c,X\geq 0 \right]=
&
\iint_{D} 
f(x,y)\, dxdy
\\
=
&
\iint_{
\begin{array}{r}
-\infty< y<+\infty,  \\
0\leq x <c+y \,\,.
\end{array}} 
f(x,y)\, dxdy
\\
=
&
\int_{-\infty< y <+\infty} \bigg[ \int_{0\leq x<c+y}f(x,y) dx\bigg] dy 
\\
=
&
\int_{-\infty}^{+\infty} \bigg[ \int_{0}^{c+y}f(x,y) dx\bigg] dy
\end{align}
