Uniform Probability Mass Functions #
This file defines a number of uniform PMF
distributions from various inputs,
uniformly drawing from the corresponding object.
PMF.uniformOfFinset
gives each element in the set equal probability,
with 0
probability for elements not in the set.
PMF.uniformOfFintype
gives all elements equal probability,
equal to the inverse of the size of the Fintype
.
PMF.ofMultiset
draws randomly from the given Multiset
, treating duplicate values as distinct.
Each probability is given by the count of the element divided by the size of the Multiset
Uniform distribution taking the same non-zero probability on the nonempty finset s
Equations
- One or more equations did not get rendered due to their size.
Instances For
The uniform pmf taking the same uniform value on all of the fintype α
Equations
- PMF.uniformOfFintype α = PMF.uniformOfFinset Finset.univ (_ : Finset.univ.Nonempty)
Instances For
Given a non-empty multiset s
we construct the PMF
which sends a
to the fraction of
elements in s
that are a
.
Equations
- PMF.ofMultiset s hs = { val := fun (a : α) => ↑(Multiset.count a s) / ↑(Multiset.card s), property := (_ : HasSum (fun (a : α) => ↑(Multiset.count a s) / ↑(Multiset.card s)) 1) }