hw1 - 4 Solve the following recurrences by giving an exact...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 1 Due: Tuesday, Feb. 9 1. Rank the following 6 functions by order of growth into a sequence f 1 , f 2 , . . . , f 6 such that f i = O ( f i +1 ) for i = 1 , 2 , . . . , 5. Please indicate the case where f i = Θ ( f i +1 ). In either case, please briefly justify your answer: 2 (log 3) n +0 . 1 log n , ( 2) log n , (log n ) log n , 2 2 n , n log log n , 3 n (log n ) 5 2. For each of the following statements, state whether it is true or false. Give proofs or counterex- amples to justify your answer. All functions are assumed to be asymptotically positive. (a) f ( n ) + g ( n ) = Θ (max( f ( n ) , g ( n ))) (b) f ( n ) = Θ ( f ( n - 1)) (c) If f ( n ) = O ( s ( n )) and g ( n ) = O ( r ( n )) then f ( n ) - g ( n ) = O ( s ( n ) - r ( n )). 3. Compute the following sum precisely: S ( n ) = n k =1 log( n/k ) . You can assume that n is a power of 2.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4. Solve the following recurrences by giving an exact closed form solution for T ( n ) if possible or giving an asymptotic upper bound otherwise. (You may assume that n is a power of an integer as you need.) (a) T ( n ) = 2 T ( n/ 2) + log n, T (2) = 1. (b) T ( n ) = 16 T ( n/ 4 + 3) + n 2 , T ( k ) = 1 for k ≤ 4. 5. The input is a set S containing n real numbers, and a real number x . Design an algorithm to determine whether there are two elements of S whose sum is exactly x . The running time of your algorithm should be O ( n log n ) 1...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern