Solveeit Logo

Question

Question: The number of integers between 1 and 1000000 having the sum of the digits equals to 18 is (a) 3364...

The number of integers between 1 and 1000000 having the sum of the digits equals to 18 is
(a) 33649
(b) 25927
(c) 41371
(d) None of these

Explanation

Solution

Hint:Assume that the numbers are of the form abcdefabcdef. Calculate all the possible numbers abcdefabcdef such that a+b+c+d+e+f=18a+b+c+d+e+f=18 , where anyone of the digits is greater than or equal to 10. Subtract this set of numbers from the number of the form abcdefabcdef to get the required answer.

Complete step-by-step answer:
We have to calculate the number of possible integers between 1 and 1000000 such that the sum of digits is equal to 18.
We will assume that the numbers are of the form abcdefabcdef such that a+b+c+d+e+f=18a+b+c+d+e+f=18 and a,b,c,d,e,f0a,b,c,d,e,f\ge 0.
We know that the number of possible non-negative solutions of a1+a2+...ar=n{{a}_{1}}+{{a}_{2}}+...{{a}_{r}}=n is n+r1Cr1{}^{n+r-1}{{C}_{r-1}}.
Substituting r=6,n=18r=6,n=18 in the above expression, the number of possible numbers of the form abcdefabcdef such that a+b+c+d+e+f=18a+b+c+d+e+f=18 and a,b,c,d,e,f0a,b,c,d,e,f\ge 0 is 18+61C61=23C5{}^{18+6-1}{{C}_{6-1}}={}^{23}{{C}_{5}}.
However, we observe that some of these numbers have digits greater than or equal to 10. So, we have to remove those numbers. We will count all such possible numbers.
Let’s assume one digit, say ‘a’ is greater than or equal to 10.
So, the sum of the other five digits is 18a18-a. Thus, we have b+c+d+e+f=18ab+c+d+e+f=18-a. We have to count all possible combinations of b, c, d, e, and f.
So, the possible number of ways to choose b, c, d, e, and f such that b+c+d+e+f=18ab+c+d+e+f=18-a is 18a+51C51=22aC4{}^{18-a+5-1}{{C}_{5-1}}={}^{22-a}{{C}_{4}}. This value should be multiplied by 6 as anyone of numbers among a, b, c, d, e, and f can have a digit greater than or equal to 10. We observe that the possible values of a are [10,18]\left[ 10,18 \right].
Thus, the possible numbers whose any one digit is greater than or equal to 10 is =6(2210C4+2211C4+2212C4+2213C4+2214C4+2215C4+2216C4+2217C4+2218C4)=6\left( {}^{22-10}{{C}_{4}}+{}^{22-11}{{C}_{4}}+{}^{22-12}{{C}_{4}}+{}^{22-13}{{C}_{4}}+{}^{22-14}{{C}_{4}}+{}^{22-15}{{C}_{4}}+{}^{22-16}{{C}_{4}}+{}^{22-17}{{C}_{4}}+{}^{22-18}{{C}_{4}} \right)
Simplifying the above expression, the possible numbers whose any one digit is greater than or equal to 10 is =6(12C4+11C4+10C4+9C4+8C4+7C4+6C4+5C4+4C4)=6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{8}{{C}_{4}}+{}^{7}{{C}_{4}}+{}^{6}{{C}_{4}}+{}^{5}{{C}_{4}}+{}^{4}{{C}_{4}} \right).
We can rewrite 4C4{}^{4}{{C}_{4}} as 5C5{}^{5}{{C}_{5}} as both of them are equal to 1.
Thus, the possible numbers whose any one digit is greater than or equal to 10 is =6(12C4+11C4+10C4+9C4+8C4+7C4+6C4+5C4+5C5)=6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{8}{{C}_{4}}+{}^{7}{{C}_{4}}+{}^{6}{{C}_{4}}+{}^{5}{{C}_{4}}+{}^{5}{{C}_{5}} \right).
We know the formula nCr+nCr+1=n+1Cr+1{}^{n}{{C}_{r}}+{}^{n}{{C}_{r+1}}={}^{n+1}{{C}_{r+1}}.
By applying formula the last two terms of expression i.e 5C4+5C5{}^{5}{{C}_{4}}+{}^{5}{{C}_{5}} can be written as 6C5{}^{6}{{C}_{5}}.Similarly apply the formula for the last two terms and simplify it ,we get
The possible numbers whose any one digit is greater than or equal to 10 is =6(12C4+11C4+10C4+9C4+8C4+7C4+6C4+6C5)=6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{8}{{C}_{4}}+{}^{7}{{C}_{4}}+{}^{6}{{C}_{4}}+{}^{6}{{C}_{5}} \right).
6(12C4+11C4+10C4+9C4+8C4+7C4+7C5) 6(12C4+11C4+10C4+9C4+8C4+8C5) 6(12C4+11C4+10C4+9C4+9C5) 6(12C4+11C4+10C4+10C5) 6(12C4+11C4+11C5) 6(12C4+12C5) 6(13C5) \begin{aligned} & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{8}{{C}_{4}}+{}^{7}{{C}_{4}}+{}^{7}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{8}{{C}_{4}}+{}^{8}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{9}{{C}_{4}}+{}^{9}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{10}{{C}_{4}}+{}^{10}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{11}{{C}_{4}}+{}^{11}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{12}{{C}_{4}}+{}^{12}{{C}_{5}} \right) \\\ & \Rightarrow 6\left( {}^{13}{{C}_{5}} \right) \\\ \end{aligned}
Thus, the possible numbers whose any one digit is greater than or equal to 10 is 6(13C5)6\left( {}^{13}{{C}_{5}} \right). We will now subtract this value from all the possible six-digit integers whose sum is 18.
So, the number of six-digit integers whose sum is 18 is =23C56(13C5)=23!18!5!6(13!5!8!)=25927={}^{23}{{C}_{5}}-6\left( {}^{13}{{C}_{5}} \right)=\dfrac{23!}{18!5!}-6\left( \dfrac{13!}{5!8!} \right)=25927.
Hence, the number of integers between 1 and 1000000 having the sum of the digits equals to 18 is 25927 which is option (b).

Note: One must subtract the numbers whose digit is greater than or equal to 10 as such numbers don’t exist. Students should know the formulas nCr=n!r!(nr)!{}^{n}{{C}_{r}}=\dfrac{n!}{r!\left( n-r \right)!} , the number of possible non-negative solutions of a1+a2+...ar=n{{a}_{1}}+{{a}_{2}}+...{{a}_{r}}=n is n+r1Cr1{}^{n+r-1}{{C}_{r-1}} and nCr+nCr+1=n+1Cr+1{}^{n}{{C}_{r}}+{}^{n}{{C}_{r+1}}={}^{n+1}{{C}_{r+1}} for solving these types of questions.
.