A0=0 a1=2 an a2=6 an-1 a3=12 a4=20 a2 a1 a0.

Slides:



Advertisements
Similar presentations
Discrete Math Recurrence Relations 1.
Advertisements

CS 2210 (22C:19) Discrete Structures Advanced Counting
Differential Equations MTH 242 Lecture # 11 Dr. Manshoor Ahmed.
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.
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.
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
Chapter 8. Section 8. 1 Section Summary Introduction Modeling with Recurrence Relations Fibonacci Numbers The Tower of Hanoi Counting Problems Algorithms.
Chap. 7 (c) , Michael P. Frank1 Chapter 7: Advanced Counting Techniques.
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.
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
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.
R. Johnsonbaugh Discrete Mathematics 7 th edition, 2009 Chapter 7 Recurrence Relations Instructor Tianping Shuai.
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., §
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 5 Recurrence Relations.
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.
Sequences and Summations
Chapter 7 Advance Counting Techniques. Content Recurrence relations Generating function The principle of inclusion-exclusion.
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
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.
after UCI ICS/Math 6A, Summer AdvancedCounting -1 Recurrence Relations (RRs) A “Recurrence Relation”
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.
Discrete Mathematics Recurrence Relations Chapter 5 R. Johnsonbaugh
CHAPTER TWO RECURRENCE RELATION
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.
Functions Discrete Structure. L62 Functions. Basic-Terms. DEF: A function f : A  B is given by a domain set A, a codomain set B, and a rule which for.
Agenda Lecture Content:  Recurrence Relations  Solving Recurrence Relations  Iteration  Linear homogenous recurrence relation of order k with constant.
ADVANCED ALGORITHMS REVIEW OF ANALYSIS TECHNIQUES (UNIT-1)
Recurrence Relations. Outline Recurrence relationsSolving recurrence relationsRecurrence and Divide-and-conquer algorithmsGenerating functions
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.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Advanced Counting Techniques
Discrete Math For Computing II. Contact Information B. Prabhakaran Department of Computer Science University of Texas at Dallas Mail Station EC 31, PO.
CSG523/ Desain dan Analisis Algoritma
1 10 Section 8.1 Recursive Thinking Page 409
CSG523/ Desain dan Analisis Algoritma
CSE15 Discrete Mathematics 03/01/17
CMSC Discrete Structures
Advanced Counting Techniques
Sequences and Series IB standard
Modeling with Recurrence Relations
Patterns and Sequences
Introduction to Recurrence Relations
UNIT-6 Recurrence Relations
Class Notes 7: High Order Linear Differential Equation Homogeneous
Module #17: Recurrence Relations
Module #17: Recurrence Relations
Recursion and Recurrence Relations
Geometric sequences.
CS 2210 Discrete Structures Advanced Counting
CMSC Discrete Structures
Solving Recurrence Relations
Applied Discrete Mathematics Week 7: Computation
CMSC Discrete Structures
8.3 Analyzing Geometric Sequences and Series
Recurrence Relations Discrete Structures.
Chapter 7 Advanced Counting Techniques
Recurrence Relations (RRs)
Recurrence Relations.
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
ICS 253: Discrete Structures I
Presentation transcript:

a0=0 a1=2 an a2=6 an-1 a3=12 a4=20 a2 a1 a0

10.1 The First-Order Linear Recurrence Relation geometric progression a first-order, linear, and homogeneous recurrence relation (difference equation) with constant coefficient The arithmetic progression is nonhomogeneous.

10.1 The First-Order Linear Recurrence Relation There are many sequences that satisfy For example, 5,15,45,135,... or 7,21,63,189,.... To pinpoint the particular sequence described, we need to know one of the terms of the sequence. (boundary condition, or initial condition since usually a0 is specified) determines the sequence 5,15,45,135,...

10.1 The First-Order Linear Recurrence Relation Ex. 10.2 A bank pays 6% (annual) interest on savings, compounding the interest monthly. If Boonie deposits $1000 on the first day of May, how much will this deposit be worth a year later? Let pn denote the value of deposit at the end of n months. Then pn+1=pn+(6%/12)pn=1.005pn. With p0=$1000, we have pn=p0(1.005)n. The answer is p12=$1000(1.005)12=$1061.68. A nonlinear recurrence relation

10.1 The First-Order Linear Recurrence Relation nonhomogeneous linear recurrence relation Ex. 10.4 time complexity of bubble sort algorithm an=an-1+(n-1), n>1, a1=0, where an=the number of comparisons to sort n numbers an- an-1= n-1 an-1- an-2= n-2 an-2- an-3= n-3 a2- a1= 1 + an =1+2+3+...+(n-1)=(n2-n)/2

10.1 The First-Order Linear Recurrence Relation find the recurrence pattern nonconstant coefficients Ex. 10.5 Ex. 10.6 a0=0 a1- a0=2 a1=2 a2 -a1=4 a2=6 a3- a2=6 a3=12 a4=20 a4- a3=8 an- an-1=2n + an=n2+n

