Maths Olympiad Prep

Library / /357 of 377

Combinatorics Difficulty 5.8 AIME, harder Prove it United States

Problem:

Call an 2n2n-digit base-10 number special if we can split its digits into two sets of size nn such that the sum of the numbers in the two sets is the same. Let pnp_{n} be the probability that a randomly-chosen 2n2n-digit number is special. (We allow leading zeros in 2n2n-digit numbers).

a. The sequence pnp_{n} converges to a constant cc. Find cc.

b. Let qn=pncq_{n} = p_{n} - c. There exists a unique positive constant rr such that qnrn\frac{q_{n}}{r^{n}} converges to a constant dd. Find rr and dd.

Solution

Solution:

a.

Answer: 12\frac{1}{2}

We first claim that if a 2n2n-digit number xx has at least eight 00's and at least eight 11's and the sum of its digits is even, then xx is special.

Let AA be a set of eight 00's and eight 11's and let BB be the set of all the other digits. We split BB arbitrarily into two sets YY and ZZ of equal size. If yYyzZz>8\left|\sum_{y \in Y} y - \sum_{z \in Z} z\right| > 8, then we swap the biggest element of the set with the bigger sum with the smallest element of the other set. This transposition always decreases the absolute value of the sum: in the worst case, a 99 from the bigger set is swapped for a 00 from the smaller set, which changes the difference by at most 1818. Therefore, after a finite number of steps, we will have yYyzZz8\left|\sum_{y \in Y} y - \sum_{z \in Z} z\right| \leq 8.

Note that this absolute value is even, since the sum of all the digits is even. Without loss of generality, suppose that yYyzZz\sum_{y \in Y} y - \sum_{z \in Z} z is 2k2k, where 0k40 \leq k \leq 4. If we add kk 00's and 8k8-k 11's to YY, and we add the other elements of AA to ZZ, then the two sets will balance, so xx is special.

b.

Answer: r=14, d=1r = \frac{1}{4},\ d = -1

To get the next asymptotic term after the constant term of 12\frac{1}{2}, we need to consider what happens when the digit sum is even; we want to find the probability that such a number isn't balanced. We claim that the configuration that contributes the vast majority of unbalanced numbers is when all numbers are even and the sum is 2mod42 \bmod 4, or such a configuration with all numbers increased by 11. Clearly this gives qnq_{n} being asymptotic to 122(12)2n=(14)n-\frac{1}{2} \cdot 2 \cdot \left(\frac{1}{2}\right)^{2n} = -\left(\frac{1}{4}\right)^{n}, so r=14r = \frac{1}{4} and d=1d = -1.

To prove the claim, first note that the asymptotic probability that there are at most 44 digits that occur more than 1010 times is asymptotically much smaller than (12)n\left(\frac{1}{2}\right)^{n}, so we can assume that there exist 55 digits that each occur at least 1010 times. If any of those digits are consecutive, then the digit sum being even implies that the number is balanced (by an argument similar to part (a)).

So, we can assume that none of the numbers are consecutive. We would like to say that this implies that the numbers are either 0,2,4,6,80,2,4,6,8 or 1,3,5,7,91,3,5,7,9. However, we can't quite say this yet, as we need to rule out possibilities like 0,2,4,7,90,2,4,7,9. In this case, though, we can just pair 00 and 77 up with 22 and 44; by using the same argument as in part (a), except using 00 and 77 both (to get a sum of 77) and 22 and 44 both (to get a sum of 66) to balance out the two sets at the end.

In general, if there is ever a gap of size 33, consider the number right after it and the 33 numbers before it (so we have k4,k2,k,k+3k-4, k-2, k, k+3 for some kk), and pair them up such that one pair has a sum that's exactly one more than the other (i.e. pair k4k-4 with k+3k+3 and k2k-2 with kk). Since we again have pairs of numbers whose sums differ by 11, we can use the technique from part (a) of balancing out the sets at the end.

So, we can assume there is no gap of size 33, which together with the condition that no two numbers are adjacent implies that the 55 digits are either 0,2,4,6,80,2,4,6,8 or 1,3,5,7,91,3,5,7,9. For the remainder of the solution, we will deal with the 0,2,4,6,80,2,4,6,8 case, since it is symmetric with the other case under the transformation x9xx \mapsto 9-x.

If we can distribute the odd digits into two sets S1S_{1} and S2S_{2} such that (i) the difference in sums of S1S_{1} and S2S_{2} is small; and (ii) the difference in sums of S1S_{1} and S2S_{2}, plus the sum of the even digits, is divisible by 44, then the same argument as in part (a) implies that the number is good.

In fact, if there are any odd digits, then we can use them at the beginning to fix the parity mod 44 (by adding them all in such that the sums of the two sets remain close, and then potentially switching one with an even digit). Therefore, if there are any odd digits then the number is good.

Also, even if there are no odd digits, if the sum of the digits is divisible by 44 then the number is good.

So, we have shown that almost all non-good numbers come from having all numbers being even with a digit sum that is 2mod42 \bmod 4, or the analogous case under the mapping x9xx \mapsto 9-x. This formalizes the claim we made in the first paragraph, so r=14r = \frac{1}{4} and d=1d = -1, as claimed.

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: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.