Chapter 8 Recursion. 8.3 More Recurrence Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients.

Slides:



Advertisements
Similar presentations
Week 6 - Wednesday CS322.
Advertisements

Fall 2002CMSC Discrete Structures1 Now it’s Time for… RecurrenceRelations.
CHAPTER 5 Higher-Order Linear Differntial Equations Second-order DE: Second-order linear DE: Note: A,B,C,F function of x only Second-order homogeneous.
Chapter 2: Second-Order Differential Equations
Second-Order Differential
Recurrence Relations Reading Material –Chapter 2 as a whole, but in particular Section 2.8 –Chapter 4 from Cormen’s Book.
CSE115/ENGR160 Discrete Mathematics 04/19/12 Ming-Hsuan Yang UC Merced 1.
A second order ordinary differential equation has the general form
Discrete Structures Chapter 6 Recurrence Relations
Ch 6.1: Definition of Laplace Transform Many practical engineering problems involve mechanical or electrical systems acted upon by discontinuous or impulsive.
Matrices and Systems of Equations
Recurrence Relations Reading Material –Chapter 2 as a whole, but in particular Section 2.8 –Chapter 4 from Cormen’s Book.
Recursive and Explicit Formulas for Arithmetic (Linear) Sequences.
Recursion Lecture 17: Nov 11. Quiz int hello(int n) { if (n==0) return 0; else printf(“Hello World %d\n”,n); hello(n-1); } 1.What would the program do.
Boyce/DiPrima 9 th ed, Ch 3.1: 2 nd Order Linear Homogeneous Equations-Constant Coefficients Elementary Differential Equations and Boundary Value Problems,
1 Linear Recurrence Relations Part I Jorge Cobb The University of Texas at Dallas.
Chapter 3 Section 3.4 The Fundamental Theorem of Algebra.
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
SECOND-ORDER DIFFERENTIAL EQUATIONS
Jessie Zhao Course page: 1.
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Chapter 2 Simultaneous Linear Equations (cont.)
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.
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Copyright © 2011 Pearson Education, Inc. Sequences Section 8.1 Sequences, Series, and Probability.
Solving Recurrence Lecture 19: Nov 25. Some Recursive Programming (Optional?)
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:
Solving Second-Order Recursive Relations Lecture 36 ½ Section 8.3 Wed, Apr 19, 2006.
RECURRENCE Sequence Recursively defined sequence
CSCI 115 Chapter 3 Counting. CSCI 115 §3.1 Permutations.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Recurrence.
Chapter 3 Determinants Linear Algebra. Ch03_2 3.1 Introduction to Determinants Definition The determinant of a 2  2 matrix A is denoted |A| and is given.
after UCI ICS/Math 6A, Summer AdvancedCounting -1 Recurrence Relations (RRs) A “Recurrence Relation”
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Advanced Counting Techniques CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Module #20 - Recurrences Solving Recurrences Rosen 6 th ed., §7.2.
Discrete Mathematics Recurrence Relations Chapter 5 R. Johnsonbaugh
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
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.
CSE 2813 Discrete Structures Solving Recurrence Relations Section 6.2.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
Recurrence Relations. Outline Recurrence relationsSolving recurrence relationsRecurrence and Divide-and-conquer algorithmsGenerating functions
RECURRENCE Sequence Recursively defined sequence
CSCI 115 Chapter 3 Counting. CSCI 115 §3.1 Permutations.
Ch 4.2: Homogeneous Equations with Constant Coefficients Consider the nth order linear homogeneous differential equation with constant, real coefficients:
1 RECURRENCE 1. Sequence 2. Recursively defined sequence 3. Finding an explicit formula for recurrence relation.
Chapter 2 Fundamentals of the Analysis of Algorithm Efficiency Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Solving Linear Homogeneous Recurrence Relations ICS 6D Sandy Irani.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
1 Lecture Outline for Recurrences Already Covered: Recursive definition of sequences Recursive definition of sets Recursive definition of operations Recursive.
CMSC Discrete Structures
11.2 Arithmetic Sequences.
Modeling with Recurrence Relations
UNIT-6 Recurrence Relations
Class Notes 7: High Order Linear Differential Equation Homogeneous
11.3 Geometric sequences; Geometric Series
A second order ordinary differential equation has the general form
Ch 4.2: Homogeneous Equations with Constant Coefficients
CMSC Discrete Structures
Solving Recurrence Relations
CMSC Discrete Structures
Recurrence Relations Discrete Structures.
Differential Equations
Chapter 7 Advanced Counting Techniques
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
ICS 253: Discrete Structures I
Presentation transcript:

Chapter 8 Recursion

8.3 More Recurrence

Second-Order Recurrence Definition – A second-order linear homogeneous recurrence relation with constant coefficients is a recurrence relation of the form, a k = Aa k-1 + Ba k-2 for all ints k ≥ some fixed int, where A and B are fixed real numbers and B≠0. – This is called a second order because expression is based on the previous two terms (a k-1, a k-2 ). – Its linear a k-1, a k-2 are separate terms of the first order. – Homogenous because are terms are of the same order. – Constant coefficient b/c A and B are fixed real numbers that do not depend on k.

Example State whether each is a second-order linear homogenous recurrence relation. a k = 3a k-1 + 2a k-2 b k = b k-1 + b k-2 + b k-3 d k = d 2 k-1 + d k-1 * d k-2 e k = 2e k-2 f k = 2f k-1 + 1

Distinct Roots Lemma – Let A and B be real numbers. A recurrence relation of the form a k = Aa k-1 + Ba k-2 is satisfied by the sequence 1, t, t 2, t 3, …, t n, … where t is non-zero real number if, and only if, t satisfies the equation t 2 – At – B = 0.

Characteristic Equation Definition – Given a second-order linear homogenous recurrence relation with constant coefficients: a k = Aa k-1 + Ba k-2 for all ints k≥2, the characteristic equation of the relation is t 2 – At – B = 0

Example Use characteristic eq to find solutions to a recurrence problem. – Consider recurrence relation where kth term of a sequence equals the sum of the (k-1)st term plus twice the (k-2) term. a k = a k-1 + 2a k-2 – Find all sequences that satisfy 1, t, t 2, t 3, …, t n, … – Solution t 2 – t - 2 = 0 t 2 – t - 2 = (t – 2)(t + 1), thus the values of t = 2, -1 t can be: 1, 2, 2 2, 2 3, …, 2n OR 1, -1 2, -1 3, … -1 n This example demonstrates how to find two distinct sequences that satisfy a given second-order homogenous recurrence relation with constant coefficients.

Single Root Case Consider a k = Aa k-1 + Ba k-2 for ints k≥2, but consider that the characteristic equation t 2 – At – B = 0 has a single root. By Lemma one sequence that satisfies the relation is: 1, r, r 2, r 3, … r n, … however another is: 0, r, 2r 2, 3r 3, …, nr n To see this observe: t 2 – At – B = (t – r) 2 = t 2 – 2rt – r 2, A=2r B=-r 2 s n = nr n for all ints n≥0 As k-1 + Bs k-2 = A(k -1)r k-1 + B(k -2)r k-2 = 2r(k -1)r k-1 + -r 2 (k -2)r k-2 = 2(k -1)r k - (k -2)r k = (2k – 2 – k + 2) r k = kr k = s k

Single Root Lemma – Let A and B be real numbers and suppose the characteristic eq t 2 – At – B = 0 has a single root r. Then the sequence 1, r 1, r 2, …, r n, … and 0, r, 2r 2, … nr n, … both satisfy the recurrence relation a k = Aa k-1 + Ba k-2 for all ints k≥2

Single Root Theorem – Suppose a sequence satisfies a recurrence relation a k = Aa k-1 + Ba k-2 for some real numbers A and B with B≠0 and for all ints k≥2. If the characteristic eq t 2 – At – B = 0 has a single (real) root r then the sequence a 0, a 1, a 2, … satisfies the explicit formula a n = Cr n + Dnr n where C and D are the real numbers whose values are determined by the values of a 0 and any other known value of the sequence.

Example Suppose b 0, b 1, b 2 … satisfies the recurrence relation b k = 4b k-1 – 4b k- 2 for all ints k ≥ 2 with initial conditions b 0 = 1 and b 1 = 3. Find an explicit formula for the sequence. Solution – sequences is of second-order linear homogenous recurrence relation with constant coefficients (A=4 and B=-4). The single-root condition is also met because the characteristic equation t 2 – 4t + 4 = 0 has a single root r = 2 ( (t-2)(t-2) ) – b n = C 2 n + Dn2 n – to find C and D use initial conditions b 0 = 1 = C 2 0 +D(0)2 0 => C = 1 b 1 = 3 = C 2 1 +D(1)2 1 => 2C + 2D = 3 (sub C = 1 from above) 3 = 2(1) + 2D => D = ½ – Hence, b n = 2 n + ½ n2 n for all ints n≥2