Chapter 6.1: Recurrence Relations Discrete Mathematical Structures: Theory and Applications.

Slides:



Advertisements
Similar presentations
3/25/2017 Chapter 16 Recursion.
Advertisements

Discrete Math Recurrence Relations 1.
The Towers of Hanoi or Apocalypse When?.
Week 6 - Wednesday CS322.
The Algorithmic problems?
Chapter Recurrence Relations
AE1APS Algorithmic Problem Solving John Drake
Recursion, Divide and Conquer Lam Chi Kit (George) HKOI2007.
CS 2210 (22C:19) Discrete Structures Advanced Counting
The Tower of Hanoi Ben Epstein Special Topics 2003.
Use of Computer Technology in Education Course Management Systems Learning Management Systems Classroom Teaching Technology Modeling and Simulation and.
Recursion. Idea: Some problems can be broken down into smaller versions of the same problem Example: n! 1*2*3*…*(n-1)*n n*factorial of (n-1)
Kavita Math231 Recursion and Iteration. Kavita Math231 We use Recursion when we have to perform a complex task that can be broken into the several subtasks.
Chapter 10 Recursion. Copyright © 2005 Pearson Addison-Wesley. All rights reserved Chapter Objectives Explain the underlying concepts of recursion.
Recursion.
Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.
1 Section 6.1 Recurrence Relations. 2 Recursive definition of a sequence Specify one or more initial terms Specify rule for obtaining subsequent terms.
6.Advanced Counting Techniques 1 Copyright M.R.K. Krishna Rao 2003 Ch 6. Recurrence Relations A recurrence relation for the sequence {a n } is an equation.
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Copyright © Cengage Learning. All rights reserved.
Recursively Defined Sequences Lecture 35 Section 8.1 Wed, Mar 23, 2005.
Advanced Counting Techniques
Department of Computer Science Data Structures Using C++ 2E Chapter 6: Recursion Learn about recursive Definitions Algorithms Functions Explore the base.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
13.2 Recursive Definitions Objective 1) Provide the recursive definition for sequences; 2) Identify the type of a sequence from a recursive definition.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Recursion Jordi Cortadella Department of Computer Science.
CSE 2813 Discrete Structures Recurrence Relations Section 6.1.
Module #20 - Recurrences 1 Ch. 7 Recurrence Relations Rosen 6 th ed., §§7.1.
15.1 CompSci 102© Michael Frank Today’s topics Recurrence relationsRecurrence relations –Stating recurrences –LiHoReCoCo Reading: Sections Reading:
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 5 Recurrence Relations.
Complexity A decidable problem is computationally solvable. But what resources are needed to solve the problem? –How much time will it require? –How much.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Recurrence.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Java Programming: Guided Learning with Early Objects Chapter 11 Recursion.
Recurrence Relation Models
Upon completion, the world will end…
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Lecture - 8 On Stacks, Recursion. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Lecture Outline Quick sort Algorithm Recursion –Calculate n factorial –Fibonacci.
Discrete Mathematics Recurrence Relations Chapter 5 R. Johnsonbaugh
22C:19 Discrete Math Advanced Counting Fall 2010 Sukumar Ghosh.
CHAPTER TWO RECURRENCE RELATION
1 Examples of Recursion Instructor: Mainak Chaudhuri
Recursion Colin Capham Recursion – an introduction to the concept.
COMP 170 L2 L11: Recursion, Recurrence, and Induction l Objective n Recursion  A problem solving technique that reduces big problems into smaller ones.
Pass the Buck Every good programmer is lazy, arrogant, and impatient. In the game “Pass the Buck” you try to do as little work as possible, by making your.
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
CMPF144 FUNDAMENTALS OF COMPUTING THEORY Module 9: The Tower of Hanoi.
1 In this puzzle, the player begins with n disks of decreasing diameter placed one on top of the other on one of three pegs of the game board. The player.
Recursively Defined Sequences Lecture 40 Section 8.1 Wed, Apr 11, 2007.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
1 Towers of Hanoi Three pegs, one with n disks of decreasing diameter; two other pegs are empty Task: move all disks to the third peg under the following.
Discrete Math For Computing II. Contact Information B. Prabhakaran Department of Computer Science University of Texas at Dallas Mail Station EC 31, PO.
Tower of Hanoi problem: Move the pile of rings from one peg to another
Actual tower vs. computer simulation
Chapter 15 Recursion.
Chapter 15 Recursion.
Introduction to Recurrence Relations
Copyright © Cengage Learning. All rights reserved.
Tower of Hanoi problem: Move the pile of rings from one peg to another
Copyright © Cengage Learning. All rights reserved.
The Hanoi Tower Problem
CS 2210 Discrete Structures Advanced Counting
Recursion.
1A Recursively Defined Functions
Chapter 19: Recursion.
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
Tower of Hanoi problem: Move the pile of rings from one peg to another
Recursively Defined Sequences
Presentation transcript:

Chapter 6.1: Recurrence Relations Discrete Mathematical Structures: Theory and Applications

Discrete Mathematical Structures: Theory and Applications 2 Learning Objectives  Learn about recurrence relations  Learn the relationship between sequences and recurrence relations  Explore how to solve recurrence relations by iteration  Learn about linear homogeneous recurrence relations and how to solve them  Become familiar with linear nonhomogeneous recurrence relations

Discrete Mathematical Structures: Theory and Applications 3 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 4 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 5 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 6 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 7 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 8 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 9 Sequences and Recurrence Relations  Tower of Hanoi  In the nineteenth century, a game called the Tower of Hanoi became popular in Europe. This game represents work that is under way in the temple of Brahma.  There are three pegs, with one peg containing 64 golden disks. Each golden disk is slightly smaller than the disk below it.  The task is to move all 64 disks from the first peg to the third peg.

Discrete Mathematical Structures: Theory and Applications 10 Sequences and Recurrence Relations  The rules for moving the disks are as follows: 1.Only one disk can be moved at a time. 2.The removed disk must be placed on one of the pegs. 3.A larger disk cannot be placed on top of a smaller disk.  The objective is to determine the minimum number of moves required to transfer the disks from the first peg to the third peg.

Discrete Mathematical Structures: Theory and Applications 11 Sequences and Recurrence Relations  First consider the case in which the first peg contains only one disk.  The disk can be moved directly from peg 1 to peg 3.  Consider the case in which the first peg contains two disks.  First move the first disk from peg 1 to peg 2.  Then move the second disk from peg 1 to peg 3.  Finally, move the first disk from peg 2 to peg 3.

Discrete Mathematical Structures: Theory and Applications 12  Consider the case in which the first peg contains three disks and then generalize this to the case of 64 disks (in fact, to an arbitrary number of disks).  Suppose that peg 1 contains three disks. To move disk number 3 to peg 3, the top two disks must first be moved to peg 2. Disk number 3 can then be moved from peg 1 to peg 3. To move the top two disks from peg 2 to peg 3, use the same strategy as before. This time use peg 1 as the intermediate peg.  Figure 8.2 shows a solution to the Tower of Hanoi problem with three disks. Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 13

Discrete Mathematical Structures: Theory and Applications 14  Generalize this problem to the case of 64 disks. To begin, the first peg contains all 64 disks. Disk number 64 cannot be moved from peg 1 to peg 3 unless the top 63 disks are on the second peg. So first move the top 63 disks from peg 1 to peg 2, and then move disk number 64 from peg 1 to peg 3. Now the top 63 disks are all on peg 2.  To move disk number 63 from peg 2 to peg 3, first move the top 62 disks from peg 2 to peg 1, and then move disk number 63 from peg 2 to peg 3. To move the remaining 62 disks, follow a similar procedure.  In general, let peg 1 contain n ≥ 1 disks. 1. Move the top n − 1 disks from peg 1 to peg 2 using peg 3 as the intermediate peg. 2. Move disk number n from peg 1 to peg Move the top n − 1 disks from peg 2 to peg 3 using peg 1 as the intermediate peg.

Discrete Mathematical Structures: Theory and Applications 15 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 16 Sequences and Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 17

Discrete Mathematical Structures: Theory and Applications 18 Linear Homogenous Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 19 Linear Homogenous Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 20 Linear Homogenous Recurrence Relations

Discrete Mathematical Structures: Theory and Applications 21 Linear Homogenous Recurrence Relations