Recurrences
Overview
A recurrence is an equation that describes a function in terms of its value on other, typically smaller, arguments. A recurrence
- For all
, we have . - For all
, every path of recursion terminates in a defined base case.
Finding Bounds
Substitution
In the substitution method, one guesses the form of a bound and then uses mathematical induction to prove the guess correct and solve for constants. In general, there are two steps:
- Guess the form of the solution using symbolic constants.
- Use mathematical induction to show the solution works and find the constants.
Recursion-Tree
In the recursion-tree method, one models the recurrence as a tree whose nodes represent the costs incurred at various levels of the recursion. To then solve the recurrence, one determines the costs at each level and adds them up.
Generally speaking, once a reasonable guess has been derived, the substitution method is then used to formally prove the result.
Master Theorem
Let
Let
where
- If there exists a constant
such that , then . - If there exists a constant
such that , then . - If there exists a constant
such that , and if additionally saitisfies the regularity condition for some constant and all sufficiently large , then .
Solving Recurrences
To solve a recurrence relation means to find a closed form for the relation (with respect to initial conditions).
Telescoping
We can use telescoping to solve recurrences of form
Iteration
Iteration refers to the expansion of terms, starting at the initial conditions, in the hope of discovering a pattern. It is more general than telescoping is.
A recurrence of form
Characteristic Roots
When encountering linear homogeneous recurrence relations with constant coefficients, we can use the characteristic root technique to solve. We demonstrate with a quadratic characteristic polynomial, though this technique generalizes to higher-order polynomials as well.
Given recurrence relation
where