Solution

[5]
1.
Let C(x) =
X
cn xn .
n≥1
a)
Explain why you know, without any significant calculation, that C(x) has a compositional inverse D(x) such that C(D(x)) = D(C(x)) = x. You may use results from
class/notes without proof.
Solution: We note that since C(x) is given as a sum over n ≥ 1, so c0 = 0. Note that
the question was supposed to also say that c1 6= 0 also. Since c0 = 0 and c1 6= 0 then
C(x) has a compositional inverse.
b)
Let D(x) be the compositional inverse of C(x). Compute d0 , d1 , d2 , d3 . Your answer for
each dn can be in terms of various ck , as well as any dj that you have already determined.
Solution: We use C(D(x)) = x, and extract coefficients. Note that we know that
c0 = d0 = 0.
x = C(D(x)) = c1 d1 x + d2 x2 + d3 x3 · · ·
2
+ c2 d1 x + d2 x2 + d3 x3 · · ·
3
+ c3 d1 x + d2 x2 + d3 x3 · · ·
Extracting coefficients gives the following system of equations.
[x1 ] :
1 = c1 d1
2
[x ] :
0 = c1 (d2 ) + c2 (d1 )2
[x3 ] :
0 = c1 (d3 ) + c2 (2d1 d2 ) + c3 (d1 )3
We can solve this system one step at a time. Note that the division is not a problem
since c1 6= 0.
1
c1
c2 d2
d2 = − 1
c1
2c2 d1 d2 + c3 d31
d3 = −
c1
d1 =
Note that since each dn is in terms of previous dj , we can express each dn purely in
terms of the ck .
1
c1
c2 d2
c2 (1/c1 )2
c2
d2 = − 1 = −
=− 3
c1
c1
c1
d1 =
d3 = −
3
2c2 d1 d2 + c3 d31
2c2 (1/c1 )(−c2 /c31 ) + c3 (c−1
c2 c3
1 )
=−
= 2 52 − 4
c1
c1
c1 c1
Alternatively, we could have used D(C(x)) = x.
x = D(C(x)) = d1 c1 x + c2 x2 + c3 x3 · · ·
+ d2 c1 x + c2 x2 + c3 x3 · · ·
2
+ d3 c1 x + c2 x2 + c3 x3 · · ·
3
Extracting coefficients gives the following system of equations.
[x1 ] :
1 = d1 c1
[x2 ] :
0 = d1 (c2 ) + d2 (c1 )2
[x3 ] :
0 = d1 (c3 ) + d2 (2c1 c2 ) + d3 (c1 )3
We can solve this system one step at a time.
1
c1
c2 d1
d2 = − 2
c1
c3 d1 + 2c1 c2 d2
d3 = −
c31
d1 =
Again, we can express this purely in terms of the ck .
1
c1
c2 (1/c1 )
c2
d2 = −
=− 3
2
c1
c1
d1 =
d3 = −
[5]
2.
c3 d1 + 2c1 c2 d2
c3 (1/c1 ) + 2c1 c2 (−c2 /c31 )
c3
c22
=
−
=
−
+
2
c31
c31
c41
c51
Let an satisfy the recurrence an+1 = nan + 2n for n ≥ 0.
X
a) By applying
(·) xn to this recurrence, give a functional equation for the ordinary
n≥0
generating function F (x) =
X
an xn . You do not need to solve this to determine F (x).
n≥0
Solution:
an+1 = nan + 2n
X
X
X
an+1 xn =
nan xn +
2n xn
n≥0
n≥0
n≥0
F − a0
d
1
=x F+
x
dx
1 − 2x
If we want, we can write this in a more coefficient-extraction friendly fashion.
F − a0 = x2
d
x
F+
dx
1 − 2x
Notice that a0 dos not appear on the right-hand side, because of the derivative. And in
fact, it doesn’t appear on the left-hand side either, right? This is not entirely surprising,
since from the given recurrence, we see that regardless of a0 , we have a1 = 1 and an
uniquely determined for n ≥ 1.
X
xn
b) By applying
(·)
to this recurrence, give a functional equation for the exponential
n!
n≥0
X xn
generating function G(x) =
an . You do not need to solve this to determine G(x).
n!
n≥0
Solution:
an+1 = nan + 2n
X
xn X n xn
xn X
nan
2
an+1
=
+
n!
n!
n!
n≥0
n≥0
n≥0
d
d
G = x G + e2x
dx
dx
If we want, we can write this in a more coeeficient-extraction friendly fashion.
d
(1 − x) G = e2x
dx
1 2x
d
G=
e
dx
1−x
Notice that a0 doesn’t appear on the right-hand side, and doesn’t occur on the lefthand side because of the derivative. This is not entirely surprising, since from the given
recurrence, we see that regardless of a0 , we have a1 = 1 and an uniquely determined for
n ≥ 1.
[5]
3.
Let bn = an − an−2 for n ≥ 2, with b1 = a1 and b0 = a0 .
a)
Give the generating function B(x) in terms of A(x) (ordinary generating functions).
Solution: Multiply by xn to get the following.
X
bn xn = an xn − an−2 xn
X
X
bn xn =
an xn −
an−2 xn
2≥0
n≥2
n≥2
B − b0 − b1 x = A − a0 − a1 x − x2 A
B = (1 − x2 )A
b)
Using your relation for B(x), give A(x) in terms of B(x).
Solution:
1
B
A=
1 − x2
The full details would include the observation that since 1 − x2 is a formal power series
with nonzero constant term, then it has a reciprocal.
c)
Using your expression for A(x) in terms of B(x), give an in terms of various bk .
X
1
Solution: We have
=
x2n . So we get an .
2
1−x
n≥0
bn/2c
X
1
an = [x ] A = [x ]
B
=
12k bn−2k =
2
1−x
n
n
k=0
(
b0 + b2 + · · · + bn
b1 + b3 + · · · + bn
n even
n odd
The 12k is simply the 1 that is the coefficient of x2k in 1/(1 − x2 ). The coefficient of odd
powers of x is zero, so we ignore it in the sum.
[5]
4.
Let rm be the number of rooted unlabelled plane trees with m edges, such that the number
of children of each vertex is even.
a)
Find a simple functional equation for R(x) =
X
rm xm .
m≥0
Solution: Let R be the set of such trees. Each such tree can be thought of as a
sequence of subtrees, corresponding to the children of the root, where the sequence if
of even length. For each subtree we need to include the edge that attaches it to the
root, so more correctly it is an sequence of even length of edge-subtree pairs. This gives
R = Seqeven (|R) = Seq(|R|R), which gives as a generating function the following.
R=
1
1 − (xR)2
R = 1 + x2 R 3
b)
Based on your functional equation, prove that every value rm is uniquely determined by
this equation.
Solution: We extract cofficients.
[x0 ] R = [x0 ] 1 + x2 R3 = [x0 ] (1)
r0 = 1
Now for m ≥ 1 we get the following.
[xm ] R = [xm ] 1 + x2 R3 = [xm ] x2 R3
rm = [xm ] x2 R3
X
rm =
{ri rj rk : i + j + k = m − 2}
The sum may well be empty (for instance, if m = 1, which makes r1 = 0), but it is
completely determined by the set of values {r0 , r1 , · · · , rm−1 }. This argument does not
apply to m = 0 since then we can’t drop the “1” from 1 + x2 R3 . But we already know
r0 = 1, so by induction all rm are uniquely determined.
Note that if m is odd, then m − 2 is also odd, and if i + j + k = m − 2 then at least one of
i, j, k must also be odd. This idea leads to a proof by induction (based on the functional
equation) that rm = 0 when m is odd. Of course one can prove this fact directly from
the definition of this set of trees. . .
[5]
5. Let C be some set of labelled components, and G be the collection of labelled objects made
up of components from C. Thus G = Set(C). You are not told what exactly a “component”
means, nor what it means for an object to be “made up” of components, but you may assume
that this is an admissible construction. Let C(x) and G(x) be the exponential generating
functions for C and G.
a)
Give all possible values of c0 and g0 . Briefly justify your answer.
Solution: We must have c0 = 0, otherwise it makes no sense to speak of a set of
C-objects. Now g0 is the number of objects of size zero. But an object of size 0 must
have no components (since there are no components of size 0), and regardless of what
“component” means there is only one way to have no components, namely, an (the)
empty set of components.
P
Alternatively we can deduce this from G(x) = exp(C(x)) = n≥0 C(x)n /n!.


X C(x)n

g0 = [x0 ] G = [x0 ] 
n!
n≥0


X c0 + c1 x + c2 x2 + · · · n

= [x0 ] 1 +
n!
n≥1
=1+
X
n≥1
cn0
n!
The infinite
P sum must be a finite sum, which means we must have c0 = 0. Then
g0 = 1 + n≥1 0 = 1. So as before, c0 = 0 and g0 = 1.
b)
1
. Find an explicit formula for cn .
1 − 2x3
(hint: you might want to start by relating G and C, and then solving for C.)
Assume that G(x) =
Solution: We have G(x) = eC(x) . We solve this for C to get C(x) = log G(x) =
1
. We expand the expression for C(x) to get the following.
log
1 − 2x3
X (2x3 )k
X 2k (3k)! x3k
C(x) =
=
k
k
(3k)!
k≥1
k≥1
( k
n/3
2 (3k)!
= 2 n/3n! = 2n/3 3(n − 1)! n = 3k
k
cn =
0
3-n
Is it surprising to see that every component has size a multiple of 3? In fact, the
expression for G(x) tells us that every object has size a multiple of 3, and components
are objects too.