3

So, we got the worst professor ever who didn't tell us actually how to solve generating functions to obtain coefficients but just ran over some examples giving random theorems and results to obtain coefficients in those examples.

I have this equation: $a + b + c + d + e + f = 29$ where $a<8$ and $b >8$.

So, I think I figured out the expression for the generating function: $$(x + x^2 + \cdots x^7)(x^9 + x^{10} +\cdots x^{29}) (x + x^2 + \cdots x ^{29})^{4}$$

My question is how do we actually go about solving this?

DJWK
  • 51
  • 1
    Same situation, if someone could demonstrate the solution with actually the mechanism and thought process to solve these, it'd be really helpful! – Charles Apr 14 '23 at 10:29
  • 1
    Should the exponent be $3$ instead in the final term? – Gareth Ma Apr 14 '23 at 10:35
  • Just find the sum of coefficients. Observe the geometric series. – An_Elephant Apr 14 '23 at 10:52
  • 1
    @An_Elephant That's not really helpful, you're probably just like OP's professor :) – Gareth Ma Apr 14 '23 at 10:54
  • @GarethMa Elephants cannot become professors. – An_Elephant Apr 14 '23 at 10:57
  • You can utilize factorization of sum as difference of two geometric series and then multiply the expressions together. Oh wait Garreth already did it all on his own. Meow. For another method, if you are allowed a computer you can use fast Fourier transforms and the convolution theroem. But then it turns more into an engineering exercise. You can also probably do it formally with a Fourier expansion without a computer. Although there is a fair chance that if you are new to generating functions then transform theory is yet out of reach. – mathreadler Apr 14 '23 at 11:03
  • 1
    @mathreadler You sure are "a curious cat trying to make a paw print or two in this world" :D – Gareth Ma Apr 14 '23 at 23:30

1 Answers1

6

Welcome to the amazing world of generating functions. Firstly, while the polynomials you set up are correct, as you will see it's more convenient to use infinite series instead of the truncated series as you have done, meaning to instead analyse the power series

\begin{align*} G(x) &= (x + x^2 + \cdots + x^7)(x^9 + x^{10} + \cdots)(x + x^2 + \cdots)^3 \\ &= x^{13}\underbrace{(1 + x + \cdots + x^6)(1 + x + x^2 + \cdots)^4} \\ &= x^{13}H(x) \end{align*}

Now we want to find $[x^{29}]G(x) = [x^{16}]H(x)$. Firstly, we transform these ugly series into a closed form. We have a beautiful tool called geometric series for this!

$$ H(x) = \left(\sum_{i = 0}^6 x^i\right)\left(\sum_{i = 0}^{\infty} x^i\right)^4 = \frac{1 - x^7}{(1 - x)^5} $$

The next natural step is to simplify the fraction, since the degree of the numerator exceeds the denominator:

$$ H(x) = -\frac{35x^4 - 105x^3 + 126x^2 - 70x + 14}{(1 - x)^5} $$

[Note 1]

Now, the remaining step is quite simple. We simply expand out $\frac{1}{(1 - x)^5}$ into a power series again. There are many ways to figure this out, but the standard way is to take repeated derivative of $\frac{1}{1 - x} = \sum_i x^i$. You can check out this answer for more details, but I will give the answer here - we have

$$ \frac{1}{(1 - x)^5} = \sum_{k = 0}^{\infty} \binom{k + 4}{4} x^k = 1 + 5x + 15x^2 + 35x^3 + \cdots $$

Finally, we can substitute this into our $H(x)$ to get

$$ H(x) = (\color{red}{-35x^4} + 105x^3 - 126x^2 + 70x - 14)\sum_{k = 0}^{\infty} \binom{k + 4}{4} x^k $$

You can write this into a single summation (without the multiplication) by multiplying the sums out and shifting indices around, but I won't bother, since our final goal is to find $[x^{16}]H(x)$, which we can do here:

$$ [x^{16}]H(x) = \color{red}{-35[x^{12}]}\sum_k \binom{k + 4}{4} x^k + \cdots = -35 \cdot \binom{16}{4} + \cdots $$

I am feeling lazy so I won't write everything out, but that's the idea. Also, here's a way to check the answer using Sage, a computer algebra system. The answer should be 4130 :)

Oh and as a bonus, you can write down an explicit answer for any coefficient, meaning you can answer the question not just for $29$ but for any number! You can also derive recurrence relations between the coefficients by dealing with the polynomial itself (c.f. Fibonacci numbers here), but you can explore that yourself.


[Note 1]: Normally, here you would have to first do a partial fraction decomposition. For example, suppose that one of the constraints is that $a$ or any of the variable has to be even. In that case, your power series would have something of the form $1 + x^2 + x^4 + \cdots$, meaning $H(x)$ will then look like $\frac{\textrm{polynomial}}{(1 - 2x)(1 - x)^4}$. You perform partial fraction decomposition to get $\frac{\cdot}{1 - 2x} + \frac{\cdot}{1 - x} + \cdots$, then apply the same method.

Gareth Ma
  • 3,725
  • Hey, the way you explained this is brilliant! Honestly, the professor filling the board full of equations expanding endlessly and doing weird adjustments was spinning my head – DJWK Apr 14 '23 at 11:45
  • and yeah, there was a mistake on my side as you pointed out about the exponent of the final term – DJWK Apr 14 '23 at 11:50
  • @DJWK Glad you liked it and found my answer clear, feel free to check out my other ones :P – Gareth Ma Apr 14 '23 at 12:05