What is the coefficient of x in (x4+x3+x2+x+1)5?
What is the coefficient of x3 in (x4+x3+x2+x+1)5?
(x4+x3+x2+x+1)5=(1+x2+x3+x4)5
(1+x2+x3+x4)2=(1+x2+x3+x4)(1+x2+x3+x4)=1+x+x2+x3+…+x+x2+x3+…+x2+x3+…+x3+…=1+2x+3x2+4x3+…
(1+x2+x3+x4)3=(1+2x+3x2+4x3+…)(1+x2+x3+x4)=1+x+x2+x3+…+2x+2x2+2x3+…+3x2+3x3+…+4x3+…=1+3x+6x2+10x3+…
(1+x2+x3+x4)4=(1+3x+6x2+10x3+…)(1+x2+x3+x4)=1+x+x2+x3+…+3x+3x2+3x3+…+6x2+6x3+…+10x3+…=1+4x+10x2+20x3+…
(1+x2+x3+x4)5=(1+4x+10x2+20x3+…)(1+x2+x3+x4)=1+x+x2+x3+…+4x+4x2+4x3+…+10x2+10x3+…+20x3+…=1+5x+15x2+35x3+…
Consider the following scenario: You have 5 baskets. At each basket you can pick anywhere from 0 to 4 apples. How many ways can you pick 3 apples? The function given is the generating function for this question, and so it suffices just to solve the scenario.
(0,0,1,1,1),(0,0,0,1,2),(0,0,0,0,3) are the only ones that work. So the answer is 5!2!3!+5!3!1!1!+5!4!1!=10+20+5=35.
Alternatively:
See if you can find a pattern in @heureka's answer -- prove it.