18

How can I show that for any set of $8$ distinct positive integers not exceeding $30$, there must exist two distinct $4$-elements subsets that same up to the same number?

I tried using pigeon hole principle, but i still don't get it.

There are $$\binom {8}4=70$$ four-elements subsets of an $8$-element set.

The least possible sum is $1+2+3+4=10$ and the greatest possible sum is $27+28+29+30=114$. Hence, there are $105$ sums.

I have no idea how to continue because the number of possible integer sums is greater than the number of four-element subsets. The $4$-element subsets are not necessarily non-overlapping.

Edit: For example, from $X=\{1,3,9,11,15,20,24,29\}$ , we can choose two different subsets $\{1,3,15,24\}$ and $\{3,9,11,20\}$ because they both sum up to $43$.

  • 3
    I wrote a quick computer program to check. There is no 8 element combination out of 30 (total - 5852925) that doesn't have duplicates. There is a simpler similar question that I solved using pigeonhole few days back but this one beats me. That was, out of first 28 positive numbers, if we choose any 14, then at least two pair in 14 will have same sum. – Prakash Dec 06 '19 at 17:16
  • What’s the second least/most possible sum? – Hugh Dec 07 '19 at 06:40
  • 2
    This was posted again here. In case it's from an ongoing contest, please note the contest problem policy. – joriki Dec 07 '19 at 07:14
  • For any 8 numbers there are less than 70 distinct sums which can be formed. For example, {1, 4, 9, 13, 18, 22, 27, 30} allows only 34. It is just a matter of determining which sets of 8 numbers allow the maximum number of distinct sums. – Goldbug Dec 07 '19 at 12:39
  • In some sense @Prakash-CrowCanyon already proved it, right? – WhatsUp Dec 07 '19 at 18:24
  • @WhatsUp I don't think so. We should take a look at his code, prove that it is correct and replicate his result by running the code on different computers. – Slup Dec 08 '19 at 17:18
  • @Slup Of course what I said should be understood as: he claims that he proved it. Yet we haven't seen the details of his proof. – WhatsUp Dec 08 '19 at 19:47
  • C# code: http://collabedit.com/qp543 Pls note this is not optimized, I just wrote quickly to check. Also, this is not really a proof. – Prakash Dec 09 '19 at 07:10
  • Julia version. So far I have checked this up to 39. The statement still holds. – NonalcoholicBeer Dec 09 '19 at 11:28
  • @Goldbug - As per program, max. different sums are 58. One combination that gives this count is - 30,26,22,15,4,3,2,1 – Prakash Dec 09 '19 at 11:53
  • The set ${1, 4, 7, 22, 31, 39, 40, 41}$ does not contain two 4-subsets which have the same sum. A computer search with the above mentioned Julia code could not find such an 8-subset for ${1, \dots, 40}$. So the real challenge is to prove the original problem with $30$ replaced by $40$. – NonalcoholicBeer Dec 09 '19 at 12:14
  • I am severly confused right now. If I understand the question correctly, I can use any 8 numbers lower or equal to 30 and need to find the two distinct sets of four with the same sum, right? But when I have an odd number of odd numbers, regardless of how I choose the two sets of four, they will not be both odd or both even, so the sums can not be equal. What do I miss here? – Nurator Dec 09 '19 at 12:37
  • @Nurator The sets are distinct but not necessarily disjoint – AnalysisStudent0414 Dec 09 '19 at 12:47
  • @Nurator The problem is not to find one such $8$-set, but show all such $8$-sets have at least two $4$-subsets of the same sum. – NonalcoholicBeer Dec 09 '19 at 12:48
  • 1
    @AnalysisStudent0414 Ok that makes total sense. So I cant use the same set twice, but they can share elements. Thanks! – Nurator Dec 09 '19 at 12:48
  • @v_esserman are the sets allowed to be multi sets? I know that there is a computer proof for normal sets. – Calvin Lin Dec 10 '19 at 04:19
  • @CalvinLin I think the question asks for normal sets. – NonalcoholicBeer Dec 10 '19 at 13:39

4 Answers4

5

