# 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

**Hint:**We have to make three cases for solving this problem. In the first case, we enlist the possibilities when 5 appears once in the digits from 1 to 1000 which we will find by selecting 1 position from 3 places and now 5 is gone and 9 digits are possible so multiplying the result of selecting 1 position out of 3 positions with ${{9}^{2}}$. In the second case, we will enlist the possibilities when 5 appears twice in the same way as we have shown earlier but now, we have to choose 2 positions from 3 places. In the third case, the possibility is 1 when all the three digits are 5 is 555. Now, add all these possibilities to get the answer.

**Complete step-by-step solution:**We are asked to find the number of times 5 appears from 1 to 1000.

Now, in 1000 there are no 5 digits so 5 appears in one digit, two digits, and three digits numbers.

We are going to find the number of times 5 appears from 1 to 1000 by taking three cases. In the first case, 5 appears once, in the second case 5 appears twice and in the third case, 5 appears thrice and then adds all the three cases.

Case 1: When the digit 5 appears once.

_ _ _

In the three places above, first of all we are going to choose one place where 5 appears. The ways to select one position out of these three places is:

${}^{3}{{C}_{1}}$

Now, in the remaining 2 places, any 9 digits from 0 to 9 except 5 will appear so multiplying 9 by 9 and hence multiplying ${{9}^{2}}$ to above expression we get,

${}^{3}{{C}_{1}}{{\left( 9 \right)}^{2}}$

We know that, ${}^{n}{{C}_{1}}=n$. Using this relation in the above expression we get,

$\begin{align}

& 3\left( 81 \right) \\

& =243 \\

\end{align}$

Case 2: When the digit 5 appears twice.

_ _ _

Now, the digits are appearing twice so we have to choose two places out of three places and the ways to select two places out of 3 are as follows:

${}^{3}{{C}_{2}}$

We know that, ${}^{n}{{C}_{r}}={}^{n}{{C}_{n-r}}$ using this relation in the above expression we get,

${}^{3}{{C}_{3-2}}={}^{3}{{C}_{1}}$

The above expression is reduced to 3.

Now we know that if in a number 5 appears twice then we have to multiply numbers by 2.

After the two places are occupied by 5 we are remaining with just one position so any of the 9 digits can be placed in that blank so multiplying 9 by 3 we get,

$\begin{align}

& 9\times 3 \times 2\\

& =54 \\

\end{align}$

Case3: When the digit 5 appears thrice.

Now we know that if in a number 5 appears thrice then we have to multiply numbers by 3.

There is only one possibility when 5 appears thrice is:

$555$

So the number will be $ 3 \times 1$.

Now, adding the result of cases 1, 2 and 3 we get,

$\begin{align}

& 243+54+3 \\

& =300 \\

\end{align}$

Hence, the digit 5 appears 300 times from 1 to 1000.

Hence, the correct option is (c).

**Note:**You might think that we can count the digit 5 by first looking from 1 to 9, how many times 5 appear then from 10 to 99 how many times 5 appear then from 100 to 999 how many times digit 5 will appear. You can do it but it will consume a lot of time and you cannot afford that much time in the examination so it is better to do the problem in the way that we have solved above.