Macm 201 A7
Macm 201 A7
Do all of these questions and write out the solutions neatly and succinctly as training. You do not have to hand
in your work. The quiz on Nov. 1 will closely follow some of the questions on this assignment. Solutions will
be posted afterwards. Compare these with your own work to check if you did the questions correctly and use
them to improve your own exposition. Make use of the workshop to get clarification.
Textbook Reading
Exercises
A. Textbook Questions
9.1 Exercises 2ac, 3.
9.2 Exercises 1de, 2bde.
10.4 Exercises 1ad.
B. Additional Questions
Questions on 9.1
1. [Optional but instructive: we mainly use GFs for theoretical purposes, but a bit of hands-on
experience will help you to get a better feeling for what they do] Execute the following command
in Wolfram Alpha:
Coefficient[ (x+xˆ2+xˆ3+xˆ4+xˆ5+xˆ6)ˆ6, x, 18 ]
to compute the coefficient of x18 in the polynomial (x + x2 + x3 + x4 + x5 + x6 )6 .
Alternatively, if you have Maple, use the command
coeff( (x+xˆ2+xˆ3+xˆ4+xˆ5+xˆ6)ˆ6, x, 18 )
Or in SageMath (or https://sagecell.sagemath.org/)
R.<x> = QQ[[]]
f = (x+xˆ2+xˆ3+xˆ4+xˆ5+xˆ6)ˆ6
f[18]
Or using SymPy (on for instance https://sfu.syzygy.ca)
from sympy import *
x = symbols(’x’)
f = (x+x**2+x**3+x**4+x**5+x**6)**6
f.expand().coeff(x,18)
2. [Optional but instructive] For each equation, express the number of integer solutions as the
coefficient of a polynomial. Then use Wolfram Alpha, Maple, or SageMath to calculate the coef-
ficient.
(a) a1 + a2 + a3 = 14 where a1 , a2 , a3 ≥ 0.
(b) b1 + b2 + b3 = 15 where 2 ≤ b1 ≤ 6, b2 is even and b3 is odd.
3. [Optional but instructive] If a fair die is rolled 5 times, how many ways can the sum of the rolls
equal 15?
Use a generating function. Use Wolfram Alpha or Maple or SageMath to compute the required
coefficient.
C OPYRIGHT B RUIN 1
MACM 201 A SSIGNMENT #7
4. Carol is collecting money from her cousins for a walkathon. Three cousins promise to give her
either $2, $3, or $4 and one promises to give her either $5 or $10. Let an be the number of ways
she can get $n. Give a generating function for an . How many ways can she get $15?
Questions on 9.2
5. Let A(x) = 1 − x + x2 − x3 + x4 − . . . and B(x) = 0 + 1x + 2x2 + 3x3 + . . . .
Calculate rational GFs for A(x), B(x), A(x) + B(x) and B ′ (x).
6. Let an be the number of ways to select n balls from a large bag of red, blue, and yellow balls
where the selection must include an even number of blue balls. Write down a generating func-
tion for an in closed form.
7. This question investigates the Sicherman dice. Consider the set of six sided die where one dice
has the numbers 1, 3, 4, 5, 6, 8 and the other has the numbers 1, 2, 2, 3, 3, 4 (see figure).
If these two dice are rolled at the same time we’ll investigate the possible sums and their fre-
quencies in two ways: by direct enumeration in (a) and (b) below, and by using generating
functions in (c) and (d) below.
(a) Determine the numbers which can occur as the sum of rolling these two dice.
(b) For each number in (a) determine the number of possible ways this sum could be rolled.
From this information, write down the generating polynomial D(x) for the sum when rolling
these two die.
(c) Now, write down the generating polynomial D1 (x) for the first dice, and D2 (x) for the second
dice.
(d) Verify that D1 (x) · D2 (x) = D(x) by multiplying the two polynomials in part (c).
(e) How does the generating polynomial D(x) compare to the one for the sum when rolling two
standard six sided die?
8. Determine a formula for the coefficient of xn for the rational GFs 1/(1 + 2x)3 and x/(2 − x)3 .
1
9. Consider the generating function A(x) = . Find a formula for [xn ]A(x).
(2 − x)(2 + x)
(Note, we get [x4 ]A(x) = 1/64.)
∞
X 1
10. Let A(x) = an xn = 2 (2 − x)
. Find a formula for the coefficient an .
n=0
(x − 1)
(Note, we get a2 = 17/8.)
11. Find the generating function for the number of integer solutions of 2a + 3b + 5c = n for the cases
(a) a, b, c ≥ 0.
(b) a, b, c ≥ 1.
In each case write the generating function as a rational function.
q(x)(a0 + a1 x + a2 x2 + a3 x3 + a4 x4 + . . . ) = p(x)
up to x4 .
C OPYRIGHT B RUIN 2
MACM 201 A SSIGNMENT #7
13. The generating function for the Fibonacci sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, . . . is
∞
X
F (x) = fn xn = x + x2 + 2x3 + 3x4 + 5x5 + 8x6 + . . . .
n=0
Because the Fibonacci sequence is generated by a linear recurrence fn = fn−1 + fn−2 with
constant coefficients it has a rational GF. Use the method of Section 10.4 to find the rational
generating function for fn .
C OPYRIGHT B RUIN 3