Example of Binomial Distribution and Probability

This Tutorial will explain the Binomial Distribution, Formula, and related Discrete Probabilities

Suppose you toss a coin over and over again and each time you can count the number of “Heads” you get.

For example, if you decide to toss the coin 10 times, and you get 4 Heads and 6 Tails, then in that case, the number of heads is 4.

However, if you continue to toss the coin 10 times, count the number of heads each time, and writing down that number, you will be collecting “data” that follows the “binomial distribution”.

In addition, because the number of heads you will get each time you toss the coin 10 times can be different, you can let X be the number of heads you get when you toss the coin 10 times.

In this case, “X” represents a “random discrete variable”.

It is random, because you can get 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10 heads total each time you toss the coin 10 times. However, there is no way to predict how many you will get – it is random.

It is discrete because the only possible number of heads you can get are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10.

It is a variable because the value of X will vary or change each time you toss the coin 10 times.

 

NOTE: Tossing the coin 10 times (in this example) is the “experiment”. The “result” is the number of heads you get. To create a “distribution” for this experiment, you would repeat the experiment over and over. In other words, you toss the coin 10 times and record the number of heads. Then again, you toss the coin 10 times and record the number heads. If you repeat this say 1000 times, you will have 1000 data values for this experiment. However, those data values can only be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10.

THINK ABOUT THIS: What do you think this distribution would look like? In other words, if you repeated this 1000 times recorded the number of heads each time, what would you expect?

 

What is the sample space in this example?

The sample space is a collection of all possible outcomes of the experiment. Remember that the experiment is tossing a coin 10 times and counting the number of heads.

Therefore, the sample space is:

{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

There are no other possible values that can result from this experiment.

 

What are the Probabilities?

We know that when using a fair coin, we have a 50% (or .5) chance or getting a head and a 50% (or .5) chance of getting a tail. Therefore, for each individual toss, P(head) = .5.

However, we are tossing 10 times and counting the number of heads. Each toss is independent because its result is not affected by the toss before or after it.

Given this, we can create a TABLE OF PROBABILITIES

 

10 Coin Tosses
X P(Num Heads =X)
0 P(Num Heads =0) 0.000977
1 P(Num Heads =1) 0.009766
2 P(Num Heads =2) 0.043945
3 P(Num Heads =3) 0.117188
4 P(Num Heads =4) 0.205078
5 P(Num Heads =5) 0.246094
6 P(Num Heads =6) 0.205078
7 P(Num Heads =7) 0.117188
8 P(Num Heads =8) 0.043945
9 P(Num Heads =9) 0.009766
10 P(Num Heads =10) 0.000977

 

What does this table tell us and where did the numbers come from?

Imagine that you toss a coin 10 times in a row and count the number of heads. Next, suppose that the number of heads is “0”. In other words, you tossed all tails. This would be very surprising because the probability of that happening is very small. In fact, P(num heads = 0) in 10 tosses is .000977 (about .1%).

 

But how do you calculate that probability?

First, note that we know the following:

1)      We will toss 10 times (so we have 10 “trials” in each experiment – we count the number of heads)

2)      Each toss is independent(no toss affects any other toss)

3)      The probability of tossing a head is always .5 (so p = .5)

4)      We will count the number of heads from 10 tosses and that value will be discrete (it must be a whole number between 0 and 10)

In other words, this is a Binomial Distribution.

Using the Binomial Formula, we can calculate the probability of getting any number of heads given 10 coin tosses.

 

Here is the Binomial Formula:

nCx * p^x * q^(1-x)

 

Do not panic

“n” is the number of tosses or trials total – in this case, n = 10

“x” is the number of heads in our example

“p” is the probability of getting a head, which is 50% (or .5)

“q” is the probability of not getting a head (which is also .5). q = 1 – p.

 

“nCx” is the number of ways we can “choose” x from n.

This is called a “combination”. MORE ON COMBINATIONS AND PERMUTATIONS

 

Let’s see some examples of how to get the values in the above Table:

P(X = 0)

nCx * p^x * q^(n-x)

10C0 * .5^0 * .5^(10-0)

 

