I want to compare following functions asymptotically and then arrange them in the ascending order. Also requested is a proper explanation lg((√n)!), lg(SquareRoot(n!)), SquareRootlg(n!), (lg(√n))!, (SquareRoot(lg n))!, SquareRoot(lg n)!
Asked
Active
Viewed 2,286 times
0
-
well i know that log (n!) is O(nlogn) so i can check that the first three would arranged as SqRt(Log(n!)) Log(SqRt(n)!) log(SqRt(n!)) but cant compare the next three with these...please help – noddy Sep 02 '11 at 18:38
1 Answers
0
If you wonder about "general solution" and you follow a lot into asymptotic functions comparisons. Here is what I recommend :
Use limit definition of BigO notation, once you know:
f(n) = O(g(n)) iff limit (n approaches +inf) f(n)/g(n) exists and is not +inf
You can use Computer Algebra System, for example opensource Maxima, here is in Maxima documentation about limits .
So, checking lg(n)*lg(n) = O(sqrt(n))
can be dane is checking limit of (lg(n)lg(n))/sqrt(n)
:
(%i1) limit( (log(n)^2) / (sqrt(n)), n, inf);
(%o1) 0
If you like, longer, more descriptive notation :
(%i1) f(n) := log(n)^2 ;
2
(%o1) f(n) := log (n)
(%i2) g(n) := sqrt(n) ;
(%o2) g(n) := sqrt(n)
(%i3) limit(f(n)/g(n), n, inf);
(%o3) 0

Community
- 1
- 1

Grzegorz Wierzowiecki
- 10,545
- 9
- 50
- 88