Solving Recurrences (Telescoping)

Context: FIT2004_MOC · turning a recursive algorithm’s cost recurrence into a Big-O bound · the analysis half of Divide and Conquer (the maths of Recurrence Relation applied to running time) Upstream and downstream: getting the recurrence out of the code, and the auxiliary space the same recursion costs, live in Analysing Recursive Algorithms (Time and Auxiliary Space) — this note owns only the solving.

Quick Revision

  • 🎯 Objective: a recursive algorithm’s running time obeys a recurrence (, , , …) ➔ solve it for a closed-form growth class by telescoping.
  • 📦 Core Components: levelssubstitutegeneral form in fix from the baseclosed formcomplexityverify (base + general) | with calls the general form is a level-sum, and its ratio decides the answer.
  • ⚡ Key Constraint: the assessed method is repeated substitution (telescoping), written in the lecturer’s Steps 0–6b below — marks are for the steps, not the answer. It is the only one of the two methods that covers both and ; the Master Theorem below is a lecturer-flagged shortcut with strictly narrower reach.

📝 How It Works — the mandated exam format (Steps 0 → 6b)

Write every step, in this order, every time. A correct with no general form and no verification earns nothing; Steps 6a+6b are not optional garnish — together they are the induction that proves the closed form.

StepNameWhat must appear on the page
0Write the levelsthe recurrence instantiated at , , , (or , , …) — one line each, before any substitution
1Substitute and simplify (a little)fold each level into the one above, one substitution per line; simplify only enough to keep , visible so the series is readable
2Find the pattern to the generalcollapse the visible series into the general form in
3Resolve base caseset the argument to the base () and solve for the depth ()
4General ➔ closed formsubstitute back into the Step 2 form and simplify to a -free expression, using
5Time complexityread the dominant term off the closed form ()
6aVerify — base caseevaluate the closed form at ; it must return
6bVerify — general casesubstitute the closed form for into the original recurrence’s RHS; it must reproduce the closed form exactly
  • Step 0 is where the answer is decided ➔ instantiating four levels before substituting is what makes the series visible at Step 1; jumping straight to "" is the step that loses marks even when the bound is right.
  • A threshold base shifts by a constant, not by an order ➔ if the guard is if n < 3 then , and the is absorbed: still . Solve Step 3 with the threshold the code actually uses, then discard the constant.
  • Step 6b runs on log identities is what makes the verification close; keep the rules at hand or 6b stalls.

🧭 Shape recognition

(Diagnose before expanding: how the argument shrinks fixes the DEPTH, the per-step work fixes what accumulates.)

Recurrence shapeArgument shrinksDepth What accumulatesClosed form
by constants
by arithmetic series
by factor constants
by factor geometric, ratio
by factor , waysgeometric, ratio see the level-sum below
by , waysgeometric, ratio
by , waysa branching tree, nodes
  • Branching on the SAME argument still telescopes has one argument per level, so the general form is clean: , and collapses it via the Geometric Series to . Only different arguments () break the method.
  • The one diagnosticsubtracting from the argument gives depth ; dividing gives depth — everything else is what you sum over that depth.
  • Branching by subtraction is the catastrophic case calls that each shrink by a constant build a tree of depth with nodes ⟹ exponential. Naive Fibonacci’s counts nodes, so it is bounded above by the full binary tree (exactly , — see Fibonacci Sequence). This is the recurrence that motivates memoisation and dynamic programming.
  • This shape does NOT telescope cleanly ➔ with two different arguments there is no single general form in ; bound it instead by the tree ().

📊 Worked example 1 — linear power ()

Algorithm: power(x, N) returns x * power(x, N-1), base power(x,1)=x.

📊 Worked example 2 — logarithmic power_better ()

Algorithm: repeatedly squares the base and halves power_better(x*x, N/2).

  • The lessonsubtracting from each step (Example 1) gives ; dividing each step (Example 2) gives — the halving is exactly why power_better beats power.

⭐ Worked example 3 — the exam exemplar, all 7 steps (, , Merge Sort)

(This is the format every recurrence answer must copy. Examples 1, 2 and 4 are compressed to show shape only — never compress in the exam.)

Step 0 — write the levels

Step 1 — substitute it in and simplify (a little)

Step 2 — find the pattern to the general (every term collapses to )

Step 3 — resolve base case

Step 4 — general ➔ closed form

Step 5 — time complexity from the closed form

Step 6a — verify, base case

Step 6b — verify, general case (substitute the closed form back into the original recurrence)

🧮 Proof Blueprint — verifying a GIVEN closed form by induction

(Applied 2 P3. A different question type: the closed form is handed to you, so there is nothing to telescope — the marks are entirely in the induction’s form.)

  • Recognise the ask“use mathematical induction to prove that is a solution” ⟹ produce base case, an explicitly cited hypothesis, and an inductive step. Step 6b is a one-line algebraic check; this is the full Mathematical Induction apparatus.
  • ⚡ Induct over the DOMAIN, not over ➔ a recurrence in is only defined at . So the successor of in the domain is , not — attempting is unprovable because has no defining equation. State this restriction explicitly; it is a marked step, not a technicality.
  • The step is always: unfold once, invoke the hypothesis, re-fold with log laws ➔ the constant is absorbed by writing .

