ac web development English Français Español

E-Learning

Back

Statistics - The binomial distribution

Contents

Introduction

Consider the toss of a coin n times, we are interested to know how many heads we might get when the probability of getting heads in one toss is p with 0<p<1 (note that for p = 0 or p = 1 there is no game).

The binomial setting

To have a reference, we know that when n = 1, i.e., when there is only one trial the resulting distribution function must be:
  1. Probability for heads: p
  2. Probability for tails: 1 - p

Now lets consider an experiment of n-trials (we toss a coin n times) where the probability for heads is p and this probability remains constant through the experiment. We are interested in the probability of getting k heads after the coin is tossed n times.

After each trial we will obtain a sequence of the form (heads, tails, heads, heads,...) where in each trial

  • P(heads) = p
  • P(tails) = 1 - p = q

As an guide to build the distribution lets consider 3 particular sequences for a 3 trials experiment:

  • Sequence 1: (heads, heads, heads)
  • Sequence 2: (heads, heads, tails)
  • Sequence 3: (heads, tails, tails)

Because the trials are independent, the probability of getting these sequences are:

  • P(3,3) = p·p·p = p3 = p3·q0
  • P(3,2) = p·p·(1-p) = p2·(1-p) = p2·q1
  • P(3,1) = p·(1-p)·(1-p) = p·(1-p)2 = p1·q2

Thus, the probability of a particular sequence is:

P(sequnce) = pnumber heads·(1-p)number of tails   [1]

This probability depends only on the number of heads (or tails) in the sequence.

But there more than one sequences that contain the same number of heads (or tails) as can be seen when considering possible outcomes from our example as (heads, heads, tails), (heads, tails, heads), etc. All of these sequences belong to the same result, two heads and one tail. In general, the number of sequences that belong to one particular result (to obtain k heads after n tosses) is:

Where n! = n·(n-1)·(n-2)....2·1 and 0! = 1

Therefore, the probability for all the sequences containing k heads after n tosses Pn(k,p) is equal to the total number of sequences with k heads after n tosses times the probability of obtaining k heads after n tosses of a coin:

Examples

Example 1. Here the numeric values and a histogram for the binomial distribution with n = 10 and probability of heads p = 0.6:

Number of heads (k)Probability P10(k,0.6)
00.000104858
10.001572864
20.010616832
30.042467328
40.111476736
50.200658125
60.250822656
70.214990848
80.120932352
90.040310784
100.006046618

Example 2. Genetics says that an offspring independently receive genes from their parents. If both parents carry genes for the O and A blood types, each offspring has probability 0.25 of getting two O genes and so of having blood type O. The number N of O blood types among 5 children of these parents equal to the number of successes in 5 independent trials with probability 0.25. Therefore, N has the binomial distribution P5(k,0.25)

Offsprings with O blood type (k)Probability P5(k,0.25)
00.2373046875
10.3955078125
20.2636718753
30.0878906250
40.0146484375
50.0009765625

Exercises

Exercise 1. Calculate the mean value of the binomial distribution Pn(k,p).

By definition of main value, we want to calculate:

In order to calculate the main value (or average) for the binomial distribution we will use the following helper function:

Where the second equals sign comes from Newton's binomial theorem. We will proceed by calculating the derivative of H(s):

, but the derivative of H at s = 1 is the number we are looking for:

Therefore,

If we toss a coin 10 times when the probability of heads is 0.6, then we are expected to obtain a number of N = 10⨯0.6 = 6 heads. How much the actual number would differ from 6 will be given by the standard deviation. It is left to the student to calculate this value (tip: use the second derivative of the helper function H(s) also called moment-generating function).