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的范围,对比得出答案。

实例
接上实例

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

  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.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容