The Recursion-Tree Method

Suppose you write a divide-and-conquer sorting routine. You want to know, before running a single benchmark, whether it will handle a billion elements in seconds or hours. The recurrence describing its running time might look like T(n)=2T(n/2)+nT(n) = 2T(n/2) + n. The entire question of scalability collapses into solving this equation. Guessing the answer by intuition is unreliable. Recurrences with innocuous-looking differences, like T(n)=2T(n/2)+nT(n) = 2T(n/2) + n versus T(n)=2T(n/2)+n2T(n) = 2T(n/2) + n^2, produce asymptotically different growth rates. A wrong guess can mean shipping software that silently degrades on large inputs. The recursion-tree method turns a recurrence into a picture. It is a tree in which every node is a subproblem. The cost written next to each node is the extra ("non-recursive") work done at that call, excluding its children. Summing the costs level by level, and then across all levels, produces a total. That total is either an exact closed form or — more commonly — a well-justified guess. Such a guess can then be checked by substitution. This technique is the workhorse behind the intuition for the Master Theorem. It also handles the many recurrences the Master Theorem cannot, such as unbalanced splits or recurrences with logarithmic terms. The big picture is that recurrence solving is really a bookkeeping problem. You track how much work is spent, at which depth, on how many pieces. Then you add it all up. The recursion tree makes every one of those quantities visible simultaneously. It replaces algebraic manipulation with a diagram you can read off almost mechanically. This is why the method is taught before more automated tools. It builds the mental model that makes those tools trustworthy rather than magical. This article develops the method from first principles. It shows how to build the tree, and how to sum costs per level. It also covers the geometric-series arithmetic that decides which term dominates. Finally, it shows how to convert a tree-derived guess into a rigorous proof via substitution. It closes with a worked example on an unbalanced recurrence. There the tree method shines precisely because there is no clean master-theorem case to fall back on.

Key takeaways
  • A recursion tree represents a recurrence: each node is a subproblem, its label is the non-recursive work at that call.
  • Total running time is the sum, over all levels, of (work per node at that level) × (number of nodes at that level).
  • Whether cost is dominated by the root, spread evenly across levels, or dominated by the leaves determines the closed form.
  • The method gives a strong guess, which must then be confirmed with the substitution method to be a proof.
  • It handles cases the Master Theorem cannot: unequal subproblem sizes, extra logarithmic factors, non-polynomial driving functions.
  • Building the tree correctly requires care with tree depth, leaf count, and geometric-series convergence — the classic sources of error.
The core insight

A recursion tree converts a recurrence into a sum of level-costs, and whichever level — top, middle, or bottom — contributes the largest share of that sum determines the recurrence's asymptotic solution.

The idea

A recurrence relation for an algorithm's running time expresses T(n)T(n), the cost on an input of size nn, in terms of TT evaluated at smaller sizes plus some extra work. A typical divide-and-conquer recurrence has the shape

T(n)=a T(n/b)+f(n),T(n) = a \, T(n/b) + f(n),

meaning: split the problem of size nn into aa subproblems each of size n/bn/b, solve each recursively, and spend f(n)f(n) additional time to divide the input and combine the sub-results. The recursion tree is the literal unrolling of this recurrence into a tree: the root represents the call T(n)T(n), labeled with f(n)f(n) (the work done at that call, not counting its children); its aa children represent the aa recursive calls T(n/b)T(n/b), each labeled with f(n/b)f(n/b); and so on, until the subproblem size shrinks to the base case, at which point that branch terminates in a leaf. The key quantity at every level ii (root is level 00) is the per-level cost: the sum of the labels of all nodes at that depth. Because the tree is usually regular near the root (every node at level ii has the same subproblem size n/bin/b^i, assuming a single split ratio bb), the per-level cost is often

(number of nodes at level i)×(cost per node at level i)=ai⋅f(n/bi).(\text{number of nodes at level } i) \times (\text{cost per node at level } i) = a^i \cdot f(n/b^i).

