How many $4$-digit numbers are there whose digit sum equals $10$?
For example, $2017$ is such a $4$-digit number.
I got this from a $10$th grade math competition review. I asked my algebra-$2$ teacher and she doesn't know how to solve it.
combinatorics
How many $4$-digit numbers are there whose digit sum equals $10$?
For example, $2017$ is such a $4$-digit number.
I got this from a $10$th grade math competition review. I asked my algebra-$2$ teacher and she doesn't know how to solve it.
Best Answer
Reword this as finding the number of integer solutions to the system
$$\begin{cases} x_1+x_2+x_3+x_4=10\\ 1\leq x_1\color{grey}{\leq 9}\\ 0\leq x_2\color{grey}{\leq 9}\\0\leq x_3\color{grey}{\leq 9}\\ 0\leq x_4\color{grey}{\leq 9}\end{cases}$$
Ignoring the upper bound conditions for now, count the number of solutions to the above using a standard stars and bars argument.
Then, noticing that none of the upper bound conditions could possibly be violated for $x_2,x_3,x_4$ (while still satisfying the sum and all lower bounds), and only one outcome violates the first upper bound condition, subtract one to correct the overall count.