@[instance]
@[instance]
Equations
- pmf.inhabited = {default := pmf.pure (inhabited.default α)}
Equations
- pmf.of_multiset s hs = ⟨λ (a : α), ↑(multiset.count a s) / ↑(s.card), _⟩
def
pmf.of_fintype
{α : Type u_1}
[fintype α]
(f : α → nnreal) :
finset.univ.sum (λ (x : α), f x) = 1 → pmf α
Equations
- pmf.of_fintype f h = ⟨f, _⟩
Equations
- pmf.bernoulli p h = pmf.of_fintype (λ (b : bool), cond b p (1 - p)) _