Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Using Excel to compute the binomial

distribution.
FAQ# 1311 Last Modified 1-January-2009

The exact binomial distributionWhat is the chance of exactly 16 heads out of 20 tosses?

If we assume that the coin toss is fair and the results are recorded properly, the results will follow what is
called a binomial distribution. The equation that describes the binomial distribution is built-in to Excel:

=BINOMDIST(16,20,0.5, FALSE)

That formula answers this question: What is the chance of getting exactly 16 successes out of 20 tries,
when the probability of success is 0.5 (since 50% of fair coin tosses are heads)? The answer is 0.46%, or
about one time in 200. (Why FALSE? Read on for an explanation.)

The cumulative binomial distribution

The chance of observing 16 heads out of twenty coin flips is about 1 in 200. Thats pretty rare. But it is the
answer to the wrong question. If we had observed 17 heads, we would have been even more surprised.
So we need to add to the probability we calculated the chance of observing 17, 18, 19 or 20 heads. One
way to do this is to use a formula similar to the one shown above (but changing 16 to the other values)
and adding up the probabilities. Another way is to use this Excel formula:

=1 - BINOMDIST(15,20,0.5,TRUE)

With the last argument to the function set to True, that function returns the probability of getting 15 or
fewer successes out of 20 tries when the probability of success is 0.5. Subtract that result from 1 to get
the probability of getting 16 or more successes. So to switch from calculating an exact probability to a
cumulative one, we had to change the last argument to Excels function from False to True, and also had
to change the first value from 16 to 15.

The answer is 0.59%.

Newer functions in Excel 2010 and later


Microsoft has created a new set of statistical functions intrdouced in Excel 2010. All of these use two (or
more) word function names separated by period. The example at the top of this page is written as:

=BINOM.DIST(16,20,0.5, FALSE)
In some cases, the newer functions are more accurate than the older ones, so it makes sense to always
use them.
Binomial Distribution
Definition 1: Suppose an experiment has the following characteristics:
the experiment consists of n independent trials, each with two mutually exclusive outcomes
(success and failure)
for each trial the probability of success is p (and so the probability of failure is 1 p)
Each such trial is called a Bernoulli trial. Let x be the discrete random variable whose
value is the number of successes in n trials. Then the probability distribution function
for x is called the binomial distribution, B(n, p), and is defined as follows:

where C(n, x) = and n! = n(n1)(n2)321 as described in Combinatorial


Functions.
C(n, x) can be calculated by using the Excel function COMBIN(n,x). See Figure 2
of Built-in Excel Functions for more details about this function.
Observation: Figure 1 shows a graph of the probability density function for B(20, .25).

Figure 1 Binomial distribution


That the graph looks a lot like the normal distribution is not a coincidence
(see Relationship between Binomial and Normal Distributions)
Property 1:

Click here for a proof of Property 1.


Excel Function: Excel provides the following functions regarding the binomial
distribution:
BINOMDIST(x, n, p, cum) where n = the number of trials, p = the probability of
success for each trial and cum takes the value TRUE or FALSE.
BINOMDIST(x, n, p, FALSE) = probability density function f(x) value at x for the
binomial distribution B(n, p), i.e. the probability that there are x successes in n trials
where the probability of success on any trial is p.
BINOMDIST(x, n, p, TRUE) = cumulative probability distribution F(x) value at x for the
binomial distribution B(n, p), i.e. the probability that there are at most x successes
in n trials where the probability of success on any trial is p.
CRITBINOM(n, p, 1 ) = critical value; i.e. the minimum value of x such that F(x) 1
, where F is the cumulative binomial distribution function for B(n, p)
Excel 2010/2013 provide the following additional functions: BINOM.DIST, which is
equivalent to BINOMDIST, and BINOM.INV, which is equivalent to CRITBINOM.
Excel 2013 introduces the following new function (where x y n):
BINOM.DIST.RANGE(n, p, x, y) = the probability there are between x and y
successes (inclusive) in n trials where the probability of success on any trial is p
Thus, BINOM.DIST.RANGE(n, p, x, y) = BINOMDIST(y, n, p, TRUE)
BINOMDIST(x1, n, p, TRUE) if x > 0 and BINOM.DIST.RANGE(n, p, 0, y) =
BINOMDIST(y, n, p, TRUE). The y parameter may be omitted, in which case
BINOM.DIST.RANGE(n, p, x) = BINOMDIST(x, n, p, FALSE).
Example 1: What is the probability that if you throw a die 10 times it will come up six 4
times?
We can model this problem using the binomial distribution B(10, 1/6) as follows

Alternatively the problem can be solved using the Excel function:

BINOMDIST(4, 10, 1/6, FALSE) = 0.054266

You might also like