I have asked a question about a maximum of discrete function yesterday at a Maximum of Discrete Function.
I want to generalize the question. Let $X=\{(x_1,\ldots ,x_n)\mid x_i=\pm 1,1\leq i\leq n\}$.
Fix $\vec{a}_1,\cdots,\vec{a}_m\in X$. Consider the discrete function $$F(\vec{x})=\sum_{i=1}^{m}(\vec{x}^T\vec{a}_i)^2,~~~~~~~\vec{x}\in X$$
I want to find when the function reaches the maximum. Is it at $\vec{x}=\vec{a}_i$, for some $i$? And how to prove it? Thank you.