---
title: "Distribution of the number of successes s in n trials, each with probability p"
canonical: "https://modelassist.epixanalytics.com/space/EA/26574973/Distribution%20of%20the%20number%20of%20successes%20s%20in%20n%20trials%2C%20each%20with%20probability%20p"
format: markdown
---
####  

#### Exploring the binomial process

We start our exploration of the binomial process by looking at the probability of a certain number of successes *s* for a given number of trials *n* and probability of success *p*. Imagine we have two binomial trials, there are four possible outcomes, as shown below, namely SS, SF, FS, and FF, where SF means success followed by failure, etc.

 

> Macro (gliffy)

  


These outcomes have probabilities *p*<sup>2</sup>, *p*(1-*p*), (1-*p*)*p* and (1-*p*)<sup>2</sup> respectively. The binomial process considers each success to be identical and therefore does not differentiate between the two events SF and FS: they are both just one success in two trials. The probability of one success in two trials is then just 2*p*(1-*p*): the 2 in this equation is the number of different paths that result in 1 success in 2 trials.

  


Now imagine that we have three trials:

> Macro (gliffy)

 

  


The eight outcomes are: SSS, SSF, SFS, SFF, FSS, FSF, FFS, and FFF. There is thus 1 event producing 3 'successes', 3 events producing 2 successes, 3 events producing 1 success and 1 event producing no successes for three trials.

  


#### The binomial distribution equation

In general, the number of ways that we can get *s* successes from *n* trials can be calculated directly using the [binomial coefficient](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26574954/) *<sub>n</sub>**C**<sub>s</sub>*, which is given by:

  


![image](media://6959da5f-1e5a-4ad6-a560-18c63c347516)

                > Macro (mathinline)



  


We can check this is right, by choosing *n* =3, (remembering that 0! = 1) then:

  


![image](media://ee8cdd5a-e201-4ff0-93c2-c2e08de129f7)

                > Macro (mathinline)



                > Macro (mathinline)



                > Macro (mathinline)



                > Macro (mathinline)



  


which match the number of combinations we have already calculated. Each of the ways of getting *s* successes in *n* trials has the same probability, namely *p**<sub>s</sub>*(1-*p*)*<sup>n-s</sup>*, so the probability of observing *x* successes in *n* trial is given by:

  


![image](media://56fd1559-a718-4091-8040-9dc2740a6365)

                > Macro (mathinline)



  


which is the probability mass function of the [Binomial](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575204/)(*p,n*) distribution. In other words, the number of successes *s* one will observe in *n* trials, where each trial has the same probability of success is given by:

  


                *s* = Binomial(*p,n*)

  


#### Examples of the Binomial

The four figures below show the distribution for a number of different p's (probabilities) and n's (trials).

  


![image](media://b307b237-c130-44f2-ba2f-55fa7257ec67)

  


  


The first figure above shows the number of tails (here called success (s)) if we toss a coin five times could be 0, 1, 2, 3, 4 or 5 with the probabilities  displayed on the y-axes. The figure to the right shows the same situation, but now with 40 tosses. The most likely outcome is 20 tails , but it could be as low as 10 or as high as 30. Note that this figure looks somewhat like a bell-shaped [Normal distribution](https://epixanalytics.atlassian.net/wiki/spaces/EA/pages/26575246/).

  


  


  


  


  


---