Homework #2

Here are some exercises dealing with the Big-Oh notation. The due date for this homework is Monday, April 12. You will be graded on whether you did the homework. It is in your best interest to do your best. Try to do these problems without consulting your notes. If you cannot, consult your notes, then try again. If you have questions, drop by office hours.

Big-oh exercises

  1. Give the definition of f(n) = O( g(n) ).
  2. Demonstrate, by applying the definition of big-oh, that
    1. n2 = O(n2)
    2. n2 + 1 = O(n2)
    3. k n2 + 1 = O(n2), where k is a positive constant
  3. Demonstrate, by giving appropriate counterexamples, that the following claims are false:
    1. If f(n) = O(g(n)) and f(n) = O(h(n)) then g(n) = h(n).
    2. If f(n) = O(g(n)) and g(n) = O(f(n)) then f(n) = g(n).
  4. Prove, by applying the definition of f(n) = O(g(n)), each of the following:
    1. If f(n) = O(g(n)) and g(n) = O(h(n)) then f(n) = O(h(n)).
    2. If f1(n) = O(g1(n)) and f2(n) = O(g2(n)) then f1(n) f2(n) = O(g1(n)g2(n))

Carl G. Alphonce
Last modified: Wed Feb 25 08:52:19 EST 2004