3.4 Solving Recurrence Relations
We have seen that it is often easier to find recursive definitions than closed formulas. Lucky for us, there are a few techniques for converting recursive definitions to closed formulas. Doing so is called solving a recurrence relation. Recall that the recurrence relation is a recursive definition without the initial conditions. For example, the recurrence relation for the Fibonacci sequence is . (This, together with the initial conditions and give the entire recursive definition for the sequence.)
We are going to try to solve these recurrence relations. By this we mean something very similar to solving differential equations: we want to find a function of (a closed formula) which satisfies the recurrence relation, as well as the initial condition.1 Just like for differential equations, finding a solution might be tricky, but checking that the solution is correct is easy.
Sometimes we can be clever and solve a recurrence relation by inspection. We generate the sequence using the recurrence relation and keep track of what we are doing so that we can see how to jump to finding just the term. Here are two examples of how you might do that.
Telescoping refers to the phenomenon when many terms in a large sum cancel out—so the sum “telescopes.” For example:
because every third term looks like: , and then and so on.
We can use this behavior to solve recurrence relations. Here is an example.
The above example shows a way to solve recurrence relations of the form where has a known closed formula. If you rewrite the recurrence relation as , and then add up all the different equations with ranging between 1 and , the left-hand side will always give you . The right-hand side will be , which is why we need to know the closed formula for that sum.
However, telescoping will not help us with a recursion such as since the left-hand side will not telescope. You will have 's but only one . However, we can still be clever if we use iteration.
We have already seen an example of iteration when we found the closed formula for arithmetic and geometric sequences. The idea is, we iterate the process of finding the next term, starting with the known initial condition, up until we have . Then we simplify. In the arithmetic sequence example, we simplified by multiplying by the number of times we add it to when we get to , to get from to .
To see how this works, let's go through the same example we used for telescoping, but this time use iteration.
Of course in this case we still needed to know formula for the sum of . Let's try iteration with a sequence for which telescoping doesn't work.
Iteration can be messy, but when the recurrence relation only refers to one previous term (and maybe some function of ) it can work well. However, trying to iterate a recurrence relation such as will be way too complicated. We would need to keep track of two sets of previous terms, each of which were expressed by two previous terms, and so on. The length of the formula would grow exponentially (double each time, in fact). Luckily there happens to be a method for solving recurrence relations which works very well on relations like this.
The Characteristic Root Technique
Suppose we want to solve a recurrence relation expressed as a combination of the two previous terms, such as . In other words, we want to find a function of which satisfies . Now iteration is too complicated, but think just for a second what would happen if we did iterate. In each step, we would, among other things, multiply a previous iteration by 6. So our closed formula would include multiplied some number of times. Thus it is reasonable to guess the solution will contain parts that look geometric. Perhaps the solution will take the form for some constant .
The nice thing is, we know how to check whether a formula is actually a solution to a recurrence relation: plug it in. What happens if we plug in into the recursion above? We get
.
Now solve for :
, so by factoring, or (or , although this does not help us). This tells us that is a solution to the recurrence relation, as is . Which one is correct? They both are, unless we specify initial conditions. Notice we could also have . Or . In fact, for any and , is a solution (try plugging this into the recurrence relation). To find the values of and , use the initial conditions.
This points us in the direction of a more general technique for solving recurrence relations. Notice we will always be able to factor out the as we did above. So we really only care about the other part. We call this other part the characteristic equation for the recurrence relation. We are interested in finding the roots of the characteristic equation, which are called (surprise) the characteristic roots.
Perhaps the most famous recurrence relation is , which together with the initial conditions and defines the Fibonacci sequence. But notice that this is precisely the type of recurrence relation on which we can use the characteristic root technique. When you do, the only thing that changes is that the characteristic equation does not factor, so you need to use the quadratic formula to find the characteristic roots. In fact, doing so gives the third most famous irrational number, , the golden ratio.
Before leaving the characteristic root technique, we should think about what might happen when you solve the characteristic equation. We have an example above in which the characteristic polynomial has two distinct roots. These roots can be integers, or perhaps irrational numbers (requiring the quadratic formula to find them). In these cases, we know what the solution to the recurrence relation looks like.
However, it is possible for the characteristic polynomial to have only one root. This can happen if the characteristic polynomial factors as . It is still the case that would be a solution to the recurrence relation, but we won't be able to find solutions for all initial conditions using the general form , since we can't distinguish between and . We are in luck though:
Notice the extra in . This allows us to solve for the constants and from the initial conditions.
Although we will not consider examples more complicated than these, this characteristic root technique can be applied to much more complicated recurrence relations. For example, has characteristic polynomial . Assuming you see how to factor such a degree 3 (or more) polynomial you can easily find the characteristic roots and as such solve the recurrence relation (the solution would look like if there were 3 distinct roots). It is also possible that the characteristics roots are complex numbers.
However, the characteristic root technique is only useful for solving recurrence relations in a particular form: is given as a linear combination of some number of previous terms. These recurrence relations are called linear homogeneous recurrence relations with constant coefficients. The “homogeneous” refers to the fact that there is no additional term in the recurrence relation other than a multiple of terms. For example, is non-homogeneous because of the additional constant 1. There are general methods of solving such things, but we will not consider them here, other than through the use of telescoping or iteration described above.
Find the next two terms in beginning . Then give a recursive definition for the sequence. Finally, use the characteristic root technique to find a closed formula for the sequence.
171 and 341. with and . Closed formula: . To find this solve the characteristic equation, , to get characteristic roots and . Then solve the system
Consider the sequences (with ).
- Describe the rate of growth of this sequence.
- Find a recursive definition for the sequence.
- Find a closed formula for the sequence.
- If you look at the sequence of differences between terms, and then the sequence of second differences, the sequence of third differences, and so on, will you ever get a constant sequence? Explain how you know.
Show that is a solution to the recurrence relation .
We claim works. Plug it in: . This works - just simplify the right-hand side.
Suppose that and are both solutions to a recurrence relation of the form . Prove that is also a solution to the recurrence relation, for any constants .
Think back to the magical candy machine at your neighborhood grocery store. Suppose that the first time a quarter is put into the machine 1 Skittle comes out. The second time, 4 Skittles, the third time 16 Skittles, the fourth time 64 Skittles, etc.
- Find both a recursive and closed formula for how many Skittles the nth customer gets.
- Check your solution for the closed formula by solving the recurrence relation using the Characteristic Root technique.
Let be the number of tile designs you can make using squares available in 4 colors and dominoes available in 5 colors.
- First, find a recurrence relation to describe the problem. Explain why the recurrence relation is correct (in the context of the problem).
- Write out the first 6 terms of the sequence .
- Solve the recurrence relation. That is, find a closed formula for .
- .
- 4, 21, 104, 521, 2604, 13021
- .
You have access to tiles which come in 2 different colors and tiles which come in 3 different colors. We want to figure out how many different path designs we can make out of these tiles.
- Find a recursive definition for the sequence of paths of length .
- Solve the recurrence relation using the Characteristic Root technique.
Solve the recurrence relation .
- What is the solution if the initial terms are and ?
- What do the initial terms need to be in order for ?
- For which are there initial terms which make ?
We have characteristic polynomial , which has as the only repeated root. Thus using the characteristic root technique for repeated roots, the general solution is where and depend on the initial conditions.
- .
- For example, we could have and .
- For every . Take and .
Consider the recurrence relation .
- Find the general solution to the recurrence relation (beware the repeated root).
- Find the solution when and .
- Find the solution when and .
Discrete Mathematics: An Open Introduction, 3rd edition, by Oscar Levin (discrete.openmathbooks.org), licensed under CC BY-SA 4.0; this adaptation is distributed under the same license. License: CC-BY-SA-4.0.