[Math] How many $6$ digit numbers are there whose digits sum to $51$

combinatorics

How many $6$ digit numbers are there whose digits sum to $51$? Permutation and not combination right? Is the solution $6!/5! + 6!/4! + 6!/(3!3!) = 56$ ways

Best Answer

We know that all the numbers are digits. $$(9-x_1)+(9-x_2)+(9-x_3)+(9-x_4)+(9-x_5)+(9-x_6)=51$$

$$x_1+x_2+x_3+x_4+x_5+x_6=9\times 6-51=3$$

$$\binom{6+3-1}{6-1}=\binom{8}{5}=56$$

Of course, this only works because the sum is less than $9$.