Solveeit Logo

Question

Question: Find the number of 5 digit numbers that contain the number 7 exactly 1 time (repetition is allowed)....

Find the number of 5 digit numbers that contain the number 7 exactly 1 time (repetition is allowed).

Explanation

Solution

Here, we have been asked to find the number of 5 digit numbers which contain 7 only once. For this, we will make 2 cases- one where 7 has the first position and the other where 7 has one of the other 4 positions. Then we will see in how many ways the other positions can be filled in both cases and the final answer of each case will be the product of the number of ways each position can be filled. Then we will add the results of both the cases and hence we will get the total number of 5 digit numbers which contain 7 only once. Thus, we will get an answer.

Complete step-by-step solution:
Here, to find the number of 5 digit numbers that contain 7 exactly once, is found as follows:
We will make two cases here, one where 7 has the first position and the other where 7 has one of the other 4 positions.
Case-1: when 7 has the first position:
When 7 has the first position among the 5 positions, the number will look something like as follows:
\underset{\scriptscriptstyle-}{7}\ \\_\ \\_\ \\_\ \\_
Now, since 7 only has to come once, it cannot be repeated again. Except for 7, there are now 9 digits, which can be filled in the next 4 positions- 0, 1, 2, 3, 4, 5, 6, 8, and 9.
Now, since repetition is allowed, any one of these 9 digits can be placed in any of the 4 positions. Hence, there are 9 ways to fill all 4 digits separately. Now, since they have to be filled simultaneously, the number of 5 digit numbers which contain 7 only once at the first position is given as:

& 9\times 9\times 9\times 9 \\\ & \Rightarrow {{9}^{4}} \\\ \end{aligned}$$ Hence, there is ${{9}^{4}}$ 5 digit numbers which contain 7 only once at the first position. Case-2: when 7 does not have the first position: When 7 is not on the first position, it has 4 other positions on which it can occur. Now, we know that the number of ways to select ‘r’ objects out of ‘n’ objects is given by $^{n}{{C}_{r}}$. Thus, the number of ways of selecting any one position for 7 to occur among the remaining 4 positions is given as: $\begin{aligned} & ^{4}{{C}_{1}} \\\ & \Rightarrow \dfrac{4!}{1!\left( 4-1 \right)!} \\\ & \Rightarrow \dfrac{4!}{1!3!} \\\ & \Rightarrow \dfrac{4\times 3!}{1!3!} \\\ & \Rightarrow 4 \\\ \end{aligned}$ Now, for the first position, we know that 0 cannot occur on the first position. Thus, there are 8 digits available for the first position- 1, 2, 3, 4, 5, 6, 8 and 9. For the remaining 3 positions (positions except for the first position and the position on which 7 is filled), there are again 9 digits available to fill them as above separately. Thus, the number of 5 digit numbers which contain 7 only once but not at first position are given as: $\begin{aligned} & 8\times 4\times 9\times 9\times 9 \\\ & \Rightarrow 32\times {{9}^{3}} \\\ \end{aligned}$ Thus, there are $32\times {{9}^{3}}$ 5 digit numbers which contain 7 only once but not at the first position. Now, the total number of 5 digit numbers which contain 7 only once are given as: ${{9}^{4}}+32\times {{9}^{3}}$ Solving it, we get: $\begin{aligned} & {{9}^{4}}+32\times {{9}^{3}} \\\ & \Rightarrow 9\times {{9}^{3}}+32\times {{9}^{3}} \\\ & \Rightarrow \left( 9+32 \right)\times {{9}^{3}} \\\ & \Rightarrow 41\times {{9}^{3}} \\\ \end{aligned}$ Thus, the final answer is $41\times {{9}^{3}}=29889$ **Hence, there are a total of 29889 5 digit numbers which contain 7 only once.** **Note:** Here, we have calculated the value of the final answer, i.e. $41\times {{9}^{3}}$ because we have the convenience of a calculator and also the time to calculate it. But in examinations, it is better to leave the answer in this form itself otherwise the whole calculation will take up a lot of time and hence will not give enough time for other questions.