# Problem Of The Week #458 March 8th 2021

Status
Not open for further replies.

#### anemone

##### MHB POTW Director
Staff member
Here is this week's POTW:

-----

How may 6-digit numbers are there such that the sum of their digits is exactly 8? (Leading zeros, e.g. 041030 are allowed.)

-----

#### anemone

##### MHB POTW Director
Staff member
Congratulations to Opalg for his correct solution, which you can find below:
Solution from Opalg :
Suppose you have six boxes labelled A,B,C,D,E,F, and eight identical balls to distribute among the boxes. One way of doing this would be to put 4 balls into box B, 1 ball into box C and 3 balls into box E. The number of balls in each box A,...,F is then 0,4,1,0,3,0. Now combine those digits into a single number, 041030. Conversely, each 6-digit number whose digits sum to 8 gives rise to a distribution of the 8 balls into the boxes.

So the number of 6-digit numbers whose digits sum to 8 is the same as the number of ways of allocating 8 balls to 6 boxes. By a standard result in combinatorics, that number is $${6+8-1\choose6-1} = {13\choose5} = 1287.$$

Alternative solution from other:
The answer is equal to the coefficient of $x^8$ in the expansion of $(1+x+x^2+\cdots+x^9)^6$.

Since $1+x+x^2+\cdots=\dfrac{1}{1-x}$, the answer can be obtained also from the coefficient of $x^8$ in the Maclaurin series of $\displaystyle \dfrac{1}{(1-x)^6}=(1-x)^{-6}=\sum_{n=0}^{\infty} (-1)^n {-6 \choose n} x^n$.

Hence, the answer is $\displaystyle {-6 \choose 8}=\dfrac{(-6)(-7)(-8)(-9)(-10)(-11)(-12)(-13)}{8!}=1287$

Status
Not open for further replies.