cs 312: algorithm analysis lecture #8: non-homogeneous recurrence relations this work is licensed...

24
CS 312: Algorithm Analysis Lecture #8: Non- Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License . by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, Sean Warn

Upload: walter-bradley

Post on 01-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

CS 312: Algorithm Analysis

Lecture #8: Non-Homogeneous Recurrence Relations

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, Sean Warnick

Page 2: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Announcements

HW #5 Due Today Questions about Homogeneous RR?

Project #2 Questions about the project? Early Day: Wednesday Due Date: next Friday!

Page 3: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Objectives

Find specific solutions using initial conditions

Understand how to solvenon-homogeneous, linear, recurrence relations with constant coefficients Geometric forcing functions

Define roots of multiplicity j

Page 4: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Example (cont.): Linear, HomogeneousRecurrence Relation

Page 5: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Finding the Specific Solution

Page 6: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Linear Combinations

Page 7: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Fibonacci in Closed Form!

Page 8: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Fundamental Theorem of Algebra

For every polynomial of degree n, there are exactly n roots.

They may not be unique.

Page 9: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Roots of Multiplicity j

Page 10: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Roots of Multiplicity j

Page 11: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Roots of Multiplicity j

Page 12: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Roots of Multiplicity j

Page 13: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Example

Page 14: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Non-Homogeneous, LinearRecurrence Relations

Page 15: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Non-Homogeneous Example

What do you notice about the problem now?

Page 16: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Example (Cont.)

Page 17: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0
Page 18: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0
Page 19: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Initial Conditions

Page 20: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Initial Conditions

Page 21: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Example (cont.)

Page 22: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Example (cont.)

Page 23: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Towers of Hanoi Revisited

Page 24: CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0

Assignment

Read: Recurrence Relations Notes, Parts III & IV

HW #6: Part II Exercises (Section 2.2) Towers of Hanoi using method of recurrence

relations.