23. Given $n \in \mathbf{N}$ and $a \in[0, n]$, under the condition $\sum_{i=1}^{n} \sin ^{2} x_{i}=a$, find the maximum value of $\sum_{i=1}^{n} \sin 2 x_{i} \mid$. (1983 Czechoslovak Mathematical Olympiad Problem)
23. Since $\sum_{i=1}^{n} \sin ^{2} x_{i}=a$, then $\sum_{i=1}^{n} \cos 2 x_{i}=\sum_{i=1}^{n}\left(1-2 \sin ^{2} x_{i}\right)=n-2 a$. Consider $n$ unit vectors in the plane $\left(\cos -2 x_{i}, \sin 2 x_{i}\right), i=1,2, \cdots, n$. By the Cauchy-Schwarz inequality, the length of their sum does not exceed $n$, i.e.,
$$\begin{array}{c}
\left(\sum_{i=1}^{n} \cos 2 x_{i}\right)^{2}+\left(\sum_{i=1}^{n} \sin 2 x_{i}\right)^{2} \leqslant n\left(\sum_{i=1}^{n} \cos ^{2} x_{i}\right)+n\left(\sum_{i=1}^{n} \sin ^{2} x_{i}\right)= \\
n \sum_{i=1}^{n}\left(\cos ^{2} x_{i}+\sin ^{2} x_{i}\right)=n
\end{array}$$

Thus,
$$\left|\sum_{i=1}^{n} \sin 2 x_{i}\right| \leqslant \sqrt{n^{2}-(n-2 a)^{2}}=2 \sqrt{a(n-a)}$$

On the other hand, if we take
$$x_{1}=x_{2}=\cdots=x_{n}=\arcsin \sqrt{\frac{a}{n}}$$

then
$$\begin{array}{l}
\sum_{i=1}^{n} \sin ^{2} x_{i}=n\left(\sqrt{\frac{a}{n}}\right)^{2}=a \\
+\sum_{i=1}^{n} \sin 2 x_{i} \left\lvert\,=\sum_{i=1}^{n} 2\left(\frac{\sqrt{a(n-a)}}{n}\right)=2 \sqrt{a(n-a)}\right.
\end{array}$$

Therefore, the maximum value of $\sum_{i=1}^{n} \sin 2 x_{i}$ is $2 \sqrt{a(n-a)}$.