CSCI 3104 - Algorithms - Fall 2010

Problem Set #1

Due: Mon, Aug 30th

1. In each of the following situations, indicate whether f = O(g), or f = Omega(g), or both (in which case f = Theta(g)).
(a) f(n) = n1.01, g(n) = n (lg n)2
(b) f(n) = lg n, g(n) = ln n
(c) f(n) = nn, g(n) = n!

2. The text spends a lot of time talking about fib(200). Compute this number exactly. (Hint: python has arbitrary-precision arithmetic... you can learn enough python in about 15 mins to solve this problem.)

3. Look up the "golden ratio" online. Call this number φ. Using your favorite multi-precision calculator (python works again), compute φ200/sqrt(5) rounded to the nearest integer. Compare the efficiency of this method to the method of problem 2. (Think about how Python must be internally computing its exponentiation function.)

4. As we said in class, if lim n → ∞ f(n)/g(n) is constant, then f(n) = O(g(n)). Show that the converse is false. In other words, give some f(n) and g(n) where f(n) = O(g(n)) but the limit of f(n)/g(n) isn't constant. (Hint: choose an f(n) where the limit doesn't exist. Remember to use functions from Z+ to R+ only.)

5. I mentioned in class that n.01 grows faster than lg n and that the proof takes the limit, requiring l'Hôpital's rule. Let's use a simpler approach: set n=2100k and simplify. What's the smallest integer k such that n.01 is larger than lg n? How do we know that n.01 will remain larger forever after?