Guaranteed sum

Suppose you randomly select k k of the first 2016 positive integers. What is the smallest k k that guarantees that at least one pair of the selected integers will sum to 2017?


The answer is 1009.

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

Lawrence Chiou
Feb 19, 2016

There exist 2016 / 2 = 1008 2016 / 2 = 1008 pairs of integers that sum to 2017 2017 : ( 1 , 2016 ) , ( 2 , 2015 ) , , ( 1008 , 1009 ) (1, 2016), (2, 2015), \ldots, (1008, 1009) . If only 1008 1008 integers are selected, it is possible to select the first 1008 1008 positive integers, none of which pairwise sum to 2017 2017 . By the pigeonhole principle, selecting at least 1008 + 1 = 1009 1008 + 1 = \boxed{1009} integers guarantees that at least two of the integers will be part of a pair that sums to 2017 2017 .

Selecting k intergers randomly we can select 1008 and 1009 right.The only pair possible is with these two and it sums up to 2017.So cant 'k' be 2.

Sindhuja Reddy - 2 years, 5 months ago

Log in to reply

2 doesn't guarantee that sum will add up to 2017. What if you select 45 and 48?

Gobind Singh - 2 years, 5 months ago

No! If so, then you can't guarantee that you will have exactly 1008 and 1009. You can also have 1,2 or 5,3 etc. which doesn't sum to 2017. So you have to make sure that you pick at least some integers that there exists a pair of the selected integers which sums to 2017. Now think, why didn't we take the pair 2,2015 or 3,2014 and so on?

Akash Hossain - 1 year, 9 months ago

Log in to reply

The FIRST k elements are being selected, so it's guaranteed that there will exist 1008 and 1009 consecutively

Charchit Agarwal - 1 year, 4 months ago
Steve G
Jan 2, 2018

a+b have to sum up to 2016 with a \neq b. What is the worst case we can select numbers? It's always picking the smallest number. And what is the largest possible sum we can build with a given set? The sum of the two largest elements. k set largest sum 2 { 1 , 2 } 1 + 2 = 3 3 { 1 , 2 , 3 } 2 + 3 = 5 . . . . . . . . . 1008 { 1 , 2 , . . . , 1007 , 1008 } 1007 + 1008 = 2015 1009 { 1 , 2 , . . . , 1008 , 1009 } 1008 + 1009 = 2017 \begin{array}{c}\\\text{k}&\text{set}&\text{largest sum}\\ 2&\{1,2\} &1 + 2 = 3\\ 3&\{1,2,3\} &2 + 3 = 5 \\ ...& ... & ... \\ 1008& \{1, 2, ..., 1007, 1008\} & 1007 + 1008 = 2015 \\ 1009& \{1, 2, ..., 1008, 1009\} & 1008 + 1009 = 2017 \\ \end{array}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...