Given reals $a_1, a_2, \cdots, a_{n - 1}, a_n$ such that $\sum_{i = 1}^na_1^2 = 1$. Calculate the maximum value of $\sum_{cyc}|a_1 - a_2|$.
Solution 1:
The maximal value is $2\sqrt{n-1}$ if $n$ is odd, and $2\sqrt{n}$ if $n$ is even. We can prove the following:
Let $a_1, \ldots, a_n$ be real numbers, $n \ge 2$. Then $$ \tag{*} |a_1 - a_2| + |a_2 - a_3| + \ldots + |a_{n - 1} - a_n| + |a_n - a_1| \le c_n \sqrt{a_1^2 + \ldots + a_n^2} $$ where $c_n = 2\sqrt{n-1}$ if $n$ is odd, and $c_n = 2\sqrt{n}$ if $n$ is even. The bounds are sharp.
Proof: Case 1: $n$ is even. Then $$ |a_1 - a_2| + |a_2 - a_3| + \ldots + |a_{n - 1} - a_n| + |a_n - a_1| \\ \underset{(1)}{\le} \sum_{k=1}^n (|a_k| + |a_{k+1}|) = 2 \sum_{k=1}^n (1 \cdot |a_k|) \underset{(2)}{\le} 2 \sqrt{n} \sqrt{\sum_{i=1}^{n} a_i^2 } \, , $$ where the last step uses the Cauchy-Schwarz inequality.
Equality holds at $(1)$ if the $a_k$ have alternating signs, and equality holds at $(2)$ if all $|a_k|$ are equal. It follows that equality holds in $(*)$ exactly if $$ (a_1, \ldots, a_n) = (x, -x, \ldots, x, -x) $$ for some $x \in \Bbb R$.
Case 2: $n$ is odd. There must be (at least) one index $k$ such that $a_{k-1} - a_k$ and $a_k - a_{k+1}$ have the same sign. Without loss of generality $k=n$, so that $$ |a_{n-1} - a_n | + |a_n - a_{1}| = |a_{n-1} - a_{1}| \, . $$ Then, using the already proven estimate for the even number $n-1$, $$ |a_1 - a_2| + |a_2 - a_3| + \ldots + |a_{n - 1} - a_n| + |a_n - a_1| \\ = |a_1 - a_2| + |a_2 - a_3| + \ldots + |a_{n - 1} - a_1| \\ \underset{(3)}{\le} 2\sqrt{n-1} \sqrt{\sum_{i=1}^{n-1} a_i^2 } \underset{(4)}{\le} 2\sqrt{n-1} \sqrt{\sum_{i=1}^{n} a_i^2 } \, . $$
Equality holds at $(3)$ if $(a_1, \ldots, a_{n-1}) = (x, -x, \ldots, x, -x)$, and equality at $(4)$ holds if $a_n = 0$. It follows that equality holds in $(*)$ exactly if $$ (a_1, \ldots, a_n) = (x, -x, \ldots, x, -x, 0) $$ for some $x \in \Bbb R$, or a cyclic rotation thereof.
Solution 2:
We have that $|x - y| = 2 \cdot \max(x, y) - (x + y)$
$$\implies \sum_{cyc}|a_1 - a_2| = 2 \cdot \left[\sum_{cyc}\max(a_1, a_2) - \sum_{i = 1}^na_1\right]$$
which could be rewritten as $$\sum_{cyc}|a_1 - a_2| = 2 \cdot \sum_{i = 1}^nx_ia_i$$ where $x_i \in \{-1, 0, 1\}, i = \overline{1, n}$ and $\displaystyle\sum_{i = 1}^nx_i = 0$.
In the case of $n$ being odd-numbered, there must exist $m$ $(1 \le m \le n)$ such that $x_m = 0$, otherwise $\displaystyle\sum_{i = 1}^nx_i$ would be odd.
Let $x_n = 0$, we obtain that $$\sum_{cyc}|a_1 - a_2| \le 2 \cdot \sum_{i = 1}^{n - 1}x_ia_i \le 2 \cdot \sum_{i = 1}^{n - 1}|a_i| \le 2\sqrt{(n - 1) \cdot \sum_{i = 1}^{n - 1}a_i^2} = 2\sqrt{n - 1}$$
The equality sign occurs when $a_i = \pm \sqrt{\dfrac{1}{n - 1}}, i = \overline{1, n - 1}$ and $a_n = 0$ such that $\displaystyle\sum_{i = 1}^{n}a_1 = 0$.
The same progress could be done for even-numbered values of $n$.