0% found this document useful (0 votes)
2 views

03-class

The document discusses asymptotic notation, including O-notation, Θ-notation, Ω-notation, and their definitions and relationships. It provides examples and proofs to illustrate how these notations are used to describe the growth of functions. Additionally, it touches on concepts like little-o and little-ω notations, and includes some summation formulas.

Uploaded by

Kevin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

03-class

The document discusses asymptotic notation, including O-notation, Θ-notation, Ω-notation, and their definitions and relationships. It provides examples and proofs to illustrate how these notations are used to describe the growth of functions. Additionally, it touches on concepts like little-o and little-ω notations, and includes some summation formulas.

Uploaded by

Kevin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

---------------------------- 3 ---------------------------- 3-2

Growth of Functions 3-1a


 f(n) = (g(n)) iff g(n)=(f(n)), Ex. n2=(3n2-6n)
漸近的 ‘’
3.1 Asymptotic notation O-notation: f(n) = O(g(n))
 a set
“” g(n) is an asymptotically upper bound for f(n).
-notation: f(n) = (g(n))
g(n) is an asymptotically tight bound for f(n). O(g(n))= {f(n)| there exist positive constants c
and n0 such that
(g(n)) = {f(n)| there exist positive constants c1, 0  f(n)cg(n)
c2, and n0 such that for all n n0} 調大
0 c1 g(n)f(n)c2 g(n)
for all n  n0} 調小 調大
 (g(n))  O(g(n))
when n is sufficiently large f g
Example: Prove that 3n2 - 6n = (n2).  f(n) = (g(n)) implies f(n) = O(g(n))
Proof: To do so, we have to determine c1, c2, and  6n = O(n), 6n = O(n2)
n0 such that  "The running time is O(n2)" means "the worst-
case running time is O(n2)."
g f g
‘’
c1n2 3n2 - 6n c2n2, (for all nn0)
-notation: f(n) = (g(n))
g(n) is an asymptotically lower bound for f(n).
dividing which by n2 yields
(g(n))= {f(n)| there exists positive constants c
c1 3 - 6/n c2. 3-1y and n0 such that
調小
0  cg(n) f(n)
Clearly, by choosing c1=2, c2=3 and n0=6 we can for all n n0}
verify that 3n2 - 6n = (n2). Q.E.D
There are many choices!
3-3 ‘’ 3-4
 f(n) = (g(n)) iff (f(n)=O(g(n))) & (f(n)=(g(n))) -notation: f(n) = (g(n)) (little-omega of g of n)
3-3x

(g(n)) = {f(n)| for(any) positive constant c, there


exists a constant n0 > 0 such that
0  cg(n) < f(n) for all n n0}
任意大
 2n2 = (n), but 2n2 
(n2).
f (n )
 f(n) = (g(n)) iff lim = ∞.
tight bound upper bound lower bound n →∞g ( n )

3-3y
Comparison of functions
o(g(n)) = Ο(g(n)) \ Θ(g(n)) ???
‘’  functions:       O  
o-notation: f(n) = o(g(n)) (little-oh of g of n)  real numbers:         

o(g(n))= {f(n)| for (any) positive constant c, there
 Transitivity, Reflexivity, Symmetry, Transpose 3-4x
exists a constant n0 > 0 such that
Symmetry
0  f(n) < cg(n) 
for all n n0} 任意小  Any two real numbers can be compared.
(trichotomy) But, not any two functions can be
 2n = o(n2), but 2n2  o(n2). compared.
 f(n) = o(g(n)) can also be defined as
f (n ) Example: f(n)=n and g(n)=n1+sin n
lim = 0.
n → ∞g ( n )
3-5 3-6
(e)~(h) Appendix A: Summation formulas
Homework: Problems 3-2, 3-3, 3-4. k
lg* n = k lglg...lg n  1 n n n
 (cak  bk )  c  ak   bk
k 1 k 1 k 1
3-4y
1 + 2 + ... + n x0 + x1+ x2 + ... + xn
n 1 n
 2 n(n  1)  (n 2 )
k   x k  ( x n 1  1) /( x  1)
k 1 k 0
n 1
n1
loge n =  1 x dx
H n    log e n  O(1) (Harmonic series)
k 1 k = O(lg n)
 1  x
 x k 
1  x
( x  1)  kx k  (1  x )2
( x  1)
k 0 k 0
3-5x
(differentiating and then
n 1 n 1 1 multiplying by x)
1 1 1
   (  )  1 
k 1 k ( k  1) k 1 k k  1 n

n n
lg  ak   lg ak
k 1 k 1

*  n/a /b = n/ab *  n/a /b = n/ab


* lga b = (lgc b)/(lg c a) * algc b = blgc a

You might also like