Let $n$ be a fixed positive integer. Find the maximum possible value of \[ \sum_{1 \le r < s \le 2n} (s-r-n)x_rx_s, \]where $-1 \le x_i \le 1$ for all $i = 1, \cdots , 2n$.
Problem
Source: 2015 ISL A3
Tags: inequalities, algebra, IMO Shortlist, multivariate polynomial, maximization, n-variable inequality, Hi
07.07.2016 23:59
This solution is due to Michael Kural and David Stoner. Let $F = \sum_{1 \le r < s \le 2n} (s-r-n) x_rx_s$ be the objective function. We claim $F \le n(n-1)$ is the maximum, achieved when $x_i = (-1)^i$. By linearity, we can assume $x_i \in \{\pm1\}$. First, define the partial sums \begin{align*} a_i &= x_1 + \dots + x_i \\ b_i &= x_{2n} + \dots + x_i \end{align*}for each $i=1,\dots,2n$ (thus each $a_i$ and $b_i$ is an integer). Also, let $c = x_1 + \dots + x_{2n} = a_{2n} = b_1$. Then we have \begin{align*} \sum_{i=1}^{2n} (a_i^2 + b_i^2) &= \sum_{1 \le r < s \le 2n} \left( (2n+1-s) + r \right)2x_rx_s + \sum_{1 \le r \le 2n} (2n+1) x_r^2 \\ &= 2(n+1) \sum_{1 \le r < s \le 2n} x_rx_s - 2F + (2n+1) \sum_{1 \le r \le 2n} x_r^2 \\ &= (n+1) c^2 - 2F + n \sum_{1 \le r \le 2n} x_r^2 \\ &= (n+1) c^2 - 2F + 2n^2. \end{align*}Thus \[ 2F \le (n+1)c^2 + 2n^2 - \sum_{i=1}^{2n} (a_i^2+b_i^2) \]Now, by computing the difference $a_i^2 + b_{2n+1-i}^2 - \frac{1}{2} c^2$ for $i=1,2,\dots,2n-1$, (which is of the form $X^2+Y^2-\frac{1}{2} (X+Y)^2 = \frac{1}{2} (X-Y)^2$), we find that \begin{align*} \sum_{i=1}^{2n} (a_i^2+b_i^2) - (n+1)c^2 &= \frac{1}{2}(x_1-x_2-x_3-\dots-x_{2n-1}-x_{2n})^2 \\ &+ \frac{1}{2}(x_1+x_2-x_3-\dots-x_{2n-1}-x_{2n})^2 \\ &+ \frac{1}{2}(x_1+x_2+x_3-\dots-x_{2n-1}-x_{2n})^2 \\ &+ \dots \\ &+ \frac{1}{2}(x_1+x_2+x_3+\dots+x_{2n-1}+x_{2n})^2. \end{align*}Within each consecutive pair of these sums, one of the sums is at least $2$, contributing $\frac{1}{2} \cdot 2^2 = 2$. Thus we conclude that the entire sum must be at least $2n$. So, $2F \le 2n^2 - 2n \implies F \le n(n-1)$ as desired.
08.07.2016 03:51
Here is the Inspiring solution given by the shortlist (First three lines from solution posted above) Let $F =\sum_{1 \le r < s \le 2n} (s-r-n) x_rx_s$ be the objective function. We claim $F \le n(n-1)$ is the maximum, achieved when $x_i = (-1)^i$. By linearity, we can assume $x_i \in \{\pm1\}$. First, define the partial sums \begin{align*} a_i &= x_1 + \dots + x_i \\ b_i &= x_{2n} + \dots + x_i \end{align*}for each $i=1,\dots,2n$ (thus each $a_i$ and $b_i$ is an integer). Now for all integers $1 \le k \le 2n$ define $T_k = (a_{i-1}-b_{i+1})^2$ (here $a_0 = 0$ and $b_{2n+1} = 0$) Consider $Q=\sum_{p=1}^{2n} T_p$ In the full expansion of this sum notice that for $1 \le r < s \le 2n, x_rx_s$ the coefficient is $$2(r-1)+2(2n-s)-2(s-r-1) = -4s+4n+4r = - 4(s-r-n)$$ Thus $Q = -4F + (2n-1) \sum_{i=1}^{2n} (x_i)^2 = -4F + (2n-1)(2n) = -4F+4n^2-2n$ and so $4F = 4n^2-2n-Q$. Thus, we wish to minimize $Q$ Now remark that each $T_k$ is $(\text{odd number of terms which are -1 or 1})^2$ meaning we have $T_k \ge 1 \implies Q \ge 2n$ But this means $4F \le 4n^2-2n-2n = 4n^2-4n$ or $F \le n^2-n = n(n-1)$ as desired. oops thanks @below
08.07.2016 03:55
@above wrong inequality signs on the last line- should be $\le$ not $\ge$
09.07.2016 08:34
Darn. That's a horrible looking expression. Call that $F$ like the above. Of course, looking at this expression as a linear function of $x_i$ for each $x_i$, we can assume $x_i = \pm 1$. Okay so that $x_rx_s$ term implies that we have to square some stuff up. Take the partial sum $s_i = \sum_{k=1}^i x_k$. Then $\sum_{i=1}^{2n} s^2_i$ will have $2(2n+1-s)x_rx_s$. So for us to have $2s-2r-2n$, we have to find another sum of squares of partial sum which gives us $2rx_rx_s$. Of course, this is the partial sum $t_i = \sum_{k=i}^{2n} x_k$. Then $\sum_{i=1}^{2n} t^2_i$ will have $2rx_rx_s$. Define $t_{2n+1}=0$. This is for later calculations. Now let's calculate this. $$\sum_{i=1}^{2n} (s^2_i+t^2_i) = (2n+1) \sum_{i=1}^{2n} x^2_i + \sum_{1\le r<s \le 2n} (4n+2-2s+2r)x_rx_s$$$$= (2n+1) \sum_{i=1}^{2n} x^2_i - 2F + (2n+2) \sum_{1\le r < s \le 2n} x_rx_s = (n+1) (\sum_{i=1}^{2n} x_i)^2 - 2F + n\sum_{i=1}^{2n} x^2_i = (n+1) (\sum_{i=1}^{2n} x_i)^2 - 2F + 2n^2$$ In another words, $$2F = 2n^2 + (n-1) (\sum_{i=1}^{2n} x_i)^2 - \sum_{i=1}^{2n-1} (s^2_i + t^2_{i+1})$$Now note that $s_i+t_{i+1} = \sum_{i=1}^{2n} x_i$. Therefore, $\frac{1}{2}(\sum_{i=1}^{2n} x_i)^2 - s^2_i - t^2_{i+1} = -\frac{1}{2}(s_i-t_{i+1})^2$. Now we have $$2F = 2n^2 - \sum_{i=1}^{2n} \frac{1}{2}(s_i-t_{i+1})^2$$Notice that $(s_i-t_{i+1})-(s_{i-1}-t_i) = 2x_i$, so $s_i-t_{i+1}$ changes by $\pm 2$ as $i$ increases by $1$. Also note that $s_i-t_{i+1} \equiv 0 \pmod{2}$. To minimize the sum of squares, it is best to have $\pm 2$, $0$, $\pm 2$, $0$ $\cdots$. This gives us $2F \le 2n^2-2n$, or $F \le n(n-1)$. To show this is possible, take $x_i$ to be $1, -1, 1, -1, \cdots$. Then $s_i=1, t_{i+1}=-1$ if $i \equiv 1 \pmod{2}$, and $s_i=t_{i+1}=0$ if $i \equiv 0 \pmod{2}$. $\blacksquare$
17.04.2017 17:29
Hmm,isn't it hard for A3?I think A4 is easier than this? (Does anyone think like me?)
19.04.2017 19:05
No, the main problem is figuring out convexity. After that, it is just bash.
27.12.2018 01:13
As the expression is linear in each variable, the maximum occurs at a corner of the hypercube, i.e. when all of the $x_i$ are $\pm 1.$ We claim that the maximum is $n(n-1),$ achieved by $x_i=(-1)^i.$ The main idea is to let $\varepsilon_{i,j}=\begin{cases}1,\ |i-j|>n \\ -1,\ |i-j|<n\end{cases},$ and to write \[\sum_{1\leq r<s\leq 2n}(s-r-n)x_rx_s=\sum_{i=1}^{2n}\sum_{i+1\leq j<k\leq i+n}\varepsilon_{jk}x_{j}x_{k}.\]We can think of each term $\sum_{i+1\leq j<k\leq i+n}\varepsilon_{jk}x_jx_k.$ as an $n$-gon with consecutive vertices in the $2n$-gon shown below. With this geometric interpretation, we see that $\varepsilon_{ij}=1$ iff the segment connecting $i,j$ intersects the positive $x$-axis. Thus, taking each $x_j$ with $1<j\leq N$ to $-x_j,$ all of the coefficients become $-1.$ This is because exactly one of the endpoints of the crossing edges are switched, while $0$ or $2$ endpoints of non-crossing edges are switched. [asy][asy] int N = 10; pair[] A = new pair[N]; size(5cm); for (int i = 0; i <N; ++i) { A[i] = dir(180/N+360/N*i); } for (int i = 0; i < N; ++i) { draw(A[i]--A[(i+1)%N],lightblue); label("$"+string(i+1)+"$",A[i],dir(360/N*i+180/N)); } draw((0,0)--(1.1,0),red); draw(A[1]--A[N-1],orange+dashed); [/asy][/asy] Now $\sum_{i+1\leq j<k\leq i+n}-x_jx_k=\tfrac{x_{i+1}^2+\cdots+x_{i+n}^2-(x_{i+1}+\cdots+x_{i+n})^2}{2}=\tfrac{n-S^2}{2}.$ If $n$ is odd, $|S|\geq 1$ so each term is bounded above by $\tfrac{n-1}{2}$ and summing over all $2n$ polygons gives us the bound. If $n$ is even, analyzing the equality cases shows that the average value of $S^2$ for each term is at least $1,$ which gives us the desired bound.
06.08.2020 07:44
13.07.2021 22:10
The answer is $n^2-n$, which can be achieved by $(1,-1,1,-1,\ldots,1,-1)$. Since the expression we want to maximize is linear with respect to each variable, we can assume that $x_i$ is either $1$ or $-1$ for all $i=1,\ldots,2n$. The key step is to notice that $$\sum_{1 \leq r<s \leq 2n} (s-r-n)x_rx_s=(x_1)(x_2+\cdots+x_{2n})+(x_1+x_2)(x_3+\cdots+x_{2n})+\cdots+(x_1+\cdots+x_{2n-1})(x_{2n})-n\sum_{1 \leq i<j \leq 2n} x_ix_j$$Suppose that out of $x_1,x_2,\ldots,x_n$, $k$ of them are $1$ and $2n-k$ of them are $-1$. Then, $$\sum_{1 \leq i<j \leq 2n} x_ix_j=\dbinom{k}{2}+\dbinom{2n-k}{2}-k(2n-k)=2k^2-4nk+2n^2-n=2(k-n)^2-n.$$By AM-GM, we also know that $$(x_1+\cdots+x_i)(x_{i+1}+\cdots+x_{2n}) \leq \left(\frac{x_1+\cdots+x_n}{2}\right)^2=(k-n)^2.$$Now, we do casework on the parity of $k-n$. Case 1: $k-n$ is even. Since $(x_1+\cdots+x_i)(x_{i+1}+\cdots+x_{2n})$ is odd for all odd $i$ from $1$ to $2n-1$, we know that $$(x_1+\cdots+x_i)(x_{i+1}+\cdots+x_{2n}) \leq (k-n)^2-1$$for all odd $i$ in that range. Thus, we want to maximize $$n\left((k-n)^2-1\right)+(n-1)(k-n)^2-n\left(2(k-n)^2-n\right)=n^2-n-(k-n)^2.$$So, the expression is bounded above by $n^2-n$. Case 2: $k-n$ is odd. Since $(x_1+\cdots+x_i)(x_{i+1}+\cdots+x_{2n})$ is even for all even $i$ from $1$ to $2n-1$, we know that $$(x_1+\cdots+x_i)(x_{i+1}+\cdots+x_{2n}) \leq (k-n)^2-1$$for all even $i$ in that range. Thus, we want to maximize $$(n-1)\left((k-n)^2-1\right)+n(k-n)^2-n\left(2(k-n)^2-n\right)=n^2-n+1-(k-n)^2.$$Since $k-n$ is odd, the expression is bounded above by $n^2-n$, completing our proof.
22.07.2021 05:37
What is "linearity" thing that everybody is using(or as @G_U puts it, the corner of the hypercube)? I don't understand how you can just ignore the rest of elements? Although it feels intuitive, is there like a rigorous way to show that this assumption is valid? Also what hypercube is @G_U talking about?
15.02.2022 12:41
JustKeepRunning wrote: What is "linearity" thing that everybody is using(or as @G_U puts it, the corner of the hypercube)? I don't understand how you can just ignore the rest of elements? Although it feels intuitive, is there like a rigorous way to show that this assumption is valid? Also what hypercube is @G_U talking about? Well,for me ,I would like to write the formula as a function of x_i, and the degree is 1, which implies whenever the other elements is, the maximum occurs at the border
20.08.2024 07:24
The motivation sort of felt like "get a vibe of what the equality cases are and then combi interp/algmanip the expression to work well with those equality cases."