Parameter arithmetic for Thorup's Double Tabulation bound #
Consumers of card_not_isKUnique_eight_mul_le (dictionaries hashing with Double Tabulation at
q = 4, d = 8 * c) all instantiate it the same way: c = 2 * max c_exp 1 characters of
bit-width b = (1 + Nat.clog 2 (max n_max 4)) / 2 for a polynomial universe
U ≤ max n_max 4 ^ c_exp above doubleTabThreshold c_exp, and then turn the counting bound into
a high-probability statement for a load factor B. This file packages those steps.
Main results #
two_mul_card_not_isKUnique_mul_le: if2 * B * doubleTabCodeBound c (8 * c) 4 k ≤ 2 ^ (3 * b)and1 ≤ B, then at most a1 / (2 * B)fraction of top-level tables fail to bek-unique.doubleTab_canonical_params: the canonical choice ofcandbcovers the universe (U ≤ 2 ^ (c * b)), clearsdoubleTabMinB c_exp ≤ b, and hasmax n_max 4 ≤ 2 ^ (2 * b).mul_doubleTabCodeBound_le: oncedoubleTabMinB c_exp ≤ b, a load factorA ≤ 2 ^ (2 * b) * b ^ 2times the code bound fork ≤ b ^ 2stays below2 ^ (3 * b).
References #
High-probability k-uniqueness of Double Tabulation top tables ([Thorup2013], Theorem
1(a)): when 1 ≤ B and 2 * B * doubleTabCodeBound c (8 * c) 4 k ≤ 2 ^ (3 * b), the number of
top-level tables T₁ whose simpleTabTuple T₁ fails to be k-unique is at most a 1 / (2 * B)
fraction of all top-level tables.
Canonical Double Tabulation parameters: for c = 2 * max c_exp 1 characters of bit-width
b = (1 + Nat.clog 2 (max n_max 4)) / 2, a polynomial universe U ≤ max n_max 4 ^ c_exp fits in
c characters, the capacity satisfies max n_max 4 ≤ 2 ^ (2 * b), and above
doubleTabThreshold c_exp the bit-width clears doubleTabMinB c_exp.
Code-bound budget for the canonical parameters: with c = 2 * max c_exp 1 and
doubleTabMinB c_exp ≤ b, a load factor A ≤ 2 ^ (2 * b) * b ^ 2 times
doubleTabCodeBound c (8 * c) 4 k for a key count k ≤ b ^ 2 is at most 2 ^ (3 * b).