Problem

Source: Israel Grosman Memorial Mathematical Olympiad 2001 p2

Tags: Sum, inequalities, algebra



If $x_1,x_2,...,x_{2001}$ are real numbers with $0 \le x_n \le 1$ for $n = 1,2,...,2001$, find the maximum value of $$\left(\frac{1}{2001}\sum_{n=1}^{2001}x_n^2\right)-\left(\frac{1}{2001}\sum_{n=1}^{2001}x_n\right)^2$$Where is this maximum attained?