AlgebraDifficulty 5.4AIME, harderProve itUnited States
Problem: Let a1,a2,…,a2000 be real numbers in the interval [0,1]. Find the maximum possible value of 1≤i<j≤2000∑(j−i)∣aj−ai∣
Solution
Solution: The answer is 1,000,000,000. First, note that the desired sum S is convex as a function of each ai. (Indeed, ∣ai−a∣ is convex for any real number a, and a sum of convex functions is itself convex.) Consequently, it attains a maximum at some point where each variable lies at an endpoint of its interval, i.e. S has a maximum with each ai equal to either 0 or 1. So we may restrict our attention to these cases.
Then ∣aj−ai∣=0 if ai=aj and 1 otherwise, so S is really the sum of all values of j−i where ai=aj. Equivalently, it equals ∑1≤i<j≤2000(j−i) minus the sum of j−i over pairs for which ai=aj. So our goal is equivalent to minimizing the latter sum. Fix a positive integer k, and suppose there are k values of i with ai=0 (and 2000−k values with ai=1). If we consider the sum of j−i over all pairs i<j with ai=aj=0, this sum is clearly minimized when all the i's with ai=0 are consecutive; likewise the sum over all pairs with ai=aj=1 is minimized when all the 1's are consecutive. So we may restrict our attention to the case where a1=a2=⋯=ak=0 and ak+1=⋯=a2000=1. (The case where the block of 1's precedes the block of 0's is symmetrically equivalent.)
In this case, the sum S comes out to be =1≤i<j≤2000ai=aj∑(j−i)=i=1∑kj=k+1∑2000(j−i)=j=k+1∑2000(i=1∑kj)−i=1∑kj=k+1∑2000i=j=k+1∑2000kj−i=1∑k(2000−k)i2(2000−k)(2000+[k+1])−(2000−k)2k(k+1)=1000k(2000−k)=1000(10002−[k−1000]2) which is at most 10003, with equality holding iff k=1000. So 10003 is our desired maximum, attained when ai=0 for i≤1000 and ai=1 for i>1000.
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.
Source: MathNet,
licensed CC-BY-4.0.
Statement reproduced verbatim; metadata (topic, difficulty) added by this project.