Collision counts of independent samples #
Cslib.Probability.PMF.collisionCount x is the number of pairs i < j of sample positions with
x i = x j. Among k independent draws from μ it has mean C(k, 2) ‖μ‖₂², where
‖μ‖₂² = ∑ a, μ(a)² is the collision probability (sum_iid_mul_collisionCount), and, writing
s = ‖μ‖₂² and t = ∑ a, μ(a)³, variance exactly
C(k, 2) (s - s²) + k (k - 1) (k - 2) (t - s²) (sum_iid_mul_collisionCount_sub_sq). These are the
moments behind the collision tester for uniformity Goldreich–Ron. The mean is
Diakonikolas–Gouleakis–Peebles–Price, Lemma 2 and the
variance identity is the equality chain in the proof of
Diakonikolas–Gouleakis–Peebles–Price, Lemma 3 (numbering
of arXiv:1611.03579v1), the basis of their sharp analysis.
The proof inducts on the number of samples, peeling off the first draw (sum_iid_succ_mul), and
tracks the joint moments of the collision count and the occurrence counts of single values
(occurrenceCount, both from CslibFrontier.Probability.IID.Occurrence). These joint moments are
public because the cross-collision count of two independent samples is a sum of products of
occurrence counts.
Main definitions #
Cslib.Probability.PMF.collisionCount: the number of colliding pairs of sample positions.
Main results #
Cslib.Probability.PMF.sum_iid_mul_collisionCount: the mean of the collision count.Cslib.Probability.PMF.sum_iid_mul_collisionCount_sub_sq: the variance of the collision count.Cslib.Probability.PMF.sum_iid_mul_occurrenceCount,sum_iid_mul_occurrenceCount_mul_occurrenceCount,sum_iid_mul_collisionCount_mul_occurrenceCount,sum_iid_mul_collisionCount_sq: the supporting first and second moments.
References #
The number of colliding pairs i < j with x i = x j among the samples x.
Mean of the collision count: among k independent draws from μ, the expected number
of colliding pairs is C(k, 2) times the collision probability ∑ a, μ(a)².
Variance of the collision count: among k independent draws from μ, with
s = ∑ a, μ(a)² and t = ∑ a, μ(a)³, the collision count has variance
C(k, 2) (s - s²) + k (k - 1) (k - 2) (t - s²).
Mean of an occurrence count: among k independent draws from μ, the value b occurs
k μ(b) times on average.
Joint moment of two occurrence counts among k independent draws from μ:
E[N_a N_b] = k (k - 1) μ(a) μ(b) + k [a = b] μ(a).
Joint moment of the collision count and an occurrence count among k independent draws
from μ: E[C N_b] = k (k - 1) (k - 2) ‖μ‖₂² μ(b) / 2 + k (k - 1) μ(b)².
Second moment of the collision count among k independent draws from μ, with
s = ‖μ‖₂² and t = ∑ a, μ(a)³: E[C²] = C(k, 2) s + k (k - 1) (k - 2) t + k (k - 1) (k - 2) (k - 3) s² / 4.