Graduate → Discrete Mathematics → Combinatorics ↓
Recurrence Relations
Recurrence relations are a fundamental concept in mathematics, particularly in the fields of combinatorics and discrete mathematics. They are essential for understanding sequences and analyzing algorithms in computer science. A recurrence relation is an equation that recursively defines a sequence or multidimensional array of values. Given one or more initial terms, each subsequent term of the sequence is defined as a function of the preceding terms.
Introduction to recurrence relations
Sequences of numbers can often be described by expressing each element in terms of earlier elements. Such an expression is known as a recurrence relation. Formally, the recurrence relation for a sequence {a_n}
is an equation that expresses n
term of the sequence a_n
in terms of one or more of the previous terms such as a_{n-1}
, a_{n-2}
, etc.
For example, the well-known Fibonacci sequence is defined by the recurrence relation:
F(n) = F(n-1) + F(n-2)
with initial conditions:
F(0) = 0, F(1) = 1
Here, each term is defined as the sum of the two terms preceding it.
Types of recurrence relations
Linear recurrence relations
A linear recurrence relation is one in which each term is a linear combination of the previous terms. The coefficients are constants. For example, the sequence describing compound interest is a linear recurrence relation.
Homogeneous recurrence relations
A recurrence relation is homogeneous if it can be written in the form:
a_n = c_1 * a_{n-1} + c_2 * a_{n-2} + ... + c_k * a_{nk}
where c_1, c_2, ..., c_k
are constants. The Fibonacci sequence is a homogeneous linear recurrence relation.
Non-homogeneous recurrence relations
A non-homogeneous recurrence relation consists of terms that are not linear combinations of preceding terms. An example is:
a_n = a_{n-1} + n^2
which includes the extra term n^2
.
Solution of recurrence relations
Solving a recurrence relation involves finding a formula, called the closed form, that defines the nth term of the sequence in terms of n only. Various methods are used to solve recurrence relations, including iteration, characteristic equations, and generating functions.
Iterative method
The iterative method involves expanding the recurrence relation step by step so that a_n
can be expressed in terms of initial conditions and then finding a pattern. Consider the recurrence relation:
a_n = 2a_{n-1} + 3
Starting from the initial condition, say a_0 = 1
, we calculate:
a_1 = 2*1 + 3 = 5 a_2 = 2*5 + 3 = 13 a_3 = 2*13 + 3 = 29
Observe the pattern and try to describe it using a formula.
Characteristic equation method
For linear homogeneous recurrence relations, we can often use the characteristic equation approach. If the recurrence relation is:
a_n = c_1 * a_{n-1} + c_2 * a_{n-2} + ... + c_k * a_{nk}
We consider a solution of the form a_n = r^n
, which gives the following characteristic equation:
r^n = c_1 * r^{n-1} + c_2 * r^{n-2} + ... + c_k * r^{nk}
Simplifying this gives a polynomial in terms of r
. Solving this polynomial gives the roots which are used to write the general solution.
Generating function
Generating functions turn a recurrence relation into an algebraic equation. The generating function for the sequence {a_n}
is a formal power series:
G(x) = a_0 + a_1 * x + a_2 * x^2 + ... + a_n * x^n + ...
By manipulating the series, we can obtain a formula for a_n
.
Examples of recurrence relations
Example 1: Fibonacci numbers
A classical example is the Fibonacci sequence, which is defined as:
F(n) = F(n-1) + F(n-2) F(0) = 0, F(1) = 1
The first few terms are: 0, 1, 1, 2, 3, 5, 8, 13, 21, ...
Example 2: Factorial
The factorial function, written as n!
can be defined recursively as:
n! = n * (n-1)! 0! = 1
This is a simple linear recurrence relation.
Example 3: Towers of Hanoi
The Hanoi Towers problem, which involves moving a stack of disks, is solved recursively with the following relation:
T(n) = 2T(n-1) + 1 T(1) = 1
Here, T(n)
is the minimum number of moves required to move n
discs.
Visual example
Visualizing the Fibonacci sequence
Consider looking at the Fibonacci sequence and its recursive nature.
The above visual sequence represents the blocks, and demonstrates the recursive nature of its expansion.
Conclusion
Recurrence relations are powerful tools for understanding complex sequences and algorithm performance. By expressing terms in sequences recursively, they provide insight into the behavior of systems, making them indispensable in both theoretical and applied mathematics.