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

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).


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$


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\ .$$