Find the expected area of a randomly chosen triangle. The set of numbers $(x,y)$ are positive natural numbers such that $x+y=n$. 2 points are chosen from this set. What is the expected area of the triangle formed by the origin and the two points?
 A: Note that the $x$ coordinate is supported on $[0:n]$. I'll assume that the points are selected uniformly and independently, and you should edit the question in case this is not true.
Suppose the first point is $(X_1, Y_1)$, and the second $(X_2, Y_2)$. It's easy to see that the area is 
\begin{align}
A &= \frac{1}{2}|X_1 Y_2 - X_2 Y_1| &\text{(half the absolute value of the cross product)}\\
&= \frac{1}{2}|nX_1 - X_1X_2 - nX_2 + X_1 X_2| &\text{(Using $X_i + Y_i = n$)} \\
&= \frac{n}{2}|X_1 - X_2|
\end{align}
\begin{align}
\mathbb{E}[A] &= \frac{n}{2} \sum_{a = 0}^n \sum_{b = 0}^n \mathbb{P}\{X_1 = a, X_2 = b\} |a - b| \\
&\overset{(a)}= \frac{n}{2(n+1)^2} \sum_{a= 0}^n \left(\sum_{b = a+1}^n b - a + \sum_{b = 0}^a a - b \right) \\
&= \frac{n}{2(n+1)^2} \sum_{a = 0}^n \frac{(n-a)(n-a+1)}{2} + \frac{a(a+1)}{2} \\
&= \frac{n}{2(n+1)^2} \sum_{a = 0}^n a^2 + a\\
&= \frac{n}{2(n+1)^2} \left( \frac{n(n+1)(2n+1)}{6} + \frac{n(n+1)}{2} \right) \\
&= \frac{n^2(n+2)}{6(n+1)}
\end{align}
Where equality $(a)$ uses both uniformity and independence of $X_1$ and $X_2$.
