Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Unit 2 – Combinatorics Recurrence Relation LINEAR NON HOMOGENEOUS RECURRENCE RELATIONS WITH CONSTANT COEFFICIENTS A recurrence relation of the form an= C1an-1 + C2an-2 + ..........+Ckan-k +F(n) ..............(A) Where C1,C2,.....,Cn are real numbers and F(n) is function not identically zero depending only on n , is called a non homogeneous recurrence relation with constant coefficient a n = C1an-1 + C2an-2 + ..........+Ckan-k +F(n) ................(B) Is called associated homogenous recurrence relation. PROCEDURE TO SOLVE NON HOMOGENEOUS RECURRENCE RELATION The solution of non homogeneous recurrence relations is the sum of two solutions. 1. Solutions of associated homogeneous recurrence relations (RHS = 0) 2. Particular solution depending on the RHS of the given recurrence relation. Step 1: (a) If the RHS of the recurrence relation is a a n .... ar nr then substitute 0 c0 c1 n c2n2 .... cr nr in place of an place of an 1 1 c0 c1 (n 1) c2 (n 1)2 .... cr (n 1)r in ...... in the LHS of the given recurrence relation. (b) If the RHS is an then we have Case 1: If the base a of RHS is the characteristic root ,then the solution is of the cna n . Therefore substitute cna n in place of an , c(n 1)a n1 in place of an 1 etc. Case 2: If the base a of RHS is not a root, then solution if of the form ca n . Therefore substitute ca n in place of an , ca n 1 in place of an 1 etc. SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS Page 1 Unit 2 – Combinatorics Recurrence Relation Step 2 : At the end of step -1, we get a polynomial in “n” with coefficients C0,C1,.....,Cn on LHS. Now equating LHS, RHS and compare the coefficients find the constants C0,C1,.....,Cn. PROBLEMS 1. Solve an 3an1 2n an = 3an-1 + 2n with a1 3 Solution: Given the non homogeneous recurrence relation is an 3an1 2n 0 Its associated homogeneous equation is an 3an1 0 Its characteristic equation is r 3 0 , r 3 Now ,the solution of associated homogeneous equation is a ( h ) n 3n To find particular solution Since F(n)=2n is a polynomial of degree one , then the solution is of the form an cn d (say) where c and d are constants. Now the equation an 3an1 2n becomes cn d 3an1 2n becomes cn d 3(c(n 1) d ) 2n cn d 3cn 3c 3d 2n 2cn 2n 3c 2d 0 (2c 2)n (2d 3c) 0 (2c 2) 0, (2d 3c) 0 Solving we get c 1, d 3 2 SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS Page 2 Unit 2 – Combinatorics Recurrence Relation cn d is a solution iff c 1, d an( p ) n General 3 2 3 is a particular solution 2 solution an an( h ) an( p ) an 1 3n n 3 2 .............(A) Given a1 3 . Put n=1 in (A) , we get a1 1 31 1 3 31 31 3 2 5 2 11 11 1 sub in (A), we get 2 6 General solution an n 3n 2 6 3 11 2. Solve S (k ) 5S (k 1) 6S (k 2) 2 with S (0) 1, S (1) 1 Solution : Given the non homogeneous recurrence relation is an 5an1 6an2 2 0 Its associated homogeneous equation is an 5an1 6an2 0 Its characteristic equation is r 2 5r 6 0, r 2,3 The general solution is Sn( h ) 1 (2)n 2 (3) n SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS Page 3 Unit 2 – Combinatorics Recurrence Relation Recurrence Relations Definition A recurrence relation is an equation that recursively defines a sequence where the next term is a function of the previous terms (Expressing Fn as some combination of Fi with i<n). Example: Fibonacci series Fn=Fn-1+Fn-2, Tower of Hanoi – Fn=2Fn-1+1 Linear Recurrence Relations A linear recurrence equation of degree k or order k is a recurrence equation which is in the format xn=A1xn−1+A2xn−2+A3xn−3+…Akxn−k( An is a constant and Ak≠0) on a sequence of numbers as a first-degree polynomial. These are some examples of linear recurrence equations – Recurrence Initial relations values Fn = Fn-1 + Fn- a1 = a2 = Fibonacci 2 1 number Fn = Fn-1 + Fn- a1 = 1, Lucas 2 a2 = 3 Number Fn = Fn-2 + Fn- a1 = a2 = Padovan 3 a3 = 1 SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS Solutions Page 4 Unit 2 – Combinatorics Recurrence Relation sequence Fn = 2Fn-1 + a1 = 0, Fn-2 a2 = 1 Pell number How to solve linear recurrence relation: Suppose, a two ordered linear recurrence relation is Fn=AFn−1+BFn−2 where A and B are real numbers. The characteristic equation for the above recurrence relation is − x2−Ax−B=0 Three cases may occur while finding the roots − Case 1 − If this equation factors as (x−x1)(x−x2)=0 and it produces two distinct real roots x1 and x2, then Fn=a(x1)n+b(x2)n is the solution. [Here, a and b are constants] Case 2 − If this equation factors as (x−x1)2=0 and it produces single real root x1, then Fn= (a+bn)(x1)n is the solution. PROBLEM 1. Solve the recurrence relation Fn=5Fn-1−6Fn-2 where F0=1 and F1=4 Solution The characteristic equation of the recurrence relation is − x2−5x+6=0, So, (x−3)(x−2)=0 Hence, the roots are − x1=3 and x2=2 The roots are real and distinct. So, this is in the form of case 1 Hence, the solution is − Fn=a(x1)n+b(x2)n Here, Fn=a3n+b2n (As x1=3 and x2=2) SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS Page 5 Unit 2 – Combinatorics Recurrence Relation Therefore, 1=F0=a30+b20=a+b 4=F1=a31+b21=3a+2b Solving these two equations, we get a=2 and b=−1 Hence, the final solution is − Fn=2.3n+(−1).2n =2.(3n−2n) 2. Solve the recurrence relation Fn=10Fn-1−25Fn-2 where F0=3 and F1=17 Solution The characteristic equation of the recurrence relation is − X2−10x−25=0 So (x−5)2=0 Hence, there is single real root x1=5 As there is single real valued root, this is in the form of case 2 Hence, the solution is Fn =(a+bn)(x1)n 3=F0= (a+b0)(5)0 17=F1= (a+b1)(5)1 =5a+5b 2 5 Solving these two equations, we get a=3 and b . 2 Hence, the final solution is Fn 3 n 5n SNS COLLEGE OF TECHNOLOGY (AUTONOMOUS) MA204-DISCRETE MATHEMATICS 5 Page 6