2

Find the number of positive integers not containing digit $0$ whose digits add up to $10$.

N. F. Taussig
  • 76,571
Samuel
  • 1,491
  • Obviously the maximum number is 1111111111, which has 10 digits, so we are looking for 9-digit numbers at maximum (and we will add 1 to the total). – Samuel Apr 09 '17 at 12:31
  • Look up ordered partition . This question may help: http://math.stackexchange.com/questions/31562/number-of-ordered-partitions-of-integer . And see https://en.wikipedia.org/wiki/Composition_(combinatorics)#Number_of_compositions – Ethan Bolker Apr 09 '17 at 12:34

1 Answers1

5

Suppose that you have $10$ unities written down in a row:

$$1 \quad 1 \quad 1\quad 1 \quad 1 \quad 1 \quad 1 \quad 1 \quad 1 \quad 1$$

You can see that there are 9 empty spaces between them, where you can put a separator. Any arrangement of separators (except for the case when there are no separators) can be mapped to a number with the sum equal to 10: we should merely count the number of unities in each obtained block. For example:

$$1 \quad 1~~~|~~~1\quad 1 \quad 1~~~|~~~1 \quad 1 \quad 1~~~|~~~1 \quad 1$$ This arrangement corresponds to the number $2332$. On the other hand, you can see that for any number there is a unique arrangement of separators representing this number. Thus, it is a bijection.

Since we can select any subset of spaces (except for the empty one) to fill them with separators, the number of ways to make such an arrangement is $2^9 - 1 = 512 - 1 = 511$.

Ramil
  • 1,882