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

Solution 1:

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.