4.7 Recurrence Relations P13, P100

Slides:



Advertisements
Similar presentations
Partial Orderings Section 8.6.
Advertisements

Advanced Counting Techniques
Chapter Recurrence Relations
Relations Relations on a Set. Properties of Relations.
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
Chapter Recurrence Relations
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.
ⅠIntroduction to Set Theory 1. Sets and Subsets
Applied Discrete Mathematics Week 9: Relations
Advanced Counting Techniques
Exam 2 Review 8.2, 8.5, 8.6, Thm. 1 for 2 roots, Thm. 2 for 1 root Theorem 1: Let c 1, c 2 be elements of the real numbers. Suppose r 2 -c 1.
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.
 期中测验时间:  11 月 4 日  课件 集合,关系,函数,基数, 组合数学.  Ⅰ Introduction to Set Theory  1. Sets and Subsets  Representation of set:  Listing elements, Set builder.
4.6.2 Exponential generating functions
Chapter 8 With Question/Answer Animations 1. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
Recurrence Relation. Outline  What is a recurrence relation ?  Solving linear recurrence relations  Divide-and-conquer algorithms and recurrence relations.
CSE 2813 Discrete Structures Recurrence Relations Section 6.1.
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.
CSCI 115 Chapter 3 Counting. CSCI 115 §3.1 Permutations.
Chapter 2 Mathematical preliminaries 2.1 Set, Relation and Functions 2.2 Proof Methods 2.3 Logarithms 2.4 Floor and Ceiling Functions 2.5 Factorial and.
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.
Chapter 8 With Question/Answer Animations. Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence.
 期中测验时间:  10 月 31 日上午 9 : 40—11 : 30  第一到第四章  即,集合,关系,函数,组合数学.
 Ⅰ Introduction to Set Theory  1. Sets and Subsets  Representation of set:  Listing elements, Set builder notion, Recursive definition  , ,  
after UCI ICS/Math 6A, Summer AdvancedCounting -1 Recurrence Relations (RRs) A “Recurrence Relation”
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.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
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
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
RECURRENCE Sequence Recursively defined sequence
1 RECURRENCE 1. Sequence 2. Recursively defined sequence 3. Finding an explicit formula for recurrence relation.
Advanced Algorithms Analysis and Design
Mathematical Analysis of Recursive Algorithm CSG3F3 Lecture 7.
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
CSG523/ Desain dan Analisis Algoritma
Review: Discrete Mathematics and Its Applications
CMSC Discrete Structures
Advanced Counting Techniques
CSE 2813 Discrete Structures
Modeling with Recurrence Relations
Introduction to Recurrence Relations
UNIT-6 Recurrence Relations
Recurrence Relations.
Module #17: Recurrence Relations
4.6.2 Exponential generating functions
Module #17: Recurrence Relations
Review: Discrete Mathematics and Its Applications
Recursion and Recurrence Relations
CMSC Discrete Structures
Solving Recurrence Relations
ⅠIntroduction to Set Theory 1. Sets and Subsets
CMSC Discrete Structures
Recurrence Relations Discrete Structures.
Chapter 7 Advanced Counting Techniques
Recurrence Relations (RRs)
Recurrence Relations Rosen 5th ed., §6.2 5/22/2019
ICS 253: Discrete Structures I
Presentation transcript:

4.7 Recurrence Relations P13, P100 Definition: A recurrence relation for the sequence{an} is an equation that expresses an in terms of one or more of the previous terms of the sequence, namely, a0, a1, …, an-1, for all integers n with nn0, where n0 is a nonnegative integer. A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation. Initial condition: the information about the beginning of the sequence.

Example(Fibonacci sequence): A young pair rabbits (one of each sex) is placed in enclosure. A pair rabbits dose not breed until they are 2 months old, each pair of rabbits produces another pair each month. Find a recurrence relation for the number of pairs of rabbits in the enclosure after n months, assuming that no rabbits ever die. Solution: Let Fn be the number of pairs of rabbits after n months, (1)Born during month n (2)Present in month n-1 Fn=Fn-2+Fn-1,F1=F2=1

Example (The Tower of Hanoi): There are three pegs and n circular disks of increasing size on one peg, with the largest disk on the bottom. These disks are to be transferred, one at a time, onto another of the pegs, with the provision that at no time is one allowed to place a larger disk on top of a smaller one. The problem is to determine the number of moves necessary for the transfer. Solution: Let h(n) denote the number of moves needed to solve the Tower of Hanoi problem with n disks. h(1)=1 (1)We must first transfer the top n-1 disks to a peg (2)Then we transfer the largest disk to the vacant peg (3)Lastly, we transfer the n-1 disks to the peg which contains the largest disk. h(n)=2h(n-1)+1, h(1)=1

