{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assignment1 - Jacob Manske 31 August 2007 Exercise 01 Let f...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
31 August 2007 Jacob Manske Com S 511 - Assignment 1 Exercise 01 Let f , g be asymptotically positive functions such that the limit lim n →∞ f ( n ) g ( n ) exists and is finite. Prove that f O ( g ) . Proof. Since lim n →∞ f ( n ) g ( n ) exists and is finite and f and g are asymptotically positive, c R + ∪ { 0 } such that lim n →∞ f ( n ) g ( n ) = c. Then N such that n N , f ( n ) g ( n ) - c < 1. Then f ( n ) g ( n ) - c < 1, so f ( n ) < ( c + 1) g ( n ) n N . Hence f O ( g ), as desired. Exercise 02 Suppose you have a choice of four algorithms to solve a given problem with the following (approximate) running times as a function of input size n : Algorithm 1: n 4 seconds, Algorithm 2: 30 n 3 seconds, Algorithm 3: 1200 n 2 seconds, Algorithm 4: 60000 n seconds. Specify a range of n for which each of the algorithms is optimal. Solution. To find a range of n for which algorithm i is optimal, we find those n such that the running time for algorithm i is less than the running time for algorithm j j = i .
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}