Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Of course "not obvious" is subjective, but I offer this example: f = log n! and g = n log n.


Is this true (by the definition on the site)?

I mean, certainly O(log(n!)) <= O(n log n) since we can just say that log(n!) = log(n) + log(n-1) + ... + log(1) <= log(n) + log(n) + ... + log(n) = n * log(n), but is the bound tight? It's been too long.

EDIT: Answering my own question... yes. http://www.cs.sfu.ca/CourseCentral/307/jmanuch/lec/factorial...


Informally, the left side is he integral of log over 1 to n, which is equal to n log(n) - n plus bounded error, which asymptotically is n log(n).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: