Android app on Google Play

Binomial distribution

By binomial distribution you calculate the probability of achieving “success” k times in a sequence of n independent experiments, the outcomes of which either can be “success” or “failure”.

For instance, if you flip a coin five times, what is the probability of achieving “heads” tree times?

The probability mass function

Every time you make an experiment, which either yields “success” or “failure”, the probability of achieving success in one experiment is given by:
P(success) = p,
and the probability of achieving failure is:
P(failure) = 1 – p.

When you flip a coin the probability of achieving heads is 50 percent:
P(heads) = p = 0.50
and the probability of achieving tails is also 50 percent:
P(tails) = 1 - p = 1 - 0.50 = 0.50

Now we make a sequence of experiments, and we want to calculate the probability of achieving some specific outcomes in a specific order.

For example, we make four “success or failure”-experiments, and we want to calculate the probability of ending up with this specific outcome:

success, failure, failure, success

In order to calculate the probability of getting this result, you multiply the probability of each experiment’s result together.

P(success)*P(failure)*P(failure)*P(success)=
p*(1-p)*(1-p)*p=
0.50*(1-0.50)*(1-0.50)*0.50=0.0625=6,25%

If the number of times the experiment is carried out is n, and the number of successes is k, then the number of failures must be n-k.

The general formula for calculating the probability of achieving k successes in a specific order in n experiments is then given by:

P(success)*P(success)*...*P(success)*P(failure)*P(failure)*...*P(failure)=
P(success)^k*P(failure)^{n-k}=
p^k*(1-p)^{n-k}

where p is the probability of achieving success in one experiment, n is the number of experiments, k is the number of successes and n-k is the number of failures.

The probability mass function
With the formula above you can only calculate the probability of getting a specific order of successes. If you make n experiments, and you want to calculate the probability of achieving k successes without caring about in which order they come out, you will have to use the probability mass function given by:

P(X=k)=K(n,k)*p^k*(1-p)^{n-k}

Where X is the random variable indicating the total number of successes, K(n,k) is the so-called binomial coefficient given by: K(n,k)=frac{P(n,k)}{k!}=frac{n!}{(n-k)!*k!}, n is the number of experiments and k is the number of successes.

The probability mass function is therefor given by:
P(X=k)=K(n,k)*p^k*(1-p)^{n-k}=frac{n!}{k!*(n-k)!}*p^k*(1-p)^{n-k}

The probability mass function

Calculate the probability of getting k successes in n trials.
(The order of the outcomes doesn't matter.)

Please enter

p = probability of achieving success in one experiment

n = number of experiments

k = number of successes

p: 
n: 
k: 

Cumulative distribution function

Sometimes you want to know the probability of achieving k successes or less in n experiments, P(X <= k). That is called cumulative distribution. It can be calculated by adding all probabilities of getting respectively from 0 to k successes.

P(X <= k)=P(X=0)+P(X=1)+...+P(X=k)

The cumulative distribution function

Calculate the probability of getting k successes or less in n trials.
(The order of the outcomes doesn't matter.)

Please enter

p = probability of achieving success in one experiment

n = number of experiments

k = number of successes

p: 
n: 
k: 

Mean of the binominal distribution

The mean is the expected number of successes we will get, if the probability of success per trial is p and the number of trials is n.

The mean is given by:

E(X)=mu=n*p

If we, for instance, flip a coin four times, how many times will we expect the outcome to be “heads”?

P(heads) = p = 0.5

n = 4

The mean value is:

mu=n*p=4*0.5=2

Variance

The variance describes how much we expect the results to vary.

It is given by the formula:

Var(X)=sigma^2=n*p*(1-p)

In the example above with the coin, which was flipped four times, the variance will be:

Var(X)=4*0.5*(1-0.5)=1

Standard deviation

The standard deviation is the square root of the variance.
It is given by:

SD(X)=sigma=sqrt{Var(X)}=sqrt{n*p*(1-p)}