# Math Help - Generating functions

1. ## Generating functions

I am trying to study for my finals and I am stuck. We were given a practice exam that we are allowed to use as notes for the final, but there are two questions that I am struggling with. I have posted them below. I'm hoping that someone can walk me through the steps to find a solution.

1. Set up a generating function and use it to find the number of ways in which eleven identical coins can be put in three distinct envelopes if each envelope has at least two coins in it.

2. Set up a generating function and use it to find the number of ways in which eleven identical coins can be put in three distinct envelopes if each envelope has most six coins in it.

2. ## Re: Generating functions

Originally Posted by barca112
1. Set up a generating function and use it to find the number of ways in which eleven identical coins can be put in three distinct envelopes if each envelope has at least two coins in it.
Consider the coefficient of $x^{11}$ in $(x^2+x^3+x^4+x^5+x^6+x^7)^3$. Each of the three factors corresponds to an envelope. The power of $x$ coming from the first, second, or third factor and contributing to the total power of 11 corresponds to the number of coins in the first, second, or third envelope. That's why the minimum power of $x$ in each factor is 2. The maximum power is 7 because each envelope has at most 7 coins (7 + 2 + 2 = 11). One can select, say, $x^2$ from the first factor, $x^5$ from the second and $x^4$ from the third; this would be different from $x^5$ from the first factor, $x^2$ from the second and $x^4$ from the third. Both of these variants contribute 1 to the final coefficient of $x^{11}$. This means that the envelopes are distinct.

Can you now solve the second problem?

3. ## Re: Generating functions

If I'm getting this right (which I'm not quite sure I am), I should now be able to plug 1 in for x and get the correct answer which would be 216. Does that sound right?

4. ## Re: Generating functions

Originally Posted by barca112
If I'm getting this right (which I'm not quite sure I am), I should now be able to plug 1 in for x and get the correct answer which would be 216. Does that sound right?
Which part of the question does the 216 refer?
If you expand $\left( {\sum\limits_{k = 2}^{11} {x^k } } \right)^3$ the coefficient of $x^{11}$ is $21$.

BTW it is the same in the expansion of $\left( {\sum\limits_{k = 2}^{7} {x^k } } \right)^3$.