MHB How can big O's have values of the form A+B?

  • Thread starter Thread starter find_the_fun
  • Start date Start date
  • Tags Tags
    Form
AI Thread Summary
The discussion centers on the use of big O notation in relation to bucket sort's expected time complexity of O(n+k). It explores the rationale behind incorporating arithmetic in big O notation, emphasizing that it reflects the combined growth rates of two variables, n and k. The notation indicates that the upper bound is not determined until the algorithm is implemented, allowing for either n or k to dominate the complexity. The conversation also touches on a fundamental property of big O notation, stating that if two functions are in O of their respective bounds, their sum is also in O of the sum of those bounds. This highlights the flexibility of big O notation in analyzing algorithmic performance based on varying inputs.
find_the_fun
Messages
147
Reaction score
0
For example according to wikipedia and this question bucket sort has the expected time complexity O(n+k). How does it make sense to use big O notation with arithmetic in it? Is it because it is not known which of n or k will determine the upper bound but once it is known (i.e. the algorithm is implemented) then it would be known if it actually is O(n) or O(k)?
 
Technology news on Phys.org
find_the_fun said:
For example according to wikipedia and this question bucket sort has the expected time complexity O(n+k). How does it make sense to use big O notation with arithmetic in it? Is it because it is not known which of n or k will determine the upper bound but once it is known (i.e. the algorithm is implemented) then it would be known if it actually is O(n) or O(k)?

To say that \(f(n,k)\in O(n+k)\) means that there exists a \(C>0\) such that for \(n+k\) large enough:

\[|f(n,k)| < C |n+k|\]

That is they jointly define the bound on the growth of \(|f(x,k)|\)

CB
 
find_the_fun said:
For example according to wikipedia and this question bucket sort has the expected time complexity O(n+k). How does it make sense to use big O notation with arithmetic in it? Is it because it is not known which of n or k will determine the upper bound but once it is known (i.e. the algorithm is implemented) then it would be known if it actually is O(n) or O(k)?

One of the basic property of the 'big-O notation' is that, if f and g are positive functions, then ... $\displaystyle f_{1} \in \mathcal{O} (g_{1})\ \text{&}\ f_{2} \in \mathcal{O} (g_{2}) \implies f_{1}+f_{2} \in \mathcal{O} (g_{1}+g_{2}) $

Kind regards

$\chi$ $\sigma$
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
Back
Top