- Substitution method:
guess a bound.
use mathematical induction to prove that the guess is correct.
if the guess is wrong, refine the guess and try again. - Recursion-tree method:
convert the recurrence into a recursion tree.
use this tree to rewrite the function as a sum.
use techniques of bounding summations to solve the recurrence.
Substitution method
Step 1. Guess the form of the solution.
Step 2. Use mathematical induction to show that the guess is correct.
Attention:
- A good guess is vital when applying this method
- If the initial guess is wrong, the guess needs to be adjusted later.
解题步骤:先通过替换得出自己的猜想是否合理,然后找出特例范围,测试特例,得出c的范围。再计算特例范围外的的c的范围,对比得出答案。
The recursion tree method
The idea of the recursion tree method is to expand (iterate) the recurrence and express it as a summation of terms
Important things to remember
- When using asymptotic notation, we take the fastest growing additive term and ignore its constant coefficient.
- Recall the difference between the defintions of O, W, Q and o, w: There exists some positive constant versus for any positive constant.
- Recall the hierarchy of growth rates.
To compare the order of growth of functions, use basic operations, take logarithms, or exponentiate. - In inductive proofs for statements like f (n) = O(g(n)), we have to use the same constant c throughout the proof.