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.

Prove that if $f(n) \in \mathcal{O}(h(n))$ and $g(n) \in \mathcal{O}(h(n))$ then $f(n) + g(n) \in \mathcal{O}(h(n))$.

I know that $\mathcal{O}(g(n))=\{f\space | \space\exists c\in\mathbb{R}^{+},\exists n_{0} \in \mathbb{N},\forall n\geq n_{0} : f(n)\leq c\cdot g(n)\}$

However, what do I do with this information to obtain the proof?

share|improve this question
add comment

1 Answer

Hint: Let $f(n)<k_1 h(n)$ for all $n>n_1$ and $g(n)<k_2 h(n)$ for all $n>n_2$. That such $k_1, k_2, n_1, n_2$ exists is given in the problem. Now find a $k$ and an $N$ such that $f(n)+g(n)<k h(n)$ for all $n>N$. This proves that $f+g\in O(h)$.

share|improve this answer
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.