Pairwise-independent hashing #
This module exposes the first two exact finite moments behind Stockmeyer counting, the resulting variance bound, and the finite Chebyshev hashing lemma. It also exposes the low- and high-occupancy bounds used by the weak Stockmeyer counting test.
The average size of a fixed target cell is exactly |set| / 2^rangeWidth.
The average number of ordered distinct pairs in one target cell is
(|set|² - |set|) / 2^(2 * rangeWidth).
The ordered distinct-pair count in a cell is its size times one less than its size.
The second moment is the sum of the first and second factorial moments.
Exact second moment of the size of one target cell.
Exact variance of the size of one target cell.
The cell-size variance is nonnegative.
Pairwise independence bounds the cell-size variance by its mean.
Finite Chebyshev inequality for the size of one target cell.
Pairwise-independence hashing lemma with the variance replaced by the mean.
Relative-error form of the pairwise-independence hashing lemma.
Empty- and nonempty-cell events partition the affine seeds.
A seed belongs to the nonempty-cell event exactly when its target cell has a member.
A seed belongs to the empty-cell event exactly when its target cell is empty.
First-moment upper bound on the probability that the target cell is nonempty.
Second-moment upper bound on the probability that the target cell is empty.
Second-moment lower bound on the probability that the target cell is nonempty.
If the mean cell size is at most 1/8, target-cell occupancy has
probability at most 1/8.
If the mean cell size is at least 8, target-cell occupancy has probability
at least 7/8.