Let $n$ be a positive integer. Determine the size of the largest subset of $\{ -n, -n+1, \dots, n-1, n\}$ which does not contain three elements $a$, $b$, $c$ (not necessarily distinct) satisfying $a+b+c=0$.
Problem
Source: 2009 USAMO problem 2
Tags: pigeonhole principle, induction, ceiling function, symmetry, inequalities, combinatorics, Hi
30.04.2009 22:32
I am so afraid that this solution has a hole, because I solved it in the last 45 min and wrote it up hurriedly. So yeah, this is so I know ahead of time if I'm out of the running for MOP already.
30.04.2009 22:36
That's essentially how I did it (except I chose the set {-(n + 1)/2, ..., -n, (n + 1)/2, ..., n)} instead for the odds.) I think I'll lose credit because I just said "by Pigeonhole, there must be some a and b such that a + b = n + 1, without justification (due to time pressure.) Sigh.
30.04.2009 22:50
Let $ A_n$ = $ ( - n, - n + 1... - 1,n)$ excluding $ 0$. Claim: for $ A_n$ when $ n$ is even, the largest good subset has size $ n$. When n is odd the largest good subset of $ A_n$ has $ n + 1$ elements. Furthermore, any good subset of $ A_n$ (n is odd) with $ n + 1$ elements is one of two configurations: i) contains only odd elements from $ A_n$ or ii) contains the elements $ \pm (n,n - 1...[n/2] + 1)$. Proceed with induction: the claim is clear for $ n = 1$ and $ n = 2$. Now suppose the claim is proven up to $ n - 1$. Suppose $ n$ is odd. To find all possible configurations for a good subset of size $ n + 1$ from $ A_n$, note that from the subset $ A_{n - 2}$ we have at most $ n - 1$ elements, so we have at lest two elements from $ B = ( - n, - n + 1, n - 1, n)$ Suppose we have two elements from $ B$ and $ n - 1$ elements from $ A_{n - 2}$. Based on the elements taken from $ A_{n - 2}$ (note n-2 is odd), we cannot have $ \pm (n - 1)$. So we take $ - n,n$ from $ B$. This implies that we take just all odd elements from $ A_{n - 2}$. So for this case, our claim holds (the good $ n + 1$ size subset from $ A_n$ consists of just the odd elements from $ A_n$. Suppose we take four elements from $ B$. Partition the elements of $ A_{n - 2}$ into disjoint pairs $ \pm (x,n - 1 - x)$ from which we make only take one element each and each has two distinct elements (so we rule out $ (n - 1)/2,(n - 1)/2$. Then we have $ n - 3$ such pairs and we need to take $ n - 3$ elements. However, notice that we cannot take $ \pm 1$ or two numbers would sum to $ \pm n$. then we must take $ \pm (n - 2)$. But then we cannot take $ \pm 2$ or two numbers would sum to $ \pm n$ so we have to take $ \pm (n - 3)$... continuing this way constructs the goodsubset of size $ n + 1$ that fits the description of our claim. Now suppose we take three elements from $ B$. WLOG take $ - n + 1, n - 1, n$. But this leads to a contradiction by pigeonhole because we can only have $ n - 1$ elements from $ A_n$. So suppose we take $ - n, n - 1, n$. We need $ n - 2$ elements from $ - n + 2...n - 2$. Note we cannot have $ 1$ or $ (n - 1)/2$. Partition those disjoint subsets again into those that either sum to $ n$ or $ - (n - 1)$. We now have $ n - 3$ pairs of elements from which we can only take one each. But we needed $ n - 2$. Contradiction. Now that we have established the only possible configurations of good subsets of size $ n + 1$ from $ A_n$ when $ n$ is odd, it is easy to see that adding no other element is possible (if we take all odd configuration we cant take any remaining evens, if we take the $ \geq |[n]/2 + 1|$ configuration we cant take any numbers lower). So $ n + 1$ is the maximum size for odd $ n$. Now consider $ A_n$ when $ n$ is even. If we take neither $ - n,n$ we cannot achieve $ n + 1$ by taking elements from just $ A_{n - 1}$. If we take both of $ - n,n$, a partition of $ A_{n - 1}$ (done just like in earlier cases) shows $ n + 1$ is impossible. If we take just $ n$, we need $ n$ elements from $ A_{n - 1}$ This restricts it to only two possible configurations, both of which have two numbers that add to $ - n$. So $ n + 1$ is unachievable for even $ n$. To see that $ n$ is achievable, just take all the negative numbers. This completes the induction. Unfortunately I didn't realize you could take all odds for a good $ n+1$ element subset for odd $ n$ until a few minutes left...
30.04.2009 22:53
Outline (very inelegant)
5 pages.
30.04.2009 23:20
30.04.2009 23:51
01.05.2009 00:19
01.05.2009 00:30
You guys are too pro for my taste... What I did is provide an algorithm (three, actually) and proved that with this algorithm, you could not add any more numbers on for any $ n$. While I did get the right answer of 2*ceil(n/2), the way I got it was very crude.
01.05.2009 00:31
sdkudrgn88 wrote: You guys are too pro for my taste... What I did is provide an algorithm (three, actually) and proved that with this algorithm, you could not add any more numbers on for any $ n$. While I did get the right answer of 2*ceil(n/2), the way I got it was very crude. Uh what if you use a different algorithm
01.05.2009 00:31
sdkudrgn88 wrote: What I did is provide an algorithm (three, actually) and proved that with this algorithm, you could not add any more numbers on for any $ n$. Can you elucidate please? I don't see how this works without assuming that you have a specific subset to work with.
01.05.2009 00:32
Do you think greedy algorithm works? Basically you take $ \{ -n, \dots, n \}$ and find all the offending triples. Then use greedy algorithm to remove the least amount of numbers as possible while getting rid of all the offending triples.
01.05.2009 00:33
"Greedy algorithm" isn't a solution at all. Why is the greedy algorithm optimal in this case?
01.05.2009 00:34
The "why" is the second sentence I wrote above. (Of course I can't just write "greedy algorithm qed"). I described the algorithm in detail.
01.05.2009 00:38
I suppose it would be possible, but how did you characterize all of the triples (and pairs)? Especially since it doesn't have to be symmetric, etc.
01.05.2009 00:43
Well actually, in the case $ n = 2k$, given the set $ \{ - 2k,\dots,k\} \backslash \{0\}$ (since 0 is automatically rejected because 0 + 0 + 0 = 0), start with $ - 2k$, then we have $ (2k - 1,1),(2k - 2,2),\dots,(k,k)$. Then next, we start with $ - 2k + 1$, with one fewer possibilities than the $ - 2k$ case, etc. Then mirror it for $ 2k, 2k - 1,\dots$. Basically, I got it down to (something like, I can't remember) $ \text{something}(k - 1)^2$ offending triples, apply it once, we have $ \text{something}(k - 2)^2$ offending triples, do it until we have $ \text{something}(k - k)^2 = 0$ offending triples left, and we have used the algorithm $ k$ times to remove $ k$ numbers. Then I proceeded to start the case $ 2k + 1$, which is basically the same thing but I ran out of time before I could finish.
01.05.2009 01:01
It looks like you are repeatedly choosing a variable to eliminate the maximum number triples possible, for that turn. Did you prove that you cannot have an algorithm that, say, eliminates 1 triple, then 1 triple, then all of them. In other words, you don't eliminate the maximum amount at first, but it enables you to eliminate a lot more later.
01.05.2009 01:08
Think about it this way: You have a fixed number of offending triples for each $ n$ before you do anything, and for any integer $ a$ in $ S$, you have a some number of triples which contain $ a$. Any methods of efficiently removing these triples just lead to permutations of the greedy algorithm. I just chose the greedy algorithm because that was the simplest way to explain it. * By "permutations" I meant permutations by number of triples removed in each step, not by the number actually removed.
01.05.2009 01:12
Yongyi781 wrote: Any methods of efficiently removing these triples just lead to permutations of the greedy algorithm. Wait, why?
01.05.2009 01:13
I cannot remember how I explained it; the best way to see why is to try it for something like $ n=6$ and list them out on paper.
24.02.2019 01:06
I thought that this was a really nice problem, but it took me quite a long time (like 2.5-3 hours in total)
20.02.2020 16:00
Oh wow this is actually pretty easy. We claim the answer is $n$ for even $n$ and $n+1$ for odd $n$, and any subset achieving the maximum for odd $n$ must contain $n$ and $-n$. To see this can be achieved, choose the subset containing all the odd elements. We now prove that the bounds are indeed the maximums. Call the answer for $n$ $a_n$. Note that $0$ can't be chosen. We'll prove our claim by induction on $n$. Base case $n = 1$ is trival to see. Assuming our hypothesis holds for $l, l \ge 1$, we'll prove it for $n = l+1$. Case: $n$ is odd: Note $a_n \le a_{n-1} + 2$, so we're done by the induction hypothesis. In particular, $n$ and $-n$ must both be part of the maximal subset. Case: $n = 2k$ is even: If both $n$ and $-n$ are members of the subset, then the number of positive integers $< n$ which are in the subset is $\le k-1$, and the number of negative integers $> -n$ which are in the subset is $\le k - 1$ (as $k/2, -k/2$ can't be chosen and of any two numbers summing to $n$ or $-n$ at most one can be chosen), so $a_n \le 2k$. If neither of $n, -n$ is chosen then $a_n \le a_{n-1} = n$. Now suppose exactly one of $n, -n$ is chosen. WLOG $n$ is chosen. Note that then $a_n \le a_{n-1} + 1$. Suppose $a_n = a_{n-1}+1$. Then note that deleting $n$ from the subset gives a maximal subset for $n-1$, so both $n-1$ and $-(n-1)$ are in the subset. Note that the number of negative integers $> -n$ which are chosen is $\le k-1$ (as before), and the number of positive integers $< n-1$ which are chosen is $\le k-1$ (as at most one of two numbers summing to $n-1$ can be chosen). So $a_n \le (k-1)+(k-1)+2 = 2k$, and we're done.
21.03.2020 03:19
Let $f(n)$ be the answer. We claim \[ f(n) = \begin{cases} n\qquad \qquad \text{if } n \text{ even} \\ n+1\qquad \ \text{if } n \text{ odd}. \end{cases}\]This is achieveable by taking all the odds in the set $\{-n,\ldots,n\}$. We will prove $f(n)=f(n-2)+2$, by induction on $n$, the base cases trivial. Assume $n$ is even; the analysis for odd $n$ is the same, barring base cases. Call $S_n$ the maximal subset for $\{-n,\ldots,n\}$. Assume for the sake of contradiction $|S_n| > n$. If $S_n\cap \{-n,-n+1, n-1, n\} \le 2$, then we can only get at most $(n-2)+2=n$ elements in $S_n$ by induction. Hence we need at least 3 of $\{-n,-n+1,n-1,n\}$. Let $C = S_n\cap \{-n,-n+1,n-1,n\} = \{-n,n\}$. If $C \supseteq \{-n,n\}$, then there can be at most one elements from each of the following $n-2$ pairs: $(-n+2,-2),(-n+3,-3),\ldots, (-n/2, -n/2)$ and $(n-2,2),(n-3,3),\ldots,(n/2,n/2)$. So $|S_n| \le (n-2)+2=n$, contradiction. A similar pairing argument shows we cannot have $C \supseteq \{-n+1,n-1\}$ or $C \supseteq \{-n+1,n\}$ or $C \supseteq \{-n,n+1\}$. This completes the induction, and proves that $|S_n| \le n$.
06.11.2020 20:53
Before we start just note that we'll always be ignoring the number $0$ because if you repeat $0$ three times it sums to $0$. Claim: If $n$ is even, the answer is $n$ and if $n$ is odd, $n+1$ is the answer. Proof: Note that the even and odd cases are equivalent except for the base cases being different. Note that the base cases for both case are correct so we can just proceed by only dealing with the even case. Now, let's split this into a few different cases. Let $M$ denote the maximally sized subset: Case 1: Assume that $M$ contains at most $1$ of each of the pairs $(-n, n)$ and $(-n+1, n-1)$. Note that in this case we can just proceed by induction to prove the desired. Case 2: Assume that $M$ contains both $(-n,n)$. In this case, note that you can make $n-2$ pairs that sum to $n$ and you can only take at most $1$ from each pair. So, you have a maximum of $n$ in this case as well. You can create a parallel argument for $(-n+1, n-1)$. So, in each case, the maximum is $n$ for evens. You can adjust the same argument for odds to prove the claim for odds as well. So, we're done. Note that we have a correct construction when all of the odd numbers in the set are taken which leads to the numbers desired. This construction obviously works because the sum of an odd number of odd numbers must be odd and $0$ is an even number.
26.11.2020 22:28
We will prove the answer is $n+1$ for odd $n$ and $n$ for even $n.$ Construction: Pick the numbers in the range $[-n, -\left \lceil{\frac{n}{2}}\right \rceil-1] $ and $[\left \lfloor{\frac{n}{2}}\right \rfloor+1, n]$ as the numbers in this subset. For every $x$ in this subset, we have $|x| > \frac{n}{2}$ so the sum of any $2$ would have absolute value of more than $n$ or less than or equal to $\frac{n}{2},$ which means any $3$ can't sum together to equal $0.$ We will now prove by strong induction, that this is the maximum. For the base cases of n = 1 and n = 2, we see that we cannot have $0$ in the subset, or else $0+0 = 0$, which means we can only have $-1$ and $1$, which gives a total of $n+1 = 2$ elements. For $n = 2$, if we have $2$, we cannot have $-1$ and vice versa. This is the same with $-2$ and $1$. This means we again can only have $n = 2$ elements. Let $S$ be the subset of $\{-n, -n+1, -n+2, \cdots, n-2, n-1, n\}$ that has the maximum number of elements and satisfies the problem statement. For the inductive step, we first prove for all odd numbers $n$. Let's assume for all positive integers less than $n$ that it is true, which means for $n-1$, the maximum number of elements in the subset of $\{-n+1, -n+2, \cdots, n-2, n-1\}$ that are also in $S$ is $n-1$. If there are more than $n+1$ elements, then there is at least $n$ elements that are in $\{-n+1, -n+2, \cdots, n-2, n-1\}$, a contradiction. Now, we need to prove for all even numbers $n$. We will prove by contradction that there exists $S$ that has more than $n$ elements, so assume for all positive integers less than $n$ that it is true. This means, for $n-1$, the maximum number of elements in the subset of $\{-n+1, -n+2, \cdots, n-2, n-1\}$ is $n+1.$ If $S$ does not include $n$ or $-n$, then this simplifies to the previous case of $n-1$, which we already proved is $n+1$. This means there has to be at least one of $n$ or $-n$ included in the subset. WLOG let $-n$ be included in $S$. Consider the ordered pairs $$(0, n), (1, n-1), \cdots, (\frac{n}{2}, \frac{n}{2}).$$We cannot have both terms of an ordered pair to be included in $S$, as we then have the sum of them and $-n$ to be $0$. This also means we cannot have $\frac{n}{2}$ because $\frac{n}{2}+\frac{n}{2}-n = 0.$ Therefore, there is a maximum of $\frac{n}{2}$ numbers we can include among these numbers, which happen to be the nonnegative integers. Now, suppose the greatest integer in $S$ is less than $n-1.$ This means we can split $S$ into two groups. One group contains the numbers in the subset $\{-n+2, -n+3, \cdots, n-3, n-2\}$, and the other group contains the numbers $-n$ and $-n+1.$ For the first group, we can only have a maximum of $n-2$ elements, and if we include both $-n$ and $-n+1$, then we get $n$ elements. Therefore, to have more than $n$ elements, we need to include at least one of $n-1$ and $n$. Let's say $n$ is not in $S$, so we must have $n-1$. We can again make ordered pairs $$(0, -n+1), (-1, -n+2), (-2, -n+3)\cdots (-\frac{n}{2}+1, -\frac{n}{2}),$$and we see that if we include both numbers of a pair in $S$, then the sum of them and $n-1$ will be $0$, so we can only have $1$. There are total of $\frac{n}{2}$ of these pairs, so we get a total of $\frac{n}{2}$ of these numbers. We can now take a look at the positive numbers. Because we assumed $-n$ is in $S$, we created $\frac{n}{2}+1$ pairs also, and said that we can have at most $\frac{n}{2}$ nonnegative numbers. But if we look at $(0, n)$, we can't have $0$ or else $0+0 = 0$, and we said that $n$ was not in $S$, which means we have to also subtract this pair and we end up with $\frac{n}{2}-1$ pairs, which gives us a maximum of $\frac{n}{2}-1$ numbers. Finally, if we include $-n$, we get a total of $n$ elements in $S$. Finally, we look at the case if $n$ is in $S$. By symmetry there must also only be a maximum $\frac{n}{2}$ negative numbers, so the total number of elements is at most $\frac{n}{2}+\frac{n}{2} = n$. Therefore, we have finished the even case, and the induction is complete.
07.07.2021 22:33
The answer is $2\lceil n/2\rceil$, achievable by taking every odd. Clearly $0$ can't be in the subset. We establish this by induction on $n \geq 2$, with the base case of $n=2$ being true by manual checking. Of course, $n=1$ is trivial. Let $A$ be the subset of $\{-n,\ldots,n\}$ with maximal size. If $n$ is odd, the bound is obvious because we can only add at most two elements from the maximal subset of $\{-n+1,\ldots,n-1\}$, in particular $n$ and $-n$. Now suppose $n$ is even, and consider which elements of $\{-n,n\}$ are in $A$. If none are in $A$, then we immediately get the bound of $2\lceil (n-1)/2\rceil=2\lceil n/2\rceil$, as desired. Suppose one element is in $A$, WLOG let it be $n$. Then if $|A|>2\lceil n/2 \rceil$, we must have that $A \setminus \{n\}$ is a maximal subset of $\{-n+1,\ldots,n-1\}$. For this to happen, we would need both $n-1$ and $-n+1$ to be in $A \setminus \{n\}$, otherwise $|A\setminus \{n\}|<2\lceil (n-1)/2\rceil$. Now partition $\{-n+1,\ldots,-1\}$ into the pairs $$(-n+1,-1),(-n+2,-2),\ldots,(-\tfrac{n}{2},-\tfrac{n}{2}),$$of which there are clearly $\tfrac{n}{2}$. It is clear that among each pair, at most one element can be in $A$. Since we can't chose exactly one element of the last pair, it follows that there are at most $\tfrac{n}{2}-1$ negative numbers in $A$. We can similarly split $\{1,2,\ldots,n-2\}$ into the $\tfrac{n}{2}-1$ pairs $(1,n-2),(2,n-3),\ldots,(\tfrac{n}{2}-1,\tfrac{n}{2})$, where at most one element of each pair may be in $A$. Adding back $n-1$ and $n$, it follows that there are at most $$\tfrac{n}{2}-1+\tfrac{n}{2}-1+1+1=n=2\lceil n/2\rceil$$elements in $A$, which is the desired bound. Finally suppose two elements are in $A$, i.e. both $n$ and $-n$. Then we can split $\{-n+1,\ldots,-1,1,\ldots,n-1\}$ into the pairs $$(-n+1,-1),(-n+2,-2),\ldots,(-\tfrac{n}{2},-\tfrac{n}{2}),(1,n-1),(2,n-2),\ldots,(\tfrac{n}{2},\tfrac{n}{2}),$$where we have $n$ pairs total and among each pair at most one element can be in $A$. However, since neither $\tfrac{n}{2}$ or $-\tfrac{n}{2}$ may be in $A$, this leaves a total of $n-2$ elements of $A$ in $\{-n+1,\ldots,-1,1,\ldots,n-1\}$, which gives the desired bound of $n=2\lceil n/2\rceil$. These cases complete the induction, so we're done. $\blacksquare$
15.07.2021 19:58
05.01.2022 22:38
Old Solution that I copy and pasted. My proof writing used to be so terrible We claim that for positive integers $n$, if $n$ is even, the max size is $n$; and if $n$ is odd, the max size is $n+1$. We proceed with induction. Additionally, let $S_n$ be the set $\{-n,-n+1, \ldots,n-1,n\}$ The base cases are trivial for n=1,2 with sets $\{-1,1\}$ and $\{-2,-1,1,2\}$. Note if 0 is included, then we have at most $n+1$ elements in the subset. We can thus assume that 0 is never included. Now for the inductive step. It is clear that for n=2k, any subset of $S_n$ will be the sum of a subset of $S_{n-1}$ and $\{-n,n\}$. By the inductive hypothesis this has size at most n+2. Thus, we have an additional condition that the for even n in order to have size $n+2$, $\{n,-n\}$ must be included For $n=2k+1$, we have a combination of a subset of $S_{2k}$ and $\{-(2k+1),2k+1\}$. Assume for the sake of contradiction that there is a subset with size greater than $n+1 = 2k+2$. By the inductive hypothesis there are at most $2k+2$ elements in $S_{2k}$. We now do casework on the number of elements from $\{-(2k+1),2k+1\}$. Case 1: 2 from $\{-(2k+1),2k+1\}$ In this case, we can pair up $(1,2k),(2,2k-1),\ldots,(k,k+1)$ and $(-1,-2k),(-2,-2k+1),\ldots,(-k,-k-1)$. We can have at most one from each pair, for a total of $2k+2=n+1$ elements. Case 2: 1 from $\{-(2k+1),2k+1\}$ WLOG we include 2k+1. Now, in order to have a size of more than 2k+2, we must have 2k+2 from $S_{2k}$. Since this is the equality case, $\{-2k,2k\}$ are also included in the subset. We can now pair up $(-1,-2k),(-2,-2k+1),\ldots,(-k,-k-1)$ and $(1,2k-1),(2,2k-2),\ldots (k-1,k+1)$. Thus, we have at most $k+ (k-1)+1+2 = 2k+2= n+1$ numbers in the subset. Our induction is now complete and even n have at most n+2, odd n have at most n+1. We have equality cases when we take element in $S_n$ if $|element| \geq n/2$.
25.02.2023 03:47
18.06.2023 05:32
There's also a smarter way to do this; you can skip out on the odd case apparently and just skip straight to the even $n$'s? I claim that the answer is $n+1$ for all odd $n$ and $n$ for even $n$. The desired lower bound can be achieved by choosing all odd integers in the range $[-n,n]$ to be in the subset. This must satisfy problem conditions (meaning that there do not exist not necessarily distinct $a$, $b$, $c$ in the set such that $a+b+c=0$) since it is impossible for three odd numbers to sum to $0$. For terminology, we will use $Q$ to denote the chosen subset that is a subset of the integers ranging from $n$ to $-n$, inclusive, which must satisfy problem conditions. A few things to note before we begin; 1. $0$ can never be in $Q$. This is because by setting $a=b=c=0$, we get $a+b+c=0+0+0=0$, a contradiction. 2. The set $P=Q-(Q\cap\{-n,-n+1,n-1,n\})$ is a subset of the integers in the range $[-n+2,n-2]$, and since $Q$ satisfies problem conditions, all subsets of $Q$ must satisfy problem conditions (FTSOC, assume not, then the triple in the subset that sum to $0$ also appears in $Q$ and sums to $0$ there, a contradiction), meaning that $P$ must satisfy problem conditions. We will now prove our original statement with induction, and we will take this in cases. From here on out, $P$ is a subset of $Q$ and a subset of the set of integers ranging from $-n+2$ to $n-2$, inclusive. (a) $n$ is odd. We assume that for all odd integers $k<n$, where $n$ is odd, the maximum value of the size of any subset of the integers in the range $-k$ to $k$ such that no $a$, $b$, $c$, exist in this set such that $a+b+c=0$ is $k+1$. We will now induct upwards to prove that for $n$, the maximum value of the size of any subset of the integers in the range $-n$ to $n$ such that no $a$, $b$, $c$, exist in this set such that $a+b+c=0$ is $n+1$. By the inductive assumption, we have that $|P|\leq n-1$, where $P\subseteq Q$ satisfies problem conditions and is a subset of the integers in the range $[-n+2,n-2]$. Additionally, $Q$ is a subset of the integers in $[-n,n]$ satisfying problem conditions. We wish to prove that $|Q|\leq n+1$. First I claim that if $|P|=n-1$, then $\{-n+1,n-1\}$ is not a subset of $Q$. FTSOC, suppose that $\{-n+1,n-1\}\subseteq Q$. Then this implies that there do not exist $a$, $b$ in $P$ (not necessarily distinct) such that $a+b=-n+1$ or $n-1$. However, note that in the range $[-n+2,n-2]$, there are exactly $n-3$ unordered pairs of distinct numbers $(a,b)$, such that $a+b$ is $-n+1$ or $n-1$. They are \[(1, n-2), (2, n-3), \dots, \left(\frac{n-3}{2},\frac{n+1}{2}\right), (-1,-n+2), (-2, -n+3), \dots, \left(\frac{-n+3}{2},\frac{-n-1}{2}\right), \]and the only other numbers in the set $\{-n+2,\dots,n-2\}$ not in these pairs are $0$, $\frac{-n+1}{2}$, and $\frac{n-1}{2}$, none of which can be in $P$ due to the conditions. Therefore for the numbers in $P$, we can choose at most one number from each pair for a total of at most $n-3$, implying that $|P|\leq n-3$, a contradiction to our earlier assumption that $|P|=n-1$. Therefore, if $|P|=n-1$, then $\{-n+1,n-1\}$ is not a subset of $Q$. I now claim that if $|P|=n-1$, then $\{n,-n,-n+1\}$ is also not a subset of $Q$. We use similar logic. This time, note that there are $n-3$ total unordered pairs of distinct numbers $(a,b)$ summing to $\pm n$. They are \[(2,n-2), (3,n-3), \dots, \left(\frac{n-1}{2},\frac{n+1}{2}\right), (-2,-n+2), (-3,-n+3), \dots, \left(\frac{-n+1}{2},\frac{-n-1}{2}\right),\]with the only numbers in $\{-n+2,\dots,n-2\}$ not in these pairs being $1$, $-1$, and $0$. As shown before, $0$ cannot appear in $P$. Additionally, since we assumed that $-n$ and $n-1$ are in $Q$, we cannot have $1$ in $P\subseteq Q$, otherwise we'd have \[(-n)+1+(n-1)=0,\]a contradiction to our assumption that $Q$ satisfies problem conditions. Therefore $1$ cannot appear in $P\subseteq Q$. Tying it all together, since there do not exist $a$, $b$ such that $a+b=\pm n$, we note that out of each of the $n-3$ pairs, we can choose at most one to be in $P$. Adding on the possibility of having $\{-1\}$ in $P$, we get that $|P|\leq (n-3)+1=n-2$ elements, a contradiction to our assumption that $|P|=n-1$. Therefore $\{n,-n,-n+1\}$ cannot be a subset of $Q$. Similarly, we can prove that if $|P|=n-1$, then $\{n,-n,n-1\}$ cannot be a subset of $Q$. Combining the claims above gives that if $|P|=n-1$, then for $R=Q\cap\{-n,-n+1,n-1,n\}$, we have that $|R|\leq 2$. Therefore, \[|Q|=|P\cup R|\leq |P|+|R| \leq (n-1)+2=n+1,\]as desired. Now I claim that for $|P|=n-2$, $\{-n,-n+1,n-1,n\}$ cannot be a subset of $Q$. As shown before, $n-1$ and $-n+1$ have $n-1$ total unordered pairs that are such that $a+b$ is not $-n+1$ or $n-1$. Additionally, we must also leave out $0$, $\frac{n-1}{2}$, and $\frac{-1+n}{2}$, which would result in $0$ sums. This leaves us with $n-2$ "valid" pairs to consider, each of which we can choose at most one number from. However, in order to have exactly $n-2$ numbers in $P$, we must choose one from each pair. However, neither of $1$ or $-1$ can be in $P$. Therefore, $n-2$ and $-n+2$ must both be in $P$, as we must choose at least one number from each pair. Additionally, since \[(-2)+(-n+2)+n=0,\]and \[2+(n-2)+(-n)=0,\]we also have that $2$ and $-2$ cannot be in $P$, implying that $-n+3$ and $n-3$ are in $P$. Continuing similarly, we keep going until we are left with the numbers \[-n+2, -n+3, \dots, \frac{-n-1}{2},\]and \[n-2, n-3, \dots, \frac{n+1}{2},\]in $P$, which has a total of $n-3$ numbers, a contradiction, since we assumed that $|P|=n-2$. Therefore, $\{-n,-n+1,n-1,n\}$ cannot be a subset of $Q$. This gives that $|R|\leq 3$, meaning that \[|Q|=|P\cup R|\leq |P|+|R| \leq (n-2)+3=n+1,\]as desired. Finally, if $|P|<n-2$, we have that \[|Q|=|P\cup R|\leq |P|+|R| \leq (n-3)+4=n+1,\]proving the claim for our odd case. (b) $n$ is even. For induction, we assume that for all even integers $k<n$, where $n$ is even, the maximum value of the size of any subset of the integers in the range $-k$ to $k$ such that no $a$, $b$, $c$, exist in this set such that $a+b+c=0$ is $k$. We will now induct upwards to prove that for $n$, the maximum value of the size of any subset of the integers in the range $-n$ to $n$ such that no $a$, $b$, $c$, exist in this set such that $a+b+c=0$ is $n$. From the inductive assumption, we have that the maximum value of $|P|$ over all $P$ is $n-2$. Similar to the odd case, we can prove that for $|P|=n-2$, the following claims hold 1. The set $\{-n,n\}$ is not a subset of $Q$. Assume FTSOC that it is a subset of $Q$. Since there are $n-2$ pairs and $-\frac{n}{2}$, $\frac{n}{2}$, and $0$ cannot be in $Q$, in order to achieve $n-2$ numbers in $P$, we must have $1$, $-1$ and one number chosen from each pair. However, there is an even number of pairs, therefore two of the chosen numbers from the pairs are bound to be $\pm 1$ apart or either one of $-2$ and $2$ will be chosen, which would yield \[(-2)+1+1=0,\]or \[2+(-1)+(-1)=0,\]both of which are contradictions. 2. The set $\{-n,-n+1,n-1\}$ is not a subset of $Q$, and similarly, neither is $\{-n+1,n-1,n\}$. We will only prove the first one, as the second set can be proved similarly. FTSOC, assume that it is a subset of $Q$. Note that since \[(-n)+1+(n-1)=0,\], $1$ cannot appear in $Q$. Since we cannot have $1$, since we have exactly $n-2$ pairs that sum to $n-2$ we need one number from each pair to reach our desired $n-2$. This implies that if $1$ is not in $Q$, then $n-2$ must be. Using this , we get that since \[2+(n-2)+(-n)=0,\]$2$ also cannot appear in $Q$, meaning that $n-3$ must appear in $Q$. Continuing this chain, we get that \[\{n-2, n-3, \dots, \frac{n}{2}\}\subseteq Q,\]which is a contradiction, since \[\frac{n}{2}+\frac{n}{2}+(-n)=0.\]Similarly as before, using these two claims, we have that $|R|\leq 2$, which yields that $|Q|\leq n$, as desired. Now if $|P|=n-3$, we can similarly prove as before that $\{-n,-n+1,n-1,n\}$ cannot be a subset of $Q$ by using the fact that neither $1$ or $-1$ can appear in $P$, a contradiction. Therefore, we get that $|R|\leq 3$, giving that $|Q|\leq n$, as desired. Finally, if $|P|\leq n-4$, we have that \[|Q|=|P\cup R|\leq |P|+|R| \leq (n-4)+4=n,\]as desired. Therefore, we have proved our inductive step for both cases. The base cases can be checked at $n=1$ and $n=2$ through trial and error easily, finishing the problem.
19.12.2023 05:45
wait im lazy to check but how come all the sols are longer than this trivial by induction from n to n+2, inductive hypothesis all odds: if u could add 3 numbers from inductive step (say n even,odd follows) -n-1,n+1,n+2 then contradiction with 1 AND 3, if u exclude 1 and 3 then u must add -n-1, but u must exclude -1 and -3 then so still so increase.
13.02.2024 13:42
\item[Problem 3] (USAMO 2009/2) We claim that answer is $n$ for $n$ being even and $n+1$ for $n$ being odd. For $n=1$, the set is $\{-1,1\}$ For $n=2$, the set is again $\{-1,1\}$. The base cases are therefore true. Let $f(n)$ denote the answer. We perform induction. It is known that $f(n)\leq f(n-1)+2$. We prove that if $n$ is even, $f(n)=f(n-1)$ and if $n$ is odd, $f(n)=f(n-1)+2$. Suppose $n$ is even $f(n)>f(n-1)$. Let $n=2k$. Case 1. $n,-n$ belong to the subset. Let $S$ be the subset. In this case, $n,-n\in S$. Then, $0\notin S$. Moreover, $k,-k\notin S$ and from the pairs $(1,2k-1),(2,2k-2),\ldots,(k-1,k+1)$ and $(-1,1-2k),(-2,2-2k),\dots,(1-k,1+k)$ only one element is in $S$ at most. So, excluding $n,-n$, set $S$ has at most $2(k-1)$ elements. So, the subset has at most $2k$ elements, which is not more than our bound. Case 2. $-n$ belong to the subset but $n$ doesn't. Note that we are adding exactly one extra element. It means that we can have at most $n+1$ elements in our set, including $-n$. Moreover, consider the subset of $S$ containing elements $x$ with $|x|<n-1$. There are at most $n-2$ such elements by induction hypothesis. So, to get to $n+1$, we must add the elements $-n+1,n-1,-n$ to the set $S$. Moreover, $k\notin S$. Consider the elements: \[(1,n-2),(2,n-3),\ldots,(k-1,k);(-1,2-n),(-2,3-n),\ldots,(-k,1-k)\]We can choose at most $2k-2$ elements from these pairs as we cannot take a whole pair, as sum is either $n-1$ or $1-n$. Out of these elements, we will need exactly $2k-2$ elements, as they consist of all terms $x$ with $|x|\leq n-1$. The other 3 elements are just $-n,1-n,n-1$ to make up for the total $2k+1$ elements. So, we need to take EXACTLY one element from each pair. Suppose \[n-2\in S\Longrightarrow2\notin S\Longrightarrow n-3\in S\Longrightarrow3\notin S\Longrightarrow n-4\in S\Longrightarrow\cdots k\in S\]This means that if $n-2\in S$ then for each $k\leq x\leq n-2$, we have $x\in S$, and if $1\in S$, then for each $1\leq x\leq k-1$, we have $x\in S$. However, we know $k\notin S$ as $2k+(-n)=0$ and $1\notin S$ as $-n+1+(n-1)=0$. We have arrived at the required contradiction. Case 3. $n$ belongs to subset and $-n$ doesn't. This case is similar to case 2. So, we have shown that $f(n)=f(n-1)$, as claimed. We now provide a construction. - Choose all the odd numbers in the set! For $n$ being odd, we choose $n+1$ terms and for $n$ being even we choose $n$ terms. This works because the sum of three odd numbers cannot be even! (0 is even)
08.08.2024 07:30
The answer is $n+1$ for odds and $n$ for evens, obtained from selecting all the odd integers. To prove a bound of $n+1$: let $b$ be the largest negative integer in the subset (if all integers are positive, we are done already). WLOG, assume that $|b|$ is no more than the smallest positive integer in the subset. Let $P$ be the number of positive integers in the subset. For each positive integer $a$, the nonpositive integer $-a-b$ must not be in the set. Thus, there are at most $n+1-P$ nonpositive integers, so there are at most $n+1$ integers in total.
cannot be included in our subset. So, the smallest positive integer in our set and the largest negative integer in our set are equal in magnitude. This implies that $-1$ cannot be one of the $P$ integers ruled out from our subset, so it must be in the set, and so $1$ must also be in the set. Now, we cannot include any consecutive integers from the sequence \[-1, 2,-3,4,-5, \dots, n\]or \[1, -2,3,-4,5, \dots, -n,\]so we cannot select $n+1$ integers, contradiction.
01.09.2024 10:40
Here is the generalized version: (原创组合-43) Given integer $p,q\ge 2.$ Determine the size of the largest subset of $\{ -p, -p+1, \dots, q-1, q\}$ which does not contain three distinct elements $a$, $b$, $c$ satisfying $a+b+c=0$.
15.12.2024 01:27
I claim the answer is $n+1$ for odd $n$ and $n$ for even $n$. This is achieved by taking all odds, proven by that $0$ is even. Call the $n-set$ the set $\{ -n, -n+1, \dots n-1, n\}$. We proceed using induction with the even $n$ case first. $n=2$ is obvious because we can only select one in each of the pairs $\{ -2, 1\}$ and $\{-1, 2 \}$. We assume that we can only pick $n$ numbers from the $n$-set and we need to prove that same result for the $n+2$-set (i.e. selecting $n+3$ numbers from the $n+2$-set is impossible). If FTSOC choosing $n+3$ numbers from the $n+2$-set worked, then we have the following two cases: Case 1: Three numbers from $\{ n+1, n+2, -n-2, -n-1\}$ and $n$ from the $n$-set By symmetry, we only need to consider the cases when we choose $n+1, n+2, -n-1$ and $n+1, n+2, -n-2$. In the first case, we cannot choose $-1$ from the $n$-set nor $-\frac{n+2}{2}$. Now just consider the pairs $\{ 1, n\}, \{2, n-1\}, \dots \{ \frac{n}{2}, \frac{n}{2}+1 \}$ and $\{ -2, -n\}, \{ -3, -n+1\}, \dots \{-\frac{n}{2}, -\frac{n}{2}-2\}$ of which there are $n-1$. We can only choose one from each pair from our restriction, so we can only choose at most $n-1$ numbers from the $n$-set, contradiction. In the second case, we also cannot have $1$ or $\frac{n}{2}+1$. Do the exact same pairing argument with $\{2, n\}, \{3, n-1\}, \dots \{ \frac{n}{2}, \frac{n}{2}+2 \}$ and $\{ -1, -n \}, \{-2, -n+1\}, \dots \{-\frac{n}{2}, -\frac{n}{2}-1 \}$ proving another contradiction. Thus this case is done. Case 2: All numbers from $\{ n+1, n+2, -n-2, -n-1\}$ and $n-1$ from the $n$-set. From the $n$-set, we cannot have $\pm 1$ or $\frac{n}{2}+1, -\frac{n}{2}-1$. Pair up again like $\{ 2, n \}, \{ 3, n-1 \}, \dots \{\frac{n}{2}, \frac{n}{2}+2 \}$ alongside the analogous negative pairs proving another contradiction. Therefore we have shown that if the maximum number from an $n$-set is $n$ (for $n$ even), we can have at most $n+2$ in the $n+2$-set, proving the conclusion by induction. The odd case is the same but I don't want to type it up.