Show that if f1 is O(f2) and f2 is O(g), then f1 is O(g). I did the following: Using the definition of big-Oh, we need to show that there exist n_0 and C such that f1 ≤ Cf2 is valid for some constant C > 0 and for all n >= n0. Similarly, f2 ≤ C1g. What should I do in the further step to verify it correctly
Asked
Active
Viewed 310 times
1 Answers
2
Your first step is wrong. You don't need to show that the antecedent holds, you assume that it holds. Then from your two assumptions, show that the conclusion holds. So the proof roughly goes like this (I won't give you the details since I assume it's a homework assignment):
Expand the definitions for your two assumptions (as you've already done). Now you should have four existentially quantified variables n0, n1, C1, and C2.
Combine your two assumptions by finding existentially quantified variables n3 and C3 such that both assumptions hold under these variables. (You need to constructively show that n3 and C3 exist, based on your assumptions.)
Use the chain of inequalities and the transitivity of ≤ to derive your conclusion.

Mo B.
- 5,307
- 3
- 25
- 42