Theory of Computation Notation Proof

53 Views Asked by At

The Question: Show that if $f(n) = \mathcal{O}(g(n))$ and $g(n) = \mathcal{O}(f(n))$, then $f(n) = \Theta(g(n)).$

I know that since $\Theta$ is a stronger notation than $\mathcal{O}$, then: $f(n) = \Theta(g(n))$ is contained in $f(n) = \mathcal{O}(g(n))$.

I'm really unsure about this one; guess I haven't had enough practice with notation to get the full picture. Can someone explain/guide me on this?

Thanks

1

There are 1 best solutions below

4
On

Hints:

  1. If $f\left(n\right)$ is in $O\left(g\left(n\right)\right)$, then there exists $C>0$ and $n_{0}$ such that $\left|f\left(n\right)\right|\leq C\left|g\left(n\right)\right|$ for all $n\geq n_{0}$
  2. If $f\left(n\right)$ is in $\Theta\left(g\left(n\right)\right)$, there exists $C_{1},C_{2}>0$ and $n_{0}$ such that $C_{1}\left|g\left(n\right)\right|\leq\left|f\left(n\right)\right|\leq C_{2}\left|g\left(n\right)\right|$ for all $n\geq n_{0}$.