Minimizing the Number of Pairwise Sums

Set A A consists of n = 10000 n=10000 distinct real numbers. The smallest and the next smallest elements of A A are 13 13 and 31 , 31, respectively. You are free to choose the other 9998 9998 elements of A A . Define A + A = { a i + a j 1 i , j n } , A+A=\{a_i+a_j|1 \leq i,j \leq n\}, which is the set of all pairwise sums of numbers from A A . For example, for A = { 31 , 13 } , A + A = { 26 , 62 , 44 } A=\{31,13\}, A+A=\{26,62,44\} and A + A = 3 |A+A|=3 .

Among all the sets that satisfy the above properties, let the set A A^* minimize the cardinality of the pairwise sums A + A |A^*+A^*| . Define C = A + A and S = a A a . C=|A^*+A^*|\ \textrm{ and }\ S=\sum_{a\in A^*}a. Find C + S 1 C+S-1 .


The answer is 900059998.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Calvin Lin Staff
Sep 20, 2017

We solve this problem for general n n .

Let A = { a 1 , a 2 , , a n } A = \{ a_1, a_2, \ldots , a_n \} where the elements are arranged in increasing order. Observe that

a 1 + a 1 < a 1 + a 2 < a 1 + a 3 < < a 1 + a n 1 < a 1 + a n < a 2 + a n < < a n 1 + a n a_1 + a_1 < a_1 + a_2 < a_1 + a_3 < \ldots < a_1 + a_{n-1} < a_1 + a_n < a_2 + a_n < \ldots < a_{n-1} + a_n

Thus, this tells us that there must be at least 2 n 1 2n -1 elements in A + A A + A .

Conversely, if there are exactly 2 n 1 2n-1 elements in A + A A + A , consider a i + a j a_i + a_j . We can similarly create a chain to demonstrate that

a 1 + a 1 < a 1 + a 2 < < a 1 + a j < a 2 + a j < < a i + a j < a i + 1 + a j < < a n + a j < a n + a j + 1 < < a n + a n a_1 + a_1 < a_1 + a_2 < \ldots < a_1 + a_j < a_2 + a_j < \ldots < a_i + a_j < a_{i+1} + a_j < \ldots < a_n + a_{j} < a_n + a_{j+1} < \ldots < a_n + a_n

Since there are 2 n + 1 2n+1 terms in this sequence, it must exactly match the first sequence. We can thus conclude that:

  • If i + j n + 1 i + j \leq n + 1 , then a i + a j = a 1 + a i + j 1 a_i + a_j = a_1 + a_{i+j-1 } .
  • If i + j n + 1 i+j \geq n+1 , then a i + a j = a n + a i + j n a_i + a_j = a_n + a_{i+j - n} .

Hence, (skipping a step) we can conclude that a i a_i is an arithmetic sequence.

@Abhishek Sinha My way provides more insight into what is happening. :P

Calvin Lin Staff - 3 years, 8 months ago

Log in to reply

Well, proof by induction progresses along (almost) the same line. In my opinion, establishing that the optimal sequence is in AP is slightly cleaner by induction, as there we have to worry about the last term only.

Abhishek Sinha - 3 years, 8 months ago

Log in to reply

I agree that the first part is obvious by induction, because we have the additional terms a n + a n + 1 a_{n} + a_{n+1} and a n + 1 + a n + 1 a_{n+1} + a_{n+1} .

However, the second part is not obvious to me. For example, I do not see how to conclude that a 1 + a n + 1 = a 2 + a n a_{1} + a_{n+1} = a_2 + a_n without using the chain to force the position. From the phrase of "we have to worry about the last term only", are you assuming that the "best case scenario for P n + 1 P_{n+1} must arise from the best case scenario for P n P_{n} ?

Calvin Lin Staff - 3 years, 8 months ago

Log in to reply

@Calvin Lin No assumption- the whole scenario follows right from induction. First, it is enough to consider only sorted sets A A . Assume the result to be true for some n n . Since at least two new elements are added to the pairwise sum-set, it follows that if the sum-set for P n + 1 P_{n+1} contains 2 ( n + 1 ) 1 2(n+1)-1 elements, then the sum-set for P n P_n must contain 2 n 1 2n-1 elements. Thus, by induction assumption, P n P_n is already in A.P.

Abhishek Sinha - 3 years, 8 months ago

Log in to reply

@Abhishek Sinha Ah nice. I see how that works.

I still stand by "my solution provides more insight". We're using the restriction on the number of values to help us determine which terms are equal.

Let's agree to disagree :)

Calvin Lin Staff - 3 years, 8 months ago

I think its easier to see with induction

<> <> - 3 years, 8 months ago
Abhishek Sinha
Sep 19, 2017

I am only posting a hint for now. Show that the following two results hold:

Proposition 1: A + A A^*+A^* has 2 n 1 2n-1 elements.

Proposition 2: The sorted elements of A A^* are in A.P.

These results can be proved easily using induction (Hint: Use induction on n n after sorting the set A A ), and left as an exercise.

From the above propositions, it follows that common difference of the A.P. is 31 13 = 18 31-13=18 , with the first term equal to 13 13 . Hence S = 90004000 S= 90004000 , and C = 2 n 1 = 19999 C=2n-1=19999 . The result follows from it.

Ah, this is one problem where using induction "obscures" what is going on. The "direct" solution provides more insight.

Calvin Lin Staff - 3 years, 8 months ago

Log in to reply

We agree to disagree :P

Abhishek Sinha - 3 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...