Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.

Slides:



Advertisements
Similar presentations
Advanced Counting Techniques
Advertisements

Fall 2002CMSC Discrete Structures1 Now it’s Time for… RecurrenceRelations.
Chapter 2: Second-Order Differential Equations
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
1 Copyright M.R.K. Krishna Rao Solving Recurrence Relations Steps for solving a linear homogeneous recurrence relation of degree 2 : Step #1.
Differential Equations MTH 242 Lecture # 11 Dr. Manshoor Ahmed.
A second order ordinary differential equation has the general form
Ch 5.2: Series Solutions Near an Ordinary Point, Part I
Ch 3.5: Nonhomogeneous Equations; Method of Undetermined Coefficients
Discrete Structures Chapter 6 Recurrence Relations
Chapter 6 Recurrence and Solution. 6.2 Recurrence Relation 6.3 Solve Homogeneous Recurrence 6.4 Solve Nonhomogeneous Recurrence.
Recurrence Relations Reading Material –Chapter 2 as a whole, but in particular Section 2.8 –Chapter 4 from Cormen’s Book.
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.
Warm up Use the Rational Root Theorem to determine the Roots of : x³ – 5x² + 8x – 6 = 0.
1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas.
Applied Discrete Mathematics Week 9: Relations
7.2 Solving Recurrence Relations. Definition 1 (p. 460)- LHRR-K Def: A linear homogeneous recurrence relations of degree k with constant coefficients.
Advanced Counting Techniques
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.
14.1 CompSci 102© Michael Frank Today’s topics Recurrence relationsRecurrence relations –Stating recurrences –LiHoReCoCo –Divide & conquer –Master’s method.
Recurrence Relation. Outline  What is a recurrence relation ?  Solving linear recurrence relations  Divide-and-conquer algorithms and recurrence relations.
15.1 CompSci 102© Michael Frank Today’s topics Recurrence relationsRecurrence relations –Stating recurrences –LiHoReCoCo Reading: Sections Reading:
Module #17: Recurrence Relations Rosen 5 th ed., §
Solving Second-Order Recursive Relations Lecture 36 ½ Section 8.3 Wed, Apr 19, 2006.
RECURRENCE Sequence Recursively defined sequence
Based on Rosen, Discrete Mathematics & Its Applications, 5e Prepared by (c) Michael P. Frank Modified by (c) Haluk Bingöl 1/18 Module.
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Recurrence.
Boyce/DiPrima 9th ed, Ch 4.2: Homogeneous Equations with Constant Coefficients Elementary Differential Equations and Boundary Value Problems, 9th edition,
Copyright © Cengage Learning. All rights reserved. 17 Second-Order Differential Equations.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Section 5.1 First-Order Systems & Applications
Module #20 - Recurrences Solving Recurrences Rosen 6 th ed., §7.2.
Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients.
Section 5.5 The Real Zeros of a Polynomial Function.
Second-Order Differential
7.2 Solving Linear Recurrence Relations Some of these recurrence relations can be solved using iteration or some other ad hoc technique. However, one important.
Asymptotics and Recurrence Equations Prepared by John Reif, Ph.D. Analysis of Algorithms.
CSE 2813 Discrete Structures Solving Recurrence Relations Section 6.2.
Recurrence Relations. Outline Recurrence relationsSolving recurrence relationsRecurrence and Divide-and-conquer algorithmsGenerating functions
Differential Equations MTH 242 Lecture # 09 Dr. Manshoor Ahmed.
Ch 4.2: Homogeneous Equations with Constant Coefficients Consider the nth order linear homogeneous differential equation with constant, real coefficients:
Homogeneous Linear Recurrences To solve such recurrences we must first know how to solve an easier type of recurrence relation: DEF: A linear recurrence.
Mathematical Analysis of Recursive Algorithm CSG3F3 Lecture 7.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Solving Linear Homogeneous Recurrence Relations ICS 6D Sandy Irani.
Advanced Counting Techniques
CSG523/ Desain dan Analisis Algoritma
CSG523/ Desain dan Analisis Algoritma
CMSC Discrete Structures
Modeling with Recurrence Relations
3.5 Recurrence Relations.
Chapter 4: Linear Differential Equations
UNIT-6 Recurrence Relations
Class Notes 7: High Order Linear Differential Equation Homogeneous
A second order ordinary differential equation has the general form
Non-Homogeneous Recurrence Relations
Copyright © 2014, 2010, 2007 Pearson Education, Inc.
Zeros of a Polynomial Function
Ch 4.2: Homogeneous Equations with Constant Coefficients
CMSC Discrete Structures
Solving Recurrence Relations
CMSC Discrete Structures
Recurrence Relations Discrete Structures.
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
ICS 253: Discrete Structures I
Presentation transcript:

