Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Advanced Counting - Discrete Mathematics and its Applications - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Advanced Counting, Recurrence Relations, Terms of Sequence, Initial Conditions, Unique Recursive Definition, Modelling, Tower of Hanoi, Hanoi Puzzle, Sums of Geometric Series, Bit-Strings of Length

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atmaja
atmaja 🇮🇳

4.2

(45)

182 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 6
Advanced Counting
6.1 Recurrence Relations
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Advanced Counting - Discrete Mathematics and its Applications - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Chapter 6

Advanced Counting

6.1 Recurrence Relations

Recurrence Relations

Definition: An equation that expresses the element an of the sequence {an} in terms of one or more previous terms of the sequence a0,...,an-1. A sequence is a solution of the recurrence relation if its terms satisfy the recurrence relation. Example: Consider the recurrence relation an = 2a(n-1) –a(n-2), n in N Consider the sequence: an=3n. Is it a solution?  2x3x(n-1)-3x(n-2) =3n YES! (a0 = 0, a1 = 3, a2 = 6,...) Consider the sequence an=5. Is it a solution?  2x5 – 5 = 5 YES! (a0 = 5, a1 = 5, ...) we see that to sequences can be a solution of the same recurrence relation since the initial conditions are also very important. The initial conditions plus the recurrence relation provide a unique recursive definition of a sequence. Docsity.com

Tower of Hanoi

How many moves does it take to solve the Hanoi puzzle? Let Hn be the number of moves to solve a problem with n disks. -We first move the top n-1 disks to peg 2 in H(n-1) moves. -We then move the largest disk to peg 3 in 1 move. -We then move the n-1 disks on top of the largest disk in another H(n-1) moves:  Total: Hn = 2xH(n-1)+ -Basis Step: 1 disk = 1 move: H(1)=1. -Hn = 2(2H(n-2)+1)+1 = 2^2H(n-2)+2^1 + 1 .... =2^(n-1)H1 + 2^(n-2) + 2^(n-3)+...+2+ =2^n-1 (by sums of geometric series 3.1).

Examples

How many bit-strings of length n with no consecutive 0’2?  an is number of bit-strings with no 2 consecutive 0’s in it. How can we generate a bit-string of length n from bit-strings of length n-1? Valid bit-strings fall into 2 classes, ones that end with a “0” and ones that end with a “1”. Ones that end in a “1” could be generated by adding a one to a valid bit-string of any kind: a(n-1) ways. Ones that end with a “0” came about by appending a smaller bit-string of length n-1 that ended with a “1” (otherwise 2 zeros appear), which must have come about in turn by appending a “1” to any valid bit-string of length n-2: a(n-2) ways. Total: an = a(n-1) + a(n-2) n>2. a1 = 2, a2 = 3. Recognize it? 2,3,5,8,13.....?