News for hackers. Stuff that matters.
Re:O(n^2), again, now in Windows Management Instrumentation by Craighead on Monday December 09, 2019 @03:11PM (#21745988)
What does exponential look like then?
Re:O(n^2), again, now in Windows Management Instrumentation by blattimwind on Monday December 09, 2019 @03:51PM (#21746419)
2^n (by the virtue of Big-O, m^n is in O(2^n) for any fixed m).
Re:O(n^2), again, now in Windows Management Instrumentation by aliceryhl on Monday December 09, 2019 @04:26PM (#21746774)
This is untrue: There's no constant k such that k*2^n > 3^n for all n. In general O(a^n) is strictly stronger than O(b^n) if a > b.

This is why you sometimes see complexities that are e.g. O(1.3894732894^n) in wikipedia articles on the best known cases for various algorithms.

Re:O(n^2), again, now in Windows Management Instrumentation by thaumasiotes on Monday December 09, 2019 @04:34PM (#21746866)
> In general O(a^n) is strictly stronger than O(b^n) if a > b.

Typo: O(a^n) is a stronger guarantee than O(b^n) if a < b. It means nothing if a > b.

Re:O(n^2), again, now in Windows Management Instrumentation by xmprt on Monday December 09, 2019 @10:05PM (#21749231)
I took strictly stronger to mean a^n + b^n is O(a^n) so the a^n term holds more weight. The comment didn't mention anything about guarantees.
Re:O(n^2), again, now in Windows Management Instrumentation by thaumasiotes on Tuesday December 10, 2019 @05:05AM (#21751160)
Ah, that would make sense.

I actually thought the most likely intended meaning was that an algorithm in O(a^n) must take asymptotically longer than one in O(b^n) as n goes to infinity (if a > b), which isn't true. (For example, when a > b, then every algorithm in O(b^n) is also in O(a^n), but obviously no algorithm can asymptotically require more time than itself.)

Re:O(n^2), again, now in Windows Management Instrumentation by blattimwind on Monday December 09, 2019 @06:35PM (#21747897)
Thanks for the correction.
Re:O(n^2), again, now in Windows Management Instrumentation by np_tedious on Monday December 09, 2019 @06:56PM (#21748099)
Sounds like perhaps you confused with the other direction: that the base of log(n) doesn't matter
Re:O(n^2), again, now in Windows Management Instrumentation by flugaflusen on Monday December 09, 2019 @04:29PM (#21746812)
This isn't quite right. For example, 3^n is not O(2^n) (see, e.g., https://stackoverflow.com/questions/19081673/big-o-notation-...)
Re:O(n^2), again, now in Windows Management Instrumentation by ammen99 on Monday December 09, 2019 @04:09PM (#21746607)
This is not true, consider taking the limit 3^n/2^n as n goes to infinity, the limit is infinity, hence 3^n is not O(2^n)
Re:O(n^2), again, now in Windows Management Instrumentation by layoutIfNeeded on Monday December 09, 2019 @06:46PM (#21747990)
More like for any fixed m <= 2 :)