# Maximizing the pairwise point distance in $[-1,1]$

How can we prove that, given $$n$$ points in $$[-1,1]$$, the sum of all their pairwise Euclidean distances (or, equivalently, their average Euclidean distance) is maximized if $$\lfloor n/2 \rfloor$$ points are placed at $$-1$$ and the remaining points are placed at $$1$$?

• Pairwise Distance to what? Nov 9 '20 at 1:21

WLOG assume $$-1 \leqslant x_1 \leqslant x_2 \leqslant \cdots \leqslant x_n \leqslant 1$$.
Total distance is $$\sum_{i
$$"=" \iff x_1=x_2=\cdots =x_{\lceil\frac{n-1}{2}\rceil}=-1, x_{\lfloor\frac{n+3}{2}\rfloor}=\cdots=x_n=1.$$
If $$n$$ is odd then $$x_{\frac{n+1}{2}}$$ can be anywhere between -1 and 1.