0

Q: $f(n)$ and $g(n)$ are asymptotically non-negative functions. prove that $\max(f(n), g(n)) = \Theta(f(n)+g(n))$

my proof as follows:

If $\exists n_0$ such that $f(n)\geq g(n)\geq 0$ $\forall n \geq n_0$, then $$0\leq\frac{1}{2}(f(n)+g(n))\leq f(n)=\max(f(n),g(n)) \leq 1(f(n)+g(n))$$

If $\exists n_0$ such that $g(n)> f(n) \geq 0$ $\forall n \geq n_0$, then $$0\leq\frac{1}{2}(f(n)+g(n))\leq g(n)=\max(f(n),g(n)) \leq 1(f(n)+g(n))$$

Thus, by $\Theta$ definition, $\max(f(n), g(n)) = \Theta(f(n)+g(n))$

I am not sure whether my proof is rigorously enough and logically correct.

Can I suppose or assume "if $\exists n_0$ ..." in the above-mentioned proof?

Gary
  • 31,845
ident
  • 51
  • 1
    What if there is no such $n_0$? What if $f-g$ changes sign infinitely often? This can help: https://math.stackexchange.com/q/429622 – Gary Oct 07 '23 at 08:58

0 Answers0