Papers by William Kuszmaul
12 paper(s) by this author
· All BibTeX
A Simple and Combinatorial Approach to Proving Chernoff Bounds and Their Generalizations
The Chernoff bound is one of the most widely used tools in theoretical computer science. It's rare to find a randomized algorithm that doesn't employ a Chernoff bound in its analysis. The standard proofs of Chernoff bounds are beautiful but in some ways not very intuitive. In this paper, I'll show you a different proof that has four features: (1) the proof offers a strong intuition for why Chernoff bounds look the way that they do; (2) the proof is user-friendly and (almost) algebra-free; (3) the proof comes with matching lower bounds, up to constant factors in the exponent; and (4) the proof extends to establish generalizations of Chernoff bounds in other settings. The ultimate goal is that, once you know this proof (and with a bit of practice), you should be able to confidently reason about Chernoff-style bounds in your head, extending them to other settings, and convincing yourself that the bounds you're obtaining are tight (up to constant factors in the exponent).
Optimal Bounds for Open Addressing Without Reordering
In this paper, we revisit one of the simplest problems in data structures: the task of inserting elements into an open-addressed hash table so that elements can later be retrieved with as few probes as possible. We show that, even without reordering elements over time, it is possible to construct a hash table that achieves far better expected search complexities (both amortized and worst-case) than were previously thought possible. Along the way, we disprove the central conjecture left by Yao in his seminal paper ``Uniform Hashing is Optimal''. All of our results come with matching lower bounds.
Efficient $d$-ary Cuckoo Hashing at High Load Factors by Bubbling Up
A $d$-ary cuckoo hash table is an open-addressed hash table that stores each key $x$ in one of $d$ random positions $h_1(x), h_2(x), \ldots, h_d(x)$. In the offline setting, where all items are given and keys need only be matched to locations, it is possible to support a load factor of $1 - ε$ while using $d = \lceil \ln ε^{-1} + o(1) \rceil$ hashes. The online setting, where keys are moved as new keys arrive sequentially, has the additional challenge of the time to insert new keys, and it has not been known whether one can use $d = O(\ln ε^{-1})$ hashes to support $\poly(ε^{-1})$ expected-time insertions.
In this paper, we introduce bubble-up cuckoo hashing, an implementation of $d$-ary cuckoo hashing that achieves all of the following properties simultaneously:
(1) uses $d = \lceil \ln ε^{-1} + α\rceil$ hash locations per item for an arbitrarily small positive constant $α$.
(2) achieves expected insertion time $O(δ^{-1})$ for any insertion taking place at load factor $1 - δ\le 1 - ε$.
(3) achieves expected positive query time $O(1)$, independent of $d$ and $ε$.
The first two properties give an essentially optimal value of $d$ without compromising insertion time. The third property is interesting even in the offline setting: it says that, even though \emph{negative} queries must take time $d$, positive queries can actually be implemented in $O(1)$ expected time, even when $d$ is large.
Optimal Time-Backlog Tradeoffs for the Variable-Processor Cup Game
The \emph{$ p$-processor cup game} is a classic and widely studied scheduling problem that captures the setting in which a $p$-processor machine must assign tasks to processors over time in order to ensure that no individual task ever falls too far behind. The problem is formalized as a multi-round game in which two players, a filler (who assigns work to tasks) and an emptier (who schedules tasks) compete. The emptier's goal is to minimize backlog, which is the maximum amount of outstanding work for any task.
Recently, Kuszmaul and Westover (ITCS, 2021) proposed the \emph{variable-processor cup game}, which considers the same problem, except that the amount of resources available to the players (i.e., the number $p$ of processors) fluctuates between rounds of the game. They showed that this seemingly small modification fundamentally changes the dynamics of the game: whereas the optimal backlog in the fixed $p$-processor game is $Θ(\log n)$, independent of $p$, the optimal backlog in the variable-processor game is $Θ(n)$. The latter result was only known to apply to games with \emph{exponentially many} rounds, however, and it has remained an open question what the optimal tradeoff between time and backlog is for shorter games.
This paper establishes a tight trade-off curve between time and backlog in the variable-processor cup game. Importantly, we prove that for a game consisting of $t$ rounds, the optimal backlog is $Θ(n)$ if and only if $t \ge Ω(n^3)$. Our techniques also allow for us to resolve several other open questions concerning how the variable-processor cup game behaves in beyond-worst-case-analysis settings.
Linear Probing Revisited: Tombstones Mark the Death of Primary Clustering
Published
• View Publication
• BIB
First introduced in 1954, linear probing is one of the oldest data structures in computer science, and due to its unrivaled data locality, it continues to be one of the fastest hash tables in practice. It is widely believed and taught, however, that linear probing should never be used at high load factors; this is because primary-clustering effects cause insertions at load factor $1 - 1 /x$ to take expected time $Θ(x^2)$ (rather than the ideal $Θ(x)$). The dangers of primary clustering, first discovered by Knuth in 1963, have been taught to generations of computer scientists, and have influenced the design of some of many widely used hash tables.
We show that primary clustering is not a foregone conclusion. We demonstrate that small design decisions in how deletions are implemented have dramatic effects on the asymptotic performance of insertions, so that, even if a hash table operates continuously at a load factor $1 - Θ(1/x)$, the expected amortized cost per operation is $\tilde{O}(x)$. This is because tombstones created by deletions actually cause an anti-clustering effect that combats primary clustering.
We also present a new variant of linear probing (which we call graveyard hashing) that completely eliminates primary clustering on \emph{any} sequence of operations: if, when an operation is performed, the current load factor is $1 - 1/x$ for some $x$, then the expected cost of the operation is $O(x)$. One corollary is that, in the external-memory model with a data blocks of size $B$, graveyard hashing offers the following remarkable guarantee: at any load factor $1 - 1/x$ satisfying $x = o(B)$, graveyard hashing achieves $1 + o(1)$ expected block transfers per operation. Past external-memory hash tables have only been able to offer a $1 + o(1)$ guarantee when the block size $B$ is at least $Ω(x^2)$.
Train Tracks with Gaps: Applying the Probabilistic Method to Trains
Published in Fun With Algorithms, 2020
• View Publication
• BIB
We identify a tradeoff curve between the number of wheels on a train car, and the amount of track that must be installed in order to ensure that the train car is supported by the track at all times. The goal is to build an elevated track that covers some large distance $\ell$, but that consists primarily of gaps, so that the total amount of feet of train track that is actually installed is only a small fraction of $\ell$. In order so that the train track can support the train at all points, the requirement is that as the train drives across the track, at least one set of wheels from the rear quarter and at least one set of wheels from the front quarter of the train must be touching the track at all times.
We show that, if a train car has $n$ sets of wheels evenly spaced apart in its rear and $n$ sets of wheels evenly spaced apart in its front, then it is possible to build a train track that supports the train car but uses only $Θ( \ell / n )$ feet of track. We then consider what happens if the wheels on the train car are not evenly spaced (and may even be configured adversarially). We show that for any configuration of the train car, with $n$ wheels in each of the front and rear quarters of the car, it is possible to build a track that supports the car for distance $\ell$ and uses only $O\left(\frac{\ell \log n}{n}\right)$ feet of track. Additionally, we show that there exist configurations of the train car for which this tradeoff curve is asymptotically optimal. Both the upper and lower bounds are achieved via applications of the probabilistic method.
Signed Enumeration of Upper-Right Corners in Path Shuffles
Published
• View Publication
• BIB
We resolve a conjecture of Albert and Bousquet-Melou enumerating quarter-plane walks with fixed horizontal and vertical projections according to their upper-right-corner count modulo 2. In doing this, we introduce a signed upper-right-corner count statistic. We find its distribution over planar walks with any choice of fixed horizontal and vertical projections. Additionally, we prove that the polynomial counting loops with a fixed horizontal and vertical projection according to the absolute value of their signed upper-right-corner count is $(x+1)$-positive. Finally, we conjecture an equivalence between $(x+1)$-positivity of the generating function for upper-right-corner count and signed upper-right-corner count.
Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations
Published
• View Publication
• BIB
Given a set $Π$ of permutation patterns of length at most $k$, we present an algorithm for building $S_{\le n}(Π)$, the set of permutations of length at most $n$ avoiding the patterns in $Π$, in time $O(|S_{\le n - 1}(Π)| \cdot k + |S_{n}(Π)|)$. Additionally, we present an $O(n!k)$-time algorithm for counting the number of copies of patterns from $Π$ in each permutation in $S_n$. Surprisingly, when $|Π| = 1$, this runtime can be improved to $O(n!)$, spending only constant time per permutation. Whereas the previous best algorithms, based on generate-and-check, take exponential time per permutation analyzed, all of our algorithms take time at most polynomial per outputted permutation.
If we want to solve only the enumerative variant of each problem, computing $|S_{\le n}(Π)|$ or tallying permutations according to $Π$-patterns, rather than to store information about every permutation, then all of our algorithms can be implemented in $O(n^{k+1}k)$ space.
Using our algorithms, we generated $|S_5(Π)|, \ldots, |S_{16}(Π)|$ for each $Π\subseteq S_4$ with $|Π| > 4$, and analyzed OEIS matches. We obtained a number of potentially novel pattern-avoidance conjectures.
Our algorithms extend to considering permutations in any set closed under standardization of subsequences. Our algorithms also partially adapt to considering vincular patterns.
New Results on Doubly Adjacent Pattern-Replacement Equivalences
In this paper, we consider the family of pattern-replacement equivalence relations referred to as the "indices and values adjacent" case. Each such equivalence is determined by a partition $P$ of a subset of $S_c$ for some $c$. In 2010, Linton, Propp, Roby, and West posed a number of open problems in the area of pattern-replacement equivalences. Five, in particular, have remained unsolved until now, the enumeration of equivalence classes under the $\{123, 132\}$-equivalence, under the $\{123, 321\}$-equivalence, under the $\{123, 132, 213\}$ equivalence, and under the $\{123, 132, 213, 321\}$-equivalence. We find formulas for three of the five equivalences and systems of representatives for the equivalence classes of the other two. We generalize our results to hold for all replacement partitions of $S_3$, as well as for an infinite family of other replacement partitions. In addition, we characterize the equivalence classes in $S_n$ under the $S_c$-equivalence, finding a generalization of Stanley's results on the $\{12, 21\}$-equivalence.
To do this, we introduce a notion of confluence that often allows one to find a representative element in each equivalence class under a given equivalence relation. Using an inclusion-exclusion argument, we are able to use this to count the equivalence classes under equivalence relations satisfying certain conditions.
A New Approach to Enumerating Statistics Modulo $n$
We find a new approach to computing the remainder of a polynomial modulo $x^n-1$; such a computation is called modular enumeration. Given a polynomial with coefficients from a commutative $\mathbb{Q}$-algebra, our first main result constructs the remainder simply from the coefficients of residues of the polynomial modulo $Φ_d(x)$ for each $d\mid n$. Since such residues can often be found to have nice values, this simplifies a number of modular enumeration problems; indeed in some cases, such residues are already known while the related modular enumeration problem has remained unsolved. We list six such cases which our technique makes easy to solve. Our second main result is a formula for the unique polynomial $a$ such that $a \equiv f \mod Φ_n(x)$ and $a\equiv 0 \mod x^d-1$ for each proper divisor $d$ of $n$.
We find a formula for remainders of $q$-multinomial coefficients and for remainders of $q$-Catalan numbers modulo $q^n-1$, reducing each problem to a finite number of cases for any fixed $n$. In the prior case, we solve an open problem posed by Hartke and Radcliffe. In considering $q$-Catalan numbers modulo $q^n-1$, we discover a cyclic group operation on certain lattice paths which behaves predictably with regard to major index. We also make progress on a problem in modular enumeration on subset sums posed by Kitchloo and Pachter.
Counting Permutations Modulo Pattern-Replacement Equivalences for Three-Letter Patterns
Published in William Kuszmaul. Counting Permutations Modulo Pattern-Replacement Equivalences for Three-Letter Patterns. Electronic Journal of Combinatorics, 20(4) (2013), \#P10
• View Publication
• BIB
We study a family of equivalence relations on $S_n$, the group of permutations on $n$ letters, created in a manner similar to that of the Knuth relation and the forgotten relation. For our purposes, two permutations are in the same equivalence class if one can be reached from the other through a series of pattern-replacements using patterns whose order permutations are in the same part of a predetermined partition of $S_c$.
When the partition is of $S_3$ and has one nontrivial part and that part is of size greater than two, we provide formulas for the number of classes created in each previously unsolved case. When the partition is of $S_3$ and has two nontrivial parts, each of size two (as do the Knuth and forgotten relations), we enumerate the classes for $13$ of the $14$ unresolved cases. In two of these cases, enumerations arise which are the same as those yielded by the Knuth and forgotten relations. The reasons for this phenomenon are still largely a mystery.
Equivalence Classes in $S_n$ for Three Families of Pattern-Replacement Relations
We study a family of equivalence relations on $S_n$, the group of permutations on $n$ letters, created in a manner similar to that of the Knuth relation and the forgotten relation. For our purposes, two permutations are in the same equivalence class if one can be reached from the other through a series of pattern-replacements using patterns whose order permutations are in the same part of a predetermined partition of $S_c$. In particular, we are interested in the number of classes created in $S_n$ by each relation and in characterizing these classes.
Imposing the condition that the partition of $S_c$ has one nontrivial part containing the cyclic shifts of a single permutation, we find enumerations for the number of nontrivial classes. When the permutation is the identity, we are able to compare the sizes of these classes and connect parts of the problem to Young tableaux and Catalan lattice paths.
Imposing the condition that the partition has one nontrivial part containing all of the permutations in $S_c$ beginning with 1, we both enumerate and characterize the classes in $S_n$. We do the same for the partition that has two nontrivial parts, one containing all of the permutations in $S_c$ beginning with 1, and one containing all of the permutations in $S_c$ ending with 1.