3

What does this expression f(n) = 2O(n) mean, in an exact formal manner?

nbro
  • 15,395
  • 32
  • 113
  • 196
Anatoly Libman
  • 271
  • 2
  • 12

1 Answers1

6

The statement f(n) = 2^O(n) is equivalent to

log_2(f(n)) = O(n)

(actually, any logarithm will do), so it means that there is some constant C > 0 such that

log_2(f(n)) <= C*n  <=> f(n) <= 2^(C*n)

for all large enough n. Now, ab*c = (ab)c, so another way to put it is to say

f(n) = O(b^n)

for some b > 0. This b could be 1.5, or 4, or 1000000000000, so it doesn't tell you too much. All it gives you is that f is exponential, so it's asymptotically better than O(n!), but it doesn't tell you whether it's pretty bad, bad, really bad or truly catastrophically bad.

Daniel Fischer
  • 181,706
  • 17
  • 308
  • 431
  • 1
    Therefore, examples of f(n) = 2^O(n) include: f(n) = 2^n; f(n) = 2^(3n) = 8^n; f(n) = 2^(100)n = bigBase^n, etc. In other words, f(n) = anyBase^n. – Nayuki Oct 05 '15 at 04:29