The binomial distribution #
This file defines the probability mass function of the binomial distribution.
Main results #
binomial_one_eq_bernoulli: Forn = 1, it is equal toPMF.bernoulli.
The binomial PMF: the probability of observing exactly i βheadsβ in a sequence of n
independent coin tosses, each having probability p of coming up βheadsβ.
Instances For
@[simp]
theorem
PMF.binomial_apply_zero
(p : NNReal)
(h : p β€ 1)
(n : β)
:
(binomial p h n) 0 = (1 - βp) ^ n
@[simp]
theorem
PMF.binomial_apply_last
(p : NNReal)
(h : p β€ 1)
(n : β)
:
(binomial p h n) (Fin.last n) = βp ^ n
theorem
PMF.binomial_apply_self
(p : NNReal)
(h : p β€ 1)
(n : β)
:
(binomial p h n) (Fin.last n) = βp ^ n
The binomial distribution on one coin is the Bernoulli distribution.
theorem
PMF.binomial_apply_of_le
{k b : β}
(hb : k β€ b)
{x : NNReal}
(h : x β€ 1)
:
ENNReal.ofReal (β(b.choose k) * βx ^ k * (1 - βx) ^ (b - k)) = (binomial x h b) (Fin.ofNat (b + 1) k)