๐Ÿ’๐ŸฝAlgebraic Combinatorics

Key Concepts of Recurrence Relations

Study smarter with Fiveable

Get study guides, practice questions, and cheatsheets for all your subjects. Join 500,000+ students with a 96% pass rate.

Get Started

Why This Matters

Recurrence relations describe sequences where each term depends on previous ones. They show up everywhere in discrete math, from counting problems to algorithm analysis. You're expected to recognize different types of recurrences, choose the right solving technique, and connect these structures to combinatorial interpretations like partitions, paths, and counting arguments.

Don't just memorize formulas. For each concept below, know what type of recurrence it represents, which solving method applies, and what combinatorial structures it counts. Exam questions often ask you to set up a recurrence from a word problem, solve it using an appropriate technique, or explain why a particular sequence satisfies a given relation.


Foundational Structures: Linear Recurrences

These are the core recurrences where each term is a linear combination of previous terms. Linearity means solutions can be added together to form new solutions (superposition), which is what makes the characteristic equation method work.

Linear Recurrence Relations

  • General form: an=c1anโˆ’1+c2anโˆ’2+โ€ฆ+ckanโˆ’ka_n = c_1 a_{n-1} + c_2 a_{n-2} + \ldots + c_k a_{n-k} where the coefficients cic_i are constants
  • Order refers to how many previous terms are used. A second-order recurrence uses anโˆ’1a_{n-1} and anโˆ’2a_{n-2}
  • Initial conditions must be specified for the first kk terms to uniquely determine the sequence. Without them, you get a family of solutions, not a specific one

Homogeneous Recurrence Relations

A homogeneous recurrence has the form an=c1anโˆ’1+โ€ฆ+ckanโˆ’ka_n = c_1 a_{n-1} + \ldots + c_k a_{n-k} with nothing extra added on the right side. The word "homogeneous" just means there's no standalone function of nn tacked on.

  • Characteristic polynomial is your primary solving tool: find its roots to construct the general solution
  • General solution is a linear combination of terms based on those roots, adjusted for multiplicity if roots repeat (more on this below)

Non-Homogeneous Recurrence Relations

An additional function f(n)f(n) appears on the right: an=c1anโˆ’1+โ€ฆ+ckanโˆ’k+f(n)a_n = c_1 a_{n-1} + \ldots + c_k a_{n-k} + f(n).

  • Solution structure combines the homogeneous solution (solve as if f(n)=0f(n) = 0) with a particular solution that accounts for f(n)f(n)
  • Method of undetermined coefficients works when f(n)f(n) is polynomial, exponential, or a combination. You guess a form for the particular solution, plug it in, and solve for the unknown constants. If your guess overlaps with a homogeneous solution, multiply by nn until it no longer does

Compare: Homogeneous vs. Non-homogeneous: both use the characteristic equation for the "core" solution, but non-homogeneous requires an extra particular solution. If you see a recurrence with a constant or polynomial term added, immediately identify it as non-homogeneous and plan for both solution components.


Simple Patterns: Arithmetic and Geometric Sequences

These are special cases of first-order linear recurrences with clean closed forms. They're the building blocks you'll recognize inside more complex recurrences.

Arithmetic Sequences

  • Constant difference dd between consecutive terms: an=anโˆ’1+da_n = a_{n-1} + d, with closed form an=a1+(nโˆ’1)da_n = a_1 + (n-1)d
  • Sum formula: Sn=n2(2a1+(nโˆ’1)d)S_n = \frac{n}{2}(2a_1 + (n-1)d), which comes from pairing the first and last terms
  • The closed form is a linear function of nn, so if you plot the sequence, you get a straight line

Geometric Sequences

  • Constant ratio rr between consecutive terms: an=rโ‹…anโˆ’1a_n = r \cdot a_{n-1}, with closed form an=a1rnโˆ’1a_n = a_1 r^{n-1}
  • Sum formula: Sn=a11โˆ’rn1โˆ’rS_n = a_1 \frac{1 - r^n}{1 - r} for rโ‰ 1r \neq 1
  • Growth is exponential: the sequence grows if โˆฃrโˆฃ>1|r| > 1 and decays if โˆฃrโˆฃ<1|r| < 1

Compare: Arithmetic vs. Geometric: arithmetic adds a constant (linear growth), geometric multiplies by a constant (exponential growth). Recognizing these patterns helps you guess particular solutions for non-homogeneous cases. For instance, if f(n)f(n) is a constant, try an arithmetic-style guess; if f(n)=3nf(n) = 3^n, try a geometric-style guess.


Solving Techniques: From Equations to Closed Forms

These methods transform recurrences into explicit formulas. Each technique has its sweet spot, and knowing when to apply which method is half the battle.

Characteristic Equation Method

This is the go-to method for constant-coefficient linear homogeneous recurrences.

  1. Substitute an=rna_n = r^n into the recurrence and divide through by the lowest power of rr. This gives you a polynomial equation in rr (the characteristic equation).
  2. Solve the characteristic polynomial for its roots.
  3. Build the general solution based on root types:
    • Distinct real roots r1,r2,โ€ฆr_1, r_2, \ldots: solution is an=c1r1n+c2r2n+โ€ฆa_n = c_1 r_1^n + c_2 r_2^n + \ldots
    • Repeated root rr with multiplicity mm: contributes terms c1rn+c2nrn+c3n2rn+โ€ฆ+cmnmโˆ’1rnc_1 r^n + c_2 n r^n + c_3 n^2 r^n + \ldots + c_m n^{m-1} r^n
    • Complex roots ฮฑยฑฮฒi\alpha \pm \beta i: yield terms involving โˆฃmodulusโˆฃncosโก(nฮธ)|\text{modulus}|^n \cos(n\theta) and โˆฃmodulusโˆฃnsinโก(nฮธ)|\text{modulus}|^n \sin(n\theta)
  4. Apply initial conditions to solve for the constants cic_i

Generating Functions for Solving Recurrences

  • Power series encoding: define G(x)=โˆ‘n=0โˆžanxnG(x) = \sum_{n=0}^{\infty} a_n x^n, then use the recurrence to turn this into an algebraic equation in G(x)G(x)
  • Solve for G(x)G(x) as a closed-form expression (usually a rational function)
  • Extract coefficients via partial fractions or known series expansions to recover the sequence terms

This approach is powerful for recurrences where the characteristic method gets messy, especially convolution-type recurrences like the one for Catalan numbers.

Solving Recurrences Using Iteration

  • Unroll the recurrence step-by-step: substitute the expression for anโˆ’1a_{n-1}, then for anโˆ’2a_{n-2}, and so on
  • Spot the pattern that emerges, then write a conjectured closed form
  • Prove your conjecture by induction

This method is best for simple cases or for building intuition before applying a more formal technique. For example, unrolling T(n)=2T(nโˆ’1)+1T(n) = 2T(n-1) + 1 quickly reveals a geometric series.

Compare: Characteristic equation vs. Generating functions: characteristic equations work cleanly for constant-coefficient linear recurrences, while generating functions handle variable coefficients and convolution-type recurrences more flexibly. For exams, try the characteristic equation first; switch to generating functions if the structure doesn't fit.


Combinatorial Counting Sequences

These recurrences arise from counting problems and have deep combinatorial interpretations. Understanding why the recurrence holds is often more important than memorizing the formula.

Fibonacci Sequence

  • Recurrence: Fn=Fnโˆ’1+Fnโˆ’2F_n = F_{n-1} + F_{n-2} with F0=0F_0 = 0, F1=1F_1 = 1
  • Binet's formula: Fn=ฯ•nโˆ’ฯˆn5F_n = \frac{\phi^n - \psi^n}{\sqrt{5}} where ฯ•=1+52\phi = \frac{1+\sqrt{5}}{2} and ฯˆ=1โˆ’52\psi = \frac{1-\sqrt{5}}{2}, derived via the characteristic equation with roots ฯ•\phi and ฯˆ\psi
  • Combinatorial interpretation: FnF_n counts the number of ways to tile a 1ร—n1 \times n board with 1ร—11 \times 1 squares and 1ร—21 \times 2 dominoes. The recurrence follows because the first piece is either a square (leaving nโˆ’1n-1 spaces) or a domino (leaving nโˆ’2n-2 spaces)

