2
$\begingroup$

How many natural numbers smaller than $10\,000$ that have no digit $0$ and the sum of their digits equals $9$?

I am really having a hard time solving this question. Any help would be appreciated!

3 Answers 3

3

Hint $1$: You can divide the problem into the cases of $1$ digit, then of $2$ digits, then $3$ and finally $4$ (why not more?)

Hint $2$: Use stars and bars.

  • 0
    I think I get what you mean. I can successfully know the numbers under 10,000 that the sum of their digits equal 9 and it is: x1 + x10 + x100 + x1000 = 9 Each group represents (1 digit, 2 digits, 3 digits and 4 digits). And to solve it we use D(n,k) = D(4, 9) and it equals 220. But I'm having a hard time knowing how to take off the numbers that have digits 0 in them. :/2017-01-18
  • 0
    You can consider the digits as 1's and then sum the other digits. You won't care about adding a digit greater than 9, because the sum must be 92017-01-18
2

One approach is to preload each digit position with one unit, then split the remaining $5$ units across the four positions using stars and bars, giving $\binom 83$ options for the four-digit numbers. Similarly you can calculate the options for $3,2$ and $1$ digit numbers.

1

Note that a natural number less than $10000$ with no $0$ is always a four digit number. (We only require that the first digit is not $0$, which is certainly true.) Then the question becomes: how many $4$ tuples of positive integers have a sum of $9$? This is also known as a stars and bars problem. From there, you can just read the link and see how to solve this.