Homework 1 (Due September 8 in Class) No Late Submissions
Homework 1 (Due September 8 in Class) No Late Submissions
Fall 2011
1. 2.
Find an exact solution to the following recurrence: 2 an = 2an1 + 3an2 + n 2n + 5, with a0 = a1 = 1 3 Sort the following 8 functions from asymptotically smallest to asymptotically largest, indicating ties if there are any. You do not need to turn in proofs (in fact, please dont turn in proofs), but you should do them anyway just for practice. 1 n2 lg n n!
nlg n (lg n)n (lg n)lg n e + O(1/n) To simplify notation, write f (n) g(n) to mean f (n) = o(g(n)) and f (n) g(n) to mean f (n) = (g(n)). For example, the functions n2 , n, n , n3 could be sorted either 2 n as n n2 n n3 or as n n2 n3 2 2
3. 4. 5.
The running time of an algorithm A is described by the recurrence T (n) = 7T ( n ) + n2 . 2 A competing algorithm A has a running time of T (n) = aT ( n ) + n2 . What is the 4 largerst integer value for a such that A is asymptotically faster than A? Suppose you are given three n-element sets A, B, and C Describe an O(n log n)-time algorithm1 for computing a A B C. Extra Credit Problem. (a) Prove that the operators (E a)(E b) and E2 (a + b)E + ab have the same eect on every sequence. (b) Prove that if f = (h) and g = (h) then f + g = (h).
Since youve read the Homework Guidelines, you know what the phrase describe and algorithm means. Right?
1-1