Simplifying the sum $\sum_{i=1}^n \sum_{j=i+1}^n({(x_i-x_j)}^2+{(y_i-y_j)}^2)$

626 Views Asked by At

I am trying to evaluate the sum here , $$\sum_{i=1}^n \sum_{j=i+1}^n({(x_i-x_j)}^2+{(y_i-y_j)}^2)$$

How do this sum can be simplified to $$n\sum_{i=1}^n({x_i}^2+{y_i}^2) - {(\sum_{i=1}^n{x_i})}^2-{(\sum_{i=1}^n{y_i})}^2$$ .

I need to understand the intermediate steps here.Thanks in advance

1

There are 1 best solutions below

1
On

Note that due to symmetry $$\sum\limits_{i = 1}^n {\sum\limits_{j = i + 1}^n {{{\left( {{x_i} - {x_j}} \right)}^2}} } = \frac{1}{2}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{{\left( {{x_i} - {x_j}} \right)}^2}} } $$, so that by expansion of the square and then sum, we have $$\sum\limits_{i = 1}^n {\sum\limits_{j = i + 1}^n {{{\left( {{x_i} - {x_j}} \right)}^2}} } = \frac{1}{2}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{x_i}^2} } + \frac{1}{2}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{x_j}^2} } - \sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {{x_i}{x_j}} } $$Now, the first and second terms in the R.H.S. of the above equation are the same and the third one is $\sum\limits_{i = 1}^n {{x_i}} \sum\limits_{j = 1}^n {{x_j}} $. I hope you could see your answer by now.