csl202 discrete mathematical structures
play

CSL202: Discrete Mathematical Structures Ragesh Jaiswal, CSE, IIT - PowerPoint PPT Presentation

CSL202: Discrete Mathematical Structures Ragesh Jaiswal, CSE, IIT Delhi Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures Advanced Counting Techniques Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical


  1. CSL202: Discrete Mathematical Structures Ragesh Jaiswal, CSE, IIT Delhi Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  2. Advanced Counting Techniques Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  3. Advanced Counting Techniques Recurrence relations Tower of Hanoi: Let H n denote the number of moves needed to solve the Tower of Hanoi problem with n disks. Set up a recurrence relation for the sequence { H n } . Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  4. Advanced Counting Techniques Recurrence relations Find a recurrence relation and give initial conditions for the number of bit strings of length n that do not have two consecutive 0s. How many such bit strings are there of length five? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  5. Advanced Counting Techniques Recurrence relations Dynamic Programming: This is an algorithmic technique where a problem is recursively broken down into simpler overlapping subproblems, and the solution is computed using the solutions of the subproblems. Problem: Given a sequence of integers, find the length of the longest increasing subsequence of the given sequence. Example: The longest increasing subsequence of the sequence (7 , 2 , 8 , 10 , 3 , 6 , 9 , 7) is (2 , 3 , 6 , 7) and its length is 4. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  6. Advanced Counting Techniques Solving recurrence relations Definition (Linear homogeneous recurrence) 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. Linear means that that RHS is a sum of linear terms of the previous elements of the sequence. a n = a n − 1 + a n − 2 is a linear recurrence relation whereas a n = a n − 1 + a 2 n − 2 is not. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  7. Advanced Counting Techniques Solving recurrence relations Definition (Linear homogeneous recurrence) 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. Linear means that that RHS is a sum of linear terms of the previous elements of the sequence. Homogeneous means that there are no terms in the RHS that are not multiples of a j ’s. a n = a n − 1 + a n − 2 is homogeneous whereas a n = a n − 1 + a n − 2 + 2 is not. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  8. Advanced Counting Techniques Solving recurrence relations Definition (Linear homogeneous recurrence) 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. Linear means that that RHS is a sum of linear terms of the previous elements of the sequence. Homogeneous means that there are no terms in the RHS that are not multiples of a j ’s. The coefficients of all the terms on the RHS are constants. The degree is k since a n is expressed as the previous k terms of the sequence. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  9. Advanced Counting Techniques Solving recurrence relations Definition (Linear homogeneous recurrence) 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. a n = r n is a solution of the recurrence if and only if r k − c 1 r k − 1 − ... − c k = 0 . (1) (1) is called the characteristic equation of the recurrence relation. The solutions of the characteristic equation are called the characteristic roots of the recurrence relation. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  10. Advanced Counting Techniques Solving recurrence relations Theorem Let c 1 and c 2 be real numbers. Suppose 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 of the linear homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 if and only if a n = α 1 r n 1 + α 2 r n 2 for all n = 0 , 1 , 2 , ... , where α 1 and α 2 are constants. Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  11. Advanced Counting Techniques Solving recurrence relations Theorem Let c 1 and c 2 be real numbers. Suppose 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 of the linear homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 if and only if a n = α 1 r n 1 + α 2 r n 2 for all n = 0 , 1 , 2 , ... , where α 1 and α 2 are constants. What is the solution of the recurrence relation a n = a n − 1 + 2 · a n − 2 with a 0 = 2 and a 1 = 7? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  12. Advanced Counting Techniques Solving recurrence relations Theorem Let c 1 and c 2 be real numbers. Suppose 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 of the linear homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 if and only if a n = α 1 r n 1 + α 2 r n 2 for all n = 0 , 1 , 2 , ... , where α 1 and α 2 are constants. Theorem Let c 1 and c 2 be real numbers with c 2 � = 0 . Suppose that r 2 − c 1 r − c 2 = 0 has only one root r 0 . A sequence { a n } is a solution of the recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 if and only if a n = α 1 r n 0 + α 2 nr n 0 , for n = 0 , 1 , 2 , ... , where α 1 and α 2 are constants. What is the solution of the recurrence relation a n = 6 a n − 1 − 9 · a n − 2 with a 0 = 1 and a 1 = 6? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  13. Advanced Counting Techniques Solving recurrence relations Theorem Let c 1 , c 2 , ..., c k be real numbers. Consider the linear homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 + ... + c k a n − k . Suppose the characteristic equation of the recurrence relation has k distinct characteristic roots r 1 , r 2 , ..., r k . Then { a n } is a solution of the recurrence relation if and only if a n = α 1 r n 1 + α 2 r n 2 + ... + α k r n k for n = 0 , 1 , 2 , ... , where α 1 , α 2 , ..., α k are constants. What is the solution of the recurrence relation a n = 6 a n − 1 − 11 · a n − 2 + 6 a n − 3 with a 0 = 2, a 1 = 5, and a 2 = 15? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  14. Advanced Counting Techniques Solving recurrence relations Theorem Let c 1 , c 2 , ..., c k be real numbers. Consider the linear homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 + ... + c k a n − k . Suppose the characteristic equation of the recurrence relation has t ≤ k distinct characteristic roots r 1 , r 2 , ..., r t with multiplicities m 1 , m 2 , ..., m t , respectively, so that m i ≥ 1 for i = 1 , 2 , ..., t and m 1 + m 2 + ... + m t = k. Then { a n } is a solution of the recurrence relation if and only if ( α 1 , 0 + α 1 , 1 n + ... + α 1 , m 1 − 1 n m 1 − 1 ) r n a n = 1 +( α 2 , 0 + α 2 , 1 n + ... + α 2 , m 2 − 1 n m 2 − 1 ) r n 2 + ... + ( α t , 0 + α t , 1 n + ... + α t , m t − 1 n m t − 1 ) r n t for n = 0 , 1 , 2 , ... , where α i , j are constants for 1 ≤ i ≤ t and 0 ≤ j ≤ m i − 1 . What is the solution of the recurrence relation a n = − 3 a n − 1 − 3 · a n − 2 − a n − 3 with a 0 = 1, a 1 = − 2, and a 2 = − 1? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  15. Advanced Counting Techniques Solving recurrence relations A linear non-homogeneous recurrence relation with constant coefficients is a recurrence of the form: a n = c 1 a n − 1 + c 2 a n − 2 + ... + c k a n − k + F ( n ) , where F ( n ) is a function not identically equal to zero and 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 . Theorem If { a ( p ) n } is a particular solution of the non-homogeneous 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 ( p ) + a ( h ) n } , where { a ( h ) n } is a n solution of the associated homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 + ... + c k a n − k . Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

  16. Advanced Counting Techniques Solving recurrence relations Theorem If { a ( p ) n } is a particular solution of the non-homogeneous 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 ( p ) + a ( h ) n } , where { a ( h ) n } is a n solution of the associated homogeneous recurrence relation a n = c 1 a n − 1 + c 2 a n − 2 + ... + c k a n − k . Find all solutions of the recurrence relation a n = 3 a n − 1 + 2 n . What is the solution with a 1 = 3? Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend