Recurrence Relations
Recurrence Relations
Recurrence Relation
Generating Functions:
Generating functions are not functions in the formal sense of a mapping from a domain to a
codomain; the name is merely traditional, and they are sometimes more correctly called
generating series.
When the term generating function is used without qualification, it is usually taken to mean
an ordinary generating function.
If an is the probability mass function of a discrete random variable, then its ordinary
generating function is called a probability-generating function.
The ordinary generating function can be generalized to arrays with multiple indices. For
example, the ordinary generating function of a two-dimensional array am, n (where n and m are
natural numbers) is
Example:
Exponential generating function
The exponential generating function of a sequence an is
Example:
Function of Sequences:
Generating functions giving the first few powers of the nonnegative integers are given in the
following table.
series
1
There are many beautiful generating functions for special functions in number theory. A few
particularly nice examples are
(
2
)
(
3
)
(
4
)
(
5
)
(
6
)
(
7
)
Generating functions are very useful in combinatorial enumeration problems. For example,
the subset sum problem, which asks the number of ways to select out of given integers
such that their sum equals , can be solved using generating functions.
generating function.
Polynomial Expansions:
1 x m 1
1) 1 x x 2 ... x m
1 x
1
2) 1 x x 2 ...
1 x
3) (1 x) n 1 C ( n,1) x C ( n, 2) x 2 ... C ( n, r ) x r ... C ( n, n) x n
1
n
1 C (1 n 1,1) x C (2 n 1, 2) x 2 ... C ( r n 1, r ) x r ...
(1 x)
From expansion (5) we see that the coefficient of x 6in (1 x ) 5 is C (6 5 1, 6)
More generally, the coefficient of xr in
Recurrence relations:
Introduction :A recurrence relation is a formula that relates for any integer n ≥ 1, the n-th
term of a sequence A = {ar}∞r=0 to one or more of the terms a0,a1,….,an-1.
Example. If Sn denotes the sum of the first n positive integers, then
(1) Sn = n + Sn-1. Similarly if d is a real number, then the nth term of an arithmetic
progression with common difference d satisfies the relation
Definition. Suppose n and k are nonnegative integers. A recurrence relation of the form
c0(n)an + c1(n)an-1 + …. + ck(n)an-k = f(n) for n ≥ k, where c0(n), c1(n),…., ck(n), and f(n)
are functions of n is said to be a linear recurrence relation. If c0(n) and ck(n) are not
identically zero, then it is said to be a linear recurrence relation degree k. If c0(n), c1(n),
…., ck(n) are constants, then the recurrence relation is known as a linear relation with
constant coefficients. If f(n) is identically zero, then the recurrence relation is said to be
homogeneous; otherwise, it is inhomogeneous.
Thus, all the examples above are linear recurrence relations except (8), (9), and (10); the
relation (8), for instance, is not linear because of the squared term.
The relations in (3), (4) , (5), and (7) are linear with constant coefficients.
Relations (1), (2), and (3) have degree 1; (4), (5), and (6) have degree 2; (7) has degree 3.
Relations (3) , (4), and (6) are homogeneous.
There are no general techniques that will enable one to solve all recurrence relations.
There are, nevertheless, techniques that will enable us to solve linear recurrence relations
with constant coefficients.
Example
.
an = a0 + f(1) + f(2) +….+ f(n)
n
= a0 + ∑ f(k)
K=1
Thus, an is just the sum of the f(k) ‘s plus a0.
More generally, if c is a constant then we can solve an = c a n-1 + f(n) for n ³1 in the same
way:
a1 = c a0 + f(1)
a2 = c a1 + f(2) = c (c a0 + f(1)) + f(2)
= c2 a0 + c f(1) + f(2)
a3= c a2 + f(3) = c(c 2 a0 + c f(1) + f(2)) + f(3)
=c3 a0 + c2 f(1) + c f(2) + f(3)
.
.
.
an = c a n-1 + f(n) = c(c n-1 a0 + c n-2 f(1) +. . . + c n-2 + f(n-1)) + f(n)
=c n a0 + c n-1 f(1) + c n-2 f(2) +. . .+ c f(n-1) + f(n)
Or
an = c n a0 + ∑c n-k f(k)
Say that 𝑉 is a solution. Now suppose that (𝑛) is any particular solution of the
hand side equal to 0, the “associated homogeneous equation.” We know how to solve this.
initial data.) Then 𝑈=𝑉+(𝑛) is a solution to the inhomogeneous equation, which you can see
inhomogeneous equation. (That is, it solves the equation, but does not necessarily match the
simply by substituting 𝑈 into the equation. On the other hand, every solution 𝑈 of the
inhomogeneous equation is of the form 𝑈=𝑉+(𝑛) where 𝑉 is a solution of the homogeneous
equation, and 𝑔(𝑛) is a particular solution of the inhomogeneous equation. The proof of this
is straightforward. If we have two solutions to the inhomogeneous equation, say 𝑈1 and 𝑈2,
then their difference 𝑈1−𝑈2=𝑉 is a solution to the homogeneous equation, which you can
check by substitution. But then 𝑈1=𝑉+𝑈2, and we can set 𝑈2=(𝑛), since by assumption,
𝑈2 is a particular solution. This leads to the following theorem: the general solution to the
inhomogeneous equation is the general solution to the associated homogeneous
equation, plus any particular solution to the inhomogeneous equation. This gives the
following procedure for solving the inhomogeneous equation:
1) Solve the associated homogeneous equation by the method we’ve learned. This will
involve variable (or undetermined) coefficients.
2) Guess a particular solution to the inhomogeneous equation. It is because of the guess that
I’ve called this a procedure, not an algorithm. For simple right-hand sides , we can say how to
compute a particular solution, and in these cases, the procedure merits the name “algorithm.”
3) The general solution to the inhomogeneous equation is the sum of the answers from the
two steps above.
4) Use the initial data to solve for the undetermined coefficients from step 1.
To solve the equation 𝑎𝑛 − 6𝑎𝑛−1 + 8𝑎𝑛−2 = 3. Let’s suppose that we are also given the
initial data 𝑎0 = 3, 𝑎1 = 3. The associated homogeneous equation is 𝑎𝑛 − 6𝑎𝑛−1 + 8𝑎𝑛−2 =
0, so the characteristic equation is 𝑟2 − 6𝑟 + 8 = 0, which has roots 𝑟1 = 2 and 𝑟2 = 4. Thus,
the general solution to the associated homogeneous equation is 𝑐12𝑛 + 𝑐24 . When the right-
hand side is a polynomial, as in this case, there will always be a particular solution that is a
that there is a constant 𝐶 that solves the homogeneous equation. If that is so, then 𝑎𝑛 = 𝑎𝑛
polynomial. Usually, a polynomial of the same degree will work, so we’ll guess in this case
Finally, the solution to the inhomogeneous equation, with the initial condition given, is 𝑎𝑛 =
3 ∙ 2𝑛 − 4𝑛 + 1. Sometimes, a polynomial of the same degree as the right-hand side doesn’t
𝑎𝑛 − 6𝑎𝑛 −1 + 5𝑎𝑛−2 = 3, when we guessed that the particular solution was a constant 𝐶,
work. This happens when the characteristic equation has 1 as a root. If our equation had been
we’d have arrived at the equation 𝐶 − 6𝐶 + 5𝐶 = 3, or 0 = 3. The way to deal with this is to
increase the degree of the polynomial. Instead of assuming that the solution is constant, we’ll
𝑔 𝑛 =𝑛𝐶. Then we have 𝑛𝐶−6 𝑛−1 𝐶+5 𝑛−2 𝐶=3, which simplifies to 6𝐶−10𝐶=3 so that
assume that it’s linear. In fact, we’ll guess that it is of the form
𝐶=−34 . Thus, 𝑔 𝑛 = −3𝑛4 . This won’t be enough if 1 is a root of multiplicity 2, that is, if
𝑟−1 2 is a factor of the characteristic polynomial. Then there is a particular solution of the
form 𝑔 𝑛 =𝐶𝑛2. For second-order equations, you never have to go past this. If the right-hand
side is a polynomial of degree greater than 0, then the process works juts the same, except
and then once more, if need be. For example, if the right-hand side were 𝑓 𝑛 =2𝑛−1, we
that you start with a polynomial of the same degree, increase the degree by 1, if necessary,
would start by guessing a particular solution 𝑔 𝑛 =𝐶1𝑛+𝐶2. If it turned out that 1 was a
characteristic root, we would amend our guess to 𝑔 𝑛 =𝐶1𝑛2+𝐶2𝑛+𝐶3. If 1 is a double
root, this will fail also, but 𝑔 𝑛 =𝐶1𝑛3+𝐶2𝑛2+𝐶3𝑛+𝐶4 will work in this case.
hand side is an exponential, say 𝑓 𝑛 =𝐶𝑛. In that case, we guess that a particular solution is
Another case where there is a simple way of guessing a particular solution is when the right-