1

Find the coefficient of $x^{31}$ in $(1+x+x^2+x^3+\ldots)^k$, where $k$ is a natural number

Background: I have to use generating functions to do this

I have thought about using the product rule, defining $f(x)=1+x+x^2+x^3+\ldots$ and $g(x)=(f(x))^k$ but this doesn't seem too useful since I dont know the value of $k$, and even if I knew it, if it were a large number the process would be very tedious. Could someone help me please?

kubo
  • 1,918

3 Answers3

8

Since

$$\sum_{n\ge 0}x^n=\frac1{1-x}\;,$$

you’re interested in the coefficient of $x^{31}$ in

$$\frac1{(1-x)^k}=\sum_{n\ge 0}\binom{n+k-1}nx^n\;,\tag{1}$$

which is $\binom{30+k}{31}$. $(1)$ is a standard result easily proved by induction on $k$.

Brian M. Scott
  • 616,228
  • 2
    Perhaps it is worth mentioning that $$ \binom {n+k-1} n x^n = \binom{-k} {\phantom{-}n}(-x)^n, $$ so that this identity is a binomial theorem. $\qquad$ – Michael Hardy Jun 22 '20 at 00:01
  • Your final answer is $\begin{pmatrix} 30+k \ 31 \end{pmatrix}$ but shouldn't it be $\begin{pmatrix} 30+k \ k \end{pmatrix}$? – kubo Jun 22 '20 at 00:47
  • 1
    @fdez: No: $n=31$, so $n+k-1=30+k$, and the lower number is $n=31$. Of course $$\binom{30+k}{31}=\binom{30+k}{(30+k)-31}=\binom{30+k}{k-1};,$$ so you do have that alternative. – Brian M. Scott Jun 22 '20 at 00:50
2

As Brian's solution is algebraic, here is a combinatorial proof: Let $m$ be a non-negative integer and $k$ be a positive integer. Then the coefficient of $x^m$ in the expansion of $$(1+x+x^2+x^3 +\cdots)^k$$ is the number of weak $k$-compositions of $m.$ This is the number of ways in which $m$ indistinguishable balls can be placed into $k$ distinguishable boxes such that empty boxes are allowed. By the sticks-and-stones method, this number is $\binom{m+k-1}{k-1}.$ So the answer is $$\binom{30+k}{k-1}=\binom{30+k}{31}.$$

Favst
  • 3,385
  • 1
  • 9
  • 25
  • What's the difference between "non-negative" and "positive"? I think the first term does include the number $0$ and the second one doesn't, but I am not quite sure since English is not my mother tongue – kubo Jun 22 '20 at 00:27
  • 3
    @fdez Non-negative means zero is included. Positive means zero is not included. Your intuition is correct. – Favst Jun 22 '20 at 00:28
2

If you imagine expanding the given product, all the terms that contribute to the coefficient of $x^{n}$ must come from exponents that sum up to $31$, so your coefficient will be the number of solutions $(a_1,a_2,\dots,a_k)$ to the equation $$a_1+a_2+\dots+a_k=n,$$ where each $a_i$ is an integer in $[0,n]\cap\mathbb Z$. This is a classic problem in combinatorics sometimes known as the "Stars and Bars" problem, whose answer is $$\binom{n+k-1}{n}.$$ See How to use stars and bars? for an explanation.

YiFan Tey
  • 17,431
  • 4
  • 28
  • 66