CombinatoricsDifficulty 5.8AIME, harderProve itUnited States
Problem:
Call an 2n-digit base-10 number special if we can split its digits into two sets of size n such that the sum of the numbers in the two sets is the same. Let pn be the probability that a randomly-chosen 2n-digit number is special. (We allow leading zeros in 2n-digit numbers).
a. The sequence pn converges to a constant c. Find c.
b. Let qn=pn−c. There exists a unique positive constant r such that rnqn converges to a constant d. Find r and d.
Solution
Solution:
a.
Answer: 21
We first claim that if a 2n-digit number x has at least eight 0's and at least eight 1's and the sum of its digits is even, then x is special.
Let A be a set of eight 0's and eight 1's and let B be the set of all the other digits. We split B arbitrarily into two sets Y and Z of equal size. If ∑y∈Yy−∑z∈Zz>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 9 from the bigger set is swapped for a 0 from the smaller set, which changes the difference by at most 18. Therefore, after a finite number of steps, we will have ∑y∈Yy−∑z∈Zz≤8.
Note that this absolute value is even, since the sum of all the digits is even. Without loss of generality, suppose that ∑y∈Yy−∑z∈Zz is 2k, where 0≤k≤4. If we add k0's and 8−k1's to Y, and we add the other elements of A to Z, then the two sets will balance, so x is special.
b.
Answer: r=41,d=−1
To get the next asymptotic term after the constant term of 21, 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 2mod4, or such a configuration with all numbers increased by 1. Clearly this gives qn being asymptotic to −21⋅2⋅(21)2n=−(41)n, so r=41 and d=−1.
To prove the claim, first note that the asymptotic probability that there are at most 4 digits that occur more than 10 times is asymptotically much smaller than (21)n, so we can assume that there exist 5 digits that each occur at least 10 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,8 or 1,3,5,7,9. However, we can't quite say this yet, as we need to rule out possibilities like 0,2,4,7,9. In this case, though, we can just pair 0 and 7 up with 2 and 4; by using the same argument as in part (a), except using 0 and 7 both (to get a sum of 7) and 2 and 4 both (to get a sum of 6) to balance out the two sets at the end.
In general, if there is ever a gap of size 3, consider the number right after it and the 3 numbers before it (so we have k−4,k−2,k,k+3 for some k), and pair them up such that one pair has a sum that's exactly one more than the other (i.e. pair k−4 with k+3 and k−2 with k). Since we again have pairs of numbers whose sums differ by 1, 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 3, which together with the condition that no two numbers are adjacent implies that the 5 digits are either 0,2,4,6,8 or 1,3,5,7,9. For the remainder of the solution, we will deal with the 0,2,4,6,8 case, since it is symmetric with the other case under the transformation x↦9−x.
If we can distribute the odd digits into two sets S1 and S2 such that (i) the difference in sums of S1 and S2 is small; and (ii) the difference in sums of S1 and S2, plus the sum of the even digits, is divisible by 4, 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 4 (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 4 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 2mod4, or the analogous case under the mapping x↦9−x. This formalizes the claim we made in the first paragraph, so r=41 and d=−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.