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:
- for every law the samples are distinct with probability at most
(n)_k / n ^ k(iid_injective_le_descFactorial_div_pow), and for the uniform law exactly(n)_k / n ^ k(iid_uniformOfFintype_injective), so the uniform law minimizes the collision probability; - for every law the collision probability is at least
1 - exp (-k (k - 1) / (2 n)) ≥ min (k (k - 1) / (4 n), 0.63)([BS23], Theorem B.1(i) and Corollary B.2); - for the uniform law it is at most
1 - exp (-k (k - 1) / n)when2 k ≤ n + 2([BS23], Theorem B.1(ii)).
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] #
- Corollary B.2 assumes
k ≥ 2. That hypothesis is dropped: both lower bounds are0fork ≤ 1. - Theorem B.1(ii) assumes
k < n / 2. It is proved here under2 k ≤ n + 2, whichk < n / 2implies. - The proof of Corollary B.2 (that the uniform law minimizes the collision probability) is this library's own, by the induction above. It is not the book's argument, which moves mass between two points of unequal mass.
Main results #
Cslib.Probability.PMF.iid_injective_le_descFactorial_div_pow: for every law,ksamples are distinct with probability at most(n)_k / n ^ k.Cslib.Probability.PMF.iid_uniformOfFintype_injective:kuniform samples are distinct with probability(n)_k / n ^ k.Cslib.Probability.PMF.one_sub_exp_neg_le_iid_not_injective,Cslib.Probability.PMF.min_le_iid_not_injective: the two lower bounds of Theorem B.1(i) and Corollary B.2, for every law.Cslib.Probability.PMF.iid_uniformOfFintype_not_injective_le_one_sub_exp_neg: the upper bound of Theorem B.1(ii).
References #
- D. Boneh, V. Shoup, A Graduate Course in Applied Cryptography, Version 0.6, Appendix B.1, Theorem B.1 and Corollary B.2 (printed p. 1101).
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.
[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.
[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.