Using Characteristic roots to solve recurrence relations Using Generating functions to solve recurrence relations

4.7.1 Using Characteristic roots to solve recurrence relations Definition: A linear homogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form an=h1an-1+h2an-2+…+hkan-k, where hi are constants for all i=1,2,…,k,n≥k, and hk≠0. Definition: A linear nonhomogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form an=h1an-1+h2an-2+…+hkan-k+f(n), where hi are constants for all i=1,2,…,k,n≥k, and hk≠0.

Definition: The equation xk-h1xk-1-h2xk-2-…-hk=0 is called the characteristic equation of the recurrence relation an=h1an-1+h2an-2+…+hkan-k. The solutions q1,q2,…,qk of this equation are called the characteristic root of the recurrence relation, where qi(i=1,2,…,k) is complex number. Theorem 4.18: Suppose that the characteristic equation has k distinct roots q1,q2,…,qk. Then the general solution of the recurrence relation is an=c1q1n+c2q2n+…+ckqkn, where c1,c2,…ck are constants.

Example: Solve the recurrence relation an=2an-1+2an-2,(n≥2) subject to the initial values a1=3 and a2=8. characteristic equation : x2-2x-2=0, roots: q1=1+31/2,q2=1-31/2。 the general solution of the recurrence relation is an=c1(1+31/2)n+c2(1-31/2)n, We want to determine c1 and c2 so that the initial values c1(1+31/2)+c2(1-31/2)=3, c1(1+31/2)2+c2(1-31/2)2=8

Theorem 4.19: Suppose that the characteristic equation has t distinct roots q1,q2,…,qt with multiplicities m1,m2,…,mt, respectively, so that mi≥1 for i=1,2,…,t and m1+m2+…+mt=k. Then the general solution of the recurrence relation is where cij are constants for 1≤j≤mi and 1≤i≤t.

Example: Solve the recurrence relation an+an-1-3an-2-5an-3-2an-4=0,n≥4 subject to the initial values a0=1,a1=a2=0, and a3=2. characteristic equation x4+x3-3x2-5x-2=0, roots:-1,-1,-1,2 By Theorem 4.19:the general solution of the recurrence relation is an=c11(-1)n+c12n(-1)n+c13n2(-1)n+c212n We want to determine cij so that the initial values c11+c21=1 -c11-c12-c13+c21=0 c11+2c12+4c13+4c21=0 -c11-3c12-9c13+8c21=2 c11=7/9,c12=-13/16,c13=1/16,c21=1/8 an=7/9(-1)n-(13/16)n(-1)n+(1/16)n2(-1)n+(1/8)2n

the general solution of the linear nonhomogeneous recurrence relation of degree k with constant coefficients is an=a'n+a n* a'n is the general solution of the linear homogeneous recurrence relation of degree k with constant coefficients an=h1an-1+h2an-2+…+hkan-k a n*is a particular solution of the nonhomogeneous linear recurrence relation with constant coefficients an=h1an-1+h2an-2+…+hkan-k+f(n)

