Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|improve this question

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|cite|improve this answer

Your Answer


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.