Chapter 8 With Question/Answer Animations 1

Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence Relations Nonhomogeneous Recurrence Relations Divide-and-Conquer Algorithms and Recurrence Relations Generating Functions Inclusion-Exclusion Applications of Inclusion-Exclusion 2

Section 8.2 3

Section Summary Linear Homogeneous Recurrence Relations Solving Linear Homogeneous Recurrence Relations with Constant Coefficients. Solving Linear Nonhomogeneous Recurrence Relations with Constant Coefficients. 4

Linear Homogeneous Recurrence Relations Definition: A linear homogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form a n = c 1 a n −1 + c 2 a n −2 + ….. + c k a n − k, where c 1, c 2, ….,c k are real numbers, and c k ≠ 0 it is linear because the right-hand side is a sum of the previous terms of the sequence each multiplied by a function of n. it is homogeneous because no terms occur that are not multiples of the a j s. Each coefficient is a constant. the degree is k because a n is expressed in terms of the previous k terms of the sequence. By strong induction, a sequence satisfying such a recurrence relation is uniquely determined by the recurrence relation and the k initial conditions a 0 = C 0, a 0 = C 1, …, a k −1 = C k −1. 5

Examples of Linear Homogeneous Recurrence Relations P n = (1.11) P n-1 linear homogeneous recurrence relation of degree one f n = f n-1 + f n-2 linear homogeneous recurrence relation of degree two not linear H n = 2 H n −1 + 1 not homogeneous B n = nB n −1 coefficients are not constants 6

Solving Linear Homogeneous Recurrence Relations The basic approach is to look for solutions of the form a n = r n, where r is a constant. Note that a n = r n is a solution to the recurrence relation a n = c 1 a n −1 + c 2 a n −2 + ⋯ + c k a n − k if and only if r n = c 1 r n −1 + c 2 r n −2 + ⋯ + c k r n − k. Algebraic manipulation yields the characteristic equation: r k − c 1 r k −1 − c 2 r k −2 − ⋯ − c k −1 r − c k = 0 The sequence {a n } with a n = r n is a solution if and only if r is a solution to the characteristic equation. The solutions to the characteristic equation are called the characteristic roots of the recurrence relation. The roots are used to give an explicit formula for all the solutions of the recurrence relation. 7

Solving Linear Homogeneous Recurrence Relations of Degree Two Theorem 1 : Let c 1 and c 2 be real numbers. Suppose that r 2 – c 1 r – c 2 = 0 has two distinct roots r 1 and r 2. Then the sequence {a n } is a solution to the recurrence relation a n = c 1 a n −1 + c 2 a n −2 if and only if for n = 0, 1, 2,…, where α 1 and α 2 are constants. 8

Using Theorem 1 Example: What is the solution to the recurrence relation a n = a n −1 + 2 a n −2 with a 0 = 2 and a 1 = 7 ? Solution: The characteristic equation is r 2 − r − 2 = 0. Its roots are r = 2 and r = −1. Therefore, {a n } is a solution to the recurrence relation if and only if a n = α 1 2 n + α 2 ( −1 ) n, for some constants α 1 and α 2. To find the constants α 1 and α 2, note that a 0 = 2 = α 1 + α 2 and a 1 = 7 = α α 2 ( −1 ). Solving these equations, we find that α 1 = 3 and α 2 = −1. Hence, the solution is the sequence {a n } with a n = 3∙2 n − ( −1 ) n. 9

An Explicit Formula for the Fibonacci Numbers We can use Theorem 1 to find an explicit formula for the Fibonacci numbers. The sequence of Fibonacci numbers satisfies the recurrence relation f n = f n −1 + f n −2 with the initial conditions: f 0 = 0 and f 1 = 1. Solution: The roots of the characteristic equation r 2 – r – 1 = 0 are 10

Fibonacci Numbers (continued) Therefore by Theorem 1 for some constants α 1 and α 2. Using the initial conditions f 0 = 0 and f 1 = 1, we have Solving, we obtain. Hence,., 11

The Solution when there is a Repeated Root Theorem 2 : Let c 1 and c 2 be real numbers with c 2 ≠ 0. Suppose that r 2 – c 1 r – c 2 = 0 has one repeated root r 0. Then the sequence {a n } is a solution to the recurrence relation a n = c 1 a n −1 + c 2 a n −2 if and only if for n = 0,1,2,…, where α 1 and α 2 are constants. 12