Summing this expression over all levels i=0,1,…,log⁡bni = 0, 1, \dots, \log_b n — the tree's depth, since that is where n/bin/b^i reaches the base-case size — gives the total work, up to the cost paid at the leaves themselves (the base-case cost times the number of leaves, alog⁡bna^{\log_b n}). The word "guess" matters: this sum is exact for the idealized recurrence with nn a power of bb and integer sizes throughout, and it is a strong heuristic even when those assumptions are informally violated, but the resulting closed form must still be verified rigorously — typically by the substitution method (assume the bound, plug it back into the recurrence, check the algebra closes with the right constants) — before it counts as a proof. This connects the recursion tree directly to the Substitution Method as its natural verification partner, and it is the intuitive engine behind the three cases of the Master Theorem, which is really a theorem about which level of the tree dominates the sum.

How it works

Building and evaluating a recursion tree is a mechanical five-step process. The steps are the same whether the tree turns out to be balanced (Master-Theorem territory) or unbalanced (where the tree method is indispensable).

Step 1 — Draw the root. Label it with f(n)f(n), the non-recursive work at the top-level call.

Step 2 — Expand one level. Replace the root's recursive part a T(n/b)a\,T(n/b) with aa children, each labeled f(n/b)f(n/b), representing the non-recursive work of each of those aa subcalls.

Step 3 — Recurse the expansion. Keep expanding every non-leaf node the same way. At depth ii, there are aia^i nodes, each of a subproblem of size n/bin/b^i and each labeled f(n/bi)f(n/b^i) — provided the split is uniform (single aa and bb throughout). If different children shrink by different factors, track each branch's size separately; the tree becomes irregular and levels must be summed less mechanically (this is precisely the "unbalanced" case treated in the worked example below).

Step 4 — Find the depth and the leaves. The recursion bottoms out when the subproblem size hits the base case, i.e. when n/bi=Θ(1)n/b^i = \Theta(1), giving depth i∗=log⁡bni^* = \log_b n. The number of leaves is ai∗=alog⁡bn=nlog⁡baa^{i^*} = a^{\log_b n} = n^{\log_b a} (a rewriting identity worth memorizing, since it is exactly the exponent that appears in the Master Theorem). Each leaf costs Θ(1)\Theta(1) for its base case.

Step 5 — Sum every level, then sum the levels. Compute

T(n)  =  ∑i=0i∗−1aif(n/bi)  +  Θ(ai∗),T(n) \;=\; \sum_{i=0}^{i^*-1} a^i f(n/b^i) \;+\; \Theta(a^{i^*}),

the first term collecting all the internal (non-leaf) work level by level, the second collecting the total leaf cost. Then examine the resulting series: does it grow, shrink, or stay flat as ii increases? That determines whether the root, the leaves, or every level "equally" governs the asymptotics. ``` RECURSION-TREE-ESTIMATE(a, b, f, n): // Conceptually builds and sums the recursion tree for // T(n) = a T(n/b) + f(n), base case T(1) = Θ(1). depth ← ceil(log_b(n)) // number of internal levels total ← 0 for i ← 0 to depth - 1: nodes_at_level_i ← a^i size_at_level_i ← n / b^i cost_per_node ← f(size_at_level_i) level_cost ← nodes_at_level_i cost_per_node total ← total + level_cost // record level_cost[i] for inspection — this is // the sequence whose growth pattern reveals the answer leaves ← a^depth // = n^(log_b a) total ← total + leaves Θ(1) // base-case cost per leaf return total // typically expressed in closed form after // recognizing the series (geometric, arithmetic, // or harmonic) that level_cost[i] forms ``` The pseudocode is deliberately explicit about recording* `level_cost[i]` as a sequence, because that sequence is exactly what you inspect by eye to classify the recurrence: is it increasing geometrically with ii (root-heavy — total is Θ(f(n))\Theta(f(n)), dominated by the top), decreasing geometrically (leaf-heavy — total is Θ(nlog⁡ba)\Theta(n^{\log_b a}), dominated by the bottom), or constant across levels (balanced — total is Θ(f(n)log⁡n)\Theta(f(n)\log n), since there are Θ(log⁡n)\Theta(\log n) equal-cost levels)? These three outcomes are exactly the three cases of the Master Theorem, though the tree method applies even when f(n)f(n) is not a clean polynomial, or when the split is not uniform.

