Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "CS 312: Algorithm Analysis Lecture #8: Non-Homogeneous Recurrence Relations This work is licensed under a Creative Commons Attribution-Share Alike 3.0."— Presentation transcript:

1 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.Creative Commons Attribution-Share Alike 3.0 Unported License Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, Sean Warnick

2 Announcements  HW #5: due now  Start Project #2!  Budget enough time  Be sure to keep up in the required reading listed on the schedule in Learning Suite

3 Convex Hull (Proj. #2)

4 Convexity

5

6 Objectives  Big Picture:  Develop a method to analyze recursive divide and conquer algorithms  Work up to a proof of the Master Theorem  Find specific solutions using initial conditions  Understand how to solve non-homogeneous, linear, recurrence relations with constant coefficients  Having geometric forcing functions

7 Example (cont.): Linear, Homogeneous Recurrence Relation

8 General Solution: Linear Combinations

9 Starting things off

10 Finding the Specific Solution

11 Specific Solution: One point

12 Fibonacci in Closed Form!

13

14 Fundamental Theorem of Algebra  For every polynomial of degree n, there are exactly n roots.  They may not be unique.

15 Roots of Multiplicity j

16

17

18

19 Example

20

21 CS 312: Algorithm Analysis Remainder of Lecture #8: Non-homogeneous Linear Recurrence Relations

22 Non-Homogeneous, Linear Recurrence Relations

23 Non-Homogeneous Example What do you notice about the problem now?

24 Non-Homogeneous Example What do you notice about the problem now?

25 Example (Cont.)

26

27 Coincidence?

28

29

30 Possible Update  Point out existence of homog. RR for every non-homog. RR.  Notation: Use y(k) (homog.) instead of z(k) (non-homog.) to emphasize the difference.

31 Initial Conditions

32

33 Example (cont.)

34

35 Towers of Hanoi Revisited Exercise on HW #6

36 Assignment  Read: Recurrence Relations Notes  HW #6:  Part II Exercises (Section 2.2)  Towers of Hanoi using method of recurrence relations.

37 Extra Slides

38 Possible DC Solution: Step 1  Given set of n points  Divide into two subsets  L containing the leftmost points  R containing the rightmost points  All points with same x coordinate  Assign to the same subset  Even if this makes the division not exactly into halves

39 Possible DC Solution: Step 2 Compute the convex hulls of L and R recursively

40 Possible DC Solution: Step 3  Combine the left hull CH(L) and the right hull CH(R):  Find the two edges known as the upper and lower common tangents (shown in red)  Common tangent: a line segment in the exterior of both polygons intersecting each polygon at a single vertex or a single edge.  The line containing the common tangent does not intersect the interior of either polygon

41 Possible DC Solution: Tips  Find the upper common tangent:  Scan around the left hull in a clockwise direction and around the right hull in a counter-clockwise direction  Come up with the details of finding the common tangents – hints available in the guidelines document  The tangents divide each hull into two pieces  Delete the right edges belonging to the left hull and the left edges belonging to the right hull


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

Similar presentations


Ads by Google