Let the elements of $X$ be $a_1<a_2<...<a_8$ and denote the seven successive differences by $d_i=a_{i+1}-a_i.$

Consider the subsets of size $4$ which contain either $2$ or $3$ elements of $\{a_5,a_6,a_7,a_8\}$. There are $$\begin{pmatrix}4\\1\\\end{pmatrix}\begin{pmatrix}4\\3\\\end{pmatrix}+\begin{pmatrix}4\\2\\\end{pmatrix}\begin{pmatrix}4\\2\\\end{pmatrix}=52$$ of these subsets and the possible sums of their elements range from $a_1+a_2+a_5+a_6$ to $a_4+a_6+a_7+a_8$. So, by the pigeon-hole principle, we are finished unless $$a_4+a_6+a_7+a_8-(a_1+a_2+a_5+a_6)+1\ge 52$$ $$\text {i.e.} 2(a_8-a_1)\ge51+d_1+d_4+d_7.$$ Since $a_8-a_1\le 29$ we must have $d_1+d_4+d_7\le7$. Using the observations given below, $d_1,d_4,d_7$ are all different and no two can add to the third and so $\{d_1,d_4,d_7\}=\{1,2,4\}$ and $\{a_1,a_{8}\}=\{1,30\}.$

Some observations about the $d_i$.

(1) Any two non-adjacent differences are unequal.

(2) Given three non-adjacent differences, none is the sum of the other two.

(3) Given two adjacent differences, the sum of these differences can replace one of the differences in observations (1) and (2). (We still require the 'combined difference' to be non-adjacent to the other differences involved.)

The proofs of these are all elementary and of the same form. As an example, suppose we have $d_2+d_3=d_5+d_7$, which is a combination of (2) and (3). Then $$a_4-a_2=a_6-a_5+a_8-a_7.$$ The sets $\{a_4,a_5,a_7\}$ and $\{a_2,a_6,a_8\}$ then have the same sum and $a_1$, say, can be added to each.

To return to the main proof where we know that the differences $\{d_1,d_4,d_7\}=\{1,2,4\}$.

Let $d$ be a difference adjacent to whichever of $\{d_1,d_4,d_7\}$ is $1$. Then, by the observations, $\{d,d+1\}\cap\{2,4,6\}$ is empty. So $d\ge7$.

Let $d$ be a difference adjacent to whichever of $\{d_1,d_4,d_7\}$ is $2$. Then, by the observations, $\{d,d+2\}\cap\{1,3,4,5\}$ is empty. So $d\ge6$.

Let $d$ be a difference adjacent to whichever of $\{d_1,d_4,d_7\}$ is $4$. Then, again by the observations, $\{d\}\cap\{1,2,3\}$ is empty. So $d\ge4$.

The sum of the differences (which is $29$) is now at least $(1+2+4)+(7+6+4)+d$, where $d$ is the 'other' difference adjacent to $d_4$. Therefore $d_4=4$ and the two differences adjacent to it (which cannot be equal) are $4$ and $5$. The differences adjacent to the differences of $1$ and $2$ are thus forced to be $7$ and $6$, respectively. Then $a_1+a_8=a_3+a_5$ and we are finished.

  • How did you get observation (1)? I got stuck with that because it implies $a_{i-1} + a_{i+1} = 2a_i$ and I couldn't get to a contradiction (hence my comment about multisets). Similarly for (2), $d_2+d_3=d_4$ implies that $2a_4 = a_5 + a_1$. – Calvin Lin Dec 10 '19 at 19:33
  • @CalvinLin Hi. They have to be non-adjacent differences - which are the only ones I use in the proof. –  Dec 10 '19 at 19:35
  • Ah, I now understand what you're doing. Note that for (3), you might require some clarification as I interpret (3) to allow for "sum of 2 adjacent differences is unequal to another difference" which allows for $d_2+d_3 = d_4$ whereas you want the RHS to still not be adjacent to $d_2$ or $d_3$. – Calvin Lin Dec 10 '19 at 21:25
  • +1 IMO the part about "Now $a_8 - a_1 \leq 29$ ..." could be better written to express what you're trying to say, namely "Since $a_8 - a_1 \leq 29$, we need only concern ourselves with cases where $d_1 + d_4 + d_7 \leq 7$. With the following observations (1), (2), (3), we only have the case of ${1,4,7}$ to deal with." – Calvin Lin Dec 10 '19 at 21:25
  • Thanks @CalvinLin. Changes made - I think and hope that improves the readability. –  Dec 10 '19 at 22:32
