简体   繁体   English

小 O 是 Theta 对大 O 的补集吗

[英]Is little O the complement of Theta to Big O

In other words, is o(f(n)) = O(f(n)) - Θ(f(n)) ?换句话说,是o(f(n)) = O(f(n)) - Θ(f(n))吗?

f ∈ O(g) [big O] says, essentially f ∈ O(g) [big O] 说,本质上

For at least one choice of a constant k > 0, you can find a constant y such that the inequality 0 <= f(x) <= k g(x) holds for all x > y.

f ∈ Θ(g) [theta] says, essentially f ∈ Θ(g) [theta] 本质上说

For at least one choice of constants k1, k2 > 0, you can find a constant y such that the inequality 0 <= k1 g(x) <= f(x) <= k2 g(x) holds for all x > y.

f ∈ o(g) [little o] says, essentially f ∈ o(g) [小 o] 说,本质上

For every choice of a constant k > 0, you can find a constant a such that the inequality 0 <= f(x) < k g(x) holds for all x > y.

By the definition, it is easy to realize that o(g) ⊆ O(g), and Θ(g) ⊆ O(g).根据定义,很容易实现 o(g) ⊆ O(g) 和 Θ(g) ⊆ O(g)。 And it makes sense to one complement each other.相互补充是有意义的。 I couldn't find any counter example of function that is in O(f(n)) and not in Θ(f(n)) that is not in o(f(n)).我找不到任何 function 的反例,它在 O(f(n)) 中,而不在不在 o(f(n)) 中的 Θ(f(n)) 中。

Surprisingly, no, this isn't the case.令人惊讶的是,不,事实并非如此。 Intuitively, big-O notation gives an upper bound without making any claims about lower bounds.直观地说,大 O 表示法给出了一个上限,而没有对下限做出任何声明。 If you subtract out the big-Θ class, you've removed functions that are bounded from above and below by the function.如果你减去大 Θ class,你已经删除了由 function 从上方和下方限定的函数。 That leaves you with some extra functions that are upper-bounded by the function but not lower bounded by it.这给您留下了一些额外的功能,这些功能的上限是 function,但不是下限。

As an example, let f(n) be n if n is even and 0 otherwise.例如,如果 n 为偶数,则 f(n) 为 n,否则为 0。 Then f(n) = O(n) but f(n) ≠ Θ(n).那么 f(n) = O(n) 但 f(n) ≠ Θ(n)。 However, it's not true that f(n) = o(n).然而,f(n) = o(n) 是不正确的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM