Determine Big O of a function (Discrete math)

AI Thread Summary
The function log(n^2 + 1) is analyzed to determine if it is O(log n). The argument shows that for n > 2, log(n^2 + 1) can be bounded by 3log(n), satisfying the definition of Big O notation. Despite this conclusion, the book claims that log(n^2 + 1) is not O(log n), which is disputed in the discussion. The consensus among participants is that the book's assertion is incorrect. Thus, log(n^2 + 1) is indeed considered O(log n).
Miike012
Messages
1,009
Reaction score
0
Question:
Determine whether the function log(n2+1) is O(logn).

Definition in paint document if needed.

Solution:

n2 + 1 < 2n2 whenever n>1

log(n2 + 1) < log( 2n2 ) = log(2) + 2log(n).

Now, log(n)>log(2) whenever n>2. Therefore

log(2) + 2log(n)<3log(n).

log(n2 + 1) ≤ 3log(n) whenever n>2.
∴Because there exists constants C and k such that log(n2 + 1)≤Clog(n) whenever n>k we can conclude log(n2 + 1) is O(logn).


Is this correct? The book says that log(n2 + 1) is not O(logn).
 

Attachments

  • DD.jpg
    DD.jpg
    8.1 KB · Views: 1,002
Physics news on Phys.org
I think the book is wrong and you are right.
 
Miike012 said:
Question:
Determine whether the function log(n2+1) is O(logn).

Definition in paint document if needed.

Solution:

n2 + 1 < 2n2 whenever n>1

log(n2 + 1) < log( 2n2 ) = log(2) + 2log(n).

Now, log(n)>log(2) whenever n>2. Therefore

log(2) + 2log(n)<3log(n).

log(n2 + 1) ≤ 3log(n) whenever n>2.
∴Because there exists constants C and k such that log(n2 + 1)≤Clog(n) whenever n>k we can conclude log(n2 + 1) is O(logn).


Is this correct? The book says that log(n2 + 1) is not O(logn).

I think you are right and your book is mistaken.
 
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Essentially I just have this problem that I'm stuck on, on a sheet about complex numbers: Show that, for ##|r|<1,## $$1+r\cos(x)+r^2\cos(2x)+r^3\cos(3x)...=\frac{1-r\cos(x)}{1-2r\cos(x)+r^2}$$ My first thought was to express it as a geometric series, where the real part of the sum of the series would be the series you see above: $$1+re^{ix}+r^2e^{2ix}+r^3e^{3ix}...$$ The sum of this series is just: $$\frac{(re^{ix})^n-1}{re^{ix} - 1}$$ I'm having some trouble trying to figure out what to...

Similar threads

Back
Top