Consider a pyramid with 2017 rows made up of empty boxes. The first (top) row has 1 box, and each successive row has an additional box so that the 2 0 1 7 th , bottom row has 2017 boxes.
First, place each of the first 2017 positive integers into the boxes in the bottom row. Then, each empty box in the 2 0 1 6 th row is filled with the sum of the two numbers beneath it. Then, each successively higher row of boxes is filled in the same way.
Let M and m be the maximum and minimum possible values, respectively, of the single box on the top. Then M + m = a × 2 b , where a and b are positive integers such that b is as large as possible. Find the value of a + b .
Note : Below is an example of how a pyramid of 4 rows could be filled.
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.
I did exactly the same but I didn't notice the column sum. 😬😁
Note: this is an instance where the "itchy fingers to simplify the expression" actually somewhat backfires.
This is a rewrite of my original solution, more thoroughly reasoned per Calvin Lin's wishes.
Let A k with k = 1 , … , 2 0 1 7 be an arrangement of the numbers { 1 , … , 2 0 1 7 } in the bottom row of the diagram. Define A k ′ = 2 0 1 8 − A k ; it is easy to see that A k ′ is also a valid arrangement of these numbers. I will call these arrangements dual to each other.
I will write Σ A for the value in the top box generated by arrangement A k . It is easy to see that it is a weighted sum: Σ A = k = 1 ∑ 2 0 1 7 f k A k for some constants f k . We do not need the exact values of f k ; the only important thing is that their sum is C = ∑ k f k = 2 2 0 1 6 . This may be seen as follows: each box in the second row from the bottom is the sum of two terms from the bottom row; each box in the third row from the bottom is the sum of four terms from the bottom row; each box in the fourth row from the bottom, the sum of eight terms; and so on, until we reach the 2017th row from the bottom, which is the top box.
The next observation to make is that for two dual arrangements { A k , A k ′ } , Σ A + Σ A ′ = 2 0 1 8 C . Proof: Σ A + Σ A ′ = k = 1 ∑ 2 0 1 7 f k A k + k = 1 ∑ 2 0 1 7 f k ( 2 0 1 8 − A k ) = k = 1 ∑ 2 0 1 7 2 0 1 8 f k = 2 0 1 8 C .
Now I claim that any arrangement with maximum sum is the dual of an arrangement with minimum sum, and vice versa. We can see that as follows. Suppose that A k is an arrangement with maximum sum, and B k ′ is an arrangement with minimum sum. Then Σ A ′ = 2 0 1 8 C − Σ A ≤ 2 0 1 8 C − Σ B = Σ B ′ (because by definition of "maximum", Σ A ≥ Σ B ). However, since Σ B ′ is a minimum, we also have Σ A ′ ≥ Σ B ′ , and it follows that therefore Σ A ′ = Σ B ′ is also minimal, and Σ B = Σ A is also maximal.
Finally, then, choosing such a max-min pair of dual arrangements { A k , A k ′ } , we get M + m = Σ A + Σ A ′ = 2 0 1 8 C = 2 0 1 8 ⋅ 2 2 0 1 6 = 1 0 0 9 ⋅ 2 2 0 1 7 , making the final answer 3 0 2 6 .
Amazing solution!!!
Can you explain the first paragraph in more detail? This isn't immediately obvious to me.
In fact, the solution would have been much better presented by reordering the steps. First show that we can pair up the arrangement. Hence the max and min will have the paired sum.
Log in to reply
The key fact is that the value in the top box is a weighed sum of the values in the bottom boxes. (The coefficients A k are actually the binomial coefficients ( k − 1 2 0 1 6 ) , but that does not matter much.)
If A k is an arrangement of { 1 , 2 , … , 2 0 1 7 } with weighed sum S = ∑ k f k A k , then a k = 2 0 1 8 − A k is an arrangement of { 1 , 2 , … , 2 0 1 7 } with weighed sum s = ( 2 0 1 8 ∑ f k ) − S .
Since S + s = constant , s is minimal whenever S is maximal and vice versa.
Log in to reply
Right, that's my point about the order of the logic presented. It should be:
Point 2 isn't obvious without point 1. IE Why if { a i } yields the maximum then { 2 0 1 8 − a i } yields the minimum? Especially since there are numerous ways to achieve this "minimum value", so how do we know that we couldn't do better?
Log in to reply
@Calvin Lin – Call two arrangements A i and A i ′ = 2 0 1 8 − A i dual arrangements.
Given any pair of dual arrangements, the corresponding sums Σ A and Σ A ′ satisfy Σ A + Σ A ′ = C , where C = 2 0 1 8 ∑ k f k = 2 0 1 8 ⋅ 2 2 0 1 6 .
My claim is that if an arragement has maximum sum M , then its dual necessarily has minimum sum m .
Suppose this was not true. I.e. there is a pair of dual arrangements { A , A ′ } such that A has maximal sum but A ′ does not have minimal sum. Then there exists a different pair of dual arrangements { B , B ′ } such that B ′ has minimal sum, and Σ B ′ < Σ A ′ . But then Σ B = C − Σ B ′ > C − Σ A ′ = Σ A ; but then arragement B would produce a greater sum than arragement A , contrary to our assumption that A has maximum sum. Therefore when A is maximal, the dual arrangement A ′ is necessarily minimal. The converse is proven in the same way.
Log in to reply
@Arjen Vreugdenhil – Yes, I am in agreement with you.
What I'm saying is that point 2 is hard to prove without explicitly using point 1. As such, in the presentation of the solution, we would ideally present point 1 as a lemma first (which is what you have done in the comment, but not in the solution).
Log in to reply
@Calvin Lin – I will update my solution by filling in the details :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
1 2 |
|
A pythonic solution
When we form one of these pyramids, the maximum value obtainable when going through the process is obtained when the middle number(s) (depending on whether the number at the bottom is even or odd) are maximized. Similarly, the minimum value is obtained when the middle number(s) is minimized. This is because as we go up the pyramid, the middle numbers expand outward and are added with the most numbers, affecting the outcome the most. Through some testing with smaller numbers, we can get a set of coordinate points, with x being the largest number at the bottom and y being M + m : ( 2 , 3 + 3 ) ; ( 3 , 7 + 9 ) ; ( 4 , 1 6 + 2 4 ) . Comparing the y values to the equation given in the question, we see that the formula for any number is simply ( n + 1 ) ⋅ 2 n − 1 . Plugging in our values, we get ( 2 0 1 7 + 1 ) ⋅ 2 2 0 1 7 − 1 = 2 0 1 8 ⋅ 2 2 0 1 6 = 1 0 0 9 ⋅ 2 2 0 1 7 ⟹ a + b = 1 0 0 9 + 2 0 1 7 = 3 0 2 6 . I know this was kind of a cheating strategy using the given equation. The complete way to go about solving this would use combinatorics, which I was too lazy to use.
To see the combinatorics answer, Steven Yuan has a great explanation for it.
Problem Loading...
Note Loading...
Set Loading...
Relevant wiki: Properties of Binomial Coefficients
Let's represent the bottom-most row of the pyramid by { a 0 , a 1 , a 2 , … , a 2 0 1 6 } , which is a permutation of the first 2017 positive integers. Each integer represents a value in a box.
Let S be the value in the top-most box. We can find that this value is
S = i = 0 ∑ 2 0 1 6 ( i 2 0 1 6 ) a i = ( 1 0 0 8 2 0 1 6 ) a 1 0 0 8 + i = 0 ∑ 1 0 0 7 ( i 2 0 1 6 ) ( a i + a 2 0 1 6 − i ) .
Notice that ( 1 0 0 8 2 0 1 6 ) ≥ ( 1 0 0 7 2 0 1 6 ) ≥ ( 1 0 0 6 2 0 1 6 ) ≥ ⋯ ≥ ( 1 2 0 1 6 ) ≥ ( 0 2 0 1 6 ) . Therefore, by the Rearrangement Inequality, the maximum value of S occurs when
a 1 0 0 8 = 2 0 1 7 , { a 1 0 0 7 , a 1 0 0 9 } = { 2 0 1 6 , 2 0 1 5 } , { a 1 0 0 6 , a 1 0 1 0 } = { 2 0 1 4 , 2 0 1 3 } , … , { a 0 , a 2 0 1 6 } = { 2 , 1 } ,
while the minimum value occurs when
a 1 0 0 8 = 1 , { a 1 0 0 7 , a 1 0 0 9 } = { 2 , 3 } , { a 1 0 0 6 , a 1 0 1 0 } = { 4 , 5 } , … , { a 0 , a 2 0 1 6 } = { 2 0 1 6 , 2 0 1 7 } .
Thus,
M m = = 2 0 1 7 ( 1 0 0 8 2 0 1 6 ) ( 1 0 0 8 2 0 1 6 ) + + ( 2 0 1 6 + 2 0 1 5 ) ( 1 0 0 7 2 0 1 6 ) ( 2 + 3 ) ( 1 0 0 7 2 0 1 6 ) + + ( 2 0 1 4 + 2 0 1 3 ) ( 1 0 0 6 2 0 1 6 ) ( 4 + 5 ) ( 1 0 0 6 2 0 1 6 ) + + ⋯ ⋯ + + ( 2 + 1 ) ( 0 2 0 1 6 ) ( 2 0 1 6 + 2 0 1 7 ) ( 0 2 0 1 6 ) .
If we add along each column, notice that we can pair off the coefficients i and 2 0 1 8 − i to get 2018. We have
M + m = 2 0 1 8 ( 1 0 0 8 2 0 1 6 ) + 2 ( 2 0 1 8 ) ( 1 0 0 7 2 0 1 6 ) + 2 ( 2 0 1 8 ) ( 1 0 0 6 2 0 1 6 ) + ⋯ + 2 ( 2 0 1 8 ) ( 0 2 0 1 6 ) = 2 0 1 8 ( ( 1 0 0 8 2 0 1 6 ) + 2 i = 0 ∑ 1 0 0 7 ( i 2 0 1 6 ) ) = 2 0 1 8 i = 0 ∑ 2 0 1 6 ( i 2 0 1 6 ) = 2 0 1 8 × 2 2 0 1 6 = 1 0 0 9 × 2 2 0 1 7 .
Finally, we have a + b = 1 0 0 9 + 2 0 1 7 = 3 0 2 6 .
Generalization: For a pyramid with k rows, if we fill the bottom-most row with the first k positive integers, the sum of the maximum and minimum possible values of the top-most box will be ( k + 1 ) 2 k − 1 .