Beruflich Dokumente
Kultur Dokumente
(CSC511)
Asymptotic Analysis
log b x = log a x
log a b
∑ k = 1 + 2 + ... + n = n ( n + 1)
Arithmetic series: k =1 2
n
x n +1 − 1
∑ x = 1 + x + x + ... + x =
k 2 n
x −1
( x ≠ 1)
Geometric series: k =0
∞
1
Special case: |x| < 1:
∑ =
x k
k =0 1− x
n
1 1 1
Harmonic series: ∑
k =1 k
= 1 +
2
+ ... +
n
≈ ln n
Other important ∑ lg k ≈ n lg n
k =1
n
1
formulas: ∑ k p = 1p + 2 p + ... + n p ≈
k =1 p +1
n p +1
However, you should prove that the values you choose do work.
for all n ≥ 5
Must find SOME constants c and n0 that satisfy the asymptotic notation
relation
23.09.2010 CSC511 - Advanced Algorithms Analysis 7
“Big-O” Proof Examples
Show that 30n+8 is O(n).
Show ∃ c,k: 30n+8 ≤ cn, ∀n>k .
Let c=31, k=8. Assume n>k=8. Then
cn = 31n = 30n + n > 30n+8, so 30n+8 < cn.
Show that n2+1 is O(n2).
Show ∃ c,k: n2+1 ≤ cn2, ∀n>k: .
Let c=2, k=1. Assume n>1. Then
cn2 = 2n2 = n2+n2 > n2+1, or n2+1< cn2.
Value of function →
less than 31n
everywhere.
But it is less than 30n+8
31n everywhere to n
the right of n=8.
∈O(n)
n>k=8 →
Increasing n →