If $f(n)$ and $g(n)$ are both $\Theta (h(n))$ then is it true that $f(n)$ is $\Theta (g(n))$ and $g(n)$ is $\Theta (f(n))$?

2.1k Views Asked by At

My question is exactly what the title says. If two functions are $\Theta$ of another function then are they $\Theta$ of each other. I know that this is not the case with big $O$ but does it work with $\Theta$ because $\Theta$ bounds on both sides?

1

There are 1 best solutions below

0
On BEST ANSWER

Exactly right.

If $f(n) =\Theta(h(n)) $ and $g(n) =\Theta(h(n)) $, then there are constants $a, b, c, d$ such that, for large enough $n$, $a < \frac{f(n)}{h(n)} < b $ and $c < \frac{g(n)}{h(n)} < d $.

Therefore $\frac{a}{d} < \frac{f(n)}{g(n)} < \frac{b}{c} $ so $f(n)= \Theta(g(n)) $ and $g(n) =\Theta(f(n)) $.