Contents

Introduction

where n n n is the size of the input and a(≥1) a \, (\geq 1) a(≥1) and b(>1) b \,( > 1) b(>1) are constants with f f f asymptotically positive. For instance, one can show that runtime of the merge sort algorithm satisfies

Note that the master theorem does not provide a solution for all f f f. In particular, if f f f is smaller or larger than nlog⁡ba n^{\log_b{a}} nlogb​a by less than a polynomial factor, then none of the three cases are satisfied. For instance, consider the recurrence

In this case, nlog⁡ba=n n^{\log_b{a}} = n nlogb​a=n. While f f f is asymptotically larger than n n n, it is larger only by a logarithmic factor; it is not the case that f(n)=O(nlog⁡ba−ϵ) f(n) = O\left(n^{\log_b{a} - \epsilon}\right) f(n)=O(nlogb​a−ϵ) for some ϵ>0 \epsilon > 0 ϵ>0. Therefore, the master theorem makes no claim about the solution to this recurrence.

In this case, nlog⁡ba=n3 n^{\log_b{a}} = n^3 nlogb​a=n3 and f(n)=n3log⁡n f(n) = \frac{n^3}{\log{n}} f(n)=lognn3​. f(n) f(n) f(n) is smaller than nlog⁡ba n^{\log_b{a}} nlogb​a but by less than a polynomial factor. Therefore, the master theorem makes no claim about the solution to the recurrence.