3. Asymptotic notations property


在比较的时候有三个方法:

  1. 利用以上的order
  2. 对于不好比较的exp,可以同时log,然后比较。
  3. 目光主要汇聚在最高次的那一项,其他的全都忽略

Transitivity:

holds for O-notation
as f (n) = O(g(n)) and g(n) = O(h(n)) ⇒ f (n) = O(h(n)), where the symbol ⇒ means “implies”.
It also holds for Ω, Θ, o, and ω.

Reflexivity:

  1. Holds for O,Ω, and Θ,e.g. f(n)=O(f(n)), 4n^2 = Ω(4n^2) , nlogn = Θ(nlogn).
  2. Not true for o() and ω(), e.g. logn ̸= o(logn), n ̸= ω(n).

Symmetry:

  1. f (n) = Θ(g(n)) iff g(n) = Θ( f (n)).
  2. But this is not true for O and Ω, e.g. loglogn = O(logn) but log n ̸= O(log log n).

Monotonicity:

A function f (n) is monotonically increasing if m < n implies f(m) ≤ f(n) and it is strictly increasing if m < n implies f(m) < f(n).
Similarly, f (n) is monotonically decreasing if m < n implies f (m) ≥ f (n) and strictly decreasing if m < n implies f (m) > f (n).
E.g., the running time of merge sorting: cn log n with c > 0 being a constant.

Polynomials:

Given a nonnegative integer d, a polynomial in n is a function of the form p(n) = ∑cini, where ci is a constant for each i, called a coefficient of the polynomial. The degree of a polynomial is the highest power that occurs. E.g. p(n) = 3n^7 − 4n^5 + 1.1n^2 − 100 is a polynomial of degree 7, where c0 =−1, c1 =0, c2 =1.1, c3 =c4 =0, c5 =−4, c6 =0, and c7 =3.

Iterated logarithm

In general: log(k+1) n = log log(k) n.
Iterated logarithm function: log∗ n = min{i ≥ 0 | log(i) n ≤ 1}.

Comparison of growth rates :
We will use (without proof) that exponential functions grow faster than powers.
We do not prove that logarithmic functions grow slower than powers.
Also, we will prove results like nlogn = o(n^3) using the fact that logarithms grow
slower than powers.

Working with asymptotic notations

To simplify a function by using asymptotic notation: Take the fastest growing additive term and ignore its constant coefficient. This gives Θ(something), which implies both O() and Ω().
3n^2 +5n+2 = Θ(n^2),

Further properties

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 古建筑总是能让人联想到深远的过去,历史上发生的事情,当年在这屋里究竟有多少的故事呢。
    克列尔的冬天阅读 1,781评论 0 0
  • decode(字段或字段的运算,值1,值2,值3) 这个函数运行的结果是,当字段或字段的运算的值等于值1时,该函数...
    forever_smile阅读 4,661评论 0 0
  • …曾以为我们会成为陌生人…然后我们成为了枕边人! 谢谢你…第13个年头陪着我!
    漂洋过海来爱你阅读 2,312评论 0 0
  • 今天是很奇妙的一天,同时收到两位挚友对我的生日祝福,他们俩把616阴历日期当成公历日期了,意外的惊喜让我也很...
    吕沐霏阅读 4,545评论 2 1