Catalan Numbers

  • Recurrence: Cn=โˆ‘i=0nโˆ’1CiCnโˆ’1โˆ’iC_n = \sum_{i=0}^{n-1} C_i C_{n-1-i} with C0=1C_0 = 1. This is a convolution-type recurrence, reflecting how a structure splits into two independent substructures
  • Closed form: Cn=1n+1(2nn)C_n = \frac{1}{n+1}\binom{2n}{n}
  • Counts many things: valid arrangements of nn pairs of parentheses, full binary trees with n+1n+1 leaves, triangulations of a convex (n+2)(n+2)-gon, non-crossing partitions, and Dyck paths of length 2n2n. Know at least three of these

Binomial Coefficients Recurrence

  • Pascal's identity: (nk)=(nโˆ’1kโˆ’1)+(nโˆ’1k)\binom{n}{k} = \binom{n-1}{k-1} + \binom{n-1}{k}
  • Combinatorial proof: to choose kk items from nn, pick a specific element. Either it's included (then choose kโˆ’1k-1 from the remaining nโˆ’1n-1) or it's excluded (choose all kk from the remaining nโˆ’1n-1)
  • Base cases: (n0)=(nn)=1\binom{n}{0} = \binom{n}{n} = 1 anchor the recursion

Stirling Numbers Recurrence

Stirling numbers of the second kind S(n,k)S(n,k) count the number of ways to partition a set of nn elements into exactly kk non-empty subsets.

  • Recurrence: S(n,k)=kโ‹…S(nโˆ’1,k)+S(nโˆ’1,kโˆ’1)S(n,k) = k \cdot S(n-1,k) + S(n-1,k-1)
  • Why it works: consider element nn. Either it joins one of the kk existing subsets (kk choices, applied to a partition of the first nโˆ’1n-1 elements into kk subsets) or it forms a new singleton subset (partition the first nโˆ’1n-1 elements into kโˆ’1k-1 subsets)
  • Base cases: S(0,0)=1S(0,0) = 1, S(n,0)=0S(n,0) = 0 for n>0n > 0, S(n,n)=1S(n,n) = 1

Compare: Binomial coefficients vs. Stirling numbers: both satisfy additive recurrences reflecting "include or exclude" logic for a distinguished element. But binomial coefficients count subsets (order doesn't matter, elements are just in or out), while Stirling numbers count partitions into groups (unordered groupings where every element must go somewhere). Exam questions love asking you to derive these recurrences from first principles.


Algorithm Analysis: Divide-and-Conquer

These recurrences describe computational complexity and appear at the intersection of combinatorics and computer science. The structure of the recurrence reflects how an algorithm breaks a problem into subproblems.

Divide-and-Conquer Recurrences

  • Standard form: T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n), meaning the algorithm splits the problem into aa subproblems each of size n/bn/b, with f(n)f(n) work to split and combine
  • Examples: merge sort gives T(n)=2T(n/2)+O(n)T(n) = 2T(n/2) + O(n); binary search gives T(n)=T(n/2)+O(1)T(n) = T(n/2) + O(1)
  • Analysis goal: determine asymptotic growth. Is it O(n)O(n), O(nlogโกn)O(n \log n), or O(n2)O(n^2)?

Master Theorem

