Binomial Distribution Calculator

Binomial Distribution Calculator
p =         n =

μ =         σ2 =

OK to approx. with normal distribution?

In statistics and probability, the binomial distribution's probability density function is given by the equation

PDF(x) = (nx)px(1-p)n-x,

where n is the number of independent Bernoulli trials and p is the probability of success in each trial.

A common situation where the binomial distribution arises is in a series of coin tosses. Suppose you flip a fair coin seven times in an attempt to get heads. In this case, n = 7 and p = 0.5. To figure the probability of tossing a head exactly four times, you evaluate

PDF(4) = (74)(0.5)4(0.5)3
= 35(0.5)7
= 0.2734375.

To find the probability of flipping at most four heads, you compute the sum

PDF(0) + PDF(1) + PDF(2) + PDF(3) + PDF(4)

0.0078125 + 0.0546875 + 0.1640625 + 0.2734375 + 0.2734375
= 0.77344.

Another application of the binomial distribution is in rolling fair dice. For example, suppose you roll two six-sided dice to obtain a sum of 8. The probability of getting a sum of 8 with two dice is 5/36. If you roll these dice 13 times, the probability of getting an 8 exactly twice is

PDF(2) = (13)(5/36)2(31/36)11
= 0.290456255.

Binomial Mean and Variance

The mean of the binomial distribution, μ, is given by the equation

μ = np.

The variance, σ2, is given by the equation

σ2 = np(1-p).

If you know the values of μ and σ2 but n and p are unknown, you can compute n and p with the equations

p = 1 - σ2/μ       and       n = μ2/(μ - σ2).

Approximation with the Normal Distribution

If n is large, the binomial distribution can be approximated by the normal distribution with a mean of np and a standard deviation of sqrt[np(1-p)]. The condition for n to be sufficiently large is subject to interpretation, but the approximation is better when n is at least 20 and p is closer to 0.5.

One rule of thumb for deciding if you can use the normal distribution is to check whether everything within 3 standard deviations from the mean is within the range of possible values. That is,

np + 3sqrt[np(1-p)] < n, and
np - 3sqrt[np(1-p)] > 0,

which simplifies to checking if n is greater than both 9p/(1-p) and 9(1-p)/p.

For instance, if you have a binomial distribution with p = 0.32 and n = 22, you can use the normal distribution to approximate the probabilities since

22 > 9(0.32)/0.68   and   22 > 9(0.68)/0.32.

© Had2Know 2010