Homework 5#
Due: Thursday, October 1, 2026 23:59
Submit: Gradescope, through
Blackboard’s assignment area.
Please write your homework by hand. Start each exercise on a new page, scan your work to a legible PDF, and clearly mark the pages associated with every exercise. For the computational parts, you may include a printout or screenshot of your Sage code and output.
1. (A constrained sum) #
Points: 14
Let
(A) 6 points. Let, , and be the generating functions for the allowed choices of , , and , respectively. Write each generating function both as a series and in closed form. (B) 2 points. Then find the generating function for the required problem in closed form.(C) 6 points. Use Sage to find the number of solutions for, , and . Include your Sage code and output with your work (screenshot is fine)
For part (C), begin with var(’x’), define A.series(variable, order) before extracting the three
coefficients. Extract coefficients with A.series(variable,order).coefficient(variable,power)
2. (Computing a closed formula for a sum of cubes) #
Points: 16
In this exercise we use generating functions to compute a closed formula for the sum of the cubes of numbers
Follow the steps below and show the computations used in each step.
(A) 2 points. Write down the generating function in closed form for the sequence(B) 2 points. Find the generating function in closed form for the sequence(C) 2 points. Find the generating function in closed form for the sequence(D) 3 points. Find the generating function in closed form for the sum for cubes up to. (E) 6 points. Findand use that to extract the coefficient of from .
3. (Compositions with parts 1, 2, and 3) #
Points: 12
Let
(A) 3 points. Write the generating functionfor one part, and explain why counts compositions having exactly parts. (B) 4 points. Sum over all possible numbers of parts to prove that(C) 5 points. Use Sage to find. Also report the list . Include your Sage code and output with your work.
You may use https://sagecell.sagemath.org/. The following sample shows how to extract coefficients from a power series; adapt it to this problem.
var('x')
F = 1 / (1 - x - x^2)
T = F.taylor(x, 0, 30)
print(T.coefficient(x, 20))
print([T.coefficient(x, k) for k in range(11)])
For one part, the exponent records its value. A composition has a unique number
4. (Ordered compositions versus restricted partitions) #
Points: 10
Let
(A) 5 points. Modelwith an ordinary generating function . Write and explain one factor for each allowed part size. In particular, explain why this model is a product of factors rather than the sequence construction used in Exercise 3. (B) 5 points. Use Sage to compute, , and . Include your Sage code and output with your work. Make sure your Taylor expansion includes the coefficient of .