Solving Recurrences (Telescoping)

Context: FIT2004_MOC · turning a cost recurrence into a Big-O bound · the analysis half of Divide and Conquer Upstream and downstream: getting the recurrence out of the code, and the auxiliary space it 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: levels ➔ substitute ➔ general form in ➔ fix from the base ➔ closed form ➔ complexity ➔ verify (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) in the lecturer’s Steps 0–6b — marks are for the steps, not the answer. It is the only one of the two methods covering both and ; the Master Theorem is a flagged shortcut with 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; 6a+6b together 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; keep , visible so the series stays 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 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 decides the answer ➔ four instantiated levels before substituting is what makes the series visible at Step 1; jumping straight to "" loses marks even when the bound is right.
  • A threshold base shifts by a constant, not an order ➔ guard if n < 3 gives , still . Solve Step 3 with the threshold the code uses, then discard the constant.
  • Step 6b runs on log identities ➔ is what makes verification close.

🧭 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
  • The one diagnostic ➔ subtracting from the argument gives depth ; dividing gives depth — everything else is what you sum over that depth.
  • Branching on the SAME argument still telescopes ➔ has one argument per level ⟹ , collapsed by the Geometric Series. Only different arguments () break the method — bound those by the tree ().
  • Branching by subtraction is the catastrophic case ➔ calls each shrinking by a constant build a tree of depth with nodes ⟹ exponential. Naive Fibonacci is exactly , ➔ Fibonacci Sequence; this is the recurrence that motivates memoisation.

📊 Worked examples 1 & 2 — subtract vs divide (power vs power_better)

(Compressed to show shape only — never compress in the exam.)

  • The lesson ➔ power recurses on , power_better squares the base and recurses on ; the halving is exactly why it is exponentially faster.

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

(This is the format every recurrence answer must copy.)

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 ➔

Step 6a — verify, base case ➔ ✅

Step 6b — verify, general case

🧮 Proof Blueprint — verifying a GIVEN closed form by induction

(Applied 2 P3. 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” ⟹ base case, an explicitly cited hypothesis, inductive step. Step 6b is a one-line 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 is , not ( has no defining equation). State the restriction explicitly — it is a marked step.
  • The step is always: unfold once, invoke the hypothesis, re-fold with log laws ➔ the constant is absorbed by writing .

Theorem. For (), : satisfies for all , .

Base (): Step — assume for ; show :

  • Where the marks go ➔ naming the domain restriction · citing the hypothesis at the line that uses it · the rewrite · closing with .
  • Reuse ➔ same recurrence as Binary Search and fast power, so these three lines discharge several questions.

📊 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):

  • Why quadratic ➔ the arithmetic series — levels whose work decreases linearly still sum to half the full rectangle ➔ Arithmetic Series.

⭐ 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

  • () ➔ series converges to a constant multiple of its first term ⟹ , root-dominated.
  • () ➔ every level costs , and there are ⟹ . (Merge sort: .)
  • () ➔ the last term dominates ⟹ , leaf-dominated. (.)

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

Exponent swap ➔ — the step turning a count of leaves into a power of .

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

  • Halving-with-ceiling ➔ ➔ justifies “one more level of halving costs to the depth”.
  • Instantiations ➔ · · · .

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

Covers only the divide-and-conquer family, yields not , and no case fits — telescoping covers both shapes and is the required method in assessment.

For compare with the critical exponent :

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

The three cases are the same root / equal / leaves split as the ratio above, restated for ; merge sort () is Case 2, matching the telescoping result.

⚠️ Common Mistakes

  • 💡 Skipping Steps 0 and 6 ➔ the marks live in the derivation: no instantiated levels and no verification is an unproven assertion, however right the .
  • 💡 Over-simplifying at Step 1 ➔ collapsing to too early hides the series Step 2 must generalise.
  • 💡 Stopping at the general form ➔ Step 2 still contains and an unknown ; fix from the base (, ) before reading off any complexity.
  • 💡 With ≥2 calls, sum the level totals ➔ per-level work is , not , unless .
  • 💡 Compare against , not against ➔ is leaf-dominated but () is root-dominated .
  • 💡 Reaching for the Master Theorem on a recurrence ➔ no case applies to an additively-shrinking argument; the answer will be wrong, not merely unjustified.

✍️ Practice — the lecturer’s drill set

(Blank page, all seven steps each, then diff against the closed form.)

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

🥋 Drill — solve cold, then expand

🧠 Active Recall