Intuition The ONE core idea
Some operations are rarely expensive but usually cheap, so judging each by its worst single case tells a lie about the true total work. Amortized analysis measures the guaranteed average cost across a whole sequence — like paying a small flat fee every time so the occasional huge bill is already covered.
Before you can read a single line of the parent topic , you must own every symbol it throws at you. This page builds each one from nothing, in the order they depend on each other.
Definition Operation, sequence, and
m
An operation is one single action you ask a data structure to do — a push, an increment, a union. A sequence is a list of these actions done one after another. The letter == m == is just the count of operations in that sequence.
Picture a row of m boxes, left to right. Box i is the i -th operation. We always read time left → right ; nothing is random, nothing is reordered.
Figure s01 — A row of m operation-boxes numbered left to right. Blue boxes are cheap (c i = 1 ); the occasional red box is a rare expensive spike. This row is the object every symbol on this page talks about.
Why the topic needs this: amortized analysis is a claim about a whole row of boxes , not about one box. Every symbol below is a way of talking about that row.
c i — the real cost of operation i
c i (read "c -sub-i ") is the actual amount of work operation number i really does — for example, "how many array cells did this push touch?". The little i underneath is the index : which box in the row we mean.
Picture: above each box, write the true number of steps it took. Most are tiny (c i = 1 ); once in a while one is big — say c i = 4 or c i = 8 (a spike whose size grows with how big the structure has become).
Intuition Why we can't just use the biggest
c i
If one box in a hundred costs 100 and the rest cost 1 , calling every box "100 " over-charges by nearly 100 × . The whole subject exists to charge each box honestly on average without pretending the spikes vanish.
∑ symbol (sigma)
∑ i = 1 m c i is shorthand for "add up c i for every i from 1 up to m ":
∑ i = 1 m c i = c 1 + c 2 + c 3 + ⋯ + c m .
The number under ∑ (here i = 1 ) is where you start counting ; the number on top (here m ) is where you stop .
T ( m ) — total actual cost
T ( m ) = ∑ i = 1 m c i is the grand total of real work across the whole sequence. It is a single number: the height of all the bars added together.
Why the topic needs it: the honest average is T ( m ) / m . Everything downstream is a trick to compute or bound T ( m ) without summing every spike by brute force.
c ^ i — the "charged" cost (the hat means chosen-by-us)
The hat in c ^ i (say "c -hat-sub-i ") marks a number we invent — the price we charge for operation i , which may be more or less than the real c i . The one rule that keeps us honest:
∑ i = 1 m c ^ i ≥ ∑ i = 1 m c i .
In words: the total of our made-up prices must never undercount the total real work.
c ^ (no index) — the single reported amortized cost
c ^ without an index is the one number we advertise as "the amortized cost per operation". It is the average of our charges:
c ^ = m 1 ∑ i = 1 m c ^ i .
c ^ i is the charge on one box; c ^ is that spread evenly over all boxes.
Intuition Why we are allowed to report a single average
c ^
Because of the honesty rule, ∑ c ^ i ≥ ∑ c i = T ( m ) . Divide both sides by m : the average charge c ^ is ≥ T ( m ) / m , the true average work. So quoting the single flat number c ^ never understates the real per-operation cost — it is a guaranteed ceiling. Reporting one flat price is legitimate only because it sits above the honest average, not because the spikes disappeared.
Intuition Picture: flat pricing
Imagine a market stall charging a flat $3 for every item even though some items cost the seller $1 and one rare item costs $100. As long as the flat prices collected add up to at least what the seller actually spent, the stall never loses money. c ^ is that flat price; ≥ is the "never loses money" rule.
Definition Big-O in one breath
O ( 1 ) means "cost stays bounded by a constant no matter how big the structure grows" — flat. O ( n ) means "cost grows in proportion to the number of elements n " — a straight line, where n is the count of elements in the structure (defined fully in §5). See Big-O, Big-Omega, Big-Theta for the full family.
Picture two curves: O ( 1 ) is a horizontal line; O ( n ) is a rising diagonal. The whole punchline of the topic is turning a scary O ( n ) spike into an O ( 1 ) flat line on average .
Figure s02 — Two cost curves against structure size n . The red diagonal is O ( n ) — the size of one worst-case push. The flat blue line is O ( 1 ) — the amortized cost we aim to prove. The whole topic is the arrow from red down to blue.
D i — a snapshot of the structure
D i means "the state of the data structure after operation i has finished". D 0 is the starting state (empty). Think of D i as a photograph taken between boxes i and i + 1 .
n and s for a dynamic array
For a dynamic array : == n == = number of elements currently stored ; == s == = the capacity , i.e. how many slots are allocated. Always n ≤ s . When n hits s , the array is full and must grow.
Picture a shelf with s slots, of which n hold a book. "Full" means every slot has a book.
Figure s03 — A shelf of s allocated slots (orange width) of which n currently hold a book (blue width). When the blue width reaches the orange width the array is full and must double.
Definition A geometric series
A geometric series is a sum where each term is a fixed multiple of the last. The one that matters here doubles:
1 + 2 + 4 + 8 + ⋯ + 2 k = 2 k + 1 − 1.
The key feeling: the sum is less than twice the last term . See Geometric Series .
Intuition The picture that makes doubling "free-ish"
Stack blocks of width 1 , 2 , 4 , 8 , … . Each new block is as wide as everything before it combined, plus one . So the whole stack is barely wider than the final block. Copies during table doubling cost 1 + 2 + ⋯ + 2 k < 2 m — never more than about twice the number of pushes.
Figure s04 — Doubling blocks of width 1 , 2 , 4 , 8 laid end to end. The full stack (= 15 ) is barely wider than the final block (= 8 ): the sum is under twice the last term, which is why total copy work stays below 2 m .
Why the topic needs it: this single inequality is why the aggregate method gives T ( m ) < 3 m , hence O ( 1 ) amortized.
Φ (capital Phi) — stored energy
Φ ( D i ) is a number we attach to a state D i , meant to behave like stored energy or savings in a piggy bank. Φ ( D 0 ) = 0 (empty start, no savings) and Φ ≥ 0 always (never in debt).
ΔΦ — the change in potential
The triangle Δ (Greek "delta") means "change in ". So
Δ Φ i = Φ ( D i ) − Φ ( D i − 1 )
is how much the stored energy went up or down during operation i . The master equation of the whole topic is c ^ i = c i + Δ Φ i : charge the real cost plus whatever you added to (or took from) savings.
≥ 0 and Φ ( D 0 ) = 0 matter together
When you add all the c ^ i , the potential terms telescope — every Φ ( D i ) cancels except the first and last, leaving ∑ c ^ i = ∑ c i + Φ ( D m ) − Φ ( D 0 ) . With Φ ( D 0 ) = 0 and Φ ( D m ) ≥ 0 , the leftover is ≥ 0 , so ∑ c ^ i ≥ ∑ c i — honest. That's the entire justification, and it only works because of those two conditions.
The parent topic solves everything three different ways. You do not need the details yet — just recognise the names when the map below uses them:
Definition The three accounting methods, in one line each
Aggregate method — "just add it all up": compute the total T ( m ) directly, then report c ^ = T ( m ) / m , the same flat cost for every operation.
Accounting (banker's) method — "prepay and bank credit": over-charge cheap operations, store the surplus as credit on elements, and let expensive operations spend that saved credit instead of charging the user.
Potential method — "stored energy": track a single number Φ (the piggy bank) and use c ^ i = c i + Δ Φ i ; cheap ops raise Φ , expensive ops drain it.
These same symbols power the harder examples the parent links: credits-on-bits for the Disjoint Set Union (Union-Find) and rank arguments, potential for Splay Trees and Fibonacci Heaps . Master them here once.
The diagram below shows how the foundations feed into the three methods and finally into the topic.
operation and sequence, m
summation and total T of m
accounting method credits
potential Phi and delta Phi
Recall Plaintext walkthrough of the map (read this if the diagram does not render)
Start at "operation and sequence, m " — the raw idea of a row of boxes. That feeds "actual cost c i ", which feeds "summation and total T ( m ) ", which (together with "Big-O") feeds the central node "amortized cost c ^ ".
From c ^ three arrows fan out to the three methods: aggregate (also fed by "dynamic array n , s " → "geometric series"), accounting (credits), and potential (fed by "Φ and ΔΦ ").
All three methods point into the final node, Amortized analysis — the parent topic. In short: symbols → c ^ → three methods → the topic.
Test yourself — each line is a question ::: answer reveal.
What does the index i in c i tell you? Which operation in the sequence we mean — the i -th box in the left-to-right row.
Read ∑ i = 1 m c i in plain English. Add up the actual cost of every operation from the first (i = 1 ) to the last (i = m ).
What is T ( m ) ? The total actual cost of the whole sequence, ∑ i = 1 m c i — one number.
What does the hat in c ^ i signify? A cost we choose to charge for one operation, which may differ from the real c i ; only rule is ∑ c ^ i ≥ ∑ c i .
Difference between c ^ i and c ^ (no index)? c ^ i is the charge on one operation; c ^ = m 1 ∑ c ^ i is the single averaged number we report.
Why may we report the single average c ^ ? Because ∑ c ^ i ≥ T ( m ) , dividing by m gives c ^ ≥ T ( m ) / m — a guaranteed ceiling on true average cost.
O ( 1 ) vs O ( n ) in shape?O ( 1 ) is a flat horizontal line (bounded constant); O ( n ) is a rising diagonal (grows with size).
For a dynamic array, what are n and s ? n = elements currently stored; s = allocated capacity; always n ≤ s , full when n = s .
Value of 1 + 2 + 4 + ⋯ + 2 k , and why it matters? 2 k + 1 − 1 , which is < twice the last term — so copy work stays under 2 m .
What is Φ ( D i ) and its two required conditions? Stored energy of state D i ; need Φ ( D 0 ) = 0 and Φ ( D i ) ≥ 0 for all i .
What does Δ Φ i equal? Φ ( D i ) − Φ ( D i − 1 ) , the change in potential during operation i .
State the master equation of the potential method. c ^ i = c i + Φ ( D i ) − Φ ( D i − 1 ) — actual cost plus change in potential.
Name the three methods in one word each. Aggregate (add-and-divide), Accounting (bank credit), Potential (stored energy Φ ).