Theorem. For (), , the function satisfies for all , . Strategy. Induction on , with the domain restricted to exact powers of two.

Base case (, i.e. ):

Inductive step — assume for ; show :

  • Where the marks go ➔ naming the domain restriction · citing the hypothesis by name at the line that uses it · the rewrite · closing with rather than stopping at “which is the answer”.
  • Reuse ➔ this is the recurrence behind Binary Search and the improved fast power, so the same three lines discharge several questions ➔ Analysing Recursive Algorithms (Time and Auxiliary Space).

📊 Worked example 4 — shrink-by-one with linear work ()

The lopsided D&C recurrence — one subproblem of size , work to produce it (quicksort’s bad pivot, selection-sort-shaped recursion):

  • Why it is quadratic ➔ the arithmetic series levels whose work decreases linearly still sum to , half the full rectangle. This is the derivation behind the lopsided row in Divide and Conquer.

⭐ The general D&C level-sum ()

Telescoping a multi-call recurrence produces a sum over levels; expand the tree instead of the algebra:

Level # subproblemsSize eachWork this level
leaves

  • (i.e. ) ➔ series converges to a constant multiple of its first term ⟹ , root-dominated (the top-level combine is the whole cost).
  • (i.e. )every level costs the same , and there are of them ⟹ . (Merge sort: .)
  • (i.e. ) ➔ the last term dominates, leaf-dominated. (, .)

The identity that collapses the leaf case — worth memorising, it produces every leaf-dominated exponent:

🔹 The two log identities it rests on

Exponent swap for any base — the step that turns a count of leaves into a power of .

The product in the exponent is symmetric, so and may trade places — that symmetry is the identity.

  • Halving-with-ceiling, since ➔ justifies “one more level of halving costs to the depth”, the step that makes depth rather than an unevaluated recursion.

  • Instantiations · · merge sort · a single half with work .

🔭 Beyond Week 1 — the Master Theorem (shortcut, not in the lecture slides)

A lookup that skips the algebra for the divide-and-conquer family only. Cite telescoping in assessment — the lecturer scoped the two methods explicitly:

TelescopingMaster Theorem
— divide
— shrink by oneno case fits
Bound it yieldsclosed form ⟹ only
Assessment statusrequiredsupplementary

For compare with the critical exponent :

CaseConditionResultDominated by
1the leaves
2every level equally
3the root (combine)

Quick checks: merge sort = Case 2 ⟹ ; with = Case 1 ⟹ — matching the telescoping results above. The three cases are the same root / equal / leaves split as the ratio above, restated for .

⚠️ Common Mistakes

  • 💡 Skipping Steps 0 and 6 ➔ the marks live in the derivation: no instantiated levels (Step 0) and no verification (6a+6b) is an unproven assertion, however right the . Budget exam time for all seven.
  • 💡 Over-simplifying at Step 1 ➔ collapsing to too early hides the series that Step 2 has to generalise; keep the coefficients and denominators visible until the pattern is stated.
  • 💡 Stopping at the general form ➔ Step 2 still contains and an unknown ; it is not a closed form and carries no complexity until Steps 3–4 remove both.
  • 💡 Fix from the base case ➔ the general form has an unknown depth ; you must set it so the recursion reaches the base (e.g. or ) before reading off the complexity.
  • 💡 Subtract vs divide changes the class but ; check whether the argument shrinks additively or multiplicatively.
  • 💡 With ≥2 calls, sum the level totals ➔ don’t forget the multiplier on each level’s work; the per-level totals are , not , unless .
  • 💡 Decreasing per-level work is not free is , not — the arithmetic series still costs half the rectangle.
  • 💡 Compare against , not against ➔ the regime is set by the ratio ; is leaf-dominated but () is root-dominated .
  • 💡 Reaching for the Master Theorem on a recurrence ➔ no case of it applies to an additively-shrinking argument; the answer will be wrong, not merely unjustified. Telescope instead.

✍️ Practice — the lecturer’s drill set

(Blank page, all seven steps each, then diff against the closed form. Naming the growth class without Steps 0–6b earns nothing.)

#RecurrenceBaseClosed formComplexity
1
2
3
4
5
6
7
8
  • 1 vs 2 vs 3 is a constants drill ➔ doubling the per-level work or the constant changes the coefficient, never the class — all three are via the Arithmetic Series.
  • 5 vs 6 vs 7 is the ratio drill ➔ 5 and 6 have (all levels equal), 7 has (leaf-dominated) — only changing moves the class.
  • 1 vs 8 is the catastrophe drill ➔ identical shrink () and identical constant work, but the coefficient on the recursive call replaces the arithmetic series with a geometric one of ratio becomes . Branching, not per-level work, is what makes a recurrence exponential.

🥋 Drill — solve cold, then expand

🧠 Active Recall