<s>[INST] Combinations of 5-digit numbers I'm just studying for finals here and wanted some confirmation that I'm doing things right.
So if we have 5-digit decimal numbers, there are:


*

*$10^5 - 9*8*7*6*5$ numbers with no $0$, 

*$10^5 - 9*8*7*6*5$ numbers with no $1$, and 

*$10^5-2(9*8*7*6*5)+8*7*6*5*4$ numbers with no $0$ or $1$.  


Am I correct?  Your help is so greatly appreciated.
 [/INST] *

*A $5$-digit number with no $0$ can have any of the other $9$ digits in each of its $5$ places, so there are $9^5$ such numbers. Your calculation would be right if the digits of the number were required to be distinct, but they’re not. The number of $5$-digit numbers with at least one $0$ is therefore $9\cdot10^5-9^5=9\left(10^4-9^4\right)$.

*A $5$-digit with no $1$ can have any of the $8$ digits $2,3,4,5,6,7,8,9$ in the first position, and any of the $9$ digits other than $1$ in each of the remaining $4$ positions, so there are $8\cdot9^4$ such numbers. There are then $9\cdot10^4-8\cdot9^4$ $5$-digit numbers with at least one $1$.

*A $5$-digit with no $0$ and no $1$ can have any of the other $8$ digits in each of its $5$ places, so there are $8^5$ such numbers. The number of $5$-digit numbers with at least one $0$ and at least one $1$ is then $9\cdot10^4-9^5-8\cdot9^4+8^5=9\cdot10^4-17\cdot9^4+8^5$.
Note: I’m assuming throughout that a number is not permitted to begin with $0$.
</s>