Shubhankar Kumar
Shubhankar Kumar

Reputation: 53

Confused between comparison of asymptotic notation e^n vs 2^2n

If we compare e^n and 2^2n, then since e > 2 that means 2^2n = O(e^n). But, I was just wondering if we can assume e > 2 here, and also can we ignore the constants from power as well?

Upvotes: 1

Views: 297

Answers (1)

Berthur
Berthur

Reputation: 4495

Assuming here you mean 22n and not 22n (writing 2^2n is a bit ambiguous).

You are right that e > 2 but consider the rules of exponentiation. We have that:

22n = (22)n = 4n.

Now, 4 > e, so in fact en = O(22n).

And the reverse is not true: 22n ≠ O(en). The base of the power does matter in big-O notation as it creates different complexity classes. This constant you cannot ignore.

Upvotes: 1

Related Questions