View
217
Download
1
Category
Preview:
Citation preview
IntroductionRecall from the presentation on sequences and summation that a (k-step) recurrence relation is an equation that defines the elements of a sequence recursively, i.e. in terms of their own predecessors, going back k indices:
ππ = π(ππβ1, ππβ2, β¦ , ππβπ)
A recursive definition involving a k-step recurrence relation requires the values of the first k terms: π0, π1, β¦ , ππ , called the initial conditions, to define a sequence properly.
The Fibonacci sequence, π0= 1, π1 = 1, ππ = ππβ1 + ππβ2 for π = 2,3,4, β¦ is the most well known example of a sequence that is defined recursively.
Recursive definitions are not computationally effective for very large indices. How would you evaluate ππ where π = 10100? Computing this using the recursive definition would require about 10100
additions, which would take far longer than the age of the universe to carry out even on a very fast computer, and in light of the estimate we proved in the presentation on recursively defined functions and sets,
ππ >3
2
πβ2
ππ would have far more digits than the estimated number of atoms in the universe, so it could never even be stored.
Therefore , a natural question with a recursive definition is: can we find a closed-form definition, i.e. a definition that lets us compute (or find a good estimate of) ππ as a function of π alone?
While there is no general method for solving a recurrence relation, there is one that works for linear recurrence relations with constant coefficients, i.e. recurrence relations of the form
ππ+π = π1ππ+πβ1 + π2ππ+πβ2 +β―+ ππππ
where the π1, β¦ , ππ are constants. An example of such a recurrence relation would be the 3-step recurrence relation
ππ+3 = ππ+2 + 4ππ+1 β 4ππ
Bad News and Good News
Idea of the MethodOne of the simplest linear, constant-coefficient recurrence relation is ππ+1 = 2ππ. Since the sequence value doubles with each step, we know immediately that solution sequences of this recurrence are exponential (aka geometric), i.e. ππ = π2π where π = π0 is the initial value. In particular, ππ = 2π is a solution.
By a solution of a recurrence relation, we mean a sequence whose terms satisfy the recurrence relation. In the example above, ππ+1 =2π+1 = 2 β 2π = 2ππ.
This gives us the idea: perhaps all linear, constant-coefficient recurrence relations have exponential solutions? The answer turns out to be affirmative, and this enables us to find all solutions.
Given a recurrence relation, our goal is to find an exponential solution ππ = ππ, where the unknown base π β 0 remains to be determined.
We substitute ππ = ππ into the recurrence and find the values of π for which the recurrence is satisfied.
Example 1ππ+3 = ππ+2 + 4ππ+1 β 4ππ
Substituting ππ = ππ, we get
ππ+3 = ππ+2 + 4ππ+1 β 4ππ
orππ+3 β ππ+2 β 4ππ+1 + 4ππ = 0
Since all terms have a factor ππ in common, we can factor it out:
ππ π3 β π2 β 4π + 4characteristic polynomial
= 0
We need this to be zero for all π. Since π β 0, the equation can only be satisfied if the cubic factor is zero. We can factor it by grouping:
π3 β π2 β 4π + 4 = π2 π β 1 β 4 π β 1 = (π2β4)(π β 1) = (π + 2)(π β 2)(π β 1).
We just found three π values for which the recurrence is satisfied: π = β2, 2, 1.
The cubic polynomial whose zeros we just found is called the characteristic polynomial of the recurrence relation.
Now we know thatππ+3 = ππ+2 + 4ππ+1 β 4ππ
is satisfied for ππ= 2π, ππ = (β2)π and ππ = 1.
Letβs verify the first of these solutions before we proceed. (The other one can be verified in the same way.)
If ππ= 2π, thenππ+2 + 4ππ+1 β 4ππ
= 2π+2 + 4 β 2π+1 β 4 β 2π
= 4 β 2π + 4 β 2π+1 β 4 β 2π
= 4 β 2π+1 = 2π+3.
ππ= 2π, ππ = (β2)π and ππ = 1 are not the only solutions of
ππ+3 = ππ+2 + 4ππ+1 β 4ππhowever. Any constant multiple of a solution is again a solution, and a sum of solutions is again a solution.
Therefore, if ππ, ππ and ππ are solutions, then so must be πππ + πππ + πππ. Such a sum of the individual solutions with constant factors attached is known as a linear combination of solutions.
Therefore, for any numbers π, π and π,
ππ= π2π + π β2 π + π
is a solution of our recurrence. In fact, it is the general solution. By that, we mean that any solution of the recurrence is contained in the above formula, for a specific value of π, π and π. We will not prove this, but allude to the reason in non-rigorous terms. First though, we will discuss how initial conditions fit into the picture.
Initial Conditions
Suppose we have a sequence defined recursively by a recurrence relation and a set of initial conditions. Let us study how we can use what we just learned to find a non-recursive description of the sequence. Let us use the following example:
ππ+3 = ππ+2 + 4ππ+1 β 4ππ
with π0 = 2, π1 = 0, π2 = 8.
We know from the calculation we just made that the general solution to the recurrence is
ππ = π2π + π β2 π + π
That means that we can find π, π and π to match the initial conditions. Substituting the initial conditions leads to a linear system in 3 equations and 3 unknowns:
π0 = 2 = π + π + ππ1 = 0 = 2π β 2π + ππ2 = 8 = 4π + 4π + π
We can now see why a rigorous, proof-based discussion of the solution theory of linear recurrence relations with constant coefficients and initial conditions is beyond the scope of this class: it requires knowledge of linear algebra. Intuitively though, we can glimpse the reason why the alleged general solution above is the general solution: it has three free variables, p,q,r, and every choice of these variables corresponds to exactly one initial condition π0, π1 and π2, and vice versa.
Solving the linear system
We may solve linear systems of equations by elimination. A full discussion of the elimination method belongs in a linear algebra class; we will only discuss the method by example.
π0 = 2 = π + π + ππ1 = 0 = 2π β 2π + ππ2 = 8 = 4π + 4π + π
We subtract equation 1 from equation 2 to get a new equation, and we subtract equation 2 from equation 3 to get another new equation. In both equations, the variable π has been eliminated:
β2 = π β 3π8 = 2π + 6π
Now we add two times the first equation to the second to get 4 = 4π, hence π = 1. Back-substituting, we get π = 1 and π = 0. Therefore, we found
ππ = 2π + β2 π.
The example we just finished is representative of the general situation, as long as the characteristic polynomial has distinct zeros, i.e. zeros that all have multiplicity 1. (Recall from algebra that the multiplicity of a zero of a polynomial is how many times the corresponding linear factor is repeated in the linear factorization of the polynomial.)
Generalization
We solve a linear, constant-coefficient, k-step recurrence relation
ππ+π = π1ππ+πβ1 + π2ππ+πβ2 +β―+ ππππ
by finding the zeros of the characteristic polynomial
ππ β π1ππβ1 β π2π
πβ2 ββ―β ππ
If these zeros (aka characteristic values) π1, π2, β¦ , ππ are all distinct (equivalently, have multiplicity one), then the general solution of the recurrence relation is
ππ = π1π1π + π2π2
π +β―+ πππππ
where π1 to ππ are constants. For each set of initial conditions, π0β¦ππ given, there is one and only one choice of the π1 to ππ to match the initial conditions. We find these numbers by solving a linear system of k equations in k unknowns.
Repeated Zeros of the Characteristic Polynomial
When the characteristic polynomial has repeated zeros, then our solution method cannot work because the βgeneralβ solution does not have enough free variables. Therefore, the correct general solution must have a different form. We will not prove or explain the following theorem:
if π is a repeated zero of the characteristic polynomial with multiplicity π, then not only is ππ a solution, but also πππ, π2ππ, β¦ , ππβ1ππ. The general solution is obtained by replacing the constant coefficient of ππ by a general polynomial of degree πβ 1 in π.
The required notation to represent this theorem symbolically is a little awkward, so we will illustrate the theorem with an example instead:
Suppose the characteristic polynomial of a linear recurrence relation with constant coefficients is
π + 1 π β 2 3 π + 4 2.Then the general solution is
ππ = π1 β1 π + π2 + π3π + π4π2 2π + π5 + π6π β4 π
Complex Zeros (I)Sometimes, the zeros of the characteristic polynomial are complex. In that case, the general solution will be formally complex as well, but produce real solutions for all real initial values. Let us consider the following example problem:
ππ+2 = βππ
with π0 = 1 and π1 = 0.
We can immediately see that this sequence is 1,0,-1,0,1,0,.., but it is not obvious how to describe that with a closed form formula.
The characteristic polynomial is π2 + 1, hence the two characteristic values are Β±π. Thus, the general solution of the recurrence is ππ = πππ + π βπ π, with complex numbers p and q. Substituting the initial conditions, we get
1 = π + π0 = ππ β ππ
By dividing the second equation by π, we get 0 = π β π. We can add that to the first
equation to get 2π = 1 or π =1
2. It follows that π =
1
2. Hence, ππ =
1
2(ππ + βπ π).
Complex Zeros (II)It is always possible to rewrite a formally complex, but real-valued solution solely in terms of real functions using a piecewise definition. The key to doing that lies in the fact that π4 = 1, which causes the integer powers of i to assume only 4 distinct values:
π0 = 1, π1= π, π2 = β1, π3 = βπ, π4= 1, π5 = π, π6 = β1, π7 = βπ, π8 = 1, etc. More formally:
If n is an integer, then π = 4π + π for some integer π and π β {0,1,2,3}. Then ππ = π4π+π = π4πππ =(π4)πππ = 1πππ = ππ . Using that π = π mod 4, that tells us that
ππ = ππ mod 4 =
1 if π mod 4 = 0π if π mod 4 = 1β1 if π mod 4 = 2βπ if π mod 4 = 3
For example, our previous solution ππ =1
2(ππ + βπ π) can be simplified as follows:
ππ =
1 if π mod 4 = 00 if π mod 4 = 1β1 if π mod 4 = 20 if π mod 4 = 3
which is of course a piecewise description of ππ that we could have come up with immediately based on the definition of ππ.
Complex Zeros (III)Let us study an example of a recurrence with complex but not purely imaginary characteristic values:
ππ+2 = ππ+1 β2ππ with π0 = 0 and π1 = 1.
The characteristic polynomial is π2 β π + 2. By applying the quadratic formula, we find the two characteristic values to be
π1,2 =1 Β± π 7
2.
Therefore, the general solution of the recurrence is ππ = π1+π 7
2
π
+ π1βπ 7
2
π
where p and q are
complex numbers. Substituting the initial conditions and simplifying, we get
0 = π + π
2 = π 1 + π 7 + π 1 β π 7
The first equation implies π = βπ. Substituting this into the second equation produces
2 = π 1 + π 7 β π 1 β π 7 = π β 2π 7.
This leads to π = βπ
7and π =
π
7, and to the solution ππ = β
π
7
1+π 7
2
π
β1βπ 7
2
π
.
Observe that this solution is formally complex, even though each ππ is a real number (in fact, an integer).
Complex Zeros (IV)Since the characteristic roots in our second example are mixed real/imaginary quantities, it is more difficult to make it formally apparent that the solution
ππ = βπ
2π 71 + π 7
πβ 1 β π 7
π
is purely real-valued. We have to use the binomial theorem:
1 + π 7πβ 1 β π 7
π=
π=0
ππ
πππ β βπ π 7
π
ππ
To simplify the quantity ππ, we once again have to make a case distinction here based on the remainder of π mod 4. If π mod 4 is 0 or 2, then ππ = 0 since π is even in these cases.
If π mod 4 = 1, then ππ = 2π 7π
, and if π mod 4 = 3, then ππ = β2π 7π
. After some
simplification and making the substitution j=2k+1 in the sigma sum, we get the explicitly real representation
ππ =1
2πβ1
π=0
πβ12
π
2π + 1β7 π
which cannot be further simplified (and is not an efficient way of computing ππ).
Recommended