{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

L11_RecurInduction

# L11_RecurInduction - COMP170 Discrete Mathematical Tools...

This preview shows pages 1–29. Sign up to view the full content.

1-1 COMP170 Discrete Mathematical Tools for Computer Science Discrete Math for Computer Science K. Bogart, C. Stein and R.L. Drysdale Section 4.2, pp. 143-153 Recursion, Recurrences and Induction Version 2.0: Last updated, May 13, 2007 Slides c 2005 by M. J. Golin and G. Trippen

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2-1 Recursion, Recurrences and Induction Recursion Recurrences Iterating a Recurrence Geometric Series First-Order Linear Recurrences
3-1 Recursion

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
3-2 Recursion Recursive computer programs or algorithms often lead to inductive analyses
3-3 Recursion Recursive computer programs or algorithms often lead to inductive analyses A classic example of this is the Towers of Hanoi problem

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4-1 Towers of Hanoi
4-2 Towers of Hanoi

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4-3 Towers of Hanoi 3 pegs; n disks of different sizes. A legal move takes a disk from one peg and moves it onto another peg so that it is not on top of a smaller disk Problem: Find a (efficient) way to move all of the disks from one peg to another
5-1 Towers of Hanoi

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5-2 Towers of Hanoi legal move
5-3 Towers of Hanoi legal move legal move

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5-4 Towers of Hanoi legal move legal move not legal
5-5 Towers of Hanoi legal move legal move not legal legal move

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6-1 Towers of Hanoi Problem
6-2 Towers of Hanoi Start with n disks on leftmost peg Problem

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6-3 Towers of Hanoi Start with n disks on leftmost peg using only legal moves Problem
6-4 Towers of Hanoi Start with n disks on leftmost peg using only legal moves Problem move all disks to rightmost peg.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6-5 Towers of Hanoi Start with n disks on leftmost peg using only legal moves Given i, j ∈ { 1 , 2 , 3 } let { i, j } = { 1 , 2 , 3 } - { i } - { j } Problem move all disks to rightmost peg. i.e., { 1 , 2 } = 3 , { 1 , 3 } = 2 , { 2 , 3 } = 1 .
7-1 Towers of Hanoi General Solution

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
7-2 Towers of Hanoi Recursion Base: If n = 1 moving one disk from i to j is easy. Just move it. General Solution
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}