Skip to content
The Lumenary

Each worksheet prints cleanly on A4 or Letter. Answer keys are on a separate page.

The Lumenary · Early undergraduate

Recurrences and generating functions

Name: ______________________

Date: ______________________

You will learn to

  • Solve linear recurrences with constant coefficients using the characteristic polynomial, including repeated roots and inhomogeneous terms, and prove that the solution is determined by its initial values
  • Prove Binet's formula Fn=(φn−ψn)/5F_n = (\varphi^n - \psi^n)/\sqrt5 in two ways, by characteristic roots and by generating functions
  • Work with ordinary generating functions as formal power series, and use them to solve recurrences and counting problems
  • Prove that the Catalan numbers (2nn)/(n+1)\binom{2n}{n}/(n+1) count balanced bracket sequences, by a reflection argument and by a generating function
  • Compare growth rates with OO, Ω\Omega, Θ\Theta, oo and ∼\sim, and solve the divide-and-conquer recurrence T(n)=2T(n/2)+nT(n) = 2T(n/2) + n on powers of two
  1. 1.

    In how many ways can a 1×91 \times 9 strip be tiled by 1×11 \times 1 squares and 1×21 \times 2 dominoes?

  2. 2.

    Find the characteristic roots of the recurrence an+2=an+1+6ana_{n+2} = a_{n+1} + 6a_n. Enter them as a set, e.g. 4, -1.

  3. 3.

    The sequence (an)(a_n) satisfies an+2=an+1+6ana_{n+2} = a_{n+1} + 6a_n with a0=2a_0 = 2 and a1=1a_1 = 1. Find a closed formula for ana_n and use it to compute a5a_5.

  4. 4.

    Which formula describes all solutions of an+2=6an+1−9ana_{n+2} = 6a_{n+1} - 9a_n (with AA, BB arbitrary constants)?

    • A.an=(A+Bn) 3na_n = (A + Bn)\,3^n
    • B.an=A 3n+B 3na_n = A\,3^n + B\,3^n
    • C.an=A 3n+B(−3)na_n = A\,3^n + B(-3)^n
    • D.an=(A+Bn2) 3na_n = (A + Bn^2)\,3^n
  5. 5.

    The power series ∑n≥0n! xn\sum_{n \ge 0} n!\,x^n converges only at x=0x = 0. Which statement about it, as an element of the ring Q[[x]]\Q[[x]] of formal power series, is true?

    • A.It has a multiplicative inverse in Q[[x]]\Q[[x]].
    • B.It is not a valid element of Q[[x]]\Q[[x]], because it diverges.
    • C.It can be added to other series but not multiplied, because products would diverge.
    • D.It is invertible only if we restrict to x=0x = 0.
  6. 6.

    Which of these statements are true? (Choose all that apply.)

    • A.n2=O(n3)n^2 = O(n^3)
    • B.n3=O(n2)n^3 = O(n^2)
    • C.2n+1=O(2n)2^{n+1} = O(2^n)
    • D.4n=O(2n)4^n = O(2^n)
    • E.log⁡2n=Θ(ln⁡n)\log_2 n = \Theta(\ln n)
    • F.nlog⁡n=Ω(n)n \log n = \Omega(n)
  7. 7.

    In the proof of Lemma 2 (two solutions of an+2=p an+1+q ana_{n+2} = p\,a_{n+1} + q\,a_n with the same a0a_0 and a1a_1 agree everywhere), the induction proves the statement "an=bna_n = b_n and an+1=bn+1a_{n+1} = b_{n+1}" rather than just "an=bna_n = b_n". Why?

    • A.To deduce an+2=bn+2a_{n+2} = b_{n+2} from the recurrence we need equality at two consecutive indices, so the inductive hypothesis must carry both.
    • B.Because pp or qq might be zero.
    • C.Because ordinary induction is not valid for sequences.
    • D.Because the characteristic roots might be repeated.
  8. 8.

    Using the lesson's definition IsSol p q a (meaning ∀ n, a (n + 2) = p * a (n + 1) + q * a n), which Lean statement correctly formalises: every real sequence satisfying an+2=an+1+ana_{n+2} = a_{n+1} + a_n with a0=0a_0 = 0 and a1=1a_1 = 1 is the Fibonacci sequence?

    • A.∀ a : ℕ → ℝ, IsSol 1 1 a → a 0 = 0 → a 1 = 1 → ∀ n, a n = Nat.fib n
    • B.∀ a : ℕ → ℝ, IsSol 1 1 a → ∀ n, a n = Nat.fib n
    • C.∃ a : ℕ → ℝ, IsSol 1 1 a ∧ a 0 = 0 ∧ a 1 = 1
    • D.∀ a : ℕ → ℝ, a 0 = 0 → a 1 = 1 → ∀ n, a n = Nat.fib n
  9. 9.

    In how many ways can the product x1x2x3x4x5x6x_1 x_2 x_3 x_4 x_5 x_6 be fully bracketed, keeping the factors in order? (For three factors there are two: (x1x2)x3(x_1x_2)x_3 and x1(x2x3)x_1(x_2x_3).)

  10. 10.

    Write series_inverse(a, N) that returns the first N coefficients of 1/A(x)1/A(x), where a is the list of coefficients of a power series A(x)A(x) with a[0] == 1 (missing coefficients count as 00). Use the recursion from the Proposition on inverses: b0=1b_0 = 1 and bn=−∑i=1naibn−ib_n = -\sum_{i=1}^{n} a_i b_{n-i}. Then check that 1/(1−x−x2)1/(1 - x - x^2) gives the Fibonacci numbers Fn+1F_{n+1}.

    Computational — Practice

Code: Apache-2.0 · Content: CC BY-SA 4.0