0

I'm trying to solve this equality, with no success.

Let $x_1,\dots,x_n$ be real numbers and $\bar x := \frac1n \sum_{i=1}^nx_i.$ Prove$$ \sum_{i=1}^n (x_i - \overline{x})^2 = \frac{1}{n} \sum_{1\le i < j\le n} (x_i - x_j)^2$$

I've been trying to prove this since yesterday but I can't finish this. Could you help me with this?

1 Answers1

0

Note that for all $i=1,\dots,n$: \begin{align}\tag 1\label 1 n x_i (x_i - \bar x) &= nx_i^2 - \sum_{j=1}^n x_i x_j.\\ \overline{x}(x_i-\bar{x})&=x_i(x_i-\bar{x})-(x_i-\bar{x})^2 \\ \sum_{j=1}^nx_j-\bar x &= -n\bar x + \sum_{j=1}^n x_j = 0 \text{, and thus} \\ \tag 2 \label 2 \sum_{j=1}^n x_j(x_j-\bar{x}) &= \sum_{j=1}^n \color{blue}{\bar{x}(x_j-\bar{x})} + (x_j-\bar{x})^2 = \color{blue}0+\sum_{j=1}^n (x_j-\bar{x})^2. \end{align}

We have \begin{split} \sum_{1\le i < j\le n} (x_i - x_j)^2 &= \frac12\sum_{i,j=1}^n (x_i - x_j)^2 \qquad \text{(by symmetry of the summand})\\ &= \frac12 \sum_{i,j=1}^n \color{blue}{x_i^2} -2x_ix_j+\color{blue}{x_j^2} \\ &= \frac12 \sum_{i,j=1}^n \color{blue}{2x_i^2} -2x_ix_j \\ &= \sum_{i=1}^n nx_i^2 - \sum_{i,j=1}^nx_ix_j \\ &= n\sum_{i=1}^n x_i(x_i-\bar x) \qquad \text{(by \eqref{1})} \\ &= n\sum_{i=1}^n (x_i-\bar x)^2 \qquad \text{(by \eqref{2})}. \end{split}