Dayaan M. answered 09/29/26
Computer Science Graduate with Computer Engineering Coursework
Before working through these, here is the thing that makes the whole list much easier: most of these pairs are the same order, so on most of them there is nothing to circle. Asymptotic growth ignores constant factors, so anything that merely multiplies a function by a fixed number does not make it asymptotically larger.
The reliable method for every single one is the same. Form the ratio g(n)/f(n) and ask what it does as n grows. If it runs off to infinity, g is larger. If it goes to 0, f is larger. If it settles on a constant, neither is larger and they are the same order. I will write lg for log base 2.
1. n2 vs (n+n)2
(n+n)2 = (2n)2 = 4n2. Ratio is 4. Same order, both Θ(n2).
2. 2n vs 4n
4n = (22)n = 22n, so the ratio is 2n, which goes to infinity. 4n is larger.
3. n! vs nn
Both are products of n factors, but in n! the factors are n, n−1, ..., 1 while in nn every factor is n. The ratio nn/n! goes to infinity. nn is larger.
4. 2lg n vs n
Raising 2 to the log base 2 of n undoes the log, so 2lg n = n exactly. Same, they are literally equal.
5. n vs n+n
n+n = 2n. Ratio is 2. Same order.
6. lg(n!) vs n lg n
Stirling gives lg(n!) = n lg n − n lg e + O(lg n), so the ratio goes to 1. Same order, both Θ(n log n). This one is worth remembering, since it is the reason comparison based sorting cannot beat Ω(n log n).
7. lg(2n) vs lg(4n)
These are n and 2n. Ratio is 2. Same order. Taking a log collapsed the gap from item 2 into a constant factor.
8. log10(n) vs log2(n)
Change of base: log2 n = log2(10) · log10 n ≈ 3.32 · log10 n. A fixed multiple. Same order. This is exactly why people write O(log n) without ever naming a base.
9. 2n vs 2n+1
2n+1 = 2 · 2n. Ratio is 2. Same order. Keep this one next to item 11.
10. n! vs (n+1)!
(n+1)! = (n+1) · n!, so the ratio is n+1, which goes to infinity. (n+1)! is larger. Compare with item 9: adding 1 to an exponent multiplies by a fixed 2, but adding 1 to a factorial multiplies by something that itself grows.
11. 2n vs 2n+n
2n+n = 22n = 4n, so the ratio is 2n. 2n+n is larger. Doubling the exponent is a real change, unlike adding a constant to it.
12. (n+1)n vs nn
The ratio is (n+1)n/nn = (1 + 1/n)n, and that famous limit equals e ≈ 2.718. A constant. Same order. This is the trap on the list: it looks like item 10 but it behaves like item 9.
The pattern worth taking away. Multiplying by a constant, or adding a constant to an exponent, or switching log bases, never changes the order. Those are items 1, 4, 5, 7, 8, 9 and 12. What does change the order is scaling the exponent itself, or multiplying by a factor that grows with n. Those are items 2, 3, 10 and 11. If you can sort each problem into one of those two buckets, you rarely need to compute anything at all.