hw01_sol

hw01_sol - CS170 - Spring 2010 HW1 - Solutions Jan 28, 2010...

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

View Full Document Right Arrow Icon
HW1 - Solutions Jan 28, 2010 1. (DPV 0.1) a) n - 100 = Θ( n - 200) n = Θ( n ) - 100 = Θ(1) - 200 = Θ(1) b) n 1 / 2 = O ( n 2 / 3 ) lim n →∞ n 1 / 2 n 2 / 3 = lim n →∞ 1 n 1 / 6 = 0 c) 100 n + log n = Θ( n + (log n ) 2 ) lim n →∞ 100 n +log n n +(log n ) 2 = lim n →∞ 100+ 1 n 1+2 · log n · 1 n = lim n →∞ 100 1+2 1 n = 100 We used here l’Hopital’s rule twice to take derivatives. d) n log n = Θ(10 n log(10 n )) e) log(2 n ) = Θ(log(3 n )) f) 10log n = Θ(log( n 2 )) g) n 1 . 01 = Ω( n log 2 n ) lim n →∞ n log 2 n n 1 . 01 = lim n →∞ log 2 n n 0 . 01 = lim n →∞ 2 · log n · 1 n 0 . 01 · n - 0 . 99 = lim n →∞ 2 · log n 0 . 01 · n 0 . 01 = lim n →∞ 2 · 1 n 0 . 01 2 · n - 0 . 99 = 0 We used here l’Hopital’s rule twice to take derivatives. h) n 2 / log n = Ω( n (log n ) 2 ) i) n 0 . 1 = Ω((log n ) 10 ) j) (log n ) log n = Ω( n/ log n ) We calculate lim n →∞ log( f ( n ) /g ( n )) and conclude from that about lim n →∞ ( f ( n ) /g ( n )). log( f ( n ) /g ( n )) = log ± (log n ) log n n/ log n ² = log n · log(log n ) - (log n - log(log n )) = log n · (log(log n ) - 1) + log(log n ) And it’s easy to see that lim n →∞ log n · (log(log n ) - 1) + log(log n ) = , from which we can conclude that lim n →∞ log( f ( n ) /g ( n )) = k) n = Ω((log n ) 3 ) l) n 1 / 2 = O (5 log 2 n ) 5 log 2 n = 5 log 5 n log 5 2 = n 1 log 5 2 . We now notice that 1 2 < 1 log 5 2 . m) n 2 n = O (3 n ) We calculate lim n →∞ log( f ( n ) /g ( n )) and conclude from that about lim n →∞ ( f ( n ) /g ( n )). log( f ( n ) /g ( n )) = log n + n log2 - n log3 = log n + (log2 - log3) · n . Since log2 - log3 < 0 the limit goes to -∞ , and so lim n →∞ ( f ( n ) /g ( n )) = 0 n) 2 n = Θ(2 n +1 ) 2 n +1 = 2 · 2 n o) n ! = Ω(2 n ) n ! > ( n 2 ) n 2 = ± n 2 1 2 ² n , and since for n > 8 we have ± n 2 1 2 ² > 2, ± n 2 1 2 ² n = Ω(2 n ) and the result follows. 1
Background image of page 1

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

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

Page1 / 5

hw01_sol - CS170 - Spring 2010 HW1 - Solutions Jan 28, 2010...

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

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