为什么f(n)和g(n)在定义Θ]时必须为非负函数>

问题描述 投票:0回答:1

同时阅读有关CLRS中的Θ定义的信息。我发现

The definition of Θ(g(n)) requires that every member f(n) ∈ Θ(g(n))  be
asymptotically nonnegative, that is, that f(n) be nonnegative whenever n is 
sufficiently large. Consequently, the function g(n) itself must be 
asymptotically nonnegative, or else the set Θ(g(n))  **is empty.** 

具有一个正函数而另一个为负,可能不能让我们进行渐近分析。(Θ(g(n))在这里可以是一个空集合)。

但是

如果两个函数都为负,则不成问题,而是有效的分析。作者为什么对Θ设置这样的限制。这没用吗?

同时阅读有关CLRS中的Θ定义的信息。我发现Θ(g(n))的定义要求每个成员f(n)∈Θ(g(n))渐近为非负,也就是说,只要n为...,f(n)就为非负。

algorithm big-o analysis asymptote
1个回答
1
投票

允许否定函数使等效定义变得复杂,并且实际上使它们不等效:

  1. [f(n)O(g(n))中,如果存在常数N,C,使得对于所有n > Nf(n) <= C*g(n)
© www.soinside.com 2019 - 2024. All rights reserved.