A question on joint probability distribution function $f(x,y) = 2$, for $x>0, y>0, x+y<1$.
What is $P(X+Y>\frac{2}{3})$? I've looked at a lot of questions of this kind, but I couldn't understand the concept. If we were to solve this graphically, do we look for the area b/w the two lines $y=\frac{2}{3}-x$ and $y=1-x$? And if we solve this by integration, what will be the limits of integration?
Would really appreciate if someone could help me out, and make me understand the concept behind choosing the limits. Thanks.
 A: If you draw a picture, the domain of $f$ (where $f$ is $>0$) is just the bounded triangle $T$ bounded by the lines $x=0$, $y=0$ and $x+y =1$, of area $\frac{1}{2}$, so that indeed the total probability equals $1$ when integrated over that area.
In general $P((x,y) \in B)$, where $B$ is a measurable subset of the domain, is just $\int_B f(x,y)dxdy$ where we integrate over the area $B$. As $f$ is constantly $2$ here, it's also just $2\mu(B)$, where $\mu(B)$ is the Lebesgue measure ("area")  of $B$.
So to determine this graphically, compute the area of the part of the above-mentioned triangle $T$ that lies above the line $x+y=\frac{2}{3}$. The area below it inside $T$, is just a triangle of height and base $\frac{2}{3}$ and that has area $\frac{4}{18} = \frac{2}{9}$. So the asked for area is $\frac{1}{2}-\frac{2}{9} = \frac{5}{18}$, and times $2$ for the factor of $f$ we get that $P(X+Y > \frac{2}{3})= \frac{5}{9}$.
If you want to use the double integral way, you can write the area as the union of $\{(x,y): 0 \le x \le \frac23 , \frac{2}{3} -x \le y \le 1-x\}$ (from the lower to the upper line) and $\{(x,y): \frac{2}{3} \le x \le 1: 0 \le y \le 1-x\}$ for the part between the $x$-axis and the line $x+y=1$. 
So the analytical way (which I won't compute but trust will check out) gives
$$\int_0^{\frac23} \left( \int_{\frac23-x}^{1-x} 2 dy\right) dx + \int_{\frac23}^1 \left( \int_0^{1-x} 2dy \right) dx$$
as a repeated integral. 
A: If you just want to write down the integral:
$$
P(X+Y - \tfrac{2}{3} > 0) = \int\limits_{0}^{1} \int\limits_{0}^{1 - x}f(x,y)\theta(x+y - \tfrac{2}{3}) dydx
$$
Where $\theta(x) = 1$ if $x > 0$ and $\theta(x) = 0$ elsewhere. Now you have to adjust the boundaries to the range, where the $\theta$-function has finite contribution:
$$
y+x >  \tfrac{2}{3} \Rightarrow y > \tfrac{2}{3} -x
$$
So the final integral you need to solve is
$$
P(X+Y - \tfrac{2}{3} > 0) = \int\limits_{0}^{1} \int\limits_{\max(\tfrac{2}{3} -x,0)}^{1 - x}f(x,y) dydx = 2\int\limits_{0}^{1}\int\limits_{\max(\tfrac{2}{3} -x,0)}^{1 - x} dydx 
$$
Here max(a,b) ist the greater number between a and b.
