For every positive integer , let be the number of all positive integers with exactly digits, each having exactly of the digits equal to and the other digits equal to . Let be the number of all positive integers with exactly digits, each of its digits can only be , , or and the number of 's equals the number of 's. Prove that .
IMO Hk TST
Solution
We consider the following mapping between the set of all positive integers formed by 's and 's and the set of all positive integers with digits formed by , , , such that the numbers of 's and 's are equal.
For each , we can pair up every two consecutive digits of from left to right. This gives pairs in total. Then we replace the pairs , , , by , , , respectively. If there are , , , pairs of , , , respectively, then there are 's and 's in . Thus, we must have . This shows the numbers of 's and 's in the image are the same, and so the image belongs to .
Clearly, the mapping is reversible. For each , we just need to replace the digits , , , in by , , , respectively. If there are , , , copies of , , , respectively, then there are 's and 's in the image, and so the image belongs to . This shows the mapping is a bijection, and hence