I want to determine the subset of $m$ members ($m < n/2$) of the set $e^{i 2\pi k/n}, \ \ k=0,\dots, n-1$, so that the absolute value of its sum is maximal.
-
7$\begingroup$ This is easy: arrange these roots of unity by their real parts $\cos{2\pi k/n}$ and take the $m$ 'rightmost' roots of unity, giving the $m$ largest real parts. You may argue geometrically to prove that you can't do any better for maximizing the absolute value of the sum. $\endgroup$– Vesselin DimitrovCommented Jul 23, 2018 at 20:45
-
$\begingroup$ & Vesselin Dimitrov, can you give a proof? $\endgroup$– LiraCommented Jul 24, 2018 at 5:59
1 Answer
A simple geometric argument is based on the following observation about vectors: $$|\overrightarrow{u}+\overrightarrow{v}|^2=|\overrightarrow{u}|^2+|\overrightarrow{v}|^2+2\overrightarrow{u}\cdot \overrightarrow{v},$$ where $\overrightarrow{u}\cdot \overrightarrow{v}=|\overrightarrow{u}||\overrightarrow{v}|\cos \theta$ is the dot product. To maximize the length of the sum of vectors, the angle $\theta$ has to be as small as possible. This leads to the requirement that in the sum of roots of unity, there should be no "gaps". If there is a gap (that is, if the roots of unity are not consecutive), then one can split the sum into two subsums and write it as the sum of two vectors, where they are separated by at least one root of unity. Then by the above observation, one can apply a suitable rotation to make the length of the sum greater. This is a contradiction.
In fact, by direct computation, the maximum can be achieved by taking the sum to be $v:=1+\zeta+\cdots+\zeta^{m-1}$ ($m< n/2$), where $ \zeta=e^{2\pi i/n}$. In this case, $$|v|=\frac{\sin m\pi/n}{\sin \pi/n}.$$