Solveeit Logo

Question

Question: The number of times the digit 5 will be written when listing the integers from 1 to 1000 is A.271 ...

The number of times the digit 5 will be written when listing the integers from 1 to 1000 is
A.271
B.272
C.300
D.None of these

Explanation

Solution

Here, we will consider three different cases i.e. when the digit 5 appears only once, when it appears twice and when it appears thrice using the formula of combination. We will then add all these 3 cases to get the required number of times.

Formula Used:
nCr=n!r!(nr)!{}^n{C_r} = \dfrac{{n!}}{{r!\left( {n - r} \right)!}}, where nn is the total number of terms and rr is the number of terms to be selected.

Complete step-by-step answer:
We are going to find the number of times the digit 5 appears while listing the numbers from 1 to 1000.
Now, while listing the numbers from 1 to 1000, we can have a maximum of 3 digit numbers.
Hence, we will consider 3 cases:
Case 1: When the digit 5 appears only once.
Now, as we know that we can have a maximum of three digit numbers.
Hence, in order to choose only 1 place from those 3 digits, we will use the formula of combinations nCr{}^n{C_r}
Hence, the number of ways of choosing that 1 place where 5 will appear =3C1 = {}^3{C_1}
Also, the remaining 2 digits can be filled by the remaining 9 digits from 0 to 9 except 5.
The total number of ways of filling the remaining two digits =9×9=92 = 9 \times 9 = {9^2}
The total number of cases where the digit 5 appears only once =3C1×(9)2 = {}^3{C_1} \times {\left( 9 \right)^2}
Using the formula, nCr=n!r!(nr)!{}^n{C_r} = \dfrac{{n!}}{{r!\left( {n - r} \right)!}}, we get,
Total number of cases where the digit 5 appears only once =3!1!(2)!×(9)2 = \dfrac{{3!}}{{1!\left( 2 \right)!}} \times {\left( 9 \right)^2}
Simplifying the expression, we get
\Rightarrow Total number of cases where the digit 5 appears only once =3×81=243 = 3 \times 81 = 243
Case 2: When the digit 5 appears twice.
Now, as we know that we can have a maximum of three digit numbers.
Hence, in order to choose 2 places from those 3 digits, we will use the formula of combinations nCr{}^n{C_r}
Hence, the number of ways of choosing 2 places where 5 will appear =3C2 = {}^3{C_2}
Also, the remaining 1 digit can be filled by the remaining 9 digits from 0 to 9 except 5.
Hence, total number of ways of filling the remaining digit will be 9
Also, the digit 5 appears twice, hence, we will multiply by 2
Hence, total number of cases where the digit 5 appears twice =2×3C2×9 = 2 \times {}^3{C_2} \times 9
Using the formula, nCr=n!r!(nr)!{}^n{C_r} = \dfrac{{n!}}{{r!\left( {n - r} \right)!}}, we get,
Total number of cases where the digit 5 appears two times =2×3!2!(1)!×9 = 2 \times \dfrac{{3!}}{{2!\left( 1 \right)!}} \times 9
Simplifying the expression, we get
\Rightarrow Total number of cases where the digit 5 appears two times =2×3×9=54 = 2 \times 3 \times 9 = 54
Case 3: When the digit 5 appears three times
Now, as we know that we can have a maximum of three digit numbers.
Hence, this case will include only 1 possible case which is having a number 555.
But since, we have the same number 5 three times, hence, we will multiply this by 3.
Hence, total number of possible cases =1×3=3 = 1 \times 3 = 3
Therefore, adding all the three cases together, we get
Required number of times the digit 5 occurs =243+54+3=300 = 243 + 54 + 3 = 300
Therefore, the digit 5 occurs 300 times.
Hence, option C is the correct answer.

Note: We can solve this question in an alternate way.
First, we will think that how many 5’s are at the units place:
\left\\{ {5,15,25,35,....95} \right\\} = 10 fives
Then how many 5’s are at the tens place:
\left\\{ {50,51,52,53,....59} \right\\} = 10 fives
Hence, from 1 to 100, we have a total of 10+10=2010 + 10 = 20 fives.
Hence, from 1 to 1000, we will have 20×10=20020 \times 10 = 200 fives in the units and tens place altogether.
Therefore, at the hundred’s place, the number of 5’s are:
\left\\{ {500,501,502,.....599} \right\\} = 100 fives
Hence, the total number of times the digit 5 will be written when listing the integers from 1 to 1000 is 200+100=300200 + 100 = 300 times.
Hence, option C is the correct answer.