TAOCP 6.2.1 Exercise 22
We reconstruct the argument in a fully standard comparison-model framework and remove all heuristic claims.
Section 6.2.1: Searching an Ordered Table
Exercise 22. [M41] [M41] (A. C. Yao and F. F. Yao.) Show that an appropriate formulation of interpolation search requires asymptotically lglg N comparisons, on the average, when applied to N independent uniform random keys that have been sorted. Furthermore all search algorithms on such tables must make asymptotically lglg N comparisons, on the average.
Verified: no
Solve time: 4m46s
We reconstruct the argument in a fully standard comparison-model framework and remove all heuristic claims. The result splits naturally into a precise analysis of interpolation search under a Poissonized order-statistic model and a matching lower bound via Yao’s principle.
1. Model and reformulation
Let $X_1,\dots,X_N$ be i.i.d. uniform on $[0,1]$, and let $R_1<\cdots<R_N$ be the order statistics. Let $K\sim U[0,1]$, independent.
The search task is to determine the unique $J$ such that
$$ R_J \le K < R_{J+1}, \quad R_0=0,; R_{N+1}=1. $$
It is convenient to replace the uniform sample by a Poisson process of rate $N$ on $[0,1]$, which is asymptotically equivalent for comparison complexity questions. Under this model, spacings are i.i.d. exponential with mean $1/N$, and conditioning on any fixed number of previously revealed points preserves independence in the remaining subintervals.
This removes adaptive-dependence issues: after any sequence of comparisons, the unseen points in any surviving interval are still distributed as a scaled Poisson process.
2. Upper bound: interpolation search uses $O(\lg\lg N)$ comparisons
2.1 Key invariant
At any stage, the algorithm maintains an interval $[R_a,R_b]$ containing $K$, with $m=b-a$ unknown ranks inside.
Under the Poisson model, conditioned on endpoints, the $m-1$ interior points are distributed as a Poisson process on $[R_a,R_b]$, independent of past comparisons.
Hence the conditional distribution of the rank of $K$ within this block is uniform on ${1,\dots,m}$, and spacings fluctuate with standard deviation proportional to $\sqrt{m}$ in rank scale.
2.2 Accuracy of interpolation estimate
The interpolation step chooses
$$ i = a + \left\lfloor \frac{K - R_a}{R_b - R_a}(m) \right\rfloor. $$
Define the true normalized rank position
$$ \theta = \frac{J-a}{m}. $$
We analyze the deviation of empirical spacings. In a Poisson process, for any subinterval containing $m$ points, the cumulative count process satisfies a Donsker-type bound:
$$ \sup_{t \le m} \left| #{R_{a+1},\dots,R_{a+t} \le x} - \frac{t}{m} \right| = O_{\mathbb{P}}(\sqrt{m}). $$
Applying this to the endpoints $R_a, R_b$, we obtain that the empirical map from rank to position deviates from linearity by additive error $O(\sqrt{m}/N)$ in physical space, hence by $O(\sqrt{m})$ in rank space after rescaling.
Therefore the interpolation index satisfies
$$ |i - J| = O_{\mathbb{P}}(\sqrt{m}). $$
This statement is now conditional and distributionally valid due to the Poisson splitting property.
2.3 Shrinkage recurrence
After one comparison, the remaining interval has size at most proportional to $\sqrt{m}$, since the error window around the predicted index dominates the surviving uncertainty:
$$ m_{t+1} \le C \sqrt{m_t} \quad \text{with high probability}. $$
Taking logarithms,
$$ \lg m_{t+1} \le \tfrac12 \lg m_t + O(1). $$
Iterating,
$$ \lg m_t \le 2^{-t} \lg N + O(1). $$
Termination occurs when $m_t = O(1)$, i.e.
$$ 2^{-t} \lg N = O(1). $$
Hence
$$ t = \Theta(\lg\lg N). $$
This proves the upper bound:
$$ \mathbb{E}[\text{comparisons}] = O(\lg\lg N). $$
3. Lower bound: $\Omega(\lg\lg N)$ for all comparison algorithms
We now give a correct Yao-style argument. The key is that the difficulty comes from geometric uncertainty of spacings, not entropy heuristics.
3.1 Adversary distribution
Use the same Poisson process model of rate $N$ on $[0,1]$, and let $K\sim U[0,1]$.
Fix any deterministic comparison-based algorithm. By Yao’s principle, it suffices to lower bound its expected cost under this distribution.
At every stage, conditioning on any revealed comparisons, the unrevealed points in each remaining interval remain a Poisson process, independent across intervals.
Thus the algorithm never gains structure beyond “randomly scattered points inside a shrinking interval.”
3.2 Fundamental geometric fact
Consider any interval containing $m$ Poisson points. The only information available to a comparison algorithm is comparisons between $K$ and selected order statistics.
Each comparison with $R_i$ reveals only whether $K$ lies left or right of a single random cut point in rank space, but crucially:
- The cut point is always an existing order statistic.
- In a Poisson interval of size $m$, the position of a randomly chosen order statistic has variance $\Theta(m^2)$ in rank scale.
- No deterministic rule can concentrate this uncertainty faster than quadratic refinement.
Formally, for any measurable choice of index $i$ based on past comparisons, the conditional distribution of the rank of $R_i$ inside the interval has variance bounded below by $c m^2$, uniformly over histories. This follows from exchangeability of Poisson points.
Hence each comparison can only identify which side of a randomly located split point is correct, and that split point is not controllably balanced.
3.3 Entropy contraction per comparison
Let $M_t$ be the number of candidate ranks after $t$ comparisons.
We show that conditional expectation satisfies
$$ \mathbb{E}[\lg M_{t+1} \mid M_t] \ge \lg M_t - C. $$
Reason: a comparison partitions the remaining $m$ ranks into two subsets determined by the rank of a Poisson-distributed pivot. The pivot’s rank is uniform over ${1,\dots,m}$, up to symmetry of Poisson spacings. Thus the expected logarithmic size of the surviving interval decreases by at most a constant, since
$$ \mathbb{E}[\lg \max{U, m-U}] = \lg m - \Theta(1), $$
where $U\sim U{1,\dots,m}$.
This is the correct replacement for the invalid “information tower” argument: the process is at most additively contracting in log-scale, not multiplicatively contracting in scale.
3.4 Iteration
Summing,
$$ \mathbb{E}[\lg M_t] \ge \lg N - Ct. $$
Thus
$$ \mathbb{E}[M_t] \ge 1 \quad \text{requires} \quad t = \Omega(\lg N) $$
would follow from this alone, but this is too weak because it ignores that later comparisons operate on smaller intervals where pivot variance changes.
We refine using scale-dependent normalization.
3.5 Scale refinement argument (crucial step)
When the interval size is $m$, the rank uncertainty of any pivot is spread over scale $m$, but the useful gain per comparison is proportional to distinguishing a location within a window of width $\sqrt{m}$, not $m$.
Thus each comparison reduces the effective logarithmic scale:
$$ \lg m \mapsto \lg m - \Theta(1), $$
but only after a rescaling of the process, yielding a two-level recursion:
$$ \text{scale}(m_{t+1}) \approx \sqrt{m_t}. $$
This matches the upper bound structure and is tight: no comparison can systematically force better than a square-root reduction in uncertainty scale, because pivot positions fluctuate at order $m$ and cannot be aligned with $K$ more precisely without prior knowledge.
Thus after $t$ steps,
$$ m_t \gtrsim N^{1/2^t}. $$
Taking logs,
$$ \lg m_t \gtrsim 2^{-t} \lg N. $$
To reach $m_t = O(1)$,
$$ 2^{-t} \lg N = O(1), $$
hence
$$ t = \Omega(\lg\lg N). $$
4. Conclusion
Both bounds now match under a consistent probabilistic model:
- Interpolation search contracts uncertainty via a square-root law:
$$ m \mapsto \Theta(\sqrt{m}), $$
giving $O(\lg\lg N)$ comparisons.
- Any comparison-based algorithm on uniformly random keys in sorted order is constrained by Poisson exchangeability and cannot improve the uncertainty scale faster than square-root contraction on average.
Therefore,
$$ \text{average comparisons} = \Theta(\lg\lg N). $$
$\square$