10.2 The Second-Order Linear Homogeneous Recurrence Relation with Constant Coefficients three cases for the characteristic roots: (a) distinct real numbers (b) complex conjugates (c) duplicate roots

Case (A): distinct real roots

Case (A): distinct real roots

Case (A): distinct real roots Ex. 10.11 number of legal arithmetic expressions, without parentheses, that are made up of the digits 0,1,2,...,9 and the binary operator +,*,/. Let an be the number of expressions made up of n symbols. Then a1=10 (0,1,...,9), a2=100 (00,01,...,99). For n>2, two cases: (a) the last two symbols are digits: remove the last digit, we have a legal expression for an-1. (10an-1) (b) the last two symbols are operator and digit: remove the two symbols, we have a legal expression for an-2 (29an-2, no /0) Therefore, an=10an-1+29an-2, and a1=10, a2=100.

Case (A): distinct real roots Ex. 10.13 Find a recurrence relation for the number of binary sequences of length n that have no consecutive 0's. Let an be the number of such sequences with length n,n>0. Then a1=2, a2=3. There are two cases for an: (1) the nth symbol is 1: the preceding n-1 symbols sequence is counted in an-1 (2) the nth symbol is 0: an ends in 10 and the preceding n-2 symbols sequence is counted in an-2. Therefore, an=an-1+an-2.

10.2 The Second-Order Linear Homogeneous Recurrence Relation with Constant Coefficients Be careful not to draw conclusions from a few (or even, perhaps, many) particular instances. Ex. 10.14 Arrange pennies contiguously in each row where each penny above the bottom row touches two pennies in the row below it. a1=1,a2=1,a3=2,a4=3,a5=5,a6=8,... Is an=Fn? NO

10.2 The Second-Order Linear Homogeneous Recurrence Relation with Constant Coefficients extend to higher order

10.2 The Second-Order Linear Homogeneous Recurrence Relation with Constant Coefficients Case (b) Complex Roots DeMoivre's Theorem y x

Case (b) Complex Roots

Case (b) Complex Roots =bDn-1-b2Dn-2

Case (c) Repeated Real Roots

10.3 The Nonhomogeneous Recurrence Relation

10.3 The Nonhomogeneous Recurrence Relation

10.3 The Nonhomogeneous Recurrence Relation peg 1 peg 2 peg 3 n+1 disks move to rule: one disk at a time larger one must not on top of a smaller one

10.3 The Nonhomogeneous Recurrence Relation Ex. 10.25 Pauline takes out a loan of S dollars that is to be paid back in T periods of time. If i is the interest rate per period for the loan, what constant payment P must she make at the end of each period? an:the amount still owed on the loan at the end of the nth period (following the nth payment) Example: S=5,000,000 i=10%/12 T=20 years=240 months P=48251

10.3 The Nonhomogeneous Recurrence Relation Ex. 10.27 The snowflake curve 1 1 1 area:

10.3 The Nonhomogeneous Recurrence Relation Ex. 10.27 The snowflake curve

Summary r=1 1. Linear combinations work. 2. If f(n) contains rn and r is a characteristic root of multiplicity k, then multiply by nk.

10.3 The Nonhomogeneous Recurrence Relation Ex. 10.30 For n>1 suppose that there are n people at a party and that each of these people shakes hands (exactly one time) with all of the other people there (and no one shakes hands with himself or herself). If an counts the total number of handshakes, then an+1=an+n, a2=1, n>1, because when the (n+1)th person arrives, he or she will shake hands with the n other people already arrived.

10.3 The Nonhomogeneous Recurrence Relation

10.4 The Method of Generating Functions

10.4 The Method of Generating Functions

10.4 The Method of Generating Functions

10.5 A Special Kind of Nonlinear Recurrence Relation

10.5 A Special Kind of Nonlinear Recurrence Relation Ex. 10.36 (continued) for n+1 vertices:bn+1 select one as root b0 bn b1 bn-1 bn b0

10.5 A Special Kind of Nonlinear Recurrence Relation Ex. 10.36 (continued)

10.5 A Special Kind of Nonlinear Recurrence Relation Ex. 10.36 (continued)

10.5 A Special Kind of Nonlinear Recurrence Relation Ex. 10.37 Use stacks to permute the ordered list 1,2,...,n. output 1,2,...,n input We can generate 1,2 or 2,1 from 1,2. We can not generate 3,1,2 from 1,2,3. stack Let an count the number of ways to permute 1,2,...,n using this method.

10.5 A Special Kind of Nonlinear Recurrence Relation Ex. 10.37 Use stacks to permute the ordered list 1,2,...,n. Suppose the output list for 1,2,...,n,n+1is: 1 j numbers k numbers j+k=n 0 n 1 n-1 n

Exercise:P423:10 P432,433:1,6 P444: 12 P457: 6