Big O Notation and with Functions as Exponents

175 Views Asked by At

It is right to assume that if $f$ and $g$ are $O(h)$ then $f^g$ is $O(h^h)$? The base ($f$) and the exponent ($g$) are both less than $h$ for some $c$.

1

There are 1 best solutions below

0
On

No, it is not right: you have to assume further conditions on $f$ and $g$. As counterexamples you have the one pointed out by @GerryMyerson in the comments to the question or the following one, where $f$ and $g$ are controlled by $h$ with the same bounding constant $c=1$. $$ \begin{split} f(x)&=\frac{\sin(x)}{|x|+1}\\ g(x)&=\frac{\cos(x)}{|x|+1} \end{split} \quad h(x)=\frac{1}{|x|+1}\;\Longrightarrow\; \begin{split} f&=O(h)\\ g&=O(h) \end{split} $$ However, $$ f^g\neq O(h^h) $$ since $h^h$ is bounded on the whole $\mathbb{R}$ while $f^g\to\infty$ if $x\to (2n+1)\pi$ for all $n\in \mathbb{Z}$.