so I've searched a lot about this and I've seen a few solutions but I didn't understand any of them.

I have this equation which I'm meant to use generating functions to find the number of solutions of this equations:

u1 + u2 + ... + u7 = 16, where 1<= ui <= 5 and i= 1, ..., 7. (I've also included a screenshot of the question for more clarity.


So I know I have sample solutions for similar questions but I can't follow their working. Here is a sample solution: https://gyazo.com/babd84f939d4a8df3c83730c5ef4e802

I can do all the way up line 5 of the solution section but I don't understand how g(X) returns that function and then also how do they get the solution from g(X) ???

Thanks a lot in advance!


Hint: consider $(u+u^2+...+u^5)^7$, specifically the coefficient in front of $u^{16}$.

  • $\begingroup$ So I got up to: X^7(1+X+...+X^4)^7 but then what comes next? $\endgroup$ – Alan Kamali May 4 at 5:00
  • $\begingroup$ That’s a nice reduction as you now need to find the $u^9$ coefficient of the second piece. To do so you could either brute force the expansion (discarding anything bigger than $u^9$ along the way) or you could take 9 derivatives and evaluate at 0. $\endgroup$ – Alex R. May 4 at 5:09
  • $\begingroup$ Why do I need to find u^9 ? $\endgroup$ – Alan Kamali May 4 at 5:12
  • $\begingroup$ I’m dividing both sides by $u^7$ (or $X^7$) in your notation. $\endgroup$ – Alex R. May 4 at 5:14
  • $\begingroup$ so the co efficient of u^9 would be 7*6*5, or am i wrong here? $\endgroup$ – Alan Kamali May 4 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.