Balls-to-Slots Problem Specification #
This module formalizes the pure balls-to-slots (probe-complexity) problem of Bender,
Farach-Colton, J. Kuszmaul, W. Kuszmaul, and Liu, "On the Optimal Time/Space Tradeoff for Hash
Tables", Proc. 54th ACM STOC, pp. 1284–1297, 2022 (arXiv:2111.00602v2, Section 2.1, printed
p. 3 / PDF p. 4, and Section 3, printed p. 8 / PDF p. 9)
[BFCK+22], aligned with Cslib's StateTransitionSpec grid:
- Slot assignments (
SlotAssignment α M): injective mapsFin M → Option αwithslotOf,present,freeSlots,delete, andput. (Adaptation: Section 3 permitsMspecial slots of costlog₂ M; since Section 3.1'sk-kick tree uses zero special slots,SlotAssignment α Mstores all balls in primary slotsFin M.) - Operations & costs:
Op α(insert,delete,query), 0-indexedprobeIndexwith integer floor probe costslotProbeComplexity = 1 + Nat.log 2 (probeIndex + 1)(differing from Section 2.1's real-logarithm1 + log₂ iby< 1per ball), andswitchingCost(Section 2.1, printed p. 3 / PDF p. 4, and Section 3.1, printed p. 8 / PDF p. 9).
General k-wise fiber conditioning, disjoint-restriction concentration, and two-stage product
union-tail bounds live in CslibFrontier.Probability.KWiseIndependent.Restriction,
CslibFrontier.Probability.KWiseIndependent.Concentration, and
CslibFrontier.Foundations.Probability.TwoStage.
Main definitions #
Cslib.DataStructure.BallsToSlots.Op,stepSet,activeSetFrom,activeSet,opsBalls,ValidOp,ValidOpSeqFrom,ValidOpSeq,SlotAssignment,RespectsProbeSeq,probeIndex,slotProbeComplexity,ballProbeComplexity,totalProbeComplexity,xorProbeSeq,dyadicSplitEquiv,switchingCost,displacedBalls,changedSlots,spec,schemeSpec.
Main results #
SlotAssignment.slotOf_eq_some_iff,SlotAssignment.card_present_add_card_freeSlots,totalProbeComplexity_eq_sum_present,card_activeSet_le,exists_split_last_insert_of_mem_activeSet.dens_sum_totalProbeComplexity_gt_le_of_snapshotBound.
References #
Operations on a balls-to-slots scheme over ball universe α.
- insert {α : Type u_1} (x : α) : Op α
Insert ball
xinto the active set (no-op ifxis already present). - delete {α : Type u_1} (x : α) : Op α
Delete ball
xfrom the active set (no-op ifxis absent). - query {α : Type u_1} (x : α) : Op α
Query the slot currently assigned to ball
x(noneifxis absent).
Instances For
Single-step evolution of the finite set of present balls.
Active set of balls after executing ops starting from S.
Active set of balls after executing ops starting from ∅.
Finite set of balls mentioned anywhere in ops.
Admissibility of an oblivious operation sequence ops starting from active set S.
Admissibility of an oblivious operation sequence ops starting from ∅.
Every admissible operation sequence from ∅ maintains at most n_max present balls.
Every ball x ∈ activeSet ops of an admissible sequence ops has a last absent-to-present
insertion split ops = pre ++ .insert x :: suf where ValidOpSeq n_max pre, x ∉ activeSet pre,
#(activeSet pre) < n_max, and suf contains no .delete x.
Injective slot assignments #
An injective assignment of balls from α into M unit-capacity primary slots Fin M.
Partial map giving the ball stored in each slot (
noneif the slot is free).Slot-wise injectivity: each ball occupies at most one slot.
The empty slot assignment over M free slots.
Finite set of currently unoccupied slots in s.
Computable lookup of the unique slot holding ball x (none if x is absent).
Finite set of balls currently present in s.
Occupied balls and free slots partition all M slots.
Strictly fewer than M balls are present if and only if at least one slot is free.
Delete ball x by vacating its slot (leaving all other slots untouched).
Place ball y into slot r, preserving injective unconditionally.
Probe sequences, probe complexity, and switching cost #
A slot assignment s respects probeSeq when every present ball sits at a slot appearing on
its probe sequence.
Integer probe complexity 1 + ⌊log₂ (probeIndex + 1)⌋ of storing ball x in slot r.
Uses the floor logarithm Nat.log 2 for 1-based probe index i = probeIndex + 1, differing from
the real-logarithm measure 1 + log₂ i of [BFCK+22] (Section 2.1,
printed p. 3 / PDF p. 4, and Section 3, printed p. 8 / PDF p. 9) by strictly less than 1 per ball
and agreeing asymptotically.
Probe complexity of ball x in assignment s (0 if x is absent).
Total probe complexity summed across all occupied slots of s.
Total probe complexity over occupied slots equals the sum of ballProbeComplexity over
s.present.
Deterministic switching cost between s and s': balls in s.present ∪ s'.present whose
assigned slot changed.
Number of balls present in both s and s' that moved to a different slot.
Number of slots r : Fin M whose occupant changed between s and s'.
When s.present ⊆ s'.present, switchingCost s s' ≤ changedSlots s s'.
Deleting x displaces 0 remaining balls.
Deleting x has switching cost at most 1.
Deleting x modifies at most 1 slot.
Relational StateTransitionSpec for a balls-to-slots scheme over α, M slots, and capacity
n_max.
Relational StateTransitionSpec additionally enforcing probe-sequence validity and worst-case
per-operation switching-cost bound B_switch.
2m-th moment concentration for total probe complexity across a collection R of admissible
histories ops b with pairwise disjoint opsBalls (ops b), given a per-ball snapshot bound.