In a city the phone numbers should consist of exactly eight digits, and is not allowed as a digit in them (i.e., only may be used). It is required that every two phone numbers either be different in at least two places, or have digits separated by at least two units, in at least one of the eight places. (For example, both and may be selected if there is no more conflict with other numbers, or both and may be selected, again if there is no more conflict with other numbers, but at most one of and may be selected.)
What is the maximum number of phone numbers that can be selected, satisfying the requirements? In how many ways can one select this amount of phone numbers?
Solution
At most phone numbers can be selected, and there is only way to select this amount of phone numbers.
Consider the situation when the phone numbers have digits instead of . We shall prove the following by induction: at most phone numbers can be selected, and there is a unique way to select the phone numbers, which is to choose all phone numbers whose sum has the same parity as .
When , we can choose at most one phone number from each group
Thus, at most phone numbers can be selected. Clearly, the only way to select phone numbers is to select all odd numbers .
Assume the case is true. Consider the case . For those phone numbers not starting with the digit , we can pair them up such that and belong to the same pair if . Clearly, at most one phone number can be selected from each pair. Also, for the remaining phone numbers starting with , we can remove the digit and regard this as the case . By the inductive hypothesis, we can select at most phone numbers from these. In total, we can select at most
phone numbers.
To choose this amount of phone numbers, since we need to select phone numbers from those starting with , by the inductive hypothesis, the only way is to select all numbers with . Equivalently, this means .
All numbers with . Then by using the first pairing, we find that all numbers with should be selected, etc. In the same way, we find that all numbers with sum congruent to modulo should be selected. Clearly, the condition is satisfied if we only select those numbers. Also, as exactly one number from each pair is selected, there are such phone numbers. This proves the inductive step.
When , we can select at most phone numbers.