03-class
03-class
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