Asymptotic notation
Θ
-notation : asymptotically tight bound
Θ(g(n))={f(n):
there exist positive constans
c1,c2,
and
n0
such that
0≤c1g(n)≤f(n)≤c2g(n)
for all
n≥n0}
Every member
f(n)=Θ(g(n))
be asymptotically nonnegative
g(n) is an asymptotically tight bound for f(n) : For any n≥n0 , the function f(n) is equal to g(n) to within a constant factor.
O
-notation : asymptotic upper bound
Ω
-notation : asymptotic lower bound
Ω(g(n))={f(n)
: there exist positive constant
c
and
The
Θ
-notation is a stronger notation that
O
-notation and
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)
ω
-notation : asymptotic lower bound
ω(g(n))={f(n)
: there exist positive constant
c
and
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
a≤b
f(n)=Ω(g(n))
is like
a≥b
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
m≤n
implies
f(m)≤f(n)
. Similarly, it is monotonically decreasing if
m≤n
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”.