Growth of Functions - Introduction to Algorithm - Summary of Chapter 3

Asymptotic notation

Θ -notation : asymptotically tight bound
Θ(g(n))={f(n): there exist positive constans c1,c2, and n0 such that 0c1g(n)f(n)c2g(n) for all nn0}
Every member f(n)=Θ(g(n)) be asymptotically nonnegative

g(n) is an asymptotically tight bound for f(n) : For any nn0 , the function f(n) is equal to g(n) to within a constant factor.

O -notation : asymptotic upper bound
O(g(n))={f(n): there exist positive constant c and n0 such that 0f(n)cg(n) for all nn0}

Ω -notation : asymptotic lower bound
Ω(g(n))={f(n) : there exist positive constant c and n0 such that 0cg(n)f(n) for all nn0}

The intuition for three asymptotic bound

The Θ -notation is a stronger notation that O -notation and Ω-notation.

Theorem 3.1
For any two functions f(n) and g(n) , we have f(n)=Θ(g(n)) if and only if f(n)=O(g(n)) and f(n)=Θ(g(n))

o -notation : asymptotic upper bound (not tight)
O(g(n))={f(n): there exist positive constant c and n0 such that 0f(n)<cg(n) for all nn0}

ω -notation : asymptotic lower bound
ω(g(n))={f(n) : there exist positive constant c and n0 such that 0cg(n)<f(n) for all nn0}


Comparing function

Transitivity :
f(n)=Θ(g(n)) and g(n)=Θ(h(n)) imply f(n)=Θ(h(n))
f(n)=O(g(n)) and g(n)=O(h(n)) imply f(n)=O(h(n))
f(n)=Ω(g(n)) and g(n)=Ω(h(n)) imply f(n)=Ω(h(n))
f(n)=o(g(n)) and g(n)=o(h(n)) imply f(n)=o(h(n))
f(n)=ω(g(n)) and g(n)=ω(h(n)) imply f(n)=ω(h(n))

Reflexivity:
f(n)=Θ(f(n))
f(n)=O(f(n))
f(n)=Ω(f(n))

Symmetry:
f(n)=Θ(g(n)) if and only if g(n)=Θ(f(n))

Transpose symmetry
f(n)=O(g(n)) if and only if g(n)=Ω(f(n))
f(n)=o(g(n)) if and only if g(n)=ω(f(n))

f(n)=O(g(n)) is like ab
f(n)=Ω(g(n)) is like ab
f(n)=Θ(g(n)) is like a=b
f(n)=o(g(n)) is like a<b
f(n)=ω(g(n)) is like a>b

Some of above content refere to “Introduction to Algorithm”.


Monotonicity
A function f(n) is monotonically increasing if mn implies f(m)f(n) . Similarly, it is monotonically decreasing if mn implies f(m)f(n) . A
function f(n) is strictly increasing if m<n implies f(m)<f(n) and strictly
decreasing if m<n implies f(m)>f(n) .

Floors and ceilings
the greatest integer less than or equal to x by x . the least integer greater than or equal to x by x .

Modular arithmetic
a mod n is the remainder of the quotient a/n .If .a mod n = b mod n, we write a b (mod n) and say that a is equivalent to b, modulo n.

Some of above content refere to “Introduction to Algorithm”.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值