2

This is NOT a proof.

I have written a code and run it, and indeed, in every $8-$plet of different numbers among $\{1,2,\ldots,30\}$, there exist (at least) two different quadruplets with the same sum.

The most interesting however is that, this holds even when $n=30$ is replaced by $n=31, ,32,\ldots,40$. In the case for $n=41$ (and apparently for every number larger than $41$), such $8-$plets do exist. In particular, for $n=41$, there exist exactly $4$ such $8-$plets: $$ 1,\,2,\,3,\,11,\, 20,\, 35,\, 38,\, 41 \\ 1,\,2,\,3,\,20,\, 29,\, 35,\, 38,\, 41 \\ 1,\,4,\,7,\,13,\, 22,\, 39,\, 40,\, 41 \\ 1,\,4,\,7,\,22,\, 31,\, 39,\, 40,\, 41 $$

  • This is also my computer search result. I guess for 30 there might be a simple solution since it's an assignment. To get anywhere to 40 might be much harder. – NonalcoholicBeer Dec 10 '19 at 15:52
  • I found it interesting to analyse your examples for $41$ along the same lines as the proof for $30$. For example, the 'worst' case for $n=30$ had the differences ${d_1,d_4,d_7}={1,2,4}$ with $4$ central, whereas for $n=41$ the counterexamples all have ${d_1,d_4,d_7}={1,3,9}$ with the $9$ central. The larger numbers allowed the differences of $1$ and $3$ to be repeated and the only pattern of differences is $1, 1, , 9, , 3, 3$ with the missing differences adding to $23$. –  Dec 10 '19 at 19:03
  • Why is this not a proof? At least assuming if you had posted the source code for your search I don't see why it wouldn't be. It might not be satisfying, elegant, scalable to larger problems, or (if you made an error) correct, but "try all options" is certainly a proof technique and applying it is certainly a proof. – orlp Dec 10 '19 at 22:40
0

An additional answer concerning the case $n=41$

The examples for $n=41$ given by @YiorgosS.Smyrlis contain some important pointers for the construction of such examples for other similar problems. This answer (too large for a comment) lists some points which at the very least show why these examples do not have two sets of size $4$ with equal sums. First we note that the last two sets of size $8$ in the examples are images of the first two under $k\to 42-k$.

(1) Modulo $9$ the numbers in the first two examples are both $1,2,3,2,2,8,2,5$.

(2) The totals of all eight numbers are odd and therefore if there were two subsets of size $4$ with equal sums they would have at least one number in common. We can delete any such numbers and suppose we have two subsets of size at most $3$ with no common elements.

(3) The numbers $1$ and $3$ are the only numbers not equal to $2$ modulo $3$ and so they are in neither subset or are both in the same subset. Since $1+3+41=45$ this severely limits the size of numbers in the other set and is easily seen to be impossible.

(4) When we ignore the numbers $1$ and $3$, the total of the remaining numbers is still odd and so our two subsets must each have just two elements.

(5) The numbers $35$ and $41$ are the only numbers not equal to $2$ modulo $9$ and so they are in neither subset or are both in the same subset. Together they are too large to have the same sum as any other pair of numbers and so they can be ignored. The total of the remaining numbers is still odd! So no two subsets with equal sums can exist.

-1

The statement is false. Take for example a subset with 7 odd numbers and 1 even number. Then we divide this subset into two 4-element subsets. One of them will have 4 odd numbers whose sum will be an even number while the other will have 1 even number and 3 odd numbers which will add up to an odd number.

Example: 1,3,5,7,9,11,13,14 Total sum is 63 and if we were to form 2 subsets, sum in each would not be a whole number.