Theorem 4.20: If {a n*} is a particular solution of the nonhomogeneous linear recurrence relation with constant coefficients an=h1an-1+h2an-2+…+hkan-k+f(n), then every solution is of the form {a'n+a n*}, where {a n*} is a general solution of the associated homogeneous recurrence relation an=h1an-1+h2an-2+…+hkan-k. Key:a n*

(1)When f(n) is a polynomial in n of degree t, a n*=P1nt+P2nt-1+…+Ptn+Pt+1 where P1,P2,…,Pt,Pt+1 are constant coefficients (2)When f(n) is a power function with constant coefficient n, if  is not a characteristic root of the associated homogeneous recurrence relation, a n*= Pn , where P is a constant coefficient. if  is a characteristic root of the associated homogeneous recurrence relation with multiplicities m, a n*= Pnmn ,where P is a constant coefficient.

Example: Find all solutions of the recurrence relation h(n)=2h(n-1)+1, n2, h(1)=1 an=an-1+7n,n1, a0=1 If let an*=P1n+P2, P1n+P2-P1(n-1)-P2=7n P1=7n, Contradiction let an*=P1n2+P2n

4.7.2 Using Generating functions to solve recurrence relations Example: Solve the recurrence relation an=an-1+9an-2-9an-3,n≥3 subject to the initial values a0=0, a1=1, a2=2

Example: Solve the recurrence relation : an=an-1+9an-2-9an-3,n≥3 subject to the initial values a0=0, a1=1, a2=2 Solution: Let Generating functions of {an} be: f(x)=a0+a1x+a2x2+…+anxn+… , then: -xf(x) =-a0x-a1x2-a2x3…-anxn+1-… -9x2f(x) = -9a0x2-9a1x3-9a2x4-…-9an-2xn-… 9x3f(x) = 9a0x3+9a1x4+…+9an-3xn+… (1-x-9x2+9x3)f(x)=a0+(a1-a0)x+(a2-a1-9a0)x2+ (a3-a2-9a1+9a0)x3+…+(an-an-1-9an-2+9an-3)xn+… a0=0,a1=1, a2=2,and when n≥3,an-an-1-9an-2+9an-3=0, (an=an-1+9an-2-9an-3) thus: (1-x-9x2+9x3)f(x)=x+x2 f(x)=(x+x2)/(1-x-9x2+9x3) =(x+x2)/((1-x)(1+3x)(1-3x)) 1/(1-x)=1+x+x2+…+xn+…; 1/(1+3x)=1-3x+32x2-…+(-1)n3nxn+… 1/(1-3x)=1+3x+32x2+…+3nxn+…;

Example: Find an explicit formula for the Fibonacci numbers, Fn=Fn-2+Fn-1, F1=F2=1。 Solution: Let Generating functions of {Fn} be: f(x)=F0+F1x+F2x2+…+Fnxn+…,then: -xf(x) =-F0x-F1x2-F2x3…-Fnxn+1-… -x2f(x) =-F0x2-F1x3-F2x4-…-Fn-2xn-… (1-x-x2)f(x)=F1x+(F2-F1)x2+(F3-F2-F1)x3+(F4-F3-F2)x4+…+(Fn-Fn-1-Fn-2)xn+… F1=1, F2=1,and when n≥3,Fn-Fn-1-Fn-2=0, (Fn=Fn-1+Fn-2) thus: (1-x-x2)f(x)=x f(x)=x/(1-x-x2) Fn-10.618Fn。 golden section黄金分割。

期中测验时间: 11月3日 课件 集合,关系,函数,基数,组合数学

ⅠIntroduction to Set Theory 1. Sets and Subsets Representation of set: Listing elements, Set builder notion, Recursive definition , ,  P(A) 2. Operations on Sets Operations and their Properties A=?B AB, and B A Or Properties Theorems, examples, and exercises

3. Relations and Properties of relations reflexive ,irreflexive symmetric , asymmetric ,antisymmetric Transitive Closures of Relations r(R),s(R),t(R)=? Theorems, examples, and exercises 4. Operations on Relations Inverse relation, Composition

5. Equivalence Relation and Partial order relations equivalence class Partial order relations and Hasse Diagrams Extremal elements of partially ordered sets: maximal element, minimal element greatest element, least element upper bound, lower bound least upper bound, greatest lower bound Theorems, examples, and exercises

Cardinality, 0. 6.Everywhere Functions one to one, onto, one-to-one correspondence Composite functions and Inverse functions Cardinality, 0. Theorems, examples, and exercises

II Combinatorics 1. Pigeonhole principle Pigeon and pigeonholes example,exercise

2. Permutations and Combinations Permutations of sets, Combinations of sets circular permutation Permutations and Combinations of multisets Formulae inclusion-exclusion principle generating functions integral solutions of the equation

3. recurrence relation Applications of Inclusion-Exclusion principle example,exercise Applications generating functions and Exponential generating functions ex=1+x+x2/2!+…+xn/n!+…; x+x2/2!+…+xn/n!+…=ex-1; e-x=1-x+x2/2!+…+(-1)nxn/n!+…; 1+x2/2!+…+x2n/(2n)!+…=(ex+e-x)/2; x+x3/3!+…+x2n+1/(2n+1)!+…=(ex-e-x)/2; examples, and exercises 3. recurrence relation Using Characteristic roots to solve recurrence relations Using Generating functions to solve recurrence relations

Next: Graph theory P115,4.2;P123 4.3;P290 8.1

Exercise P104 18,20,23,Note: By Characteristic roots, solve recurrence relations 23 and By Generating functions, solve recurrence relations 18,20. 1.a)Find a recurrence relation for the number of ways to climb n stairs if the person climbing the stairs can take one stair or two stairs at a time. b) What are the initial conditions? 2.a) Find a recurrence relation for the number of ternary strings that do not contain two consecutive 0s.