The Master Method
- The master method allows one to solve recurrences of the form
`T(n) = a T(n/b) + f(n)` where `a ge 1` and `b > 1` and `f(n)` is an asymptotically positive function.
- To use this method you need to memorize the three cases of the following theorem.
Master Theorem
Let `a ge 1` and `b > 1` be constants, let `f(n)` be a function, and let `T(n)` be defined on the nonnegative integers by the recurrence
`T(n) = aT(n/b) + f(n)`,
where we interpret `n/b` to mean either `lfloor n/b rfloor` or `|~n/b~|`. Then `T(n)` has the following asymptotic bounds:
- If `f(n) = O(n^(log_b a - epsilon))` for some `epsilon > 0`, then `T(n) = Theta(n^(log_b a))`.
- If `f(n) = Theta(n^(log_b a))`, then `T(n) = Theta(n^(log_b a)log n)`.
- If `f(n) = Omega(n^(log_b a + epsilon))` for some `epsilon > 0`, and if `af(n/b) le c f(n)` for some constant `c <1` and all sufficiently large `n`, then `T(n) = Theta(f(n))`.
- We will not prove the Master Theorem in this class, but will give some intuitions on it on the next slide.