 |
|
Assignment 2
|
Due: Wednesday, April 17th (new due date)
Write up solutions to each of the following problems:
- Prove the following, using the definition of Q (Theta):
- n3-7n + 12 = Q(n3
).
- 11n2-32n+14 = Q(n2
).
- Using the definition of big-O, prove that f(n) + g(n) =
O(max(f(n), g(n)). Make no assumptions about the
functions f and g.
- Suppose you have 12 coins that are all supposed to be gold coins of the same weight, but
you know that one coin is fake and weighs less than the others. You have a balance scale
on which you can put any number of coins on each side. It will indicate whether the
two sides are the same or whether one side is lighter than the other. Outline an
algorithm for finding the fake coin. How many times must you use the scale to find the
fake coin? Generalize this to the case where you have n coins.
- Problem 2.3-7 (p. 37 in CLRS).


