Meaning and conditions
A runtime recurrence relates work on a problem to work on its subproblems. The calculator solves the restricted binary case T(n)=2T(n/2)+cn at n=2ᵏ.[1]
In general, T(n)=aT(n/b)+f(n) describes equal-sized subproblems and local overhead. Base case, size convention and cost model turn it into a specific sequence. The master theorem already treats corresponding growth orders; this page also explains model construction and exact evaluation for one fixed recurrence.[1]
Reasoning step by step
- Count recursive calls separately from local work.
- In the special case, level j contains 2ʲ problems of size n/2ʲ.
- Each internal level costs cn in total; there are k such levels.
- Each of the n leaves costs t, giving T=n·t+cnk.
Units, inverses and limits
k is an integer from 0 to 52, n=2ᵏ; t≥0 and c≥0 use the same abstract work units. The calculator handles neither unequal subproblems nor floor/ceiling recurrences. At n=1, T=t exactly. Asymptotic order is not elapsed seconds.[1]
Two fully worked examples
Eight elements
- Given
- n=8=23, T(1)=2, c=3.
- Find
- Find total work.
Add leaf and internal-level work symbolically.
Substitute the supplied values.
Result: 88 work units.
Check: Directly: T(2)=10, T(4)=32, T(8)=88.
Infer overhead in a cost model
- Given
- n=16, T(1)=1 and T(16)=144.
- Find
- Find coefficient c.
Solve the exact expression for c.
Substitute values and check.
Result: c=2 units per element per internal level.
Check: 16·1+2·16·4=144. This inverse requires n>1.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Seeing the relationship
Runtime recurrence: model, levels and exact cost
Free with a Quanta account. Your download stays ready after registration.
Five exercises with solutions
Calculate · Foundation
k=2, t=1, c=2: find T.
Show hint
Use the stated definition and check its assumptions.
Learning goal: Use the exact expression.
Rearrange · Application
n=8, c=1 and T=32: find t.
Show hint
Use the stated definition and check its assumptions.
Learning goal: Recover base work.
Interpret · Application
Why are there three internal levels but eight leaves at n=8?
Show hint
Use the stated definition and check its assumptions.
Learning goal: Distinguish depth from node count.
Show solution and calculation
Three halvings reach size one; call counts are 1, 2, 4 and finally 8 leaves.
Error analysis · Application
Someone assigns T(1) to internal levels and additionally charges cn at leaves. Correct this.
Show hint
Use the stated definition and check its assumptions.
Learning goal: Avoid double-counting the base case.
Show solution and calculation
The defined base case stops recursion.
Only k internal levels cost cn each; leaf work totals nt.
Transfer · Challenge
What happens to T when c=0 while t>0?
Show hint
Use the stated definition and check its assumptions.
Learning goal: Respect coefficient boundaries.
Show solution and calculation
T=nt grows linearly.
The usual Θ(n log n) statement here requires positive linear overhead c.
Check your understanding with the formula’s reference test.
7 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Continue learning
Connect this calculation to master theorem and Big-O notation.
Sources for this explanation
Quanta · Updated November 9, 2026
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Added a full article with original DE/EN examples, exercises, models and source checks.
Cite this reference page
Quanta. Divide-and-conquer runtime recurrence. Updated November 9, 2026. https://quanta-study.de/en/formula-sheet/laufzeitrekurrenz
When citing a specific scientific statement, also cite the specialist source linked to that statement.