talaangoshtari wrote:How many positive integers less than 10,000 are such that the sum of their digits is 5?
(a) 31
(b) 51
(c) 56
(d) 62
(e) 93
Positive numbers less than 10,000 can have one to four digits.
One digit numbers whose digits add up to 5 can only use the number 5.
5
So there is just 1 one digit number whose digits add up to 5.
Two digit numbers whose digits add up to 5 can be permutations of (1,4), (2,3), and (5,0).
Permutations of two elements have two arrangements, except for (5,0) which can only have one, 50, as 05 is not really a two digit number.
So 2 + 2 + 1 = 5 two digit numbers.
Three digit numbers whose digits add up to five can be permutations of (1,1,3), (0,1,4), (0,2,3), (0,0,5), and (2,2,1).
For example (1,1,3) can be arranged 3!/2! = 3 ways.
However, because of the zeros, (0,0,5) can only be arranged one way, as 500.
Taking into account the doubles and the zeros, one can arrange those sets in the following number of ways respectively.
3 + 4 + 4 + 1 + 3 = 15 three digit numbers.
Four digit numbers whose digits add up to five can be permutations of (1,1,3,0), (0,0,1,4), (0,0,2,3), (0,0,0,5), (0,2,2,1) and (1,1,1,2).
For example, (1,1,3,0) can be arranged (3 x 3 x 2 x 1)/2! = 9 ways.
(1,1,1,2) can be arranged 4!/3! = 4 ways.
Taking into the account the doubles, triples and zeros, one can arrange those sets in the following number of ways respectively.
9 + 6 + 6 + 1 + 9 + 4 = 35
So the total of one digit, two digit, three digit, and four digit numbers is the following.
1 + 5 + 15 + 35 = 56
Choose
C.