The Master Theorem gives you a shortcut for recurrences of the form T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n). The key quantity is nlogโกban^{\log_b a}, which represents the cost if all the work were done at the leaves of the recursion tree.

  • Case 1: If f(n)=O(nlogโกbaโˆ’ฯต)f(n) = O(n^{\log_b a - \epsilon}) for some ฯต>0\epsilon > 0, the leaf work dominates: T(n)=ฮ˜(nlogโกba)T(n) = \Theta(n^{\log_b a})
  • Case 2: If f(n)=ฮ˜(nlogโกba)f(n) = \Theta(n^{\log_b a}), work is evenly spread across levels: T(n)=ฮ˜(nlogโกbalogโกn)T(n) = \Theta(n^{\log_b a} \log n)
  • Case 3: If f(n)=ฮฉ(nlogโกba+ฯต)f(n) = \Omega(n^{\log_b a + \epsilon}) for some ฯต>0\epsilon > 0 (and a regularity condition holds), the top-level work dominates: T(n)=ฮ˜(f(n))T(n) = \Theta(f(n))

For merge sort, a=2a = 2, b=2b = 2, so nlogโก22=nn^{\log_2 2} = n. Since f(n)=O(n)f(n) = O(n), this is Case 2, giving T(n)=ฮ˜(nlogโกn)T(n) = \Theta(n \log n).

Tower of Hanoi Recurrence

  • Recurrence: T(n)=2T(nโˆ’1)+1T(n) = 2T(n-1) + 1 with T(1)=1T(1) = 1. The logic: move nโˆ’1n-1 disks off the largest, move the largest, then move nโˆ’1n-1 disks back on top
  • Closed form: T(n)=2nโˆ’1T(n) = 2^n - 1, which you can derive by iteration (unrolling reveals a geometric series 1+2+4+โ€ฆ+2nโˆ’11 + 2 + 4 + \ldots + 2^{n-1}) or by the characteristic equation method
  • This is a classic example of a subtractive recurrence (T(nโˆ’1)T(n-1), not T(n/b)T(n/b)) with an exponential solution

Compare: Tower of Hanoi vs. typical divide-and-conquer: Tower of Hanoi has T(nโˆ’1)T(n-1) (subtractive), while divide-and-conquer has T(n/b)T(n/b) (divisive). This difference is why the Tower of Hanoi grows exponentially while divide-and-conquer recurrences typically grow polynomially (or nlogโกnn \log n). If you see subtraction in the argument, expect exponential growth. The Master Theorem does not apply to subtractive recurrences.


Quick Reference Table

ConceptBest Examples
Second-order linear recurrenceFibonacci sequence, Tower of Hanoi
Characteristic equation solvingFibonacci (distinct roots), any constant-coefficient linear
Generating function approachCatalan numbers, complex non-homogeneous cases
Combinatorial countingCatalan numbers, Binomial coefficients, Stirling numbers
Additive recurrence structurePascal's identity, Stirling numbers
Convolution-type recurrenceCatalan numbers
Algorithm complexityDivide-and-conquer recurrences, Master theorem
Exponential closed formTower of Hanoi, Geometric sequences

Self-Check Questions

  1. Both the Fibonacci sequence and the Tower of Hanoi satisfy second-order recurrences. What structural difference explains why Fibonacci grows roughly as ฯ•n/5\phi^n / \sqrt{5} (where ฯ•โ‰ˆ1.618\phi \approx 1.618) while the Tower of Hanoi grows as 2n2^n? (Hint: look at the characteristic roots.)

  2. Given the recurrence an=3anโˆ’1โˆ’2anโˆ’2+5a_n = 3a_{n-1} - 2a_{n-2} + 5, identify whether it's homogeneous or non-homogeneous, and outline which solving technique you'd apply first.

  3. Compare and contrast Pascal's identity for binomial coefficients with the Stirling numbers recurrence. What combinatorial principle underlies both, and how do their interpretations differ?

  4. If you need to find a closed form for CnC_n (Catalan numbers) starting from the recurrence, which solving method would you choose and why? What makes this recurrence harder than Fibonacci?

  5. The Master Theorem applies to recurrences of the form T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n). Explain why it cannot be directly applied to the Tower of Hanoi recurrence, and describe what alternative approach you'd use instead.