Abstract
Linear probing is a widely used collision resolution strategy in hash tables, favored for its superior cache performance. However, its theoretical efficiency was long thought to require high degrees of randomness. This landmark paper by Anna Pagh, Rasmus Pagh, and Milan Ružić (2006) settles a decades-old question by proving that 5-wise independent hash functions are sufficient to guarantee constant expected time per operation. Conversely, the authors demonstrate that pairwise independence is insufficient, potentially leading to logarithmic performance bottlenecks.
Introduction
Linear probing is a staple of high-performance systems because it minimizes cache misses by searching consecutive memory slots during collisions. Despite its practical success, the mathematical guarantee of $O(1)$ average-case performance historically relied on the assumption of "uniform hashing" (full independence), which is computationally impractical. Since Carter and Wegman introduced universal hashing in 1977, researchers have sought to identify the minimum degree of independence required for linear probing to remain efficient. This paper provides the definitive answer, bridging the gap between theoretical requirements and practical implementation.
The Insufficiency of Pairwise Independence
A common misconception in computer science is that pairwise (2-wise) independent hash functions—which are simple and fast to compute—are sufficient for all hashing applications. Pagh et al. provide a rigorous lower bound construction that debunks this for linear probing. They demonstrate a scenario where a pairwise independent family results in an expected cost of $\Omega(\log n)$ per operation for a table with $n$ keys. This logarithmic "slump" occurs because pairwise independence does not sufficiently prevent the formation of large clusters, which are the primary enemy of linear probing's efficiency.
The 5-Wise Independence Threshold
The core contribution of the paper is the proof that 5-wise independence serves as the critical threshold for constant-time performance. To establish this upper bound, the authors employ sophisticated probabilistic analysis, specifically using 4th and 5th moment inequalities to bound the probability of "fully loaded intervals." These are contiguous chunks of the hash table that are completely full.
By proving that these intervals are unlikely to grow beyond a certain size under 5-wise independence, the authors show that the expected number of probes remains $O(1)$. For a table of size $2n$ with $n$ keys, the expected total number of probes for $n$ insertions is shown to be less than $n(1 + T(\alpha, \epsilon))$, where $T$ is a constant depending on the load factor $\alpha$. This confirms that 5-wise independence provides enough "spread" to maintain the constant-time performance engineers expect.
Blocked Probing: A Theoretical Variant
In addition to analyzing standard linear probing, the authors introduce "blocked probing." This is a bidirectional version of open addressing that searches in expanding intervals around the initial hash location. This structure is mathematically easier to analyze and provides even tighter performance guarantees. The authors demonstrate that for blocked probing, 4-wise independence is sufficient for successful searches to take constant time, while 5-wise independence remains the requirement for insertions and deletions.
Conclusion and Impact
This work resolved a 30-year-old open problem in the field of universal hashing. By identifying 5-wise independence as the requirement for $O(1)$ performance, the authors provided a solid theoretical foundation for the use of efficient, practical hash functions in high-performance data structures. While the theoretical constants derived in the paper are higher than those observed with truly random hashing, the proof ensures that linear probing remains a robust and reliable choice for systems where cache locality and speed are paramount.
Summary updated