1 / 8

Discrete Mathematics CS 2610

Discrete Mathematics CS 2610. November 13, 2008. Intro to Recurrence Relations. Earlier in the semester, we saw how we could define sequences recursively or functionally. Specifically, we learned how to take functionally-defined sequences and transform them to recursively-defined sequences.

anjelita
Download Presentation

Discrete Mathematics CS 2610

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Discrete Mathematics CS 2610 November 13, 2008

  2. Intro to Recurrence Relations Earlier in the semester, we saw how we could define sequences recursively or functionally. Specifically, we learned how to take functionally-defined sequences and transform them to recursively-defined sequences. Example: an = 2n becomes a0 = 1 an+1 = 2n+1 = 22n = 2an, for n ≥ 1.

  3. Intro to Recurrence Relations Solving recurrence relations works in the opposite direction. But there’s a catch… (Isn’t there always?) A recursive definition of a sequence involves a recursive formula and a set of basis values. The formula itself, without the initial conditions, is a recurrence relation. We are going to be interested in solving relations both with, and without, initial conditions.

  4. Intro to Recurrence Relations Without initial conditions, a recurrence relation defines a set, or family, of sequences. Consider an+1 = 2an. If a0 = 1, an = 2n. But if a0 = 3, an = 32n. These two sequences are clearly similar. This is because an+1 = 2an defines a family of sequences, an = a02n, for n ≥ 1.

  5. Intro to Recurrence Relations A recurrence relation along with initial conditions specify a single sequence. Any such sequence is a solution to the relation. We can check solutions using substitution. Consider the recurrence relation an = 2an-1 - an-2. Is an = 3n a solution for n ≥ 1? Try it out! an = 2an-1 - an-2 = 23(n-1) – 3(n-2) = 6n – 6 -3n + 6 = 3n = an

  6. Intro to Recurrence Relations We can use recurrence relations to solve interest problems, for example. If you put money into an interest bearing instrument that compounds annually, how much money will you have after some period of time?

  7. Intro to Recurrence Relations We can also use this method to describe the famous “Towers of Hanoi” problem… The recurrence is an = 2an-1 + 1. Can you see why? Let’s solve the relation for a0 = 1…

  8. Intro to Recurrence Relations Finally, let’s see how we can apply recurrence relations and their solutions to a tough counting problem. How many bitstrings of length n do not contain consecutive 0’s? The techniques we’ve studied so far can’t solve this without ridiculous amounts of effort! One solution is 5-½( (1+5½)/2 )n+2 - 5-½( (1-5½)/2 )n+2 . We can find a more elegant and easier solution!!!

More Related