Figure
Recursion tree for T(n) = 2T(n/2) + n, showing per-level costs summing to Θ(n log n)
n cost = n n/2 n/2 cost = 2·(n/2) = n n/4 n/4 n/4 n/4 cost = 4·(n/4) = n ⋮ every level costs n n leaves, each Θ(1) → total leaf cost = Θ(n) depth 0 depth 1 depth 2 depth log₂n Θ(log n) levels × Θ(n) per level = Θ(n log n)

Complexity & correctness

Deriving the closed form. For T(n)=aT(n/b)+f(n)T(n) = a T(n/b) + f(n), the recursion tree gives

T(n)=∑i=0log⁡bn−1aif(n/bi)  +  Θ(nlog⁡ba),T(n) = \sum_{i=0}^{\log_b n - 1} a^i f(n/b^i) \;+\; \Theta(n^{\log_b a}),

where the second term is the total leaf cost (there are nlog⁡ban^{\log_b a} leaves, each Θ(1)\Theta(1)). The sum is a series in ii; its behavior falls into three regimes, matching the Master Theorem's three cases:

  • Leaves dominate. If aif(n/bi)a^i f(n/b^i) decreases geometrically as ii grows (each level contributes strictly less than a constant fraction of the level above), the sum is dominated by its last term and T(n)=Θ(nlog⁡ba)T(n) = \Theta(n^{\log_b a}). This happens when f(n)=O(nlog⁡ba−ϵ)f(n) = O(n^{\log_b a - \epsilon}) for some ϵ>0\epsilon > 0.
  • All levels contribute equally. If aif(n/bi)a^i f(n/b^i) stays the same order of magnitude at every level, there are Θ(log⁡n)\Theta(\log n) levels each contributing Θ(f(n))\Theta(f(n)), giving T(n)=Θ(f(n)log⁡n)T(n) = \Theta(f(n) \log n). This happens when f(n)=Θ(nlog⁡ba)f(n) = \Theta(n^{\log_b a}).
  • The root dominates. If aif(n/bi)a^i f(n/b^i) increases geometrically as ii grows, the sum is dominated by its first term (i=0i=0), giving T(n)=Θ(f(n))T(n) = \Theta(f(n)). This happens when f(n)=Ω(nlog⁡ba+ϵ)f(n) = \Omega(n^{\log_b a + \epsilon}), subject to a regularity condition on ff.

This is exactly the trichotomy formalized by the Master Theorem — the recursion tree is the reasoning that makes that theorem believable rather than an arbitrary rule to memorize.

Why the tree method is only a guess-generator, not a proof by itself. The per-level sum above assumes an idealized regular tree: nn a power of bb, every subproblem exactly n/bin/b^i, and the sum over ii evaluated as an infinite or exact geometric series with clean closed forms. Real recurrences involve floors and ceilings (T(⌈n/2⌉)T(\lceil n/2 \rceil)), possibly non-uniform splits, and lower-order terms that the loose tree-level arithmetic can obscure. The standard remedy is: use the tree to conjecture a bound T(n)=O(g(n))T(n) = O(g(n)) (or Θ\Theta, or Ω\Omega), then verify it by the substitution method — assume T(k)≤c g(k)T(k) \le c\, g(k) for all k<nk < n, substitute into the recurrence, and check that the algebra produces T(n)≤c g(n)T(n) \le c\, g(n) for a suitable constant cc and all nn beyond some threshold n0n_0. This two-step discipline (tree for intuition, substitution for rigor) is standard practice, because the tree's informal handling of floors/ceilings and boundary terms can, in principle, hide an extra logarithmic factor or an incorrect constant.

