Intro to Recurrence Relations in Discrete Mathematics, Slides of Discrete Mathematics

This document from cs 2610 course at docsity.com introduces recurrence relations in discrete mathematics. It explains how to define sequences recursively and functionally, the difference between recursive and functional definitions, and how to solve recurrence relations with and without initial conditions. Examples and applications of recurrence relations in interest problems and the towers of hanoi problem are also provided.

Typology: Slides

2012/2013

Uploaded on 04/27/2013

aslesha
aslesha 🇮🇳

4.4

(14)

160 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Discrete Mathematics
CS 2610
November 13, 2008
Docsity.com
pf3
pf4
pf5
pf8

Partial preview of the text

Download Intro to Recurrence Relations in Discrete Mathematics and more Slides Discrete Mathematics in PDF only on Docsity!

Discrete Mathematics

CS 2610

November 13, 2008

2

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 = 2 n^ becomes

a 0 = 1 an+1 = 2 n+1^ = 2⋅ 2 n = 2an, for n ≥ 1.

4

Without initial conditions, a recurrence relation defines a set, or family, of sequences.

Consider an+1 = 2an.

If a 0 = 1, an = 2n^. But if a 0 = 3, an = 3⋅ 2 n^.

These two sequences are clearly similar. This is because an+1 = 2an defines a family of sequences, an = a 0 ⋅ 2 n, for n ≥ 1.

5

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

7

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 a 0 = 1…

8

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+^.

We can find a more elegant and easier solution!!!