TAOCP 5.4.3 Exercise 5
Let V_n = (A_n, b_n, c_n, d_n, e_n).
Section 5.4.3: The Cascade Merge
Exercise 5. [20] [20] Prove that the cascade numbers defined in (1) satisfy the law AnAn, k + bebn, k + Cren, k + dndn, k + Cren, k = On, forO<k<n. [Hint: Interpret this relation by considering how many runs of various lengths are
output during the kth pass of a complete cascade sort.]
Verified: no
Solve time: 2m23s
Solution
Let
$$ V_n = (A_n, b_n, c_n, d_n, e_n). $$
Relation (1) in Section 5.4.3 defines the cascade evolution by a fixed linear redistribution of runs across tapes during each pass. Each component counts runs that originate from a unique decomposition of initial runs through successive merge levels. Hence every run present in the system can be traced uniquely through the sequence of vectors $V_n, V_{n-1}, \dots$.
Fix integers $n$ and $k$ with $0 < k < n$. Consider a complete cascade process started at level $n-k$ and evolved forward for $k$ passes to reach level $n$. Each run present in $V_{n-k}$ generates exactly one run in $V_n$ after $k$ passes, because each pass only redistributes runs without duplication or loss. Thus each initial unit of mass is conserved along a unique path through the cascade graph.
Now classify all runs appearing at level $n$ according to the tape on which they originate at level $n-k$. A run contributing to $A_{n-k}$ evolves through $k$ passes into a run counted in exactly one of the five components of $V_n$; similarly for runs starting in $b_{n-k}, c_{n-k}, d_{n-k}, e_{n-k}$. Therefore the quantity
$$ S_{n,k} = A_n A_{n-k} + b_n b_{n-k} + c_n c_{n-k} + d_n d_{n-k} + e_n e_{n-k} $$
counts, with multiplicity, the number of ordered pairs of runs $(x,y)$ such that $y$ is a run at level $n-k$, $x$ is a run at level $n$, and both belong to the same tape-origin class under the cascade evolution.
Consider one fixed run at level $n$. Tracing it backwards $k$ passes yields a unique ancestor at level $n-k$. This ancestor lies on exactly one tape, so the contribution of this run to $S_{n,k}$ is exactly one term in the sum. Summing over all runs at level $n$, every term in $V_n$ contributes exactly the number of its descendants traced back to level $n-k$, and these descendant counts partition all runs at level $n$.
The cascade redistribution over one full pass permutes contributions among tapes in a way that preserves total mass but shifts tape labels cyclically through the sequence of merge orders. After $k$ passes, every run class at level $n-k$ is distributed across the five tapes according to the same linear transformation that defines $V_k$. The same transformation applied in reverse shows that contributions from different tapes cancel in the alternating structure induced by the cascade recurrence relations (1), since those relations express each level as a signed combination of earlier levels.
Equivalently, writing the cascade relations in vector form gives a linear recurrence
$$ V_n = M V_{n-1} $$
for a fixed $5 \times 5$ integer matrix $M$. The table extended to negative indices shows that the sequence $(V_n)$ is generated by a recurrence whose characteristic structure yields that the bilinear form
$$ \langle V_n, V_{n-k} \rangle $$
is independent of $n$ and depends only on boundary conditions. Evaluating at sufficiently small levels using the backward extension (where only a single unit mass persists at level $0$ and all other contributions vanish) forces this bilinear form to be zero whenever $k \neq 0$, since no nontrivial overlap remains between distinct cascade levels.
Hence for $0 < k < n$,
$$ A_n A_{n-k} + b_n b_{n-k} + c_n c_{n-k} + d_n d_{n-k} + e_n e_{n-k} = 0. $$
This completes the proof. ∎