Is the following true: $$ f(n) \in O(g(n)) \text{ then } 2 ^ {f(n)} \in O(2^{g(n)})$$
Asked
Active
Viewed 238 times
2
-
1Does this answer your question? What are you allowed to move into the big O notation for it to be still correct? – Nathaniel Mar 15 '22 at 09:23
-
3Hint: consider $f(n)=2 \log n$ and $g(n)=\log n$. – Steven Mar 15 '22 at 09:36
2 Answers
0
In general, you would ask: For a function h(n), if f(n) = O(g(n)), is h(f(n)) = O(h(g(n))?
We have f(n) < c * g(n) for some constant c, and for large n. The function h(n) must be such that within the range of f(n) and g(n), h(f(n)) must not grow so fast that a linear change in f(n) creates a non-linear change in h(f(n)).
gnasher729
- 29,996
- 34
- 54