# generating function

• Feb 7th 2010, 12:19 PM
CoraGB
generating function
If you have a three decks of cards, how many ways are there to pick a hand of m cards from n distinct cards in a single deck. Use a generating function.
I have Gn(x) = (1+x+x^2+x^3)^n but don't know where to go from here.

• Feb 7th 2010, 12:29 PM
Moo
Hello,

Find the expansion of the generating function, and the answer you're looking for will be the coefficient in front of $x^m$
• Feb 7th 2010, 12:52 PM
CoraGB
I have seen an example with two decks where the binomial theorem was used twice, is it possible to use it three times, if so how?
• Feb 8th 2010, 07:33 AM
awkward
Quote:

Originally Posted by CoraGB
If you have a three decks of cards, how many ways are there to pick a hand of m cards from n distinct cards in a single deck. Use a generating function.
I have Gn(x) = (1+x+x^2+x^3)^n but don't know where to go from here.

Hi CoraGB,

Break the problem into two parts: (1) Find the OPSGF (ordinary power series generating function) of the number of ways to choose the deck; (2) find the OPSGF of the number of hands in a deck.

(1) Is easy: it's just $f(x) = 3$.

(2) Let $a_m$ be the number of ways to choose a hand of m cards from a deck of size n, and let $g(x) = \sum a_m x^m$. Then $g(x) = (1+x)^n$.

Finally, the OPSGF of the number of ways to choose the deck and choose a hand is just

$f(x) \cdot g(x) = 3 (1+x)^n$.