The binomial distribution is the discrete probability distribution of
the number of successes in a sequence of n independent yes/no experiments,
each of which yields success with probability p. Such a success/failure
experiment is also called a Bernoulli experiment or Bernoulli trial.
In fact, when n = 1, the binomial distribution is a Bernoulli distribution.
The probability of getting exactly k successes in n trials is given by the
probability mass function:
Pr(K = k) = nCk pk (1-p)n-k
where nCk is n choose k.
It is frequently used to model number of successes in a sample of size
n from a population of size N. Since the samples are not independent
(this is sampling without replacement), the resulting distribution
is a hypergeometric distribution, not a binomial one. However, for N much
larger than n, the binomial distribution is a good approximation, and
widely used.
Binomial distribution describes the number of successes for draws with
replacement. In constrast, the hypergeometric distribution describes the
number of successes for draws without replacement.
Although Binomial distribtuion belongs to exponential family, we don't
implement DiscreteExponentialFamily interface here since it is impossible
and meaningless to estimate a mixture of Binomial distributions.