Variance of a sum of correlated random variables. The final line of the work is right but it does not make sense to me

[Problem.] Suppose that $X_1,\ldots, X_{100}$ are random variables with $\operatorname E X_i=100$ and $\operatorname E X_i^2=10100.$ If $$\operatorname{Cov}(X_i,X_j)=-1\ \ \text{for i\ne j,}$$
what is $\operatorname{Var}S,$ where $S= \sum_{i=1}^{100} X_i$?

[Solution.] To solve for $\operatorname{Var}S$ it makes sense to me to solve for $\operatorname{Var}X_i$ first. Thus, $$\operatorname{Var}X_i= 10100-10000=10100-(100^2)=100.$$ Now to solve for $\operatorname{Var}S,$ $$\operatorname{Var}S=100\operatorname{Var}X_i- \binom{100} 2 \cdot 2.$$

Question: I understand why $100\operatorname{Var}X_i$ is necessary but where did $\binom{100}2 \cdot 2$ come from?

• Everything makes sense now besides {n+1 \choose 2k} s.t.n+1=100 and k=1 – Jordan Greenhut Jan 9 '18 at 1:31

One can also say the number of unordered pairs is $\dbinom{100}2,$ but for each of those there are two ordered pairs, so it's $\dbinom{100}2\times 2,$ which is the same as $100\times99.$