Intuition The one core idea
A recurrence is a running time that describes itself in terms of smaller copies of itself; the substitution method is nothing more than guessing the closed-form answer and proving that guess by induction . Everything on this page is the vocabulary you need before that sentence makes sense — we build each symbol from a picture, in an order where each one leans on the one before it.
This page is the toolbox . The parent note swings the tools; here we forge them one at a time. If a smart 12-year-old read the parent and stumbled on a symbol, the answer lives below.
Before any symbol, one picture. When you run a program on an input, it does some number of basic steps (a comparison, an addition, a swap). More input usually means more steps.
n
n is a plain-words count of how big the input is — how many numbers to sort, how many items in a list. The letter n is just a nickname for "the size."
Picture: a row of n boxes waiting to be processed.
T ( n ) — the running time function
T ( n ) means "the number of basic steps the program takes when the input has size n ." The T stands for Time ; the ( n ) says "this depends on n ."
Picture: a machine with a dial reading n on the left, and a counter on the right showing T ( n ) .
Why the topic needs it: the whole game is to find a simple formula for T ( n ) . Right now T ( n ) is a black box — we only know how it relates to itself , which is the next idea.
A recurrence is an equation that defines T ( n ) using T of smaller inputs, plus some extra local work.
Example: T ( n ) = 2 T ( n /2 ) + n .
Read it aloud: "to handle size n , do two sub-jobs of size n /2 , then do n extra steps to combine them."
Let us name every piece of that equation, because the parent uses the general shape T ( n ) = a T ( n / b ) + h ( n ) constantly.
Definition The four pieces of
T ( n ) = a T ( n / b ) + h ( n )
a = how many smaller sub-jobs you make (a whole number, a ≥ 1 ).
b = by what factor each sub-job shrinks (so a sub-job has size n / b ).
n / b = the size of one sub-job (input divided by b ).
h ( n ) = the extra local cost at this level (the "glue" work, like combining results).
Intuition Why "self-describing" is the whole trick
A recurrence hides the answer inside itself, like a mirror facing a mirror. To reach the real total you'd have to unroll it forever. The substitution method dodges that: instead of unrolling, it guesses the total and checks the guess survives one step of the mirror. That is why we need every tool below.
Why the topic needs it: the substitution method exists only to turn a self-describing T ( n ) into a plain formula you can read at a glance.
The recurrence 2 T ( n /2 ) + n keeps halving . "How many times can I halve n before I reach 1 ?" — that question has a name.
log 2 n — the halving count
log 2 n (say "log base 2 of n ") answers: how many times must you halve n to get down to 1 ?
log 2 8 = 3 because 8 → 4 → 2 → 1 is three halvings.
Picture: a staircase going down by dividing by 2 each step; the number of steps is log 2 n .
Intuition Why log and not something else?
Divide-and-conquer repeatedly divides the input. Repeated division is the exact opposite of repeated multiplication, and "how many multiplications/divisions" is precisely what a logarithm counts. No other tool answers "how many halvings"; that is why log appears in every halving recurrence.
The parent uses one algebra fact about logs. Here it is, earned:
n 0 = 1 breaks a log bound
log 2 1 = 0 (you need zero halvings — you are already at 1). So c n log n at n = 1 equals c ⋅ 1 ⋅ 0 = 0 , which cannot bound a positive T ( 1 ) . That is exactly why the parent starts the base case at n 0 = 2 .
Why the topic needs it: the target bound O ( n log n ) is a log; you cannot manipulate it without the halving picture and the subtraction identity.
We never prove T ( n ) equals an exact formula; we bound it. Three symbols express "how fast does it grow, ignoring constants and small n ."
O , Ω , Θ (see Big-O Big-Omega Big-Theta )
T ( n ) = O ( g ( n )) — "T grows no faster than g ": there is a constant c > 0 with T ( n ) ≤ c g ( n ) for all large n . (An upper ceiling.)
T ( n ) = Ω ( g ( n )) — "T grows no slower than g ": T ( n ) ≥ c g ( n ) . (A lower floor.)
T ( n ) = Θ ( g ( n )) — both at once: T is sandwiched between two copies of g . (The tight answer.)
Intuition Why constants get ignored
A faster computer just multiplies every step count by a fixed factor — it changes c , not the shape . O /Ω/Θ deliberately throw away that machine-dependent factor so the bound describes the algorithm , not the laptop.
c and the threshold n 0
c = a fixed positive multiplier we get to choose once to make T ( n ) ≤ c g ( n ) true.
n 0 = the smallest input size from which the bound must hold ("for all n ≥ n 0 "); we allow small inputs to misbehave.
Picture: c g ( n ) is a ceiling; past the doorway at n 0 , the curve T ( n ) stays under it forever.
Common mistake The single-
c rule (the parent's Mistake A)
The proof must reproduce the same c it assumed. If your step turns c into c + 1 , that growth repeats once per level, and there are log n levels — so it secretly becomes Θ ( n log n ) , not O ( n ) . Watch for a constant that won't sit still.
Why the topic needs it: the substitution method's entire output is "T ( n ) ≤ c g ( n ) " — an O statement. Without c and n 0 the proof has no target and no base to stand on.
The substitution method is induction wearing a costume (see Mathematical Induction ).
Intuition Why a recurrence
loves induction
A recurrence already relates T ( n ) to T of smaller inputs — and "assume it for smaller inputs" is exactly what the inductive step lets you do. The shapes match perfectly, so we don't solve the recurrence; we verify a guess by dropping it into the IH.
Definition Inductive hypothesis (IH) here
The IH is the guess itself, applied to smaller inputs: "T ( k ) ≤ c f ( k ) for every k < n ." In particular it holds for k = n / b , since n / b < n .
Why the topic needs it: "prove by induction" is literally step 2 of the method. The base case, the IH, and the single-c rule all come straight from here.
Definition Absorb the residual
After substituting you get c f ( n ) + ( leftover ) . The residual is that leftover. You absorb it by showing the leftover is ≤ 0 , so it can only help the inequality ≤ c f ( n ) .
Picture: a set of scales already tipped in your favour; a negative leftover pushes it further down, never up.
Why the topic needs it: these are the middle two letters of the parent's mnemonic G-A-S-A-B (Guess, Assume, Substitute , Absorb , Base). They are the actual moves of the proof.
Recurrence T of n = a T of n over b + h of n
Logarithm log n = halving count
Target bound O of n log n
Big-O Big-Omega Big-Theta with constant c and n0
Mathematical Induction base plus step
Inductive hypothesis for smaller n
Cover the right side and answer aloud; then reveal.
What does T ( n ) mean in one sentence? The number of basic steps the program takes on an input of size n .
What is a recurrence? An equation that defines T ( n ) using T of smaller inputs plus extra local work.
In T ( n ) = a T ( n / b ) + h ( n ) , what are a , b , and h ( n ) ? a = number of sub-jobs, b = shrink factor (sub-job size n / b ), h ( n ) = extra local cost.
What real question does log 2 n answer? How many times you must halve n to reach 1 .
State the identity used to split log ( n /2 ) . log 2 ( n /2 ) = log 2 n − 1 , because log turns division into subtraction and log 2 2 = 1 .
Why can't the base case start at n 0 = 1 for an n log n bound? log 2 1 = 0 , so c n log n = 0 at n = 1 and can't bound a positive T ( 1 ) .
What do O , Ω , Θ mean? Upper bound, lower bound, and both-at-once (tight) bound on growth, ignoring constants.
What are c and n 0 ? c = fixed positive multiplier you choose once; n 0 = smallest input size from which the bound must hold.
State the two parts of a proof by induction. Base case (prove P ( n 0 ) directly) and inductive step (assume IH for smaller inputs, prove P ( n ) ).
What is the inductive hypothesis in this method? The guess T ( k ) ≤ c f ( k ) assumed for all k < n , especially k = n / b .
Why is substituting the IH's bound legal for an upper bound? Replacing T ( n / b ) by something ≥ it can only enlarge the right side, so ≤ survives.
What does "absorb the residual" require? The leftover term must be ≤ 0 with a single fixed c , so it only helps the inequality.