[Math] Number of 3-digit numbers which do not contain more than 2 different digits.

combinatorics

[1] Total number of 3-digit numbers which do not contain more than 2 different digits.

[2] Total number of 5-digit numbers which do not contain more than 3 different digits.

$\underline{\bf{My\; Try}}::$ I have formed different cases.

$\bullet$ If all digits are different, like in the form $aaa$, where $a\in \{1,2,3,…..,9\}$

$\bullet$ If all digits are different, like in the form $aba$ , where $a\in \{1,2,3,4,….,9\}$

$\bullet$ If one digit is zero and the other is non-zero, like $a00$ or $aa0$, where $a\in \{1,2,3,4,….,9\}$

But I do not understand how I can get a solution.

Please explain it to me.

Best Answer

The fact that a $3$-digit number, by most definitions, cannot begin with $0$ complicates the analysis.

The case where there is only one digit is easy, there are $9$ possibilities.

We now count the $3$-digit numbers which have $2$ different digit.

There are two subcases (i) $0$ is one of the digits, and (ii) all the digits are non-zero.

Case (i): There are $9$ choices for the other digit. For each such choice, either we have two $0$'s ($1$ number) or one zero. If we have one $0$, it can be out in one of $2$ places. That gives a total of $(9)(3)$.

Case (ii): There are $9$ choices for the first digit. We can either choose to use it twice, in which case we have $2$ choices of where to put the second occurrence, or use it once. The other digit can be chosen in $8$ ways, for a total of $(9)(3)(8)$.

Add up. We get $252$.

Another way: There are $(9)(10)(10)$ $3$-digit numbers. There are $(9)(9)(8)$ with digits all different. Subtract. We get $252$.

We leave the more complicated $5$-digit question to you. It is slightly simpler to take more or less the second approach. It is easy to count the $5$-digit numbers, and also the $5$-digit numbers where the digits are all different. Some elements of the first approach will have to be borrowed to deal with the case exactly $4$ distinct digits.