5. Methods for solving recurrences

  1. 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.
  2. 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:

  1. A good guess is vital when applying this method
  2. If the initial guess is wrong, the guess needs to be adjusted later.

解题步骤:先通过替换得出自己的猜想是否合理,然后找出特例范围,测试特例,得出c的范围。再计算特例范围外的的c的范围,对比得出答案。

5. Methods for solving recurrences_第1张图片
实例
5. Methods for solving recurrences_第2张图片
接上实例

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

题目
5. Methods for solving recurrences_第3张图片

Important things to remember

  1. When using asymptotic notation, we take the fastest growing additive term and ignore its constant coefficient.
  2. Recall the difference between the defintions of O, W, Q and o, w: There exists some positive constant versus for any positive constant.
  3. Recall the hierarchy of growth rates.
    To compare the order of growth of functions, use basic operations, take logarithms, or exponentiate.
  4. In inductive proofs for statements like f (n) = O(g(n)), we have to use the same constant c throughout the proof.

你可能感兴趣的:(5. Methods for solving recurrences)