Between 1 to 10,000, how many times does the digit 7 appear?
Hint:
all digits appear equal number of times in 1 digit number, 2 digit number, 3 digit number and 4 digit number.
for 1 digit number ---- the number of numbers = 9 -1 + 1 = 9
so, number of 7's = 9/9 = 1 (divided by 9 because there are total 9 digits)
for 2 digit number ---- the number of numbers = 99 -10 + 1 = 90
so, number of 7's = 90x2/9 = 20 (divided by 9 because there are total 9 digits)
for 3 digit number ---- the number of numbers = 999 -100 + 1 = 900
so, number of 7's = 900x3/9 = 300 (divided by 9 because there are total 9 digits)
for 4 digit number ---- the number of numbers = 9999 -1000 + 1 = 9000
so, number of 7's = 9000x4/9 = 4000 (divided by 9 because there are total 9 digits)
total number of 7's = 1 + 20 + 300 + 4000 = 4321
Hint:
all digits appear equal number of times in 1 digit number, 2 digit number, 3 digit number and 4 digit number.
for 1 digit number ---- the number of numbers = 9 -1 + 1 = 9
so, number of 7's = 9/9 = 1 (divided by 9 because there are total 9 digits)
for 2 digit number ---- the number of numbers = 99 -10 + 1 = 90
so, number of 7's = 90x2/9 = 20 (divided by 9 because there are total 9 digits)
so, number of 7's = 900x3/9 = 300 (divided by 9 because there are total 9 digits)
for 4 digit number ---- the number of numbers = 9999 -1000 + 1 = 9000
so, number of 7's = 9000x4/9 = 4000 (divided by 9 because there are total 9 digits)
total number of 7's = 1 + 20 + 300 + 4000 = 4321
No comments:
Post a Comment