Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I understand that $f(n) \leq Ng(n)$ and $g(n) \leq Nh(n)$ so obviously $f(n) \leq Nh(n)$, but how would one go about proving this using proper semantics (using big $O$ notation)?

share|improve this question
    
"obviously $f(n) \leq Nh(n)$": That's not quite right. –  TonyK Dec 11 '11 at 10:20
add comment

1 Answer

Well, when $f(n)$ is $O(g(n))$, you should have an associated constant $K_f$ and some $N_f$. Then, when $g(n)$ is $O(h(n))$, you have an associated constant $K_h$ and some $N_h$.

Take the larger of the two $N$ (or their sum, or their product, etc) and take $K_f K_h$ to be the new constant. This will give you the asymptotic $n$ and $k$ so that $f(n) < kh(n)$ for all sufficiently large $n$.

share|improve this answer
    
something like this then? f(n) = O(g(n)) f(n) <= N(g(n) g(n) = O(h(n)) g(n) <= N1(h(n)) so f(n) <= N(g(n)) and g(n) <= N1(h(n)) f(n) <= N(g(n)) <= N1*N(h(n)) –  Doug Masters Dec 11 '11 at 3:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.