Is nlogn the Same as n Multiplied by logn?

  • Context: Undergrad 
  • Thread starter Thread starter pjhphysics
  • Start date Start date
  • Tags Tags
    Log
Click For Summary
SUMMARY

nlogn is definitively equivalent to n multiplied by log(n) in the context of Big O notation. The discussion confirms that the base of the logarithm does not affect the proportionality of the functions, as Big O notation abstracts away scalar differences. Therefore, O(log_a(x)) is equal to O(log_b(x)) for any bases a and b. This understanding is crucial for analyzing algorithmic complexity.

PREREQUISITES
  • Understanding of Big O notation
  • Familiarity with logarithmic functions
  • Basic knowledge of algorithm analysis
  • Experience with programming concepts
NEXT STEPS
  • Study the properties of logarithms in algorithm analysis
  • Learn about different bases of logarithms and their implications in Big O notation
  • Explore examples of algorithms with O(n log n) complexity
  • Investigate the relationship between logarithmic and linear functions in computational complexity
USEFUL FOR

Students, software engineers, and computer scientists interested in algorithm analysis and performance optimization will benefit from this discussion.

pjhphysics
Messages
16
Reaction score
0
Hey,

Is nlogn (or more specifically nlog[base2]n) the same as: n multiplied by logn?

Thanks
 
Mathematics news on Phys.org
Yes. In a programming, it would be written something like n * log(n).

I am guessing you're talking about Big Oh notation. An interesting thing about Big Oh is that it doesn't matter what base log you're referring to. Given two bases, log_a(x) and log_b(x) will always be proportional to each other for all x. Big Oh notation ignores scalar differences between functions, so O(log_a(x)) = O(log_b(x)).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 8 ·
Replies
8
Views
11K