by choeger · 5y ago · 0 comments
Do people really write f(x) = O(g(x)) ?
Because that doesn't seem to make sense. It could make sense if we read O as an operator (so f is the upper bound on g, but the definition is the other way around) but saying that a function is equal to an upper bound is just odd, even leaving aside the fact that the definition uses "f(x)", i.e., the application of f, to express the function itself.
I prefer O to remain the set of functions usually.
Jokes aside, in my college we would write something like:
O( f(n) ) = O(n^2) + O(n)
In the same way that ceiling(1.2) = ceiling(1.9) is symmetric, even if their contents are not equal.
Naively, one would assume that that implies O( f(n) ) - O(n) = O(n^2), which is not correct. However, O( f(n) ) = O(n^2) + O(n) implies O( f(n) ) = O(n^2), which would have been obvious if proper notation had been used.