1
$\begingroup$

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.

  • 0
    Corrections 1. $10^5-9^5$ 2. $10^5-9^5$ 3. $10^5-2(9^5)+8^5$2012-12-04

1 Answers 1

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

  • 0
    @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.)2012-12-05