The Potential Method for Amortized Analysis

Choose a stored-work potential and use telescoping to bound the expense of a complete operation sequence.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Charge for a change in stored work
  2. A binary counter can pay for its carries

Charge for a change in stored work

For operation \(i\) with actual cost \(c_i\), define its amortized cost as

\[ \widehat c_i=c_i+\Phi_i-\Phi_{i-1}. \]

If \(\Phi_0=0\) and \(\Phi_i\ge0\), summing cancels intermediate potentials and bounds total actual cost by total charges. This method is useful when the aggregate cost is hard to count directly. The potential needs to reflect the state that makes a future operation expensive.

A binary counter can pay for its carries

Let cost equal the number of changed bits in an unbounded binary increment. Choose \(\Phi\) as the number of ones. If the number ends in \(t\) ones, increment changes \(t+1\) bits and the potential changes by \(1-t\). The amortized cost is exactly \(2\). For example, \(0111\) becomes \(1000\), which costs four writes and lowers potential by two. The result permits a costly individual operation. A dynamic array similarly carries potential between resizes, while worst-case scheduling cares about when the work actually happens.[1][2]

References

  1. MIT OpenCourseWare, Design and Analysis of Algorithms: Lecture Notes ↩
  2. Eric Lehman, F. Thomson Leighton and Albert R. Meyer, Mathematics for Computer Science ↩