Can I divide the large expression O as O (n³) / n = O (n²)?

Is it possible to divide the large expression O as O (n³) / n = O (n²)? Is this separation valid?

+4
source share
3 answers

This is a matter of definition. big O is a lot. The division operator is not defined for sets.

However, we can define O(f(n)) / n = { g(n) / n | g(n) is in O(f(n)) } O(f(n)) / n = { g(n) / n | g(n) is in O(f(n)) } - and that probably means what you want, but you need to explicitly define it, since this is not a standard definition.

+6
source

I think this makes sense ... if f (n) has complexity O (n ^ 3), then f (n) / n has certain complexity O (n ^ 2). do you mean

+1
source

O(n^2) commonly used

 a function f has the upper bound of the function described by `n^2`. 

or formal:

 f ∊ O(n^2) 

So:

  • O(n^2) is a collection
  • our function f is in this set.
  • O(n^2) - a set of functions with an upper bound described by n^2

Problem: Set Division is not an algebraic division, because you know this from division of numbers, so what you want to achieve is impossible.

However, O(n^3/n) is possible and will be reduced to O(n^2) .

+1
source

Source: https://habr.com/ru/post/1435779/


All Articles