This article follows on from my previous post of June 10th 2020 titled Fibonacci-like Sequences. I owe a debt of gratitude to Niloufar Shafiei who has posted an excellent PDF about solving linear recurrence relations. He treats both linear homogeneous recurrences and linear non-homogeneous recurrences but it is only the former that I'll concern myself with in this post.
With a linear recurrence, each term of a sequence is a linear function of earlier
terms in the sequence. An example would be: However, this is not homogenous, because the last term, 1, does not involve an earlier term of the sequence. An example of a linear homogenous recurrence would be: This corresponds to the quadratic: This equals 0 when or .
The PDF referred to earlier shows that the -th term can be written in a form that is a linear combination of the two solutions: The values of can be determined from the initial conditions. When we substitute for and , this means that: Solving this pair of equations, we find and and thus can be written as: The dominant term of course is and so: The first ten terms of this sequence are (SageMathCell permalink):
1, 5, 7, 17, 31, 65, 127, 257, 511, 1025, 2047, 4097
If the quadratic associated with the recurrence relation has a repeated root, then a slightly different approach is required. For example, let's consider the recurrence: The quadratic that arises is: The repeated root here is and Niloufar Shafiei in his PDF shows that in this case, the solution is: Again, we get two equation in two unknowns and in this case, after applying the initial conditions, the solution is and . Thus can be written as: The dominant term is and so: The first ten elements of the sequence are (SageMathCell permalink):
1, 9, 45, 189, 729, 2673, 9477, 32805, 111537, 373977, 1240029, 4074381
So this is the essential idea. Niloufar Shafiei in his PDF has plenty more examples that are easy to understand and well-presented. There is a lot more to delve into regarding recurrence equations and I'm sure I'll be writing more about them in the future.
No comments:
Post a Comment