0

If $N$ denotes the number of natural numbers less than $10^{4}$ whose sum of digits is equal to $7$, determine $\frac{N}{120}$

Peter
  • 86,576

2 Answers2

3

The problem is the same as count the ways you can distribute 7 balls into 4 urns described here. Setting $n=7$ (number of balls) and $k=4$ number of urns the result becomes:

$$\binom{n+k-1}{n}=\binom{10}{7} = {10!\over7!3!} = {10\cdot 9\cdot 8\over1\cdot 2\cdot3} = 120$$

Then dividing that by $120$ you get $1$.

skyking
  • 17,080
0

We have to count the admissible decimal strings in the range $0000-9999$.

To this end we list all partitions of $7$ into $\leq4$ parts and pad them with zeros: $$7000,6100,5200,5110,4300,4210,4111,3310,3220,3211,2221\ .$$ Each of these strings can be permuted in $4$ ways $(7000,4111,2221)$, in $24$ ways $(4210)$, or in $12$ ways (the remaining ones), giving a total of $120$ admissible strings.

I don't think it pays to set up an inclusion-exclusion scheme.