Is $O(2^{n/2})$ the same as $O(2^n)$?

578 Views Asked by At

Why or why not? It seems like the answer should be no, but on the other hand, it's weird that you'd reach the same value in a constant multiple of n.

3

There are 3 best solutions below

0
On

$2^{n}$ is $O(2^{n})$ but it is not $O(2^{n/2})$.

1
On

I made the same mistake once but if you write $x=2^n$, then you would have $O(x) = O(x^2)$ which of course doesn't make sense.

0
On

By exponent rules, $O(2^{n/2}) = O((2^{1/2})^n) \approx O(1.414^n)$ which clearly differs from $O(2^n)$ by more than a constant factor (consider the ratio).