Sort in ascending order of their Big About complexity

So if given

4n ^ 2, log3 (n), 20n, n ^ 2.5, log (n!), N ^ n, 3 ^ n, n log (n), 100n ^ (2/3), 2 ^ n, 2 ^ ( n + 1), n!, (n-1) !, 2 ^ 2n

The order (the order of increasing their great complexity O) will be

log3 (n) <20n <n logn <4n ^ 2 <100 nm (2/3) log (n!) <n ^ (2,5) 2 ^ n <2 ^ (n + 1) 3 ^ n <2 ^ (2n) (P-1)! <n ^ n <n!

this is when n is a large number. Is it correct?

+4
source share
1 answer

To summarize, as n tends to + infinity, in terms of great complexity Oh:

log3 (n) <100 nm (2/3) 20n <log (n!) <n log (n) <4n ^ 2 <n ^ (2,5) 2 ^ n ~ 2 ^ (n + 1) 3 ^ n <2 ^ (2n) (P-1)! <n! <n ^ n

This Wikipedia page may interest you.


EDIT: regarding n! vs. n ^ n

Using the Stirling approximation, we have:
enter image description here
therefore O (n!) ~ O (sqrt (n) * n ^ n * e ^ (- n))
therefore, O (sqrt (n)) ~ O (e ^ (- n)) if O (n ^ n) ~ O (n!). But O (sqrt (n)) ~ O (e ^ (- n)) is false. Therefore, O (n ^ n) ~ O (n!) Is false. Since n! <n ^ n, we have n! = o (n ^ n). QED


Here's another proof from djfm that doesn't rely on Stirling's approximation:

enter image description here

+6
source

Source: https://habr.com/ru/post/1402665/


All Articles