Professional Documents
Culture Documents
LECTURE 2
Techniques of Evaluation
a) constant factors may be ignored. For all k > 0 , kf is O(f ). For instance cn2
and bn2 are both O(n2 ).
b) If f1 (n) = O(g1 (n)) and f2 (n) = O(g2 (n)) then
f1 (n) + f2 (n) = O(max(g1 (n), g2 (n))). for instance if f1 (n) = n2 + 1 and
f2 (n) = 1 then f1 (n) + f2 (n) = O(n2 )
c) If f (n) = f1 (n) + f2 (n) in which f1 (n) and f2 (n) are both non-negative for all
n ≥ 0 such that limn→∞ ff2 (n)(n)
= L for some limit L ≥ 0, then f (n) = O(f1 (n)).for
1
instance if f1 (n) = n5 + 4 and f2 (n) = n2 , then f1 (n) + f2 (n) = O(n5 ).
d) If f1 (n) = O(g1 (n)) and f2 (n) = O(g2 (n)), then f1 (n) × f2 (n) = O(g1 (n) × g2 (n)).
for instance if f1 (n) = 4n2 and f2 (n) = 3 log n then f1 (n) × f2 (n) = O(n2 log n).
e) If f1 (n) = O(g1 (n)) and g2 (n) is a function whose value is non-negative for
n ≥ 0, then f1 (n) × g2 (n) = O(g1 (n) × g2 (n)). for instance if f1 (n) = O(n2 ) and
g2 (n) = e n then f1 (n) × g2 (n) = O(n2 e n ).
f) If f (n) = O(g (n)) and g (n) = O(h(n)) then f (n) = O(h(n)). f (n) = O(2n2 ) but
2n2 = O(n2 ) then f (n) = O(n2 ).
g) the growth rate of a polynomial is determined by the degree of its leading term
If f is a polynomial of degree d, then f is O(nd )
e.g: a0 + a1 n + . . . + ap np is O(np )
a0 x k + a1 x k−1 + . . . + ak = 0 (2)
Proposition
Suppose that the roots of characteristic equation (2) are not all
distinct. If m is the multiplicity of a root r , then tn = r n , tn = nr n ,
tn = n2 r n , . . ., tn = nm−1 r n are all possible solution of equation
(2). The general solution is then a linear combination of these
terms and the terms contributed by other roots of the
characteristic equation.
Proposition
Consider (xn )n≥0 a linear recurrent sequence defined by equation
(1). If the roots r1 , r2 , . . . , rk of the equation (2) are simple ( means
each has multiplicity 1), then
Proposition 1.5
Consider (xn )n≥0 a linear recurrent sequence defined by equation
(1). If ρ is the leading root of the equation 2 (ρ is the leading root
of 2 if for all root r of equation (2), |r | < |ρ|) then there exists a
real constant A such that :
limn→∞ xn = limn→∞ Aρ n means xn = O(ρ n )