7.2 Linear Recurrence Relations
Section 7.1 used recursive rules to build strings and expressions. We now apply the same idea to a sequence, an ordered list of numbers indexed by integers.
We write a sequence as
The symbol means “the term whose index is .” The subscript is a position label, not multiplication: is the term at index .
A recurrence connects a term to earlier terms
A recurrence relation is an equation that defines using one or more earlier terms. For example,
says that each term is more than the preceding term.
The recurrence alone is not enough. We also need an initial condition, such as
Now every term is determined:
Thus the sequence begins
If we changed only the initial value to , the same recurrence would produce a different sequence. A recurrence is like a machine rule; the initial conditions determine where the machine starts.
Order tells us how much history is required
The order of a recurrence is the greatest distance it looks backward.
The recurrence
is first order because it uses only the immediately preceding term.
The recurrence
is second order because it reaches back two positions. It normally needs two initial values, such as and .
For example, with
we obtain
At , both and are available. If only were supplied, would remain unknown and the machine could not begin.
Generating terms is not yet a closed formula
A recurrence gives a local rule. To find , it may require all preceding terms. A closed form expresses directly in terms of , without referring to earlier sequence values.
For the recurrence
repeated substitution gives
The ellipsis represents the same substitution repeated until the index reaches . We can verify the formula by checking the base value and recurrence:
and
Multiplicative growth unfolds into a product
Consider
Unfolding gives
This is a geometric sequence. More generally,
has the closed form
Here is the fixed multiplication factor. The exponent counts how many times the recurrence multiplies by before reaching the base value.
Run a recurrence time machine. Configure first- or second-order dependencies, reveal terms one at a time, and scrub backward through the exact substitutions supporting a selected value. Removing a required seed breaks the dependency track at the first undefined term instead of silently inventing a number.
Counting creates recurrences naturally
Chapter 6 counted disjoint cases by addition. If objects of size can be divided into disjoint classes whose remaining parts have smaller sizes, their counts satisfy a recurrence.
Example: tiling a board
Let be the number of ways to tile a board of length using:
- a square tile of length ;
- a domino of length .
Tiles may not overlap and must cover the board exactly.
We begin with two initial counts:
Why is instead of ? There is exactly one way to tile an empty board: use no tiles. This empty construction lets the recurrence work correctly at the boundary.
For , classify every tiling by its last tile.
- If the last tile is a square, removing it leaves any tiling of length . This class has outcomes.
- If the last tile is a domino, removing it leaves any tiling of length . This class has outcomes.
The two classes are disjoint because a tiling cannot end with both tile types. They cover all tilings because every nonempty tiling has a last tile. The sum principle therefore gives
Now compute:
Notice the logical chain:
The recurrence is not a guessed numerical pattern. It records a structural counting argument.
What “linear” means
A recurrence is linear when earlier terms appear only to the first power and are not multiplied by one another.
For example,
is linear. In contrast,
is nonlinear because two earlier terms are multiplied.
A linear recurrence is homogeneous when there is no additional term depending only on . Thus
is homogeneous, while
is nonhomogeneous because of the extra .
The recurrence has constant coefficients when the multipliers of earlier terms, such as and , do not change with .
Solving a second-order homogeneous recurrence
Consider
We first look for a geometric solution . Substitution gives
For , divide by :
Move every term to one side:
This is the characteristic equation. Factoring gives
so its distinct roots are and .
Each root produces a geometric solution. Any linear combination is also a solution:
The constants and are determined by the two initial conditions. Suppose
At ,
At ,
Subtracting twice the first equation from the second gives , and then . Therefore
We can verify it directly:
Repeated characteristic roots
If the characteristic equation has the same root twice, the two independent building blocks are
Therefore the general form is
For example, the recurrence
has characteristic equation
so its solutions have the form
The initial conditions still determine and .
Tile boards by dragging squares and dominoes into place, then collapse the full gallery into “last square” and “last domino” families. Remove the final tile to reveal the reversible maps to sizes and , and watch the recurrence ledger update from actual constructions.
Section bridge
The recurrences above depend on a fixed number of immediately preceding terms. Recursive algorithms create another important shape: one problem of size becomes several subproblems of size . Section 7.3 will turn that execution pattern into divide-and-conquer recurrences and recursion trees.