Recurrences & the Master Theorem

the base case of a recurrence

A recurrence like T(n) = 2 T(n/2) + n tells you how to get T(n) from smaller values — but it never bottoms out on its own. You need a starting point: a statement of the cost for the smallest inputs, where the recursion stops and does a fixed amount of work directly. That starting point is the base case.

Concretely, the base case is something like T(1) = Theta(1) (or T(n) = Theta(1) for n <= some small constant). It says: when the problem is small enough, solve it directly in constant time instead of recursing. Two things are happening. First, it makes the recurrence well-defined — without it, unrolling T(n/2), T(n/4), ... would descend forever. Second, it grounds the induction in the substitution method: you prove the bound for the base case explicitly, then the inductive step lifts it to all n. In the recursion tree, the base cases are exactly the leaves, and the number of leaves is what gives n^(log_b a).

Here is the honest, reassuring part: for ASYMPTOTIC analysis the exact base value almost never matters. Whether T(1) = 1 or T(1) = 1000, the Theta-bound is the same, because a constant base only shifts the answer by a constant factor. That is why textbooks freely assume T(1) = Theta(1) or even T(n) = Theta(1) for all small n and move on. But the base case is NOT optional: a recurrence without one describes nothing, and in the substitution method an unchecked base case is a real gap — you genuinely must confirm the guessed bound holds at the bottom, choosing the constant so it does, before the induction is valid.

For T(n) = 2 T(n/2) + n with T(1) = 1: the recursion stops at size 1, where there are n leaves each costing 1 (total n), and log n levels each costing n, giving Theta(n log n). Changing T(1) to 5 changes nothing asymptotically — it only scales the leaf total by 5.

The base case grounds the recursion (the leaves); its exact constant does not change the Theta-bound.

Asymptotically the base constant is irrelevant, but the base case itself is mandatory — both to make the recurrence well-defined and to anchor an induction. In the substitution method, forgetting to verify the base case is a genuine logical gap, not a formality.

Also called
boundary conditioninitial condition基底情況邊界條件