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

Info iconThis 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 brie±y 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.
Background 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

Ask a homework question - tutors are online