Determine Big O of a function (Discrete math)

Click For Summary
SUMMARY

The function log(n² + 1) is O(log n) as demonstrated through the inequality log(n² + 1) ≤ 3log(n) for n > 2. The analysis shows that n² + 1 is less than 2n² for n > 1, leading to the conclusion that log(n² + 1) can be bounded by a constant multiple of log(n). This contradicts the assertion made in the referenced book, which claims that log(n² + 1) is not O(log n).

PREREQUISITES
  • Understanding of Big O notation
  • Familiarity with logarithmic properties
  • Basic knowledge of inequalities in mathematics
  • Experience with discrete mathematics concepts
NEXT STEPS
  • Study the properties of logarithms in depth
  • Learn about asymptotic notation and its applications
  • Explore advanced topics in discrete mathematics
  • Review examples of bounding functions using Big O notation
USEFUL FOR

Students and professionals in computer science, mathematicians focusing on algorithm analysis, and anyone interested in understanding the complexities of functions in discrete mathematics.

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,022
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.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 49 ·
2
Replies
49
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K