[Math] How many five-digit numbers are there that have number 4 as at least one digit

combinatoricsnumber theory

How many five-digit numbers are there that have number 4 as at least one digit?

How to do this? I don't know how to start.

Best Answer

There are $9\cdot10^4$ five-digit numbers, since there are $9$ choices for the first digit, and $10$ choices for the next $4$ digits.

Of these numbers, $8\cdot 9^4$ do not contain $4$ as a digit. Therefore the number of $5$-digit numbers with at least one $4$ as a digit is equal to $$ 9\cdot 10^4-8\cdot 9^4=37512$$