Big-O: If $f(n)=O(g(n))$, prove $2^{f(n)}=O(2^{(g(n)})$

18.2k Views Asked by At

Suppose that both f(n) and g(n) are non-negative functions. If $f(n)=O(g(n))$, is $2^{f(n)}=O(2^{(g(n)})$ true too? If not, give counter examples.

I am unsure of how to proceed. What I have in mind at the moment is that since f(n) and g(n) are non-negative functions, making them functions exponents to 2 (as the base) would not change their characteristics. I would appreciate help in understanding this problem and proving it.

1

There are 1 best solutions below

5
On

Basic idea: if $f(n)=O(g(n))$, then $$f(n)\le Cg(n)$$ and so $$2^{f(n)}\le 2^{Cg(n)}=(2^C)^{g(n)}\ .$$ If $C>1$ then this will not be a constant times $2^{g(n)}$. So a counterexample will be something like $f(n)=2n$, $g(n)=n$. I'll leave you to check the details and write this out carefully.