# Thread: Is there a better way?

1. ## Is there a better way?

(i) Find the number of integers between 500 and 5000 that do not contain 0 as a digit.

(ii) How many integers between 500 and 5000 contain the digit 0 exactly once?

(iii) ...at least twice?

---

Assuming that 500 and 5000 are not included,

(i) $(4999-500)-18-4*19-4(100+9*19)=3321$

(ii) $18*5+4*9*18=738$

(iii) $4+4(19+9)=116$

I assume these are right(ish), but is there a simpler method?

2. Hello, billym!

I'll assume that 500 and 5000 are included.

(1) Find the number of integers between 500 and 5000 that do not contain 0 as a digit.
Three-digit numbers: _ _ _

They can begin with: {5, 6, 7, 8, 9} . . . 5 choices.
. . There are 9 choices for the second digit.
. . There are 9 choices for the third digit.
There are: . $5\cdot9^2 \:=\:405$ three-digit numbers with no 0s.

Four-digit numbers: _ _ _ _

They can begin with: {1, 2, 3, 4} . . . 4 choices.
. . There are 9 choices for each of the other 3 digtits.
There are: . $4\cdot9^3 \:=\:2916$ four-digit numbers with no 0s.

Therefore, there are: . $405 + 2916 \:=\:\boxed{3321}$ numbers with no 0s.

(2) How many integers between 500 and 5000 contain the digit 0 exactly once?
Three-digit numbers: _ _ _

They can begin with: {5, 6, 7, 8, 9} . . . 5 choices.
. . There are 2 choices for the position of the 0.
. . There arte 9 choices for the third digit.
There are: $5\cdot2\cdot9 \:=\:90$ three-digit numbers with one 0.

Four-digit number: _ _ _ _

They can begin with: {1, 2, 3, 4} . . . 4 choices.
. . There are 3 choices for the position of the 0.
. . There are: $9^2$ choices for the other two digits.
There are: $4\cdot3\cdot 9^2 = 972$ four-digit numbers with one 0.

Therefore, there are: . $90 + 972 \:=\:\boxed{1062}$ numbers with exactly one 0.

(3) ...at least twice?
From 500 to 5000, there are: . $4501$ numbers.

3321 of them have no 0s.
1062 of them have one 0.

Therefore: . $4501 - 3321 - 1062 \:=\:\boxed{118}$ numbers with two or more 0s.

3. Revised:

Assuming 500 and 5000 not included,

Forms of 3-digit numbers containing 0:

AA0
A00
A0A

5*9*1*2 + 4*1*1 = 94

Forms of 4-digit numbers containing 0:

AAA0
AA0A
A0AA

AA00
A00A
A0A0

A000

4*9*9*3 = 972

4*9*3 = 108

4 = 4

(i) 4999 - 500 - 94 - 108 - 972 - 4 = 3321

(ii) 5*9*2 + 4*9*9*3 = 1062

(iii) 4 + 4*9*3 + 4 = 116

Correct?

4. Okay so you beat my revision. I guess our answers are the same except you have +2 in the last question because you included 500 and 5000. Great.