Cross-collision counts of two independent samples #
Cslib.Probability.PMF.crossCollisionCount x y is the number of pairs (i, j) of positions with
x i = y j, for samples x : Fin k → α and y : Fin l → α. It is the sum over values a of the
products of the occurrence counts of a in x and in y (crossCollisionCount_eq_sum).
Let x be k independent draws from p and y, independently, l independent draws from q.
Write t = ∑ a, p(a) q(a), u = ∑ a, p(a) q(a)² and v = ∑ a, p(a)² q(a). Then:
- the cross-collision count has mean
k l t(sum_sum_iid_mul_crossCollisionCount); - its second moment is
k l t + k (k - 1) l v + k l (l - 1) u + k (k - 1) l (l - 1) t²(sum_sum_iid_mul_crossCollisionCount_sq); - its joint moment with the collision count of
xisk (k - 1) (k - 2) l ‖p‖₂² t / 2 + k (k - 1) l v(sum_sum_iid_mul_collisionCount_mul_crossCollisionCount); the joint moment with the collision count ofyis symmetric (sum_sum_iid_mul_crossCollisionCount_mul_collisionCount).
These are the moments of the collision-based closeness tester
Diakonikolas–Gouleakis–Peebles–Price, §3 (section numbers
follow arXiv:1611.03579v1). Each follows from the occurrence-count moments of
CslibFrontier.Probability.IID.CollisionCount and the independence of the two samples.
Main definitions #
Cslib.Probability.PMF.crossCollisionCount: the number of colliding pairs across two samples.
Main results #
Cslib.Probability.PMF.crossCollisionCount_eq_sum: the count as a sum of products of occurrence counts.Cslib.Probability.PMF.sum_sum_iid_mul_crossCollisionCount: the mean.Cslib.Probability.PMF.sum_sum_iid_mul_crossCollisionCount_sq: the second moment.Cslib.Probability.PMF.sum_sum_iid_mul_collisionCount_mul_crossCollisionCount,sum_sum_iid_mul_crossCollisionCount_mul_collisionCount: the joint moments with the collision counts of each sample.
References #
The number of pairs (i, j) of positions with x i = y j.
The cross-collision count is the sum over values of the products of their occurrence counts in the two samples.
Mean of the cross-collision count: for k draws from p and l independent draws from
q, the expected number of colliding pairs across the samples is k l ∑ a, p(a) q(a).
Second moment of the cross-collision count: with t = ∑ a, p(a) q(a),
u = ∑ a, p(a) q(a)² and v = ∑ a, p(a)² q(a), it is
k l t + k (k - 1) l v + k l (l - 1) u + k (k - 1) l (l - 1) t².
Joint moment of the collision count of x and the cross-collision count: with
t = ∑ a, p(a) q(a) and v = ∑ a, p(a)² q(a), it is
k (k - 1) (k - 2) l ‖p‖₂² t / 2 + k (k - 1) l v.
Joint moment of the cross-collision count and the collision count of y: with
t = ∑ a, p(a) q(a) and u = ∑ a, p(a) q(a)², it is
k l (l - 1) (l - 2) ‖q‖₂² t / 2 + k l (l - 1) u.