This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Problem 1 a) 100n + log n = Q (n+(log n)^2) The n term dominates here, and at a large enough n the log n terms are not relevant. b) log n = Q (log(n 2 )) log(n 2 ) = 2 log n by the properties of logs So log n <= 2 log n and vice versa, so this relation is theta. c) n 2 /logn = W (n (log n) 2 ) n 2 /log n >= c(n (log n) 2 ) n 2 >= c(n (log n) 3 ) n*n>=cn(log n) 3 Clearly, (log n) 3 grows more slowly than n. However, n 2 /logn ∫ Q (n (log n) 2 ) d) ( log n) log n = W (n/log n) (log n) log n >c 2 log n for any n>4 2 log n = n log n log n > 2 log n = n>n/log n However, (log n) log n ∫ Q (n/log n) e) n 1/2 = W ((log n) 5 ) n 1/2 >= c (log n) 5 //square both sides n >= c(log n) 10 This is true for sufficiently large n. However, n 1/2 ∫ Q ((log n) 5 ) f) n 2 n = O (3 n ) n 2 n <= c 3 n n <= c 3 n / 2 n n<=c(1.5) n This is true as exponential functions increase faster than polynomials. However, n 2 n ∫ Q (3 n ) CSE 413 Homework 2 Solution Guide Problem 2 T(n) = T(n2) + T(2) + a*n T(n) = b if n<=2 ,...
View
Full
Document
This note was uploaded on 01/06/2012 for the course MANAGEMENT 000 taught by Professor 游啟璋 during the Spring '11 term at National Taiwan University.
 Spring '11
 游啟璋

Click to edit the document details