The collision tester for uniformity #
The collision tester of Goldreich–Ron draws k samples from an unknown
distribution p on a finite type of size n and accepts when the number of colliding pairs
(Cslib.Probability.PMF.collisionCount) is at most C(k, 2) (1 + 2 ε²) / n
(collisionThreshold). It is a uniformity tester with proximity ε in statistical distance
whenever 40 √n ≤ (k - 1) ε² (isTester_collisionTester), so k = O(√n / ε²) samples suffice;
this is Diakonikolas–Gouleakis–Peebles–Price, Theorem 1
(numbering of arXiv:1611.03579v1; stated there in ℓ₂ distance and transferred to total variation
by Cauchy–Schwarz) with our own constant. For ε ≤ 1 / 2 on domains of even size this sample
complexity is optimal up to the constant, by Paninski's lower bound
(Cslib.DistributionTesting.card_le_of_isTester_uniform).
The proof is Chebyshev's inequality with the exact mean and variance of the collision count
(Cslib.Probability.PMF.sum_iid_mul_collisionCount_sub_sq), following the variance analysis of
Diakonikolas–Gouleakis–Peebles–Price, Lemma 3. Write
s = ‖p‖₂² and D = s - 1 / n. If p is uniform, D = 0 and the variance is at most
C(k, 2) / n. If p is ε-far from uniform, Cauchy–Schwarz gives n D ≥ 4 ε²
(Cslib.Probability.PMF.dist_uniform_sq_le), and the excess third moment is at most
D / n + √D D. The original analysis Goldreich–Ron needed O(√n / ε⁴)
samples. The constant 40 is the one this proof gives; it is not optimized.
Main definitions #
Cslib.DistributionTesting.collisionThreshold: the acceptance threshold.Cslib.DistributionTesting.collisionTester: the collision tester.
Main results #
Cslib.DistributionTesting.collisionThreshold_eq,collisionTester_apply: unfolding lemmas.Cslib.DistributionTesting.isTester_collisionTester: the collision tester is a uniformity tester withk = O(√n / ε²)samples.
References #
The collision tester's threshold C(k, 2) (1 + 2 ε²) / n, halfway between the expected
collision count C(k, 2) / n of the uniform distribution and C(k, 2) (1 + 4 ε²) / n, a lower
bound on the expected collision count of every distribution ε-far from it.
Unfolding lemma for collisionThreshold.
The collision tester accepts k samples when their number of colliding pairs is at most
collisionThreshold.
Unfolding lemma for collisionTester.
The collision tester is a uniformity tester with k = O(√n / ε²) samples.