Uniform distributions over fixed-cardinality subsets (powersetCard) #
Uniform sampling identities for Finset.powersetCard under Cslib.Probability.PMF.uniformOfFinset:
uniformOfFinset_powersetCard_erase: drawing a uniformt-subsetUofS(1 ≤ t ≤ |S|) and erasing a uniformly chosen elemente ∈ Uyields the uniform distribution on(t - 1)-subsets ofS.uniformOfFinset_powersetCard_sub_one: erasing a uniformly chosen elemente ∈ Sfrom ak-element setS(0 < k) yields the uniform distribution on(k - 1)-subsets ofS.uniformOfFinset_powersetCard_hitOrErase: for a fixedp ∈ Sand1 ≤ t ≤ |S|, drawing a uniformt-subsetUofSand returningU.erase pwhenp ∈ Uor erasing a uniformly chosen elemente ∈ Uwhenp ∉ Uyields the uniform distribution on(t - 1)-subsets ofS.erase p.toOuterMeasure_uniformOfFinset_powersetCard_notMem: forp ∈ Sandt ≤ |S|, a uniformt-subset ofSmissespwith probability(|S| - t) / |S|.
These identities underlie the cache distribution invariants of randomized marking
(CslibFrontier.DataStructure.Paging.Marking) and the McGeoch–Sleator Partition algorithm
(CslibFrontier.DataStructure.Paging.Partition).
Helper step for erasing a uniform element from a subset U: returns U.erase e for a uniform
e ∈ U when U is nonempty, and ∅ on the unreachable empty case.
Drawing a uniform t-subset U of S (1 ≤ t ≤ |S|) and erasing a uniformly chosen element
of U yields the uniform distribution on (t - 1)-subsets of S.
Erasing a uniformly chosen element from a k-element set S (0 < k) yields the uniform
distribution on (k - 1)-subsets of S.
For p ∈ S and 1 ≤ t ≤ |S|, drawing a uniform t-subset U of S and returning
U.erase p when p ∈ U or uniformErase U when p ∉ U yields the uniform distribution on
(t - 1)-subsets of S.erase p.
A uniform t-subset of S (t ≤ |S|) misses a fixed element p ∈ S with probability
(|S| - t) / |S|.