Complexity of using the method itself. Constructing the recursion tree conceptually and summing Θ(log⁡bn)\Theta(\log_b n) levels, each requiring a constant amount of series-recognition work, takes O(log⁡n)O(\log n) "reasoning steps" — this is a pen-and-paper analysis technique, not an algorithm that runs on the target machine, so its own "cost" is about proof effort, not runtime. The value of the method is that it turns an open-ended guess into a structured, level-by-level bookkeeping exercise that rarely misses a term.

Honesty about tradeoffs. The recursion tree is superb for building intuition and for handling recurrences the Master Theorem cannot (unbalanced splits, recurrences with f(n)f(n) containing logs, recurrences like T(n)=T(n/3)+T(2n/3)+nT(n) = T(n/3) + T(2n/3) + n). It is comparatively weak at producing tight, constant-exact bounds without a follow-up substitution proof, and for deeply irregular trees the level sums themselves can become intricate enough that a direct inductive guess-and-check (skipping the tree) is faster in practice. The tree method's real strength is diagnostic: it tells you which closed form to attempt, even when it cannot, by itself, certify that form.

Worked example

Consider the unbalanced recurrence

T(n)=T(n/3)+T(2n/3)+n,T(n) = T(n/3) + T(2n/3) + n,

which arises, for instance, from a partitioning-based algorithm with a 1:2 split (a lopsided variant of the recurrence for Quicksort-style divide-and-conquer, or from certain selection algorithms). This recurrence has two different branch sizes, so it does not fit the single-ratio a T(n/b)+f(n)a\,T(n/b)+f(n) template the Master Theorem requires — this is exactly where the recursion tree earns its keep, because the tree still makes sense even though the levels are no longer perfectly regular.

Building the tree. The root has cost nn and two children: one subproblem of size n/3n/3, one of size 2n/32n/3. Each of those has cost equal to its own size (since f(n)=nf(n) = n is linear, the cost at a node of size mm is mm), and each spawns two further children in the same 1:21{:}2 ratio.

Observation 1 — every level sums to (at most) nn. At the root: cost nn. At depth 1: costs n/3n/3 and 2n/32n/3, summing to exactly nn. At depth 2, the four nodes have sizes n/9, 2n/9, 2n/9, 4n/9n/9,\ 2n/9,\ 2n/9,\ 4n/9 — again summing to exactly nn. In general, since each node's cost equals its size, and each node's two children's sizes sum to exactly the parent's size (because 1/3+2/3=11/3 + 2/3 = 1), every level's total cost is exactly nn, regardless of how unevenly that nn is distributed among the nodes at that level.

Observation 2 — the tree's depth is between log⁡3n\log_3 n and log⁡3/2n\log_{3/2} n. The shortest root-to-leaf path always takes the n/3n/3 branch, shrinking fastest, reaching the base case after log⁡3n\log_3 n steps. The longest path always takes the 2n/32n/3 branch, shrinking slowest, reaching the base case after log⁡3/2n\log_{3/2} n steps. Both quantities are Θ(log⁡n)\Theta(\log n) (only the constant inside differs), so the tree has Θ(log⁡n)\Theta(\log n) levels overall — it is not perfectly regular, but it is depth-bounded on both sides by a constant multiple of log⁡n\log n.

