Counting Digit 5 Occurrences 0-1000

  • Thread starter Thread starter f(x)
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 7K views
f(x)
Messages
182
Reaction score
0

Homework Statement


How many times does digit 5 occur in numbers fro 0-1000.

Homework Equations




The Attempt at a Solution


This is what i have done.
Total (1,2,3) digit numbers which have digit 5 occurring once in them are-:
[itex]3.^9C_1.^9C_1 = 243[/itex]
Total numbers with 5 occurring twice are [itex]^9C_1 = 9[/itex]
So, digit 5 occurs 9*2=18 times
Total Numbes with 5 occurring thrice= 1
So digit 5 occurs 3*1=3
Total times digit 5 occurs is 243+18+1=264

Is this correct, specially regarding repetitions or exclusions which i may have made?
 
Physics news on Phys.org
I would have done this quite differently. first, there is xy5 in every 10 numbers and there are 100 sets of 10 in 1000: 100 such numbers. In addition, there is 5x 9 times (not counting 55) in every 100, and 10 hundreds in 100, so 90 more Finally, every number from 500 to 599 has a 5. leaving out those of the form 5x5 and 55x, that's an additional 81. That makes a total of 100+ 90+ 81= 271 numbers between 1 and 1000 that have at least one digit 5.
 
"Total numbers with 5 occurring twice are [itex]^9C_1 = 9[/itex]
So, digit 5 occurs 9*2=18 times"
I think you missed a few numbers on this one...

55, 155, 255, 355, 455, 655, 755, 855, 955
That's 9 numbers with two 5's. But also:
505,515,525,535,545,565,575,585,595
And:
550, 551, 552, 553, 554, 556, 557, 558, 559

Thus, there are 3 locations that the non-5 can be, thus there are
[itex]^9C_1 *3= 9 *3[/itex] numbers with two 5's,
Resulting in a total of 27*2 = 54 5's.

Other than that, I probably would have initially used HallsofIvy's approach as well. However, after reviewing your approach, I think I like it better. (With your approach, your solution would match HallofIvy's solution for the number of distinct numbers with a 5 in it, rather than the number of times "5" occurs:
[itex]3.^9C_1.^9C_1 = 243[/itex]
[itex]+3.^9C_1 = 27[/itex]
[itex]+1[/itex]

But, since you're counting the 5's, you have to multiply that 2nd line by 2 and the 3rd line by 3. Nice.
 
Last edited:
It seems like it can be read two different ways. If you just want to count the number of 5s in the numbers between 0 and 999, then you may as well write the numbers with three digits, that is, from 000 to 999, and then it should be clear that the three digits are independent. This is easy.

More difficult is to count the numbers that have any 5 in them. To do this, you might try instead counting the number of three digit numbers that don't have any 5 in them, and subtract that from 1000.