Lecture 30: Solving RecurrencesWe 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 , where . Answer
Let represent the value of the summation above. From the reasoning above, we get Since , we conclude Solving Recurrences: BasicsWe consider recurrences of the form: with base case fixed. are constants. Example-1Take 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
Second-Order RecurrencesWe will now consider recurrences that are second-order of the form: with base cases . Well-Known examples of such recurrences include:
Quadratic EquationFor the second order recurrence We setup a quadratic equation Let be two different roots to the quadratic equation above. Then the closed form solution to the recurrence has the form for some coefficients . If the equation has a single repeated root , then the solution is given by Example # 1Consider 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 # 2Consider 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 . |