Using Theorem 2 Example: What is the solution to the recurrence relation a n = 6a n −1 − 9 a n −2 with a 0 = 1 and a 1 = 6? Solution: The characteristic equation is r 2 − 6 r + 9 = 0. The only root is r = 3. Therefore, {a n } is a solution to the recurrence relation if and only if a n = α 1 3 n + α 2 n( 3 ) n where α 1 and α 2 are constants. To find the constants α 1 and α 2, note that a 0 = 1 = α 1 and a 1 = 6 = α 1 ∙ 3 + α 2 ∙3. Solving, we find that α 1 = 1 and α 2 = 1. Hence, a n = 3 n + n 3 n. 13

Solving Linear Homogeneous Recurrence Relations of Arbitrary Degree This theorem can be used to solve linear homogeneous recurrence relations with constant coefficients of any degree when the characteristic equation has distinct roots. Theorem 3 : Let c 1, c 2,…, c k be real numbers. Suppose that the characteristic equation r k – c 1 r k −1 –⋯ – c k = 0 has k distinct roots r 1, r 2, …, r k. Then a sequence {a n } is a solution of the recurrence relation a n = c 1 a n −1 + c 2 a n −2 + ….. + c k a n − k if and only if for n = 0, 1, 2, …, where α 1, α 2,…, α k are constants. 14

The General Case with Repeated Roots Allowed Theorem 4 : Let c 1, c 2,…, c k be real numbers. Suppose that the characteristic equation r k – c 1 r k −1 –⋯ – c k = 0 has t distinct roots r 1, r 2, …, r t with multiplicities m 1, m 2, …, m t, respectively so that m i ≥ 1 for i = 0, 1, 2, …,t and m 1 + m 2 + … + m t = k. Then a sequence {a n } is a solution of the recurrence relation a n = c 1 a n −1 + c 2 a n −2 + ….. + c k a n − k if and only if for n = 0, 1, 2, …, where α i,j are constants for 1≤ i ≤ t and 0≤ j ≤ m i −1. 15

Linear Nonhomogeneous Recurrence Relations with Constant Coefficients Definition: A linear nonhomogeneous recurrence relation with constant coefficients is a recurrence relation of the form: a n = c 1 a n −1 + c 2 a n −2 + ….. + c k a n − k + F(n), where c 1, c 2, ….,c k are real numbers, and F(n) is a function not identically zero depending only on n. The recurrence relation a n = c 1 a n −1 + c 2 a n −2 + ….. + c k a n − k, is called the associated homogeneous recurrence relation. 16

Linear Nonhomogeneous Recurrence Relations with Constant Coefficients (cont.) The following are linear nonhomogeneous recurrence relations with constant coefficients: a n = a n −1 + 2 n, a n = a n −1 + a n −2 + n 2 + n + 1, a n = 3 a n −1 + n 3 n, a n = a n −1 + a n −2 + a n −3 + n! where the following are the associated linear homogeneous recurrence relations, respectively: a n = a n −1, a n = a n −1 + a n −2, a n = 3 a n −1, a n = a n −1 + a n −2 + a n −3 17

Solving Linear Nonhomogeneous Recurrence Relations with Constant Coefficients Theorem 5 : If {a n (p) } is a particular solution of the nonhomogeneous linear recurrence relation with constant coefficients a n = c 1 a n −1 + c 2 a n −2 + ⋯ + c k a n − k + F(n), then every solution is of the form {a n (p) + a n (h) }, where {a n (h) } is a solution of the associated homogeneous recurrence relation a n = c 1 a n −1 + c 2 a n −2 + ⋯ + c k a n − k. 18

Solving Linear Nonhomogeneous Recurrence Relations with Constant Coefficients (continued) Example : Find all solutions of the recurrence relation a n = 3 a n −1 + 2 n. What is the solution with a 1 = 3 ? Solution: The associated linear homogeneous equation is a n = 3 a n −1. Its solutions are a n (h) = α3 n, where α is a constant. Because F(n)= 2 n is a polynomial in n of degree one, to find a particular solution we might try a linear function in n, say p n = cn + d, where c and d are constants. Suppose that p n = cn + d is such a solution. Then a n = 3 a n −1 + 2 n becomes cn + d = 3( c(n − 1) + d)+ 2 n. Simplifying yields ( c)n + ( 2 d − 3 c ) = 0. It follows that cn + d is a solution if and only if c = 0 and 2 d − 3 c = 0. Therefore, cn + d is a solution if and only if c = − 1 and d = − 3/2. Consequently, a n (p) = − n − 3/2 is a particular solution. By Theorem 5, all solutions are of the form a n = a n (p) + a n (h) = − n − 3/2 + α3 n, where α is a constant. To find the solution with a 1 = 3, let n = 1 in the above formula for the general solution. Then 3 = −1 − 3/2 + 3 α, and α = 11 / 6. Hence, the solution is a n = − n − 3/2 + (11 / 6)3 n. 19