0

If f(n) is Ο(g(n)) and d(n) is Ο(h(n)), then prove that f(n) + d(n)= O(g(n)+ h(n))

I'm having trouble coming up with a formal proof.

Here is what I have so far:

f(n)=O(g(n)) and d(n)=O(h(n)) so, O(g(n)) + O(h(n)) = O(g(n)+ h(n))

But I'm not sure for this because it seems very simple.

Any help appreciated.

EDIT: i must prove this, I cant prove this by saying an example, I have to solve it as a proof by using a C constant I think or some other way..

  • https://stackoverflow.com/questions/12946600/sum-of-big-o-notation – Ctznkane525 Apr 22 '18 at 22:05
  • https://stackoverflow.com/questions/7007723/big-o-when-adding-together-different-routines – Ctznkane525 Apr 22 '18 at 22:06
  • Possible duplicate of [Big O when adding together different routines](https://stackoverflow.com/questions/7007723/big-o-when-adding-together-different-routines) – Ctznkane525 Apr 22 '18 at 22:06
  • yes, but I think my question is not answered by these links –  Apr 22 '18 at 22:21
  • 1
    The proof will start by stating what it means for f(n) to be O(g(n)) and d(n) to be O(h(n)) by using the definition of big O. To continue, consider what the definition requires to be true for f(n)+d(n) to be O(g(n)+h(n)) and then prove that using the first statements. – Paul Hankin Apr 22 '18 at 22:49

1 Answers1

1

Formally by using the definition of the Big-O-Notation it could be done like Hans Hyttel did it here.

The Proof:

enter image description here

Kristianmitk
  • 4,528
  • 5
  • 26
  • 46