A4 A positive integer is said to be bi-digital if it uses two different digits, with each digit used exactly twice. For example, 1331 is bi-digital, whereas $1113,1111,1333$, and 303 are not. Determine the exact value of the integer $b$, the number of bi-digital positive integers.
Solution 1
There are 9 choices for what the left-most digit of the number is (it cannot be 0 ) and there are 3 choices for where the second copy of this digit is. There are 9 possibilities for the digit that fills the remaining positions. Thus, $b=9 \times 3 \times 9=243$.
Solution 2
We consider two cases. Either 0 is one of the digits, or it is not. If 0 is not one of the digits, then we have $\binom{9}{2}=36$ ways to choose 2 digits which are not 0 . There are $\frac{4!}{(2!)^{2}}=6$ ways to arrange these digits, for a total of 216 numbers. If 0 is one of the digits, it cannot be the first digit of the number, since then the number would have fewer than 4 digits. In this case, there are $\binom{9}{1}=9$ ways to choose the other digit. The first digit must be the non-zero digit and there are 3 places for the other non-zero digit, so there are 27 such numbers. Thus, $b=216+27=243$.