Count of 3-digit numbers with at least one digit as 9

27.6k Views Asked by At

Find the number of $3$ digit numbers (repetitions allowed) such that at least one of the digit is $9.​$

I've posted my answer below. If there is a better way to solve this question, I would be glad to learn about that.

4

There are 4 best solutions below

1
On BEST ANSWER

Suppose that 'three-digit' means $abc$, where $a>0$.

Now, we first count that there are $900$ of these numbers.

Of numbers without a $9$, then it's $8\times 9 \times 9$, since the first digit can be any of 1-8, and the rest 0-8. This gives $648$ numbers without a 9.

One then finds that there are $252 = 900-648$ numbers that contain at least one nine (or any other specific non-zero digit).

0
On

If unit place is $9,$ hundredth place would have $9$ options $(1\,\text{to} \,9),$ tens place would have $10$ options $(0\, \text{to}\, 9).$ Total ways $90.$

When $9$ is fixed for tens place, unit place choices$=9 (0\, \text{to}\, 8),$ hundredth place choices$= 9 (1\, \text{to}\, 9).$ Total$=81.$

When $9$ is fixed for hundredth place, unit place choices$=9,$ tens place choices$=9.$ Total$=81$

Answer$=90+81+81=252$

3
On

There are $\binom{3}{1}$ ways of having one $9$, and for each of these there are $9^2$ assignments of the remaining numbers.

There are $\binom{3}{2}$ ways of having two $9$s, and for each of these there are $9$ assignments of the remaining numbers.

There is exactly one way of having three nines.

Hence the answer is $\binom{3}{1} 9^2 + \binom{3}{2} 9 +1 = 271$.

Of course, a far simpler way is to note that there are $10^3$ possible 3 digit numbers and $9^3$ possible numbers with no 9 whatsoever, hence the answer is $10^3-9^3 = 271$.

If numbers starting with $0$ are disallowed, then we must remove the 19 numbers $009,019,..089, 090,...,099$. This would leave $271-19= 252$.

1
On

The first digit $d_1$ can be $=9$ or one of $\{1,2,3,4,5,6,7,8\}$. In the first case we have $10^2=100$ choices for the digits $d_2$ and $d_3$, since a $9$ is already here. In the second case the $9^2$ choices where both $d_2$ and $d_3$ are from $\{0,1,2,3,4,5,6,7,8\}$ are forbidden. Therefore $$N=100+8\cdot(100-81)=252\ .$$