Summing. Since each of the Θ(log⁡n)\Theta(\log n) levels contributes Θ(n)\Theta(n) (at most exactly nn, and — checking the shortest branch doesn't terminate too early to make levels contribute less — at least Ω(n)\Omega(n) for all levels down to depth log⁡3n\log_3 n), the total is

T(n)=Θ(nlog⁡n).T(n) = \Theta(n \log n).

The table below traces the level-by-level costs numerically for n=720n = 720 (chosen for divisibility), rounding node sizes to nearest integer for illustration:

Depth iiNode sizes at depth iiSum of sizes at depth iiRunning total so far
0720720720
1240, 4807201440
280, 160, 160, 3207202160
327, 53, 53, 107, 53, 107, 107, 213≈ 7202880
⋮\vdots(splitting continues, 1:2 each time)≈ 720 eachgrows by ≈720 per level
≈log⁡3720≈6\approx \log_3 720 \approx 6 to log⁡1.5720≈16\log_{1.5} 720 \approx 16base cases begin to appeartaperingtotal ≈ 720×11≈7920720 \times 11 \approx 7920

With n=720n = 720 and roughly 1111 "full" levels before the tree finishes tapering off into a mix of leaves and internal nodes, the total is on the order of n×Θ(log⁡n)≈720×9.5≈6800n \times \Theta(\log n) \approx 720 \times 9.5 \approx 6800–80008000, consistent with Θ(nlog⁡n)\Theta(n \log n). (The exact constant depends on rounding and the base case, which the tree method does not need to pin down — only the growth rate Θ(nlog⁡n)\Theta(n\log n) is claimed here.)

Verifying by substitution. Guess T(n)≤c nlog⁡nT(n) \le c\, n \log n for constants c>0c>0, n0n_0, all n≥n0n \ge n_0. Assume it holds for all inputs smaller than nn:

T(n)=T(n/3)+T(2n/3)+n≤c n3log⁡n3+c 2n3log⁡2n3+n.T(n) = T(n/3) + T(2n/3) + n \le c\,\tfrac{n}{3}\log\tfrac{n}{3} + c\,\tfrac{2n}{3}\log\tfrac{2n}{3} + n.

Expanding log⁡(n/3)=log⁡n−log⁡3\log(n/3) = \log n - \log 3 and log⁡(2n/3)=log⁡n−log⁡(3/2)\log(2n/3) = \log n - \log(3/2), and collecting terms, gives

T(n)≤c nlog⁡n−c n(13log⁡3+23log⁡32)+n.T(n) \le c\,n\log n - c\, n\left(\tfrac13 \log 3 + \tfrac23 \log\tfrac32\right) + n.

The bracketed constant 13log⁡3+23log⁡32\tfrac13\log 3 + \tfrac23 \log \tfrac32 is strictly positive (numerically ≈0.918\approx 0.918 in base-2 logs), so for cc large enough that c⋅0.918≥1c \cdot 0.918 \ge 1, the extra +n+n is absorbed and T(n)≤c nlog⁡nT(n) \le c\,n\log n follows — confirming the tree-derived guess Θ(nlog⁡n)\Theta(n\log n) rigorously.

Common pitfalls & traps

PitfallWhy it happensHow to avoid it
Forgetting the leaf-cost termAttention focuses on the internal-node sum and the base case is droppedAlways add Θ(number of leaves)\Theta(\text{number of leaves}) explicitly; check it against the dominant term
Miscounting tree depthUsing log⁡2n\log_2 n out of habit instead of the actual branching factor's baseDepth is where subproblem size hits Θ(1)\Theta(1): solve n/bi=1n/b^i = 1 for i=log⁡bni = \log_b n, using the recurrence's actual bb
Assuming a uniform tree when splits are unequalRecurrences like T(n/3)+T(2n/3)T(n/3)+T(2n/3) tempt a "just use log⁡bn\log_b n" shortcutBound depth between the shortest and longest root-to-leaf path; both must be Θ(log⁡n)\Theta(\log n) for the argument to close
Treating the tree-derived bound as already provenThe level sums rely on idealized floors/ceilings and exact geometric seriesAlways follow with a substitution-method proof before citing the bound as established
Sloppy series recognition (geometric vs. arithmetic vs. harmonic)Skimming the level-cost sequence instead of computing a few explicit termsWrite out i=0,1,2i = 0, 1, 2 explicitly and check ratios between consecutive terms before invoking a series formula

Pioneers & history

The recursion tree is less the invention of one individual and more a standard visualization that crystallized as divide-and-conquer algorithm analysis matured through the 1960s–1980s, alongside the formal statement of the Master Theorem. Its logical ancestor is the general study of recurrence relations in combinatorics and numerical analysis, but its specific role as a pedagogical device for algorithm complexity — draw the tree, sum the levels, guess the closed form — was popularized through algorithms textbooks and courses that needed an intuitive bridge between recursive pseudocode and asymptotic notation.

Origins · 1 minDonald E. Knuth and how this was discovered
DE
Donald E. Knuth
1938–present · Formalized recurrence analysis for algorithms in "The Art of Computer Programming," establishing much of the standard toolkit — recursion trees, generating functions, and asymptotic methods — used to analyze divide-and-conquer procedures.

History
1962
— Hoare publishes Quicksort, motivating the study of divide-and-conquer recurrences.
1968
— Knuth begins publishing "The Art of Computer Programming," systematizing recurrence-solving techniques.
1974
— Aho, Hopcroft, and Ullman's "The Design and Analysis of Computer Algorithms" popularizes recursion-tree-style reasoning for algorithm courses.
1980
s — The Master Theorem is stated and proved in its now-standard three-case form, formalizing what recursion trees had long suggested informally.
1990
— CLRS ("Introduction to Algorithms") codifies the recursion-tree method as a named, standalone technique alongside substitution and the Master Theorem.

Where this matters

Recursion-tree reasoning underlies the complexity analysis of virtually every divide-and-conquer algorithm taught and deployed in practice: Merge Sort (T(n)=2T(n/2)+nT(n)=2T(n/2)+n, tree gives Θ(nlog⁡n)\Theta(n\log n)), Quicksort's average-case and worst-case recurrences, Binary Search's degenerate single-branch tree, Strassen's matrix multiplication (T(n)=7T(n/2)+Θ(n2)T(n) = 7T(n/2) + \Theta(n^2), revealing the sub-cubic Θ(nlog⁡27)\Theta(n^{\log_2 7}) bound), and the Fast Fourier Transform's T(n)=2T(n/2)+Θ(n)T(n) = 2T(n/2) + \Theta(n) recurrence that gives the Θ(nlog⁡n)\Theta(n\log n) bound underlying signal processing, audio/video codecs, and large-scale numerical libraries. Compiler writers and systems engineers reason about recursive algorithms' cache behavior and parallel span using the same level-by-level decomposition, since a recursion tree's depth also bounds the span (critical path length) of a parallel divide-and-conquer computation, directly informing scheduling and load-balancing decisions in parallel runtime systems. Database query planners and computational geometry libraries (closest-pair, convex hull) rely on the same style of recurrence to certify Θ(nlog⁡n)\Theta(n\log n) performance guarantees before code ever ships, and interview-style algorithm assessments at technology companies routinely test exactly this skill — sketch the tree, sum the levels, name the bound — as a proxy for a candidate's ability to reason about scalability without running benchmarks.

Ask the tutor: Can you show how the recursion tree handles a recurrence with a logarithmic driving function, like T(n)=2T(n/2)+nlog⁡nT(n) = 2T(n/2) + n\log n?

What is the difference between the recursion-tree method and the substitution method?

The recursion tree is a discovery tool: it visualizes how work is distributed across subproblem calls and lets you sum level costs to arrive at a plausible closed-form bound. The substitution method is a verification tool: you assume the guessed bound holds for smaller inputs, plug it into the recurrence, and check that the resulting inequality holds with an appropriate constant. In practice the two are used together — draw the tree to guess Θ(g(n))\Theta(g(n)), then run a substitution proof to confirm T(n)=O(g(n))T(n) = O(g(n)) or Θ(g(n))\Theta(g(n)) rigorously, since the tree's informal handling of floors, ceilings, and lower-order terms is not by itself a proof.

Does the recursion-tree method only work for recurrences the Master Theorem also solves?

No — this is one of its main advantages. The Master Theorem requires a single, uniform recurrence T(n)=aT(n/b)+f(n)T(n) = aT(n/b) + f(n) with one split ratio and a driving function satisfying specific polynomial comparability conditions. The recursion tree handles strictly more cases: unequal subproblem sizes (like T(n/3)+T(2n/3)+nT(n/3) + T(2n/3) + n), recurrences with extra logarithmic factors in f(n)f(n) that fall outside the Master Theorem's three clean cases, and recurrences where the split itself varies by input (e.g., depends on data, not just size). In all these cases you still build the tree and sum levels; you simply cannot fall back on the theorem's pre-packaged answer.

How do you find the depth of a recursion tree when subproblems don't all shrink at the same rate?

Track the shortest and longest root-to-leaf paths separately. The shortest path always follows whichever branch shrinks fastest (smallest subproblem fraction); the longest path always follows whichever branch shrinks slowest. If both paths reach the base case in Θ(log⁡n)\Theta(\log n) steps — even with different constants inside the Θ\Theta — the tree's overall depth is Θ(log⁡n)\Theta(\log n), and per-level sums bounded between these two extremes are enough to pin down the total asymptotic cost, as in the T(n/3)+T(2n/3)+nT(n/3) + T(2n/3) + n example.

What if the per-level costs don't form a clean geometric series?

Compute the first several terms explicitly (levels 0, 1, 2, 3) rather than trusting a pattern from a single ratio. Many real recurrences have level costs that are geometric only asymptotically, or that are dominated by one term after a constant number of levels; explicitly writing out early terms catches errors from applying a geometric-series formula to a sequence that isn't actually geometric. If the sequence resists simple classification, bound it above and below by geometric or arithmetic sequences you can sum, then use the substitution method to nail down the exact asymptotic class.

Why does the number of leaves in the tree equal n^(log_b a)?

The tree has depth log⁡bn\log_b n (since subproblem size shrinks by a factor of bb each level, and reaches size 1 after log⁡bn\log_b n levels), and each internal node produces exactly aa children. So the leaf count is alog⁡bna^{\log_b n}. Using the logarithm identity alog⁡bn=nlog⁡baa^{\log_b n} = n^{\log_b a} (both sides equal b(log⁡ba)(log⁡bn)b^{(\log_b a)(\log_b n)} after taking log⁡b\log_b of each), this simplifies to nlog⁡ban^{\log_b a} — precisely the exponent that also appears as the "critical polynomial" in the Master Theorem's case boundary.

Can the recursion-tree method give a wrong answer?

The method itself, applied carefully with attention to depth, leaf count, and honest series-summation, does not give an incorrect guess for well-posed recurrences — but it also does not certify that guess as correct without a follow-up proof. Common sources of actual error are sloppy execution: forgetting the leaf-cost term, misjudging whether a level-cost sequence is truly geometric, or mis-locating the tree's depth. These are execution mistakes, not flaws in the method, and they are exactly why the substitution-method check exists as a mandatory second step.

How does the recursion tree relate to the recurrence T(n) = 2T(n/2) + n underlying merge sort?

The tree has a root of cost nn (the merge step), two children each of cost n/2n/2 (summing to nn), four grandchildren each of cost n/4n/4 (again summing to nn), and so on — every level sums to exactly nn, and there are Θ(log⁡n)\Theta(\log n) levels before subproblems shrink to size 1. Multiplying Θ(log⁡n)\Theta(\log n) levels by Θ(n)\Theta(n) cost per level gives Θ(nlog⁡n)\Theta(n \log n), matching Merge Sort's well-known running time and matching the Master Theorem's "balanced" case, since f(n)=n=Θ(nlog⁡22)f(n) = n = \Theta(n^{\log_2 2}) exactly.

Before this