Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Big-O of log versus square root

Generally speaking, is the following always true?

log(n) = O(na/(a+1))? s.t. a is any constant positive integer, perhaps very large.

If not, what is the largest value of a for which this statement will hold true?

like image 664
CaptainForge Avatar asked Oct 11 '16 16:10

CaptainForge


1 Answers

As functions go, log(n) always grows slower than nany power when n gets large. See https://math.stackexchange.com/questions/1663818/does-the-logarithm-function-grow-slower-than-any-polynomial for proof.

So as long as a is a constant positive integer, it really doesn't matter what its value is, as it will always be possible to find constants C and k such that log(n) <= |C(na/(a+1)| + k, which is the definition of big-O.

However, you can also understand it intuitively: na/(a+1) approaches n as a becomes large. Naturally, log(n) is always O(n).

like image 65
pymaxion Avatar answered Sep 29 '22 08:09

pymaxion