Recursion
Class Materialβ
- Slides can be found here.
Geometry Series Formulaeβ
Solving Recurrencesβ
1. Logarithm Rules and Geometric Seriesβ
Check slides: example with becoming
2. Guessing and Substitution, then prove by inductionβ
We guess that: (this is our induction hypothesis)
We assume that is true, and we have to prove that still works.
As long as and , will be less than .
Hint: Solve
See that:
Which means that is true.
By induction, is true.
Pro-tip
In a recurrence of this form:
As long as , the recursion will converge (problem size decreasing).
For example:
- will diverge. This is .
- will converge. We can solve this recurrence with the Master Theorem.
3. Master Theoremβ
Check slides: Master Theorem v1 for Big-Oh and v2 for Big-Theta
- Use intuition to understand the 3 cases of Master Theorem...
- Which part of the recursion dominates, and why? (leaves dominates, vs work per level dominates, etc)
?. Recursion Treeβ
How does this work?