Manuscript Offprint
arXiv:2610.31363A Sharp Analysis of Fixed Offset Hash Tables
Abstract
We consider the class of open addressing hash tables that uses a fixed offset sequence to find an open slot in the table. As special cases this subsumes linear probing ( ) and quadratic probing ( ).
We give a simple analysis that the expected insertion time when the load factor is is . This bound is tight for linear probing (but not for quadratic probing), so the analysis cannot be improved at this level of generality.
1 Introduction
We consider a class of open addressing hash tables defined by a fixed offset probe sequence, which includes linear probing [Knu63] and quadratic probing [Mau68] as special cases. A hash table in this class is defined by a permutation of , indexing the slots of the table. An operation places into the first slot among
where is the hash function and without loss of generality.
Whereas the behavior of linear probing has been understood for decades [Knu63, Pet57, JS62, KW66, MY80, FPV98, Jan01], there were essentially no theoretical results on quadratic probing and general fixed offset probing until very recently. Kuszmaul and Xi [KX24] proved that all fixed offset hash tables have constant expected insertion time up to load factor 0.089 (8.9%). Guo, Pettie, and Wan [GPW27] improved this load factor limit to 35.74% for any fixed offset probe sequence and to 37.61% for the specific case of quadratic probing . Zamir [Zam26] proved that at load factor , any fixed offset hash table has expected insertion cost. Hu, Kuszmaul, Liang, Walzer, Yu, and Zhou [HKL 26a] recently proved that for quadratic probing (but not other fixed offset schemes) the expected insertion at load factor , , is , nearly reaching the conjectured bound of . The probe bound of Hu et al. [HKL 26a] is superior to the bound of linear probing [Knu63], though they are comparable in terms of cache misses, as they typically touch a local area of the array of width . Zamir [Zam26] proved that no open addressing hash table can have locality .
Supported by NSF Grant CCF-2446604.
Our analysis is unlike the recent work on quadratic and fixed offset probing [KX24, GPW27, HKL 26b, Zam26], and unlike prior analyses of linear probing [Knu63, Pet57, JS62, KW66, MY80, FPV98, Jan01, PPR09, PT16]. It is elementary, though counterintuitive in some ways.
1.2 Organization
Section 2 introduces some notation and conventions concerning sequences and sets of sequences. Section 3 defines the function, which counts how many slots of S are occupied by insertion sequence A. Section 4 proves a recurrence for the number of sequences that fully occupy S, and Section 5 applies this recurrence to upper bound the expected insertion time.
2 Notation, Definitions, and Conventions
The set of occupied slots in the hash table after inserting is uniquely determined by and the fixed offset permutation , so we shall regard the insertion sequence itself as an element of . We assume is uniformly random, so all such sequences occur with probability . If is ultimately inserted into slot , the cost of the insertion is .
Lower case letters are usually elements, upper case letters are either sequences or sets of elements, and calligraphic letters are sets of sequences. Catenation between a sequence and an element or catenation of two sequences is indicated by juxtaposition, e.g., or . If is a sequence, and are the sequences and , respectively, while is after removing the th element.
3 Properties of Occupation
Much of the analysis revolves around the occupation function Occupy, which implicitly depends on the fixed offset permutation although the specific permutation itself never enters into the analysis.
Definition 3.1. Let be a set of slots and be an input sequence. denotes the number of slots in that are occupied after inserting into the empty table.
Theorem 3.1 lists some basic properties of the Occupy function.
Lemma 3.1. Let be any set of slots.
- For any sequence and index ,
- Let be two sequences for which , for some index . Then
Proof. Let and denote the state of the hash table for the two input sequences, at various points in time. Initially, both and are empty, and after the prefix are identical. At any subsequent time, the number of occupied slots in is one more than that of .
We prove by induction that after any prefix of is inserted, the set of occupied slots in is a subset of the occupied slots in . Suppose is the slot occupied in but not just before , , is inserted. The claim holds if ultimately occupies slot in (and hence occupies any other slot in ). If ultimately occupies a slot in then the probe sequence avoids , hence occupies in as well. Either way the claim holds after inserting .
Claim 2. By Claim 1,
which implies the claim.
The analysis focuses on the relationship between the following functions.
Definition 3.2. Define the following:
In other words, is the set of length-t sequences that fully occupy and are those that still occupy when the th element is removed. is the number of sequences in , and is an upper bound on the probability that any particular of size is fully occupied, when picking a length-t input sequence at random.
Lemma 3.2.
Proof. This follows from Theorem 3.1 and the fact that there are n choices for the ith element of the sequence.
Lemma 3.3. For any fixed offset permutation, the expected cost of inserting the th element is at most
Proof. Let be the fixed offset permutation, and the uniformly random input sequence . Define to be the first slots in the probe sequence for . The expected insertion cost is
Linearity of expectation
Definition of .
Theorem 3.3 reduces the problem to bounding . In Section 4 we give a recursive expression for and , then analyze and the cost of insertion in Section 5.
4 The Recursive Bound
The and functions are difficult to evaluate directly, but easy to evaluate when the table is full. Clearly and . Theorem 4.1 allows us to work backward from these values, by upper bounding and in terms of and , respectively.
Theorem 4.1. For any set S with , and any ,
Moreover, we have
Throughout this section , , and are fixed. For any , , we define the potential to be
In other words, is the expected number of occupied slots in S when A is extended by a random -length suffix B. Define to be the change in potential:
Remember that and are defined with respect to fixed S, t.
Lemma 4.2. The potential and change-of-potential satisfy the following.
-
For any , .
-
Letting be the empty sequence, .
-
For any , , .
-
For every , .
Proof. Part 1. Follows directly from the definition.
Part 2. By symmetry the probability that any particular slot is occupied after t insertions is . The claim follows by linearity of expectation.
Part 3. Observe that , so .
Part 4. For any and any , Theorem 3.1 implies . Thus,
Recall that is the number of length-t sequences fully occupying . Define as follows
Theorem 4.2.
We could have calculated differently, by taking each and measuring the change in potential as each element of is appended to the sequence. Note that the sum of these values telescopes to .
Now fix and consider the last sum , Recall that is the subset of sequences in that still occupy when the th element is removed. From Theorem 3.2 we know that .
Lemma 4.3.
Proof. Observe that if then every with is also in . If we group the terms of the sum with a common , each appears an equal number of times. By Theorem 4.2 the net contribution of each group is zero.
Thus, to bound it suffices to consider only sequences in .
Lemma 4.4.
Proof.
Theorem 4.3
Theorem 4.2
Theorem 3.2
5
☐
We now have all the pieces to assemble a proof of Theorem 4.1.
Proof of Theorem 4.1. Using Theorem 4.4 to upper bound , we now have
hence
Since this bound applies to any with size , is upper bounded in the same way.
☐
5 Analysis of the Expected Insertion Time
By Theorem 3.3 the expected insertion cost is bounded in terms of , and Theorem 4.1 gives us a recursive expression for . In the base case we have . After insertions there is one free slot, which by symmetry is outside any particular k-element set with probability . Applying Theorem 4.1, we bound as follows, where .
Theorem 4.1
For , this is . Applying Theorem 3.3, the expected insertion cost is at most
6 Conclusion
An interesting open problem is to determine the independence necessary to implement fixed offset or quadratic hashing that preserves the guarantees of this paper or . It is known that 5-wise independence suffices for linear probing , but 4-wise independence is in general not enough .
AI Acknowledgment. The original idea came from interacting with GPT-6 Astra. The simplified presentation of the paper is due to the authors, who take full responsibility for the correctness of all statements and proofs.
References
[FPV98] Philippe Flajolet, Patricio V. Poblete, and Alfredo Viola. On the analysis of linear probing hashing. Algorithmica, 22(4):490–515, 1998.
[GPW27] Yuhao Guo, Seth Pettie, and Chengzhang Wan. A simple analysis of quadratic probing and other open addressing schemes. In Proceedings of the 10th SIAM Symposium on Simplicity in Algorithms (SOSA), 2027.
[HKL 26a] Yang Hu, William Kuszmaul, Jingxun Liang, Stefan Walzer, Huacheng Yu, and Renfei Zhou. Quadratic probing insertions are . CoRR, abs/2608.28512, 2026.
[HKL 26b] Yang Hu, William Kuszmaul, Jingxun Liang, Stefan Walzer, Huacheng Yu, and Renfei Zhou. Quadratic probing revisited: Smoothed analysis and the fall of Robin Hood. CoRR, abs/2607.13247, 2026.
[Jan01] Svante Janson. Asymptotic distribution for the cost of linear probing hashing. Random Struct. Algorithms, 19(3-4):438–471, 2001.
[JS62] Geza Schay Jr. and Wilhelm G. Spruth. Analysis of a file addressing method. Commun. ACM, 5(8):459–462, 1962.
[Knu63] Donald E. Knuth. Notes on “open” addressing. Unpublished, 1963.
[KW66] Alan G. Konheim and Benjamin Weiss. An occupancy discipline and applications. SIAM J. Appl. Math., 14(6):1266–1274, 1966.
[KX24] William Kuszmaul and Zoe Xi. Towards an analysis of quadratic probing. In Proceedings of the 51st International Colloquium on Automata, Languages, and Programming (ICALP), volume 297 of LIPIcs, pages 103:1–103:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2024.
[Mau68] W. Douglas Maurer. Programming technique: An improved hash code for scatter storage. Commun. ACM, 11(1):35–38, 1968.
[MY80] Haim Mendelson and Uri Yechiali. A new approach to the analysis of linear probing schemes. J. ACM, 27(3):474–483, 1980.
[Pet57] W. Wesley Peterson. Addressing for random-access storage. IBM Journal of Research and Development, 1(2):130–146, 1957.
[PPR09] Anna Pagh, Rasmus Pagh, and Milan Ruzic. Linear probing with constant independence. SIAM J. Comput., 39(3):1107–1120, 2009.
[PT16] Mihai Pătrașcu and Mikkel Thorup. On the k-independence required by linear probing and minwise independence. ACM Trans. Algorithms, 12(1):8:1–8:27, 2016.
[Zam26] Or Zamir. Locality in open addressing hash tables. CoRR, abs/2607.16390, 2026.