# 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:

1. $10^5 - 9*8*7*6*5$ numbers with no $0$,
2. $10^5 - 9*8*7*6*5$ numbers with no $1$, and
3. $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.

-
Not unless you are assuming all the digits are different. –  Gerry Myerson Dec 4 '12 at 23:56
Hm. My carelessness seems to get me on these questions. –  connorbode Dec 4 '12 at 23:56
Corrections 1. $10^5-9^5$ 2. $10^5-9^5$ 3. $10^5-2(9^5)+8^5$ –  connorbode Dec 4 '12 at 23:57

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

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

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

-
This is the right answer to the question I didn't intend to ask. I wrote the wrong question out.. study haze –  connorbode Dec 5 '12 at 0:04
@somekindarukus: Did you want the number of $5$-digit integers with at least one $0$, with at least one $1$, and with at least one $0$ and at least one $1$? –  Brian M. Scott Dec 5 '12 at 0:08
Yes. That's what I was going for. Is it the following: 1&2. $10^5-9^5$ 3. $10^5-2(9^5)+8^5?$ –  connorbode Dec 5 '12 at 0:17
@somekindarukus: Not quite, for two reasons. First, the number of true $5$-digit integers is $9\cdot10^4$, not $10^5$, since the leading digit can’t be $0$. Secondly, the answers to (1) and (2) are different. (If you’re just looking at $5$-digit strings, however, your answers are correct.) –  Brian M. Scott Dec 5 '12 at 0:20