Hello how can I find the minimum value of $$\sum_{1\le i \lt j \le 2022} a_ia_j $$ Where $ a_i $ and$ a_j $ are -1 or 1?
My thought was that the number of -1 and 1 (so 1011 -1's and 1011 1's) should be same but I'm not sure if that is right.
Hello how can I find the minimum value of $$\sum_{1\le i \lt j \le 2022} a_ia_j $$ Where $ a_i $ and$ a_j $ are -1 or 1?
My thought was that the number of -1 and 1 (so 1011 -1's and 1011 1's) should be same but I'm not sure if that is right.
$$ (\sum_{i=1}^{2022} a_i)^2 = \sum_{i=1}^{2022}a_i^2 \; + 2\sum_{1\le i<j \le 2022} a_ia_j $$
Since $a_i^2$ is always $1$,
$$ \sum_{1\le i<j \le 2022} a_ia_j = \frac{(\sum_{i=1}^{2022} a_i)^2 -2022}{2}$$
The minimun of $(\sum_{i=1}^{2022} a_i)^2$ is $0$, therefore the minimum of $\sum_{1\le i<j \le 2022} a_ia_j$ is $-1011$.
Let the sum be $x$. Then $2x+\sum a_i^2=(\sum a_i)^2$. Since $\sum a_i^2=2022$, you need to minimize $|\sum_{i=1}^{2022} a_i|$. The minimum is $0$ and is achieved iff $1011$ of $a_i$ are $1$ and the other $a_i$ are $-1$. Hence the minimum of $x$ is $(0-2022)/2=-1011$.