|
|
|
|
|
by Znafon
2090 days ago
|
|
>You can easily extend Landau's notation to multiple variables [...] O(k log n) Yes, but the parent wrote O(n, 1) not O(n * 1). Does O(k, log n) exists? > Sorry, that's not how you would use or define multi-variable Big-O notation, if you want it to make any sense. What do you mean? If I have f: n -> n and g: n -> 1, can I not say O(f) * O(g) = O(f*g) ? See https://math.stackexchange.com/a/2317054 for an example of demonstration. |
|
Big-O is a mapping from a function, like O(n -> 1) or (n -> n) or (n -> n^2) or (x -> sin x) to a set of functions.
Function don't care about renaming of arguments. (n -> 2 n) is the same function as (x -> 2 x).
When you write O(k log n) what you really mean is O((k, n) -> k log n)
And you can indeed take it apart:
O((k, n) -> k) * O((k, n) -> log n) == O((k, n) -> n log n)
(For some suitable definition of what multiplication of sets of functions means.)
That's very different from functions with single arguments like in your example.
(And, yes, your example works. It's just a different thing.)