CS300-02_Algorithm_Analysis - Lower Bounds and the...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lower Bounds and the Complexity of Problems P 1: Given n numbers, read them and print them in the reverse order. Can you solve this problem in less than c n time ? P 2: Given two polygons with n vertices, construct its intersection. Can you solve this problem in less than c n 2 time ? Well, … O( n 2 ) points
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 P 3: Given an array L containing n entries sorted in ascending order and given a value x , find an index of x in the list or return 0 as the answer if x is not in the list. Can you find any lower bound in time complexity for solving P 3 ? c log n Definition : (tight worst-case) Lower bound A lower bound in time complexity of a problem is the least amount of time to solve the most difficult instance of the problem. Trivial lower bound input / output Non-trivial lower bound hard to obtain
Background image of page 2
3 How to Obtain a Lower Bound P : Given a list of n numbers, find the largest one. P’ : Given a list of n distinct numbers, find the largest one. A lower bound for P ’ is also a lower bound for P . (although it may not be tight) P P
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 What is a lower bound for P ’ ? (1) Trivial lower bound: c n, c > 0 Why ? (2) Winner / loser argument 1 loser / comparison To determine the largest one, n - 1 losers must be set aside. ( n - 1) comparisons are required. (3) (By adversary argument) Fewer than n-1 comparisons Two non-losers including the winner Contradiction Why ? L ( P ’) = c n Since P P , L ( P ) = c n
Background image of page 4
5 Finding a Lower Bound Direct method Examining the size of an input / output Finding a lower bound for an instance of a problem Decision tree Indirect method Via reducibility (transformability) Note: There are many other ways.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
P : Given input (problem instance) I , find a solution for I . D : Given input I and object S , is S a solution for I ? P optimization problem D decision problem S is a solution S satisfies C 6 = =
Background image of page 6
7 P is solved D is solved Is the converse also true ? No !!! D P However, D is not more difficult than P .
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 26

CS300-02_Algorithm_Analysis - Lower Bounds and the...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online