Copyright © Cengage Learning. All rights reserved.

Slides:



Advertisements
Similar presentations
Copyright © Cengage Learning. All rights reserved.
Advertisements

Analysis of Algorithms II
Tower of Hanoi Tower of Hanoi is a mathematical puzzle invented by a French Mathematician Edouard Lucas in The game starts by having few discs stacked.
Chapter 8 Recursion. 8.1 Recursively Defined Sequences.
Chapter Recurrence Relations
Introduction to Algorithms
AE1APS Algorithmic Problem Solving John Drake
Chapter 6 Advanced Counting 6.1 Recurrence Relations.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
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.
Recursion.
1 Section 6.1 Recurrence Relations. 2 Recursive definition of a sequence Specify one or more initial terms Specify rule for obtaining subsequent terms.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Copyright © Cengage Learning. All rights reserved.
13.2: Arithmetic and Geometric Sequences Recursive Definitions.
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
1 © 2010 Pearson Education, Inc. All rights reserved © 2010 Pearson Education, Inc. All rights reserved Chapter 10 Further Topics in Algebra.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. CHAPTER 11 ANALYSIS OF ALGORITHM EFFICIENCY ANALYSIS OF ALGORITHM EFFICIENCY.
Advanced Counting Techniques
Additional Topics in Differential Equations
Data Structures Using C++ 2E Chapter 6 Recursion.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
13.2 Recursive Definitions Objective 1) Provide the recursive definition for sequences; 2) Identify the type of a sequence from a recursive definition.
Copyright © Cengage Learning. All rights reserved.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Lecture#16 Discrete Mathematics. Recursion Now, 1 is an odd positive integer by the definition base. With k = 1, = 3, so 3 is an odd positive integer.
CSC201 Analysis and Design of Algorithms Asst.Proof.Dr.Surasak Mungsing Oct-151 Lecture 2: Definition of algorithm and Mathematical.
Infinite Series Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved. 12 Limits and an Introduction to Calculus.
Sequences and Summations
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
Copyright © Cengage Learning. All rights reserved. 12 Limits and an Introduction to Calculus.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Chapter 6.1: Recurrence Relations Discrete Mathematical Structures: Theory and Applications.
1 Topics Recursion sections 8.1 – Recursion A recursively defined sequence –First, certain initial values are specified –Later terms of the sequence.
Discrete Mathematics Recurrence Relations Chapter 5 R. Johnsonbaugh
Infinite Series 9 Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved Limits at Infinity and Limits of Sequences.
RECURRENCE Sequence Recursively defined sequence
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
Copyright © Cengage Learning. All rights reserved. Sequences and Series.
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.
Tower of Hanoi Tower of Hanoi is a mathematical puzzle invented by a French Mathematician Edouard Lucas in The game starts by having few discs stacked.
Recursion by Ender Ozcan. Recursion in computing Recursion in computer programming defines a function in terms of itself. Recursion in computer programming.
Pramada Ramachandran, Assistant Professor, Department of Mathematics,
Arithmetic Sequences and Partial Sums 9.2
Sequences, Series, and Probability
Introduction to Recurrence Relations
Sequences, Series, and Probability
Dynamic Programming Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
SECTION 5.1 Sequences.
Copyright © Cengage Learning. All rights reserved.
COUNTING AND PROBABILITY
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
COUNTING AND PROBABILITY
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Copyright © Cengage Learning. All rights reserved.

Defining Sequences Recursively SECTION 5.6 Defining Sequences Recursively Copyright © Cengage Learning. All rights reserved.

Defining Sequences Recursively A sequence can be defined in a variety of different ways. One informal way is to write the first few terms with the expectation that the general pattern will be obvious. We might say, for instance, “consider the sequence 3, 5, 7, . . ..” Unfortunately, misunderstandings can occur when this approach is used. The next term of the sequence could be 9 if we mean a sequence of odd integers, or it could be 11 if we mean the sequence of odd prime numbers.

Defining Sequences Recursively The second way to define a sequence is to give an explicit formula for its nth term. For example, a sequence a0, a1, a2 . . . can be specified by writing The advantage of defining a sequence by such an explicit formula is that each term of the sequence is uniquely determined and can be computed in a fixed, finite number of steps, by substitution.

Defining Sequences Recursively The third way to define a sequence is to use recursion. This requires giving both an equation, called a recurrence relation, that defines each later term in the sequence by reference to earlier terms and also one or more initial values for the sequence.

Example 1 – Computing Terms of a Recursively Defined Sequence Define a sequence c0, c1, c2, . . . recursively as follows: For all integers k  2, Find c2, c3, and c4.

b. Show that this sequence satisfies the recurrence Example 4 – Showing That a Sequence Given by an Explicit Formula Satisfies a Certain Recurrence Relation The sequence of Catalan numbers, named after the Belgian mathematician Eugène Catalan (1814–1894), arises in a remarkable variety of different contexts in discrete mathematics. It can be defined as follows: For each integer n  1, a. Find C1,C2, and C3. b. Show that this sequence satisfies the recurrence relation for all integers k  2

Examples of Recursively Defined Sequences

Examples of Recursively Defined Sequences Recursion is one of the central ideas of computer science. To solve a problem recursively means to find a way to break it down into smaller subproblems each having the same form as the original problem—and to do this in such a way that when the process is repeated many times, the last of the subproblems are small and easy to solve and the solutions of the subproblems can be woven together to form a solution to the original problem.

Example 5 – The Tower of Hanoi In 1883 a French mathematician, Édouard Lucas, invented a puzzle that he called The Tower of Hanoi (La Tour D’Hanoï). The puzzle consisted of eight disks of wood with holes in their centers, which were piled in order of decreasing size on one pole in a row of three. Those who played the game were supposed to move all the disks one by one from one pole to another, never placing a larger disk on top of a smaller one.

Example 5 – The Tower of Hanoi cont’d The puzzle offered a prize of ten thousand francs (about $34,000 US today) to anyone who could move a tower of 64 disks by hand while following the rules of the game. (See Figure 5.6.2) Assuming that you transferred the disks as efficiently as possible, how many moves would be required to win the prize? Figure 5.6.2

Recursive Definitions of Sum and Product

Recursive Definitions of Sum and Product Addition and multiplication are called binary operations because only two numbers can be added or multiplied at a time. Careful definitions of sums and products of more than two numbers use recursion.

Recursive Definitions of Sum and Product The effect of these definitions is to specify an order in which sums and products of more than two numbers are computed. For example, The recursive definitions are used with mathematical induction to establish various properties of general finite sums and products.

Example 9 – A Sum of Sums Prove that for any positive integer n, if a1, a2, . . . , an and b1, b2, . . . , bn are real numbers, then