logoalt Hacker News

tczMUFlmoNk • today at 4:35 AM • 6 replies • view on HN

While "Θ(n^2.25)" is better, imho it's still misleading. Matrix multiplication is a problem that can be solved by algorithms whose running times (under various conditions) are functions. "Being Θ(n^2.25)" is a property of a function, not an algorithm, and not a problem. There are matrix multiplication algorithms commonly used whose worst-case running times are most certainly not Θ(n^2.25) (namely, all of them known before last month). One could precisely say that "an optimal algorithm for matrix multiplication has worst-case running time Θ(n^2.25)" or "optimal matrix multiplication takes time Θ(n^2.25)", though personally I think that the paper's formulation is cleanest: the matrix multiplication constant is ω = 2.25.

This may seem pedantic, but misconceptions about the meanings of big-O/Theta/Omega notation are very common (e.g., conflating them with "best/average/worst case" or other such nonsense) and they muddy the waters.


Replies

hansvm • today at 6:38 AM

Is literally anyone confused by the notation? Constrained to this problem: There exists an algorithm achieving Θ(n^2.25) runtime. There does not exist an algorithm achieving o(n^2.25) runtime. If we want to be pedantic about function classes vs other extensions of Big-O notation then we can talk about the runtime of some specific class of algorithms associated with this problem and manufacture the function everyone is implicitly referring to. It's a perfectly fine shorthand phrasing, especially given that the domains are different for that overlap in vocabulary.

The best/average/worst case stuff is similarly quite easy. For best, take the lowest runtime for the algorithm across all inputs of length n. Do Big-O on that sequence. Worst-case is the same technique applied to the highest runtime. Average is a bit messy since it pulls in an undefined measure which may or may not related to your application, but once you have a measure it's no harder than the other two to analyze. These are rudimentary functions satisfying the pedantry you're asking for and also exactly corresponding to the normal engineering mentality when they reach for that verbal shorthand. Why do they need further elaboration?

enedil • today at 11:58 AM

I think you are unnecessarily pedantic. E.g. for decision problems it is established, that a problem is in O(f(n)) if there exists an algorithm running in O(f(n)) time and the same goes for small o and big theta.

flowerthoughts • today at 5:26 AM

"Problem" is just a shortcut for "the optimal algorithm(s)." It's well established? It implicitly requires that the algorithm(s) in question have been proven to be actually optimal for the problem.

➕ show 1 reply
cubefox • today at 7:31 AM

The distinction between functions and problems seems questionable here.

titzer • today at 3:25 PM

> a property of a function, not an algorithm

You wanted to be pedantic and yet this is also a misconception. All computable functions have (some) algorithm to compute them. All algorithms are computable functions (maybe partial). If we're not talking computable functions, I don't know what we are talking about. Also, you got that backwards; functions are mappings from inputs to outputs and algorithms are deterministic processes to compute such outputs; algorithms have complexity bounds and not necessarily functions.

henrymerrilees • today at 9:16 AM

How's this for pedantry... problem vs algorithm vs function aside, the pesky epsilon in the upper bound means it isn't big-theta either!