by 38321003thrw · 3y ago · 0 comments
L1, L2, LL, MM, Disk, NetDisk ..., GalacticRAM.
Wow, you actually expected traversing ‘system boundaries’ with distinct access costs and maintain theoretical scaling?
An algorithm that is O(n) will be O(n) in L1, O(n) in L2, ,..., and yes O(n) in GalacticRAM. Each (sub-)system traversal is due to exceeding capacity limits.
There is likely a more interesting mathematical result buried in here, since we see that a series of sub-systems with relative constant order of magnitude increases in access costs in aggregate transforms f -> f’ with this interesting n^.5 term showing up instead of the logs.
Context is inevitable.
The article was specifically talking about putting algorithms onto real machines and the speed consequences. This creates a new version of the algorithm with certain limits. And because of these limits, there is a maximum runtime for any halting code, and it is a constant number.
Your computer being finite is irrelevant. Big O is about growth factor.
Just because you are capped at value X (< infinity) does not mean that every value below X has the same characteristics. If it did, sure, you are O(1). But if it is N^2 it will still be N^2 even if your machine only has resources for N < 12.
The colloquial use of big O as a general growth factor doesn't hold up to its definition, if you want to be sure it's valid for small inputs too.
I'm in agreement that saying algorithms on computers are all O(1) doesn't make much sense. In a finite memory model, it's impossible to solve big problems, so the running time function becomes undefined for big enough inputs, so big O becomes completely inappropriate in this situation.
Instead typically it's the amount of accesses into some array. Other times people get cute and it's `log2(input length)` so somebodies algorithm could be O(N) while if N was just `input length` then it'd be N^2.
So yes, your algorithm is bound by O(N^2), and that's the number that matters on practical computers... but it's also bound by O(1) with a stupidly large constant. So it's O(1).
> I guess you're the kind of guy that chooses to uses not 8-bit bytes in an interview?
Dude, I'm here specifically to argue against insisting on the exact literal meaning, and to choose the practical option.
Mechanical sympathy has little (if anything) to do with big-O, btw. LMAX, the poster child of mechanical sympathy, is really about minimizing the use of memory coherence machinery and not taking the substantial latency hits.
Second, there are three images of the same graph, each showing how access times aren't linear when they cross cache boundaries. There aren't any transforms and there aren't any aggregate transforms f -> f’.
Third, algorithmic complexity is about abstract amounts of work relative to amount of elements. It isn't about "a series of sub-systems" or "galactic RAM".
This article shouldn't use big O notation because it isn't really about algorithms, it is just about non constant access times.
Cache-Oblivious Structures I, MIT, by Erik Demaine
https://www.youtube.com/watch?v=bY8f4DSkQ6M
Closing the Gap Between Cache-oblivious and Cache-adaptive Analysis
https://www.youtube.com/watch?v=eB_UH7tLomw
Analysis of Recursive Cache-Adaptive Algorithms, Andrea Lincoln, 2015 (thesis)
http://dspace.mit.edu/bitstream/handle/1721.1/100630/9332274...
Why are you saying 'we' in your comment?
computational regime
I think you mean environment instead of regime.
the said “infinite” store
None of this is true for basic O notation, it's just what exponent the algorithm carries on the number of elements.
Big-O notation doesn't even have to do with this article, it's just showing that memory access isn't strictly constant. This all seems like you're trying to argue something that isn't a part of this thread and I'm not sure what that is.