How many numbers from $1$ to $99999$ have a digit-sum of $8$?
Why is the answer ${8+4\choose 4}$?
Does the following method work?
Answer is the number of ways to split 8 into 5 digits,
i.e. number of ways to insert 4 lines among a row of 8 objects.
How many numbers from $1$ to $99999$ have a digit-sum of $8$?
Why is the answer ${8+4\choose 4}$?
Does the following method work?
Answer is the number of ways to split 8 into 5 digits,
i.e. number of ways to insert 4 lines among a row of 8 objects.
Yes, the reasoning below the line in your question is correct, though it can be expanded for greater clarity. Lay out a row of $8$ stars, say:
$$********$$
Now insert $4$ dividers to break them up into $5$ groups, e.g.,
$$*||***||****$$
From left to right read off the number of stars in each of the $5$ groups: $$10304$$
The result is clearly a number between $1$ and $99999$ whose digits sum to $8$. And the procedure is clearly reversible, so the number of ways of inserting the $4$ dividers really is the number of integers in which we’re interested. For example, starting with $352=00352$, we get
$$||***|****|**$$
The string of stars and dividers is a string of $8+4=12$ objects, and the $4$ dividers can go anywhere in this string, so there are $\binom{12}4$ ways to place them and therefore $\binom{12}4$ numbers of the desired kind.
Let $x_{1}, x_{2}, x_{3}, x_{4}, x_{5} \geq 0$ be the 5 digits of the number. Then the number of numbers from 1 to 99999 that have a digit sum of 8 are the integer solutions to the equation $x_{1} + x_{2} + x_{3} + x_{4} + x_{5} = 8$. This problem is combinatorially identical to the number of distributions of $8$ indistinguishable objects to $5$ distinguishable people, hence, ${8 + 4 \choose 4}$. For more on why that is, see my answer here:
Combinatorics Distribution - Number of integer solutions Concept Explanation