Case 1: leaves dominate
f(n) = O(n^(c−ε))
For some ε > 0, the additive work grows polynomially slower. Result: Θ(n^c).
Private by design: the recurrence parameters are analyzed on this device. They are not uploaded, stored, or added to the page URL.
For T(n)=aT(n/b)+f(n), calculate c=log_b(a) and compare f(n) with n^c. The comparison describes whether work is concentrated near the recursion-tree leaves, balanced across levels, or concentrated near the root.
f(n) = O(n^(c−ε))
For some ε > 0, the additive work grows polynomially slower. Result: Θ(n^c).
f(n) = Θ(n^c)
In the classic boundary case, each level contributes the same order. Result: Θ(n^c log n).
f(n) = Ω(n^(c+ε))
If the regularity condition also holds, the additive work wins. Result: Θ(f(n)).
When f(n)=Θ(n^k(log n)^p) and k=c, the logarithm exponent refines the boundary: p>−1 gives Θ(n^c(log n)^(p+1)), p=−1 gives Θ(n^c log log n), and p<−1 gives Θ(n^c).
| Algorithm or pattern | Recurrence | Comparison | Result |
|---|---|---|---|
| Merge sort | 2T(n/2) + Θ(n) | k = log₂2 = 1 | Θ(n log n) |
| Binary search | T(n/2) + Θ(1) | k = log₂1 = 0 | Θ(log n) |
| Karatsuba multiplication | 3T(n/2) + Θ(n) | 1 < log₂3 | Θ(n^(log₂3)) |
| Strassen matrix multiplication | 7T(n/2) + Θ(n²) | 2 < log₂7 | Θ(n^(log₂7)) |
| Root-dominated work | 2T(n/2) + Θ(n²) | 2 > log₂2 | Θ(n²) |
This calculator assumes a is a fixed positive integer, b>1 is fixed, subproblems have equal size n/b, and the nonrecursive work has the asymptotic form Θ(n^k(log n)^p). Floors and ceilings in the subproblem size do not normally change the resulting asymptotic class under the theorem’s standard conditions.
Equality between k and log_b(a) is tested with a relative floating-point tolerance of 10⁻¹⁰. Inputs that differ only below this numerical tolerance are treated as the boundary case. Displayed decimal exponents are rounded to 10 significant digits; the symbolic log_b(a) form remains the exact statement.
The classic three-case theorem does not cover every recurrence. Unequal subproblem sizes such as T(n/3)+T(2n/3), coefficients that depend on n, and additive terms outside the supported polynomial-logarithmic family may require substitution, a recursion tree, or the Akra–Bazzi method. The calculated class describes asymptotic growth, not exact running time or constant factors.
Calculation note: results follow the standard Master Theorem comparison and its common logarithmic boundary extension for f(n)=Θ(n^k(log n)^p). Last reviewed: .
The standard form is T(n)=aT(n/b)+f(n), where a≥1 is the number of recursive subproblems, b>1 is the shrink factor, and f(n) is the work outside the recursive calls.
It represents the aggregate contribution associated with the recursion-tree leaves. Comparing it with f(n) reveals which part of the tree determines the total asymptotic work.
For f(n)=Θ(n^(log_b a)), classic Case 2 applies. The balanced work across the recursion levels adds a factor of log n, producing Θ(n^(log_b a) log n).
Yes. Set p to represent (log n)^p. The calculator includes the extended boundary results when k=log_b(a), including negative logarithm exponents.
Case 3 requires a f(n/b) ≤ c f(n) for some constant c<1 and sufficiently large n. In the supported polynomial-logarithmic family, k>log_b(a) makes the limiting ratio a/b^k<1, so the condition holds asymptotically.
No. It is designed for fixed-size, equal divide-and-conquer subproblems. Unequal splits, changing coefficients, and other additive functions can fall outside its scope.
No. Changing a logarithm’s base multiplies it by a positive constant, which does not change its Big-Theta class. The base matters in log_b(a) because that value is an exponent.
No. The recurrence is validated and analyzed locally in your browser. Copy and download actions also happen on your device.