1

Find number of solutions of the equation:

$$ x_1 + x_2 + x_3 + x_4 + x_5 + x_6 = 20, \quad 0 \leq x_i \leq 8, \quad x_i \in \Bbb Z $$

The answer $(27237)$ can be found with generative polynomial: $$ (1 + n + n^2 + \cdots + n^8)^6 = {}\cdots + 27237n^{20} + \cdots {} $$

Is there any way to simplify calculations? Expanding above expression by hand (even discarding higher powers of $n$ whenever possible) is rather long.

It's possible to calculate by hand number of solutions with nines, tens, eleven, twelve with combinations with repetitions and get the answer from there, but that seems like less elegant/generalized.

Maybe what I'm trying to ask is: is there a way to get a specific coefficient of a polynomial without fully expanding all the lower powers.

Sammy Black
  • 28,409
EugZol
  • 127
  • 5
  • 1
    See this answer for a blueprint of how to combine Inclusion-Exclusion with Stars-And-Bars to attack this generic type of problem. Alternatively, if you insist on staying with generating functions, which has a serious learning curve, you should study the generating functions literature. – user2661923 Jul 30 '24 at 17:52

2 Answers2

3

Here is a way that does not seem to be so lengthy. Denoting with $[n^k]$ the coefficient of $n^k$ of a series, we obtain \begin{align*} \color{blue}{[n^{20}]}&\left(1+n+n^2+\cdots+n^8\right)^{6}\\ &=[n^{20}]\left(\frac{1-n^9}{1-n}\right)^6\\ &=[n^{20}]\left(1-\binom{6}{1}n^9+\binom{6}{2}n^{18}\right)\frac{1}{(1-n)^6}\\ &=\left([n^{20}]-6[n^{11}]+15[n^{2}]\right)\sum_{k=0}^{\infty}\binom{k+5}{k}n^k\\ &=\binom{25}{20}-6\binom{16}{11}+15\binom{7}{2}\\ &=53\,130-6\cdot4\,368+15\cdot21\\ &\,\,\color{blue}{=27\,237} \end{align*} according to the claim.

Markus Scheuer
  • 112,413
0

By multinomial theorem, direct calculation is quite hard. A way to simplify it is as follow.

Since $9$ is not a prime $f(x)=1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8$ could be reducible maybe. So is in fact and we have $f(x)=(1+x+x^2)(1+x^3+x^6)=A\times B$ so $[f(x)]^6=A^6\times B^6$. It follows

$$A^3=(1+x+x^2)^3=x^6+3x^5+6x^4+7x^3+6x^2+3x+1$$ $$B^3=(1+x^3+x^6)^3=x^{18}+3x^{15}+6x^{12}+7x^9+6x^6+3x^3+1$$ $$A^6=x^{12}+6(x^{11}+x)+21(x^{10}+x^2)+50(x^9+x^3)+90(x^8+x^4)+126(x^7+x^5)+141x^6+1$$ $$B^6=1+6x^3+21x^6+50x^9+90x^{12}+126x^{15}+141x^{18}+X$$ where $X=x^{21}(126+90x^3+50x^6+21x^9+6x^{12})$ so we have to calculate the coefficient of $x^{20}$ in the product (without $X$) $$(1+6x^3+21x^6+50x^9+90x^{12}+126x^{15}+141x^{18})\times(x^{12}+6(x^{11}+x)+21(x^{10}+x^2)+50(x^9+x^3)+90(x^8+x^4)+126(x^7+x^5)+141x^6+1)$$ which is easy. We have $$141\times21+126^2+90^2+50\times6=\boxed{27237}$$

Ataulfo
  • 32,657