Positive integer less than 10,000 means the integer can be 1 or 2 or 3 or 4 digit integer.replayyyy wrote:How many positive integers less than 10 000 are there in which the sum of digits equal 5?
A. 31
B. 51
C. 56
D. 62
E. 93
Sum of digits equal to 5 is possible in the following ways,
(0, 0, 0, 5) => 4!/3! combinations = 4
(0, 0, 1, 4) => 4!/2! combinations = 12
(0, 0, 2, 3) => 4!/2! combinations = 12
(0, 1, 1, 3) => 4!/2! combinations = 12
(0, 1, 2, 2) => 4!/2! combinations = 12
(1, 1, 1, 2) => 4!/3! combinations = 4
Total number of combination possible = (4 +12 +12 +12 +12 +4) = 56
The correct answer is C.
There is an efficient method to solve this kind of problems.
The question can be rephrased as in how many ways a sum of 5 can be spread among 4 digits (including those in the form 0XXX, 00XX, 000X).
Let's assume 'X' represents 1 and '|' represents a digit separator.
Thus, 2012 becomes XX| |X|XX, 0050 becomes ||XXXXX|, 2003 becomes XX|||XXX etc.
As we are working with 4 digit number, we'll use three digit separators and as the sum of digits is 5, we'll use five 'X's. Now the problem is in how many ways 5 X's and 3 digit separators can be arranged among themselves.
Number of ways to arrange them = 8!/(3!*5!) = 56


















