算法学习之“Omega“、“Theta”和“Little Oh”

一、An asymptotical lower bound - Omega

The big oh notation introduced in the preceding section is an asymptotic upper bound. In this section, we introduce a similar notation for characterizing the asymptotic behavior of a function, but in this case it is a lower bound.

Definition (Omega)        Consider a function  f( n) which is non-negative for all integers  tex2html_wrap_inline59063. We say that `` f( n) is omega  g( n),'' which we write  tex2html_wrap_inline59919, if there exists an integer  tex2html_wrap_inline59043 and a constant  c>0 such that for all integers  tex2html_wrap_inline59075tex2html_wrap_inline59927.

The definition of omega is almost identical to that of big oh. The only difference is in the comparison--for big oh it is tex2html_wrap_inline59077; for omega, it is tex2html_wrap_inline59927. All of the same conventions and caveats apply to omega as they do to big oh.

“Omega Notattion”与“Big Oh”向对应,唯一不同的是比较符的方向,同时,Omega也拥有与Big Oh相同的性质(和、积及传递性)。


二、“Theta” 和 “Little Oh”

This section presents two less commonly used forms of asymptotic notation. They are:

  • A notation, tex2html_wrap_inline58167, to describe a function which is both O(g(n)) and tex2html_wrap_inline60093, for the same g(n). (Definition gif).
  • A notation, tex2html_wrap_inline58169, to describe a function which is O(g(n)) but not tex2html_wrap_inline60101, for the same g(n). (Definition gif).

Definition (Theta)        Consider a function  f( n) which is non-negative for all integers  tex2html_wrap_inline59063. We say that `` f( n) is theta  g( n),'' which we write  tex2html_wrap_inline60115, if and only if  f( n) is  O( g( n))  and f( n) is tex2html_wrap_inline60093.

Recall that we showed in Section gif that a polynomial in n, say tex2html_wrap_inline59551, is tex2html_wrap_inline59373. We also showed in Section gif that a such a polynomial is tex2html_wrap_inline60131. Therefore, according to Definition gif, we will write tex2html_wrap_inline60133.

Definition (Little Oh)        Consider a function  f( n) which is non-negative for all integers  tex2html_wrap_inline59063. We say that `` f( n) is little oh  g( n),'' which we write  f( n)= o( g( n)), if and only if  f( n) is  O( g( n)) but f( n) is  not  tex2html_wrap_inline60101.

Little oh notation represents a kind of loose asymptotic bound  in the sense that if we are given that f(n)=o(g(n)), then we know that g(n) is an asymptotic upper bound since f(n)=O(g(n)), but g(n) is not an asymptotic lower bound since f(n)=O(g(n)) and tex2html_wrap_inline60165 implies that tex2html_wrap_inline60167.gif

For example, consider the function f(n)=n+1. Clearly, tex2html_wrap_inline59085. Clearly too, tex2html_wrap_inline60173, since not matter what c we choose, for large enough ntex2html_wrap_inline60179. Thus, we may write tex2html_wrap_inline60181.

从上面的内容可知,Theta notation是Big Oh与Omega的交集,即同时满足Big Oh和Omega。



你可能感兴趣的:(算法学习之“Omega“、“Theta”和“Little Oh”)