Documentation

CslibFrontier.Probability.IID.Birthday

Lower bounds on the birthday collision probability #

For k independent samples of a law μ on a finite type α with n = Fintype.card α elements, this module bounds from below the probability that two samples are equal, the event {x | ¬ Function.Injective x} under iid μ k, for every law, and computes it for the uniform law:

The upper bounds for every law, from the union bound, are in CslibFrontier.Probability.IID.Distinct (Cslib.Probability.PMF.iid_not_injective_le). For the uniform law that bound is k (k - 1) / (2 n), which is below Theorem B.1(ii)'s bound whenever k (k - 1) / n ≤ 1.59.

The first item is the work. The mass of the injective k-tuples with entries in a finite set, for nonnegative point weights with a given sum, is largest for equal weights; this is a weak form of Maclaurin's inequality. The proof adds one point of the set at a time, and the step is the tangent-line form of Bernoulli's inequality, Real.pow_add_mul_sub_le_pow.

Differences from [BS23] #

Main results #

References #

Mass of injective tuples #

Distinct samples and collisions #

For every law μ on a finite type with n elements, k independent samples are distinct with probability at most (n)_k / n ^ k, which is the probability for the uniform law (iid_uniformOfFintype_injective): the uniform law maximizes the probability that the samples are distinct.

k independent uniform samples from a finite type with n elements are distinct with probability (n)_k / n ^ k.

theorem Cslib.Probability.PMF.one_sub_exp_neg_le_iid_not_injective {α : Type u_1} [Fintype α] (μ : PMF α) (k : ℕ) :
1 - Real.exp (-(↑k * (↑k - 1) / (2 * ↑(Fintype.card α)))) ≤ ((iid μ k).toOuterMeasure {x : Fin k → α | ¬Function.Injective x}).toReal

[BS23], Theorem B.1(i) and Corollary B.2, first inequality: k independent samples of any law μ on a finite type with n elements contain two equal samples with probability at least 1 - exp (-k (k - 1) / (2 n)). Theorem B.1(i) is the case of the uniform law. Corollary B.2 assumes k ≥ 2; that is not needed, since the bound is 0 for k ≤ 1.

theorem Cslib.Probability.PMF.min_le_iid_not_injective {α : Type u_1} [Fintype α] (μ : PMF α) (k : ℕ) :
min (↑k * (↑k - 1) / (4 * ↑(Fintype.card α))) 0.63 ≤ ((iid μ k).toOuterMeasure {x : Fin k → α | ¬Function.Injective x}).toReal

[BS23], Theorem B.1(i) and Corollary B.2, second inequality: k independent samples of any law on a finite type with n elements contain two equal samples with probability at least min (k (k - 1) / (4 n)) 0.63. As in one_sub_exp_neg_le_iid_not_injective, Corollary B.2's k ≥ 2 is not needed.

[BS23], Theorem B.1(ii): k independent uniform samples from a finite type with n elements contain two equal samples with probability at most 1 - exp (-k (k - 1) / n) when 2 k ≤ n + 2. The book assumes k < n / 2, which implies 2 k ≤ n + 2.