MATH3U03 Lecture20
MATH3U03 Lecture20
Solution. The denominator factors as (1 − 3x)(1 − 5x). Hence there is a partial fraction
decomposition
We can also obtain new power series using algebra and composition.
Proposition 2. For power series f (x) = n≥0 fn xn and g(x) = n≥0 fn xn we have
P P
n
!
X X
f (x)g(x) = fk gn−k xn .
n≥0 k=0
Example 3. Let f (x) = n≥0 fn xn with f0 ∈ R>0 . Find the first three coefficients of the
P
p
power series for f (x).
p
Solution. Let f (x) = n≥0 gn xn . Using the proposition, we have that
P
n
!
p p X X
f (x) f (x) = gk gn−k xn .
n≥0 k=0
1
Alexandre Zotine MATH3U03 Course Notes
f1 f1
so g1 = 2g0
= √
2 f0
. Finally, the coefficient of x2 is
p
[x2 ]( f (x))2 = g0 g2 + g12 + g2 g0 = f2 = [x2 ]f (x),
so we get
f2 − g12 f2 f12
g2 = = √ − . △
2g0 2 f0 4f03/2
This example is general. It now tells us for any power series, the coefficients of the square
1
root are given in this way. This means we can construct the power series for √1−x . The first
few coefficients are
1 3 5 35 63
1, , , , , ,··· .
2 8 16 128 256
Example 4. How many ways are there to make change for a dollar using nickels, dimes,
and quarters?
Solution. We could just count this directly using the Addition principle to break into cases.
Zero quarters, one quarter, etc.... But it gets tedious rather quickly. What we want to do
instead is encode this problem into a generating function. Let cn be thePnumber of ways to
make change for n cents using nickels, dimes, and quarters. If c(x) = n≥0 cn xn , then can
we find a generating function for this? The idea is simple, we take products of geometric
series. The claim is that
because in order to obtain the coefficient for, say x20 , we need to choose monomials out
of these factors whose exponents sum to 20. Each such choice determines a method of
making change. For instance, picking x10 from the first and second factor is saying to
use two nickels and one dime. Picking x20 from the first factor is four nickels, etc.. So
c(x) = (1−x5 )(1−x110 )(1−x25 ) .
Okay, so this rephrased the problem. Now we want to know how to obtain the coefficient
of x100 in c(x) = (1−x5 )(1−x110 )(1−x25 ) . So either we can multiply these out, or, we can use
Taylor’s theorem to get that
c(100) (0)
[x100 ]c(x) = .
100!
Which... Seems kind of difficult to compute. And it is, by hand! But computers are great
at this kind of thing. In particular, we can use mathematical software like Wolfram Alpha,
Maple, Matlab, Macaulay2, SageMath, Magma to compute this (recommend SageMath,
Wolfram Alpha, Maple, in that order [the first two are free]). By inputting the command in
to Wolfram Alpha (you can literally copy-paste this)
2
Alexandre Zotine MATH3U03 Course Notes
we get
1 + x5 + 2x10 + 2x15 + 3x20 + 4x25 + 5x30 + 6x35 + 7x40 + 8x45 + 10x50 + 11x55
+ 13x60 + 14x65 + 16x70 + 18x75 + 20x80 + 22x85 + 24x90 + 26x95 + 29x100 + · · · .
In particular, we have that there are 29 ways to make change for a dollar. △
Obviously on exams you won’t have access to a computer, but it’s worth pointing out
how valuable this is as a technique. Computers are wicked fast when it comes to these
computations. Here we phrased a combinatorial problem in terms of generating functions
and the computer is able to do the computation without us having to think about the
various different cases. Implicitly, it somehow is taking those cases into account, but this
is an automated procedure. It’s a general purpose method that applies for many problems,
which is kind of nuts!
Remark 5. This problem in particular is actually secretly counting the number of integer
partitions of n having parts equal to 5, 10, or 25. What if we wanted p(n)? In fact, the
generating function for p(n) is
X
p(n)xn = (1 + x + x2 + x3 + · · · )(1 + x2 + x4 + x6 + · · · )(1 + x3 + x6 + x9 + · · · ) · · ·
n≥0
∞
Y 1
= .
k=1
1 − xk
I mentioned earlier that there is no closed form formula for p(n). This perhaps motivates
why, although it also nevertheless gives us a means to compute the number. We can truncate
this infinite product and drop it into a computer, and it will spit out the numbers for us.
This is actually how it’s done in practice!
Example 6. A clothing store sells socks for $5, shirts for $10, and jackets for $25. How
many ways can one spend at most $50 at the store?
Solution. Just like before, the generating function gives us the number of ways to spend
exactly n dollars. So, we just need to sum the coefficients from n = 0 to n = 50. Luckily,
the power series makes this easy! We truncate our polynomial, and then plug in x = 1. This
gives us 49 total ways. △
We can take some complicated instructions and use them to translate into a generating
function.
Example 7. Find the number of unordered ten letter words from the alphabet {a, b, c, d}
that satisfy the following:
3
Alexandre Zotine MATH3U03 Course Notes
Solution. We just need to translate these each into a generating function, and take the
product.
1 x3
(1 + x4 ) (1 + x + x2 + x3 + x4 + x5 ).
1 − x2 1 − x
We can plug into a computer algebra system to solve for the x10 coefficient which turns out
to be 24. △