When finding the P(X = 0), we know that n = 10 because we have 10 tosses. We know that probability of getting a head on any toss is .5, so p = .5 and q = 1 – p = 1 – .5 = .5

We are looking for P(X = 0) so “x = 0”.

Then we plug in and get:

P(X = 0) = 10C0 * .5^0 * .5^(10-0)

 

Next, we can solve this:

 

Formula for Combination:

nCr = n! / r! * (n – r)!

NOTE: 0! = 1

NOTE 2: The “!” means the following:

10! = 10*9*8*7*6*5*4*3*2*1

5! = 5*4*3*2*1

 

P(X = 0) = 10C0 * .5^0 * .5^(10-0) =

10! / 0! (10 – 0)! * .5^0 * .5^10 =

10! / 1*10! * .5^0 * .5^10=

10!/10! * .5^0 *.5^10=

1 * 1 * .000977=

.000977

(This is the value in the Table above)

Next, P(X = 1)

Here we will calculate the probability of tossing a coin 10 times and getting one head. We also expect this probability to be small as it is not very likely.

P(X = 1) = 10C1 * .5^1 * .5^(10-1) =

 

10! / 1! (10 – 1)! * .5^1 * .5^9

=

10! / 1*9! * .5^1 * .5^9

=

10!/9! * .5 *.5^9

=

10 * .5 * .001953

=

.00976

Why is 10C1 = 10?

Because:

10C1 = 10! / 1! (10 – 1)!

= (10*9*8*7*6*5*4*3*2*1) / 1! * (9*8*7*6*5*4*3*2*1)

= (10*9*8*7*6*5*4*3*2*1) / 1! * (9*8*7*6*5*4*3*2*1)

= 10 / 1!

= 10/1

= 10

 

 

Next, P(X = 2)

Here we will calculate the probability of tossing a coin 10 times and getting two heads.

P(X = 2) = 10C2 * .5^2 * .5^(10-2) =

10! / 2! (10 – 2)! * .5^2 * .5^8=

10! / 2*8! * .5^2 * .5^8=

(10*9) / 2 * .25 *.003906=

90/2 * .25 * .003906=

.0439

 

 

Next, P(X = 3)

Here we will calculate the probability of tossing a coin 10 times and getting two heads.

P(X = 3) = 10C3 * .5^3 * .5^(10-3) =

10! / 3! (10 – 3)! * .5^3 * .5^7 =

10! / (3*2*1) * (7!) * .5^3 * .5^7=

(10*9*8) / 6 * .125 *.007813 =

720/6 * .125 * .007813=

.1171

Using this same exact method, we can calculate every value that is listed on the table above.

However, we can also use Excel to calculate these values.

IN EXCEL:

To get P(X = 0) for OUR EXAMPLE that has 10 trials (10 tosses) and each toss has a .5 chance of being a head.

Formula in Excel:

=BINOM.DIST(0,10,0.5,FALSE)

P(X=1)

=BINOM.DIST(1,10,0.5,FALSE)

P(X=2)

=BINOM.DIST(2,10,0.5,FALSE)

P(X = 3)

=BINOM.DIST(3,10,0.5,FALSE)

and so on

 


 

Finally, we can use this Table of Probabilities (which is our distribution) to determine other types of probabilities.

Example 1:

What is the probability that we toss a coin 10 times and get AT LEAST 5 heads?

In this question, we all looking for P( X >= 5).

In other words, we are looking for:

P(X = 5) + P(X = 6) + P(X = 7) + P(X = 8) + P(X = 9) + P(X = 10) = .623

So, there about a 62.3% chance of tossing a coin 10 times and getting a number of heads that is 5 or more.

Example 2:

What is the probability of tossing a coin 10 times and getting less than 3 heads?

Here, we want P( X < 3)

This is :

P(X = 0) + P( X = 1) + P( X = 2) = .00097 + .00976 + .0439 = .055 or about 5.5%

Example 3: Suppose you toss a coin 10 times. What is the probability of getting BETWEEN 3 and 6 heads?

P( 3 <= X <= 6)

Which is:

P(X = 3) + P(X = 4) + P(X = 5) + P(X = 6) = .117 + .205 + .246 + .205 = .773

As you can see, once you create the Table of Probabilities, it is easy to generate many types of probability results.