hw01_sol

# hw01_sol - CS170 Spring 2010 HW1 Solutions 1(DPV 0.1 a n...

This preview shows pages 1–3. Sign up to view the full content.

CS170 - Spring 2010 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

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

View Full Document
p) (log n ) log n = O (2 (log 2 n ) 2 ) (log n ) log n = 2 log 2 (log n ) log n = 2 log n · log 2 (log n ) , and since log n · log(log n ) = O ((log n ) 2 ) we get the result. q) n i =1 i k = Θ( n k +1 ) Since n i =1 i k < n · n k = n k +1 we have n i =1 i k = O ( n k +1 ). We notice that ( n 2 ) · ( n 2 ) k < n i =1 i k since half of the elements being added in the summation are larger or equal than ( n 2 ) .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern