Retention by pairwise independent hashing #
Fix a target set B ⊆ Y and a pairwise independent family h i : X → Y. A point x is
retained by the seed i when its hash h i x lies in B. Each point is then retained with
probability exactly p = #B / |Y|, and the retention events of two distinct points are
independent: both are retained with probability exactly p ^ 2
(IsPairwiseIndependentHash.expect_boole_apply_mem_and_apply_mem). This is sampling at rate p
with pairwise independence, the technique of Chor and Goldreich [CG89] built on the
hash families of Carter and Wegman [CW79], [WC81]. For polynomial or affine
hashing over a finite field with a box B, the rate p ranges over the ratios of box size to
field size.
The number N i = #{x ∈ S | h i x ∈ B} of retained points of a finite set S therefore has mean
#S p, second factorial moment #S (#S - 1) p ^ 2 and variance #S p (1 - p), and Chebyshev's
inequality bounds its deviations. In particular fewer than half of the expected number of points
are retained with probability at most 4 / (#S p). For a single target, B = {y}, these are the
cell-size moments of CslibFrontier.Probability.PairwiseIndependentHash.
Conversely, by inclusion–exclusion some point of S is retained with probability at least
min (#S p) 1 / 2, and at least 3 #S p / 4 when 2 #S p ≤ 1. When h is a pairwise independence
generator G : {0,1}^{2n} → ({0,1}^n)^n (seeds ι = {0,1}^{2n}, points X = Fin n), this says
that one of the n outputs lands in a set of density p: Exercise 7.23 of
Goldreich, used there in the proof of Lemma 7.22.
Main results #
Cslib.Probability.IsPairwiseIndependentHash.expect_boole_apply_mem,Cslib.Probability.IsPairwiseIndependentHash.dens_filter_apply_mem: a point is retained with probability#B / |Y|.Cslib.Probability.IsPairwiseIndependentHash.expect_boole_apply_mem_and_apply_mem,Cslib.Probability.IsPairwiseIndependentHash.dens_filter_apply_mem_and_apply_mem: two distinct points are retained independently.Cslib.Probability.IsPairwiseIndependentHash.expect_card_filter_apply_mem,Cslib.Probability.IsPairwiseIndependentHash.expect_card_filter_apply_mem_mul_sub_one,Cslib.Probability.IsPairwiseIndependentHash.expect_card_filter_apply_mem_sub_sq: the mean, second factorial moment and variance of the number of retained points.Cslib.Probability.IsPairwiseIndependentHash.dens_le_abs_card_filter_apply_mem_sub_le: Chebyshev's inequality for it.Cslib.Probability.IsPairwiseIndependentHash.dens_two_mul_card_filter_apply_mem_lt_le: fewer than half of the expected number of points are retained with probability at most4 / (#S p).Cslib.Probability.IsPairwiseIndependentHash.sub_le_dens_filter_exists_apply_mem: by inclusion–exclusion, some point ofSis retained with probability at least#S p - #S (#S - 1) p ^ 2 / 2.Cslib.Probability.IsPairwiseIndependentHash.min_mul_div_two_le_dens_filter_exists_apply_mem,Cslib.Probability.IsPairwiseIndependentHash.three_quarters_mul_le_dens_filter_exists_apply_mem: hence with probability at leastmin (#S p) 1 / 2, and at least3 #S p / 4when2 #S p ≤ 1. For a pairwise independence generator this is Goldreich's Exercise 7.23.
References #
- B. Chor, O. Goldreich, On the power of two-point based sampling
- O. Goldreich, Computational Complexity: A Conceptual Perspective, draft
r4.pdf(March 2007), Lemma 7.22 and Exercise 7.23 - J. L. Carter, M. N. Wegman, Universal classes of hash functions
- M. N. Wegman, J. L. Carter, New hash functions and their use in authentication and set equality
Retention probability: a point is retained, its hash lying in B, with probability
#B / |Y|.
Retention probability: a point is retained, its hash lying in B, with probability
#B / |Y|.
Pairwise independent retention: two distinct points are retained by B₁ and B₂ with
probability #B₁ / |Y| * (#B₂ / |Y|).
Pairwise independent retention: two distinct points are retained by B₁ and B₂ with
probability #B₁ / |Y| * (#B₂ / |Y|).
The mean number of retained points of S is #S * (#B / |Y|).
The second factorial moment of the number of retained points: the number of ordered
pairs of distinct retained points of S has expectation #S (#S - 1) (#B / |Y|) ^ 2.
The variance of the number of retained points is #S p (1 - p) with p = #B / |Y|.
Chebyshev's inequality for the number of retained points: it is at distance at least
ε > 0 from its mean #S p, with p = #B / |Y|, with probability at most #S p / ε².
Lower tail of the number of retained points: fewer than half of the expected number
#S p, with p = #B / |Y|, are retained with probability at most 4 / (#S p).
Inclusion–exclusion for retention: some point of S is retained with probability at
least #S p - #S (#S - 1) p ^ 2 / 2, where p = #B / |Y|.
A pairwise independent generator hits a dense set Goldreich, Exercise 7.23, first
claim: some point of S is sent into a set B of density
p = #B / |Y| with probability at least min (#S p) 1 / 2. Goldreich states it for a pairwise
independence generator G : {0,1}^{2n} → ({0,1}^n)^n as in his Lemma 7.22: the case
ι = {0,1}^{2n}, X = Fin n, S = univ and Y = {0,1}^n. As in the guideline, the bound follows
from inclusion–exclusion on min #S ⌈1 / p⌉ points of S.
A pairwise independent generator hits a sparse set Goldreich, Exercise 7.23, second
claim: if the set B has density p = #B / |Y| with p ≤ 1 / (2 #S), then
some point of S is sent into B with probability at least 0.75 #S p. The case of Goldreich's
generator is as in min_mul_div_two_le_dens_filter_exists_apply_mem.