3

Define a set $$X=\{(x_1,\ldots ,x_n)\mid x_i=\pm 1,1\leq i\leq n\}$$

Fix $a$, $b\in X$. Consider the discrete function $$F(x_1,\ldots,x_n)=(x_1a_1+\cdots+x_na_n)^2+(x_1b_1+\cdots+x_nb_n)^2$$ $(x_1,\ldots,x_n)\in X$.

I want to find when the function reaches the maximum. Is it at $x=a$? And how to prove it? Thank you.

gaoxinge
  • 4,434

1 Answers1

3

Say $S$ is the set of $j$ with $a_j=b_j$ and $T$ is the set of $j$ with $a_j=-b_j$. Let $$A(x)=\sum_{j\in S}a_jx_j,\quad B(x)=\sum_{j\in T}a_jx_j.$$ Then $$F(x)=(A+B)^2+(A-B)^2=2A(x)^2+2B(x)^2.$$

Since none of the variables appear in both $A(x)$ and $B(x)$ we get the maximum by maximizing $A^2$ and $B^2$ separately. And so the maximum of $F$ is $$2|S|^2+2|T|^2,$$where $|S|$ denotes the number of elements of $S$ and I'll just let you guess what $|T|$ is.

Ah, you wanted to know when $F$ is maximized. Looks like the maximum is achieved at four points: $x=a,b,-a,-b$.

And we get the minimum by minimizing $A^2$ and $B^2$ separately. The minimum of $A^2$ is $0$ or $1$ depending on whether $|S|$ is even or odd. Similarly for $B^2$, so the minimum of $F$ is $0$, $2$, or $4$, depending on the parity of $|S|$ and $|T|$.