## 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: Fibonacci numbers: and . Lucas Numbers: and . *Neganacci*numbers: and .
## Quadratic EquationFor the second order recurrence We setup a quadratic equation Let be 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 .
. |