Solving recurrences (CSCI 2824, Spring 2015)Topic covered:
We looked at deriving recurrences for counting last lecture. We also started looking into solving the very simplest of recurrences. This lecture, we will look at some more interesting ways to tackle recurrences. Especially, we will introduce generating functions as an interesting way of solving recurrences. Some Basic Summation FactsWe recall the following basic summation facts: Given a knowledge of the closed forms of the summations above, we can calculate other kinds of summations. Let us take an example. Example 1Find the value of for some constant . Answer
Let represent the value of the summation above. From the reasoning above, we get Since , we conclude Solving Linear Recurrences: BasicsWe consider recurrences of the form: with base case fixed. are constants. Example 2Take the recurrence: and . Here is the derivation for the closed form. Answer
ObservationFrom the example above, we can proceed to solve recurrences of the form as follows: Answer
Suppose that . Then If , then . Linear Recurrences with Two Initial TermsWe will now consider recurrences that are second-order of the form: with base cases . Well-Known examples of such recurrences include:
Solving the likes of Fibonacci sequence by setting up a quadratic equationFor the recurrence We setup a quadratic equation , or equivalently, , whose real roots are given by If , then the closed form solution to the recurrence has the form for some coefficients determined by the initial values . If the equation has a single repeated root, i.e., if , then the solution is given by for some coefficients determined by the initial values . Example 3Consider the recurrence: Answer
We write out some terms of this recurrence . Here we have and . Therefore we solve the quadratic equation: Its roots are: . Therefore, the solution is of the form Given , we obtain , and . Solving, we obtain the solution Therefore, . Example 4Consider the Fibonacci recurrence . Answer
Here . The characteristic polynomial is . Solving this equation, we obtain the roots . Therefore, the closed form is . Plugging, in , we obtain, . For , . Writing and , we obtain the equations: Solving them we obtain, or . Likewise, . The overall closed form is . A special note: usually, we have Fibonacci numbers starting as . The closed form for the sequence with this base case will be . |