Falling factorials against the exponential #
Bounds on the ratio (n)_k / n ^ k = n.descFactorial k / n ^ k, which is the probability that k
independent uniform samples from a set of size n are distinct. Writing the ratio as the product
∏_{i < k} (n - i) / n (Nat.cast_descFactorial_div_pow) and comparing factor by factor with
exp (-i / n) gives an upper bound valid for all n and k, and comparing with exp (-2 i / n)
gives a lower bound when 0 < n and 2 k ≤ n + 2, using the scalar inequality
exp (-x) ≤ 1 - x / 2 on [0, 1].
CslibFrontier.Probability.IID.Birthday turns these into bounds on the collision probability of
independent samples.
Main results #
Real.exp_neg_le_one_sub_div_two:exp (-x) ≤ 1 - x / 2forx ∈ [0, 1].Nat.cast_descFactorial_div_pow:(n)_k / n ^ k = ∏_{i < k} (n - i) / nin any semifield.Nat.descFactorial_div_pow_le_exp:(n)_k / n ^ k ≤ exp (-k (k - 1) / (2 n)).Nat.exp_le_descFactorial_div_pow:exp (-k (k - 1) / n) ≤ (n)_k / n ^ kfor0 < nand2 k ≤ n + 2.
(n)_k / n ^ k = ∏_{i < k} (n - i) / n in any semifield, with truncated subtraction.