Discrete Mathematics - Generating Function Adanna grows apples, oranges, avocados, persimmons, and cherymoia in her back yard.
She only harvests 10 persimmons and 1 cherymoia, but she grows an almost limitless supply of apples,
oranges, and avocados. Adanna wants to give fruit to her neighbor Farida, but she knows that Farida's
two children love oranges so much that she must receive an even number of them so she can give an
equal number to each child. In how many ways can Adanna give 14 pieces of fruit to Farida?
Can anybody help me please? I have no idea how to do this
 A: The idea is to represent each tree by a polynomial in $x$ that represents how many fruits will be chosen from each tree.  The number of fruits is the exponent of $x$.  The cherymoia is represented as $$1+x$$ because we can only choose $0$ or $1$.  The persimmon is represented as $$1+x+x^2+\cdots+x^{10}$$ beacuse we can choose from $0$ to $10$ persimmons.
The apple and the grape are each represented as 
$$1+x+x^2+\cdots+x^{14}$$ We can harvest any number of apples and grapes, but since we are only going to harvest $14$ fruits in all, we don't have to considering harvest more than $14$ of any specific fruit.  
The orange is the tricky one.  Since we have to give the kids the same number of oranges, we have to choose an even number of oranges, and the polynomial is $$1+x^2+x^4+\cdots+x^{12}+x^{14}$$ 
Now we can multiply all five polynomials and the coefficient of $x^{14}$ in the product will be the answer we seek.  Why?  Because when we multiply out the expression, we choose one term from each factor and multiply them.  We add up the products for all choices of terms.  The coefficient of $x^{14}$ in the product is the number of ways we can choose terms whose exponents add up to $14$, which is the same as the number of way to pick $14$ fruits, conformant to the specifications.
These days you can do this with a computer algebra system.
from sympy import Poly
from sympy.abc import x

chery = Poly(1+x)
pers = Poly(sum(x**n for n in range(11)))
apple = Poly(sum(x**n for n in range(15))) 
grape = Poly(sum(x**n for n in range(15))) 
orange = Poly(sum(x**n for n in range(0,15,2))) 
p = chery*pers*apple*grape*orange
print(p.as_expr().coeff(x,14))

This prints 660.
Of course, you want to know how to do it with a pencil for your course.  It turns out to be simpler to represent the apple and grape by the infinite series $$1+x+x^2+\cdots=\frac1{1-x}$$ and the orange by the infinite series $$1+x^2+x^4+\cdots=\frac1{1-x^2}.$$  The extra terms won't contribute to the coefficient of $x^{14}$ so there's no harm in having them.  I only omitted them before so I could show you how to do it by computer.  The persimmon is a geometric series, $$1+x+\cdots+x^{10}=\frac{1-x^{11}}{1-x}.$$  Multiplying all these out we get $$\begin{align}
P(x)&=\frac{(1+x)(1-x^{11})}{(1-x)^3(1-x^2)}\\&=
(1-x^{11})(1-x)^{-4}\\&=(1-x^{11})\sum_{n=0}^\infty\binom{-4}{n}(-x)^n\\&=(1-x^{11})\sum_{n=0}^\infty\binom{n+3}{3}x^n
\end{align}$$
We just have to pick out the values of $n$ that will contribute to the coefficient of  $x^{14}.$  Clearly, these are $n=14, n=3$ and the answer is $$\binom{17}3-\binom63=660,$$as expected. 
ADDENDUM IN RESPONSE TO OP'S COMMENT
Originally, I said we could represent the apple and grape by the polynomial $$1+x+x^2+\cdots+x^14$$ even though by the term of the problem, it's possible to choose any number of apples and grapes.  The terms $x^{15}+x^{16}+\cdots$ have no bearing on the problem.  It doesn't matter if we leave them in or take them out.  When I wanted to show you how to solve a problem like this on computer, I had to leave the extra terms out, because I can't enter an infinite series in the computer program.
When I wanted to show you how to do it with a pencil, I put those terms back in, because it's easier to deal with $\frac1{1-x}$ than with $\frac{1-x^{15}}{1-x}$.  But it wouldn't matter.  If I left those term out, and also left out the extra terms for the orange we would get $$\frac{(1+x)(1-x^{11})(1-x^{15})^2(1-x^{16})}{(1-x)^3(1-x^2)}$$ Now since we only care about the coefficient of $x^{14}$, we can ignore the last two terms in the numerator.  There's no way that factors of $x^{15}$ and $x^{16}$ are going to contribute to the coefficient of $x^{14}$.  So, we get to exactly the same expression as we do with the method I used.  I hope you see now, and I think you'll agree that the way I did it is simpler.  
