An urn contains $n$ balls numbered $1,2, ... , n$. We remove $k$ balls at random (without replacement) and add up their numbers. Find the mean and variance of the total.
The image is the solution of the question. But the algebra is too complicated to me. I think that the first equality in the display, it should be $2k(k-1) E(X_1 X_2)$. Am I right? I also do not understand how he get from the second to third and the third to the fourth equation. Can you help me understand these steps? I guess that the authors use $\sum_{i <j} = \sum_{i=1}^n \sum_{j = i+1}^n = n(n-1)$. I understand that the first equality, but how can we show the second equality?