Binomial distribution (from http://www.math.wm.edu/˜ leemis/chart/UDR/UDR.html ) The shorthand X ∼ binomial(n, p) is used to indicate that the random variable X has the binomial distribution for positive integer parameter n and real parameter p satisfying 0 < p < 1. The binomial distribution models the number of successes in n mutually independent Bernoulli trials, each with probability of success p. The random variable X ∼ binomial(n, p) has probability mass function

f(x) = \binom{n}{x} p^{x}(1 − p) ^{n−x} x = 0, 1, 2, ..., n.

The binomial distribution can be used to model the number of people in a group of n people with a particular characteristic, the number of defective items in a batch of n items, the number of fours in n rolls of a fair die, or the number of rainy days in a month. Stated more generically, a binomial random variable is the number of successes in n mutually independent Bernoulli trials. Three illustrations of the shape of the probability mass function for n = 30 and p = 1/6, 1/2, 5/6 are given below.

PSfrag replacements

n = 30 p = 1/6 p = 1/2 p = 5/6

x f(x)

The cumulative distribution function on the support of X is

F (x) = P(X ≤ x) = ∑_{k=0}^{x} \binom{n}{k} p^{k}(1 − p)^{n−k} x = 0, 1, 2, ..., n.

The survivor function on the support of X is

S(x) = P(X ≥ x) = ∑_{k=x}^{n} \binom{n}{k} p^{k}(1 − p)^{n−k} x = 0, 1, 2, ..., n.

The moment generating function of X is

M(t) = E [e^{tX}] = (1 − p + pe^{t}) ^{n} − ∞ < t < ∞.

The characteristic function of X is

ϕ(t) = E [e^{itX}] = (1 − p + pe^{it}) ^{n} − ∞ < t < ∞.

The population mean and variance of a binomial(n, p) random variable are

E[X] = np V [X] = np(1 − p)

and the population skewness and kurtosis are

E [( \frac{X − μ}{σ} ) ^{3}] = \frac{1 − 2p}{\sqrt{np(1 − p)}} E [( \frac{X − μ}{σ} ) ^{4}] = 3 + \frac{1 − 6p(1 − p)}{np(1 − p)} .

The population skewness and kurtosis converge to 0 and 3, respectively, in the limit as n → ∞.

Let x_{1}, x_{2}, ..., x_{n} be realizations of mutually independent Bernoulli(p) random variables. Assume that n is a fixed constant and that p is an unknown parameter satisfying 0 < p < 1. The maximum likelihood estimator for p is

p̂= \frac{1}{n} ∑_{i=1}^{n} x_{i},

which is an unbiased estimator of p, that is E \left[{ \atop p̂}\right]= p. An approximate (1 − α) · 100% confidence interval for p is

p̂− z_{α/2} \sqrt{\frac{p̂(1 − p̂)}{n}} < p < p̂+ z_{α/2} \sqrt{\frac{p̂(1 − p̂)}{n}} ,

where z_{α/2} is the 1 − α/2 percentile of the standard normal distribution. This confidence interval is symmetric about p̂and allows for an upper limit that is greater than 1 and a lower limit that is less than 0. A second approximate (1 − α) · 100% confidence interval for p is

\frac{p̂+ \frac{z_{α/2}^{2}}{2n} + z_{α/2} \sqrt{\frac{p̂(1−p̂)}{n} + \frac{z_{α/2}^{2}}{4n^{2}}}}{1 + z_{α/2}^{2}/n} < p < \frac{p̂+ \frac{z_{α/2}^{2}}{2n} − z_{α/2} \sqrt{\frac{p̂(1−p̂)}{n} + \frac{z_{α/2}^{2}}{4n^{2}}}}{1 + z_{α/2}^{2}/n} .

A third approximate (1 − α) · 100% confidence interval for p that is based on the Poisson approximation to the binomial distribution is

\frac{1}{2n}χ_{2y,1−α/2}^{2} < p < \frac{1}{2n}χ_{2(y+1),α/2}^{2} ,

where y = x_{1} + x_{2} + ···+ x_{n} and χ_{q,β}^{2} is the 1 − β percentile of a chi-square distribution with q degrees of freedom. A fourth approximate (1 − α) · 100% confidence interval for p is

\frac{1}{1 + \frac{n−y+1}{yF_{2y,2(n−y+1),1−α/2}}} < p < \frac{1}{1 + \frac{n−y}{(y+1)F_{2(y+1),2(n−y),α/2}}} ,

where F_{q,r,β} is the 1 − β percentile of an F random variable with q and r degrees of freedom.

APPL verification: The APPL statements

X := BinomialRV(n,p); Mean(X); Variance(X); Skewness(X); Kurtosis(X); MGF(X);

verify the population mean, variance, skewness, kurtosis, and moment generating function.