Maths Olympiad Prep

Library / /40 of 64

Combinatorics Difficulty 7.9 National olympiad, round 2 Find the answer

For a set SS of nonnegative integers, let rS(n)r_S(n) denote the number of ordered pairs (s1,s2)(s_1, s_2) such that s1Ss_1 \in S, s2Ss_2 \in S, s1s2s_1 \ne s_2, and s1+s2=ns_1 + s_2 = n. Is it possible to partition the nonnegative integers into two sets AA and BB in such a way that rA(n)=rB(n)r_A(n) = r_B(n) for all nn?

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

First\textbf{First} solution:} Yes, such a partition is possible. To achieve it, place each integer into AA if it has an even number of 1s in its binary representation, and into BB if it has an odd number. (One discovers this by simply attempting to place the first few numbers by hand and noticing the resulting pattern.) To show that rA(n)=rB(n)r_A(n) = r_B(n), we exhibit a bijection between the pairs (a1,a2)(a_1, a_2) of distinct elements of AA with a1+a2=na_1 + a_2 = n and the pairs (b1,b2)(b_1, b_2) of distinct elements of BB with b1+b2=nb_1 + b_2 = n. Namely, given a pair (a1,a2)(a_1, a_2) with a1+a2=na_1+a_2 = n, write both numbers in binary and find the lowest-order place in which they differ (such a place exists because a1a2a_1 \neq a_2). Change both numbers in that place and call the resulting numbers b1,b2b_1, b_2. Then a1+a2=b1+b2=na_1 + a_2 = b_1 + b_2 = n, but the parity of the number of 1s in b1b_1 is opposite that of a1a_1, and likewise between b2b_2 and a2a_2. This yields the desired bijection. Second\textbf{Second} solution:} (by Micah Smukler) Write b(n)b(n) for the number of 1s in the base 2 expansion of nn, and f(n)=(1)b(n)f(n) = (-1)^{b(n)}. Then the desired partition can be described as A=f1(1)A = f^{-1}(1) and B=f1(1)B = f^{-1}(-1). Since f(2n)+f(2n+1)=0f(2n) + f(2n+1) = 0, we have i=0 n f(n) = 0 n odd f(n) n even.\text{i=0 n f(n) = 0 n odd f(n) n even.} If p,qp,q are both in AA, then f(p)+f(q)=2f(p) + f(q) = 2; if p,qp,q are both in BB, then f(p)+f(q)=2f(p) + f(q) = -2; if p,qp,q are in different sets, then f(p)+f(q)=0f(p) + f(q) = 0. In other words, 2(rA(n)rB(n))=p+q=n,p<q(f(p)+f(q)) 2(r_A(n) - r_B(n)) = \sum_{p+q=n,p < q} (f(p) + f(q)) and it suffices to show that the sum on the right is always zero. If nn is odd, that sum is visibly i=0nf(i)=0\sum_{i=0}^n f(i) = 0. If nn is even, the sum equals (i=0nf(i))f(n/2)=f(n)f(n/2)=0. \left(\sum_{i=0}^n f(i) \right) - f(n/2) = f(n) - f(n/2) = 0. This yields the desired result. Third\textbf{Third} solution:} (by Dan Bernstein) Put f(x)=nAxnf(x) = \sum_{n \in A} x^n and g(x)=nBxng(x) = \sum_{n \in B} x^n; then the value of rA(n)r_A(n) (resp.\ rB(n)r_B(n)) is the coefficient of xnx^n in f(x)2f(x2)f(x)^2 - f(x^2) (resp.\ g(x)2g(x2)g(x)^2 - g(x^2)). From the evident identities 11x=f(x)+g(x)f(x)=f(x2)+xg(x2)g(x)=g(x2)+xf(x2),\begin{align*} \frac{1}{1-x} &= f(x) + g(x) \\ f(x) &= f(x^2) + xg(x^2) \\ g(x) &= g(x^2) + xf(x^2), \end{align*} we have f(x)g(x)=f(x2)g(x2)+xg(x2)xf(x2)=(1x)(f(x2)g(x2))=f(x2)g(x2)f(x)+g(x).\begin{align*} f(x) - g(x) &= f(x^2) - g(x^2) + xg(x^2) - xf(x^2) \\ &= (1-x)(f(x^2) - g(x^2)) \\ &= \frac{f(x^2) - g(x^2)}{f(x) + g(x)}. \end{align*} We deduce that f(x)2g(x)2=f(x2)g(x2)f(x)^2 - g(x)^2 = f(x^2) - g(x^2), yielding the desired equality. Note:\textbf{Note:} This partition is actually unique, up to interchanging AA and BB. More precisely, the condition that 0A0 \in A and rA(n)=rB(n)r_A(n) = r_B(n) for n=1,,mn=1, \dots, m uniquely determines the positions of 0,,m0, \dots, m. We see this by induction on mm: given the result for m1m-1, switching the location of mm changes rA(m)r_A(m) by one and does not change rB(m)r_B(m), so it is not possible for both positions to work. Robin Chapman points out this problem is solved in D.J. Newman's Analytic\textit{Analytic} Number Theory} (Springer, 1998); in that solution, one uses generating functions to find the partition and establish its uniqueness, not just verify it.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.