# Binomial Distribution

 English Português Français ‎Español Italiano Nederlands

A Binomial distribution is derived from a random experiment in which we either obtain event A with constant probability p, or the complementary event ${\displaystyle {\bar {A}}}$ with probability 1-p. Suppose this experiment is repeated n times. A discrete random variable that contains the number of successes A after n repetitions of this experiment, has a Binomial distribution with parameters n and p. Its probability density function is: ${\displaystyle f(x;n,p)=\left\{{\begin{array}{ll}\left({\begin{array}{c}n\\x\end{array}}\right)\cdot p_{x}\cdot (1-p)^{n-x}\quad &{\text{for}}\ x=0,1,\dots ,n\\&\\0\quad &{\text{otherwise}}\end{array}}\right.}$

Denoted: ${\displaystyle X\sim B(n;p)}$

The distribution function is given as: ${\displaystyle f(x;n,p)=\left\{{\begin{array}{ll}\sum \limits _{k=0}^{x}\left({\begin{array}{c}n\\k\end{array}}\right)\cdot p^{k}\cdot (1-p)^{n-k}\quad &{\text{for}}\ x\geq 0\\&\\0\quad &{\text{for}}\ x<0\end{array}}\right.}$

The expected value and the variance of a Binomial distribution B(n;p) are: ${\displaystyle E(X)=n\cdot p}$ ${\displaystyle Var(X)=n\cdot p\cdot (1-p)}$

The properties of the Binomial distribution include:

Reproduction property:

If ${\displaystyle X\sim B(n;p)}$ and ${\displaystyle Y\sim B(m;p)}$ are independent random variables, then the random variable Z = X + Y has Binomial distribution with parameters n+m and p, i.e. ${\displaystyle Z\sim B(n+m;p)}$.

Symmetry:

If ${\displaystyle X\sim B(n;p)}$ and ${\displaystyle Y=n-X}$ then ${\displaystyle Y\sim B(n;1-p)}$. The Binomial distribution has been tabulated for selected values of the parameters n and p (${\displaystyle p\leq 0.5}$). The binomial distribution depends the parameters n and p that determine - its shape - its location, i.e. expected value E(X) = np and - its variance, i.e. ${\displaystyle \sigma ={\sqrt {np(1-p)}}}$ This interactive example allows you to change either one or both parameters of the distribution and plot the probability distribution function of the Binomial distribution B(n;p). We recommend to only change value of one parameter at time, to explore the effect of this change on the probability plot. In addition, you can also calculate probabilities for different values of x.

Better chances for fried hamburgers

A TV commercial for Hamburger-Land contained following sentence: ”Our research showed that 75 percent of In the same commercial, the announcer also said: ”If you ask four Hamburger-Land customers, at most one of them would choose nonfried hamburger” Are these sentences saying exactly the same? The assumptions of a Bernoulli experiment are satisfied:The outcome of each experiment can take one of only two values:${\displaystyle A}$ = {nonfried hamburger } ; ${\displaystyle {\bar {A}}}$ = { fried hamburger } with probabilities ${\displaystyle P(A)=0.25}$ and ${\displaystyle P({\bar {A}})=0.75}$. A sample of customer can be very large. Therefore, it is not important whether the sampling is done with or without “replacement” The probabilities associated with each outcome can be considered to be constant and the experiments independent. Define the random variable X = ${\displaystyle \{}$ number of nonfried hamburgers in 4 decisions ${\displaystyle \},}$ which has a binomial distribution with parameters n = 4, p = 0.25;i.e. ${\displaystyle X\sim B(4;0.25)}$The probability ${\displaystyle P(X\leq 1)}$ can be computed as${\displaystyle P(X\leq 1)=P(X=0)+P(X=1)=F_{B}(1;4;0.25)}$ The probability that the event “nonfried hamburger” occurs at most once is sum of the probabilities that the “nonfried hamburger” will be chosen by none or by only one customer out of four randomly chosen customers of Hamburger-Land. In other words, the value of the distribution function of the Binomial distribution at x=1. The table of Binomial distribution with n = 4 and p = 0.25:

${\displaystyle x}$ ${\displaystyle f_{B}(x;4;0.25)}$ ${\displaystyle F_{B}(x;4;0.25)}$
0 0.3164 0.3164
1 0.4219 0.7383
2 0.2109 0.9492
3 0.0469 0.9961
4 0.0039 1.0000

The last column of the table implies that ${\displaystyle F_{B}(1;4;0.25)}$ = 0.7383. Assuming that the probabilities for fried ${\displaystyle \left({\text{P(fried hamburger)=0.75}}\right)}$and non-fried hamburgers (P(nonfried hamburger) = 0.25) are accurate, the statement from the commercial is correct with probability 0.7383.

Students from a university (HU Berlin) completed a questionnaire. 65% of the students responded that they have a part time job. What is the probability that at most 4 out of 8 randomly chosen students from this university have a part time job? The assumptions of a Bernoulli experiment are satisfied:Each “experiment” can produce only two outcomes:A = ${\displaystyle \{}$ student has a part time job ${\displaystyle \}}$ ; ${\displaystyle {\bar {A}}=\{}$ student does not have a part time job ${\displaystyle \}}$, P(A) = 0.65 ; P(${\displaystyle {\bar {A}}}$) = 0.35 . We assume that the sample number of students is large compared with the number of all students, which makes it possible to use a Binomial distribution. The probabilities associated with the events can be considered to be constant and the responses of the students are independent (the probability of choosing one student two times is very close to zero). The outcome of this experiment is the random variable X = ${\displaystyle \{}$ number of students with a part time job${\displaystyle \}}$. This random variable has a Binomial distribution: X ${\displaystyle \sim }$ B(n;p) = B(8;0.65).We need to compute the probability P(X ${\displaystyle \leq }$ 4), i.e. the distribution function F(4). The value of the distribution function B(8;0.65) is not tabulated.  Since the calculation of the distribution function by hand would be very difficult, since we would have to calculate and then sum five probabilities f(x), x = 0,1, ${\displaystyle \dots }$, 4, we evaluated the distribution function numerically (see the second column of the following table):

${\displaystyle x}$ ${\displaystyle B(8;0.65)}$ ${\displaystyle B(8;0.35)}$
0 0.0002 0.0319
1 0.0036 0.1691
2 0.0253 0.4278
3 0.1061 0.7064
4 0.2936 0.8939
5 0.5722 0.9747
6 0.8309 0.9964
7 0.9681 0.9998
8 1.0000 1.0000

Fig.1: Density functions for B(8;0,35) and B(8;0,65)

Fig.2: Distribution functions for B(8;0,35) and B(8;0,65)

The probability that at most 4 students from n=8 randomly chosen students will have a part time job is equal to 0.2936. If you are unable to evaluate the distribution numerical, it is possible to the tabulated values of the Binomial distribution and the symmetry of the Binomial distribution to obtain the probabilities we require.X = ${\displaystyle \{}$ number of students with a part time job ${\displaystyle \}\sim }$ B(8;0,65), i..e. Y = ${\displaystyle \{}$ number of students without a part time job ${\displaystyle \}\sim }$ B(8;0,35). X ${\displaystyle \leq }$ 4, i.e. x = 0,1,2,3,4 corresponds to Y ${\displaystyle \geq }$ 4, i.e. y = 4,5,6,7,8.Instead of computing the probability P(X ${\displaystyle \leq }$ 4) we can compute P(Y ${\displaystyle \geq }$ 4) = 1 - P(X ${\displaystyle \geq }$ 3). Using the table  for a Binomial distribution - we find in the third column P(Y ${\displaystyle \leq }$ 3) = 0.7064 and this implies that P(Y ${\displaystyle \leq }$ 4) = 1 - 0.7064 = 0.2936. There are 10 balls in a box, 3 are white and 7 are red. ${\displaystyle A}$ = white ball ; ${\displaystyle {\bar {A}}}$ = red ball ; ${\displaystyle P(A)=0.3;P({\bar {A}})=0.7}$ After each draw, we return the ball to the box. We draw five balls (n=5) in total. The assumptions of Bernoulli experiment are obviously fulfilled:

• There are only 2 possible outcomes for each draw
• The probabilities associated with each outcome are constant because we return the balls into the box
• The draws are mutually independent

We want to compute the probability of drawing two white balls, i.e. P(X = 2). ${\displaystyle X_{i}}$ = ${\displaystyle \{}$ number of white balls in draw i ${\displaystyle \}}$ ${\displaystyle P(X_{i}=1)=0.3;P(X_{i}=0)=0.7}$ for all ${\displaystyle i=1,\dots ,5}$ Using five repetitions, we obtain the following random variables: ${\displaystyle X_{1},X_{2},X_{3},X_{4},X_{5}}$ X = ${\displaystyle \{}$ number of white balls from n=5 draws ${\displaystyle \}}$ ${\displaystyle X=\sum \limits _{i}X_{i}}$ ${\displaystyle X\sim B(n;p)=B(5;0.3)}$ The number of all possible permutations of the draws when we select 2 white and 3 red balls is: ${\displaystyle \left({\begin{array}{c}5\\2\end{array}}\right)={\frac {5!}{2!\cdot 3!}}=10}$ The probability is: ${\displaystyle P(X=2)=f_{B}(2;5;0.3)=\left({\begin{array}{c}5\\2\end{array}}\right)\cdot 0.3^{2}\cdot 0.7^{3}=0.3087}$ The following table contains the density and the distribution function of the Binomial distribution for this experiment:

${\displaystyle x}$ ${\displaystyle f_{B}(x;5;0.3)}$ ${\displaystyle F_{B}(x;5;0.3)}$
0 0.1681 0.1681
1 0.3601 0.5282
2 0.3087 0.8369
3 0.1323 0.9692
4 0.0284 0.9976
5 0.0024 1.0000

The next figure plots the probability distribution function B(5;0,3).

The probability of a certain event can be calculated using the distribution function: ${\displaystyle f_{B}(2;5;0.3)=F_{B}(2;5;0.3)-F_{B}(1;5;0.3)}$${\displaystyle \quad =0.8369-0.5282=0.3087}$ The probability that we draw 2 white balls in 5 trials is equal to 0.3087. Derivation of the Binomial distribution The random experiment can be described by the following properties.

• only two events, ${\displaystyle A}$ and ${\displaystyle {\bar {A}}}$, are possible
• the probabilities of these events are ${\displaystyle P(A)=p}$ and ${\displaystyle P({\bar {A}})=1-p}$
• the experiment is repeated n times, the repetitions are mutually independent and the probabilities are constant

Each component of this experiment is called Bernoulli experiment. For each Bernoulli experiment, we define the random variable ${\displaystyle X_{i}(i=1,\dots ,n)}$ which takes the values 0 (if we obtain event ${\displaystyle {\bar {A}}}$) and 1 (if we obtain the event ${\displaystyle A}$). The probabilities for the events in this experiment will be P(A) = p and P(${\displaystyle {\bar {A}}}$) = 1 - p and the random variable ${\displaystyle X_{i}}$ has the following probability function (i.e., Bernoulli distribution): ${\displaystyle f(x;p)=\left\{{\begin{array}{ll}p^{x}(1-p)^{1-x}\quad &{\text{for}}x=0,1\\0\quad &{\text{otherwise}}\end{array}}\right.}$ ${\displaystyle E(X_{i})=p,Var(X_{i})=p(1-p)}$ After repeating the Bernoulli experiment n times, we obtain the number of occurrences of the event A, i.e. we observe random variable ${\displaystyle X=\{}$ number of occurrence of event A in n trials ${\displaystyle \}}$: ${\displaystyle X=\sum \limits _{i=1}^{n}X_{i}}$ X is a function (linear combination) of n random variables. The event X = x occurs if and only if the event A is observed exactly x times and event ${\displaystyle {\bar {A}}}$ is observed (n-x) times in the n trials. E.g., ${\displaystyle A_{1}\cap A_{2}\cap \dots \cap A_{x}\cap {\bar {A}}_{x+1}\cap {\bar {A}}_{x+2}\cap \dots \cap {\bar {A}}_{n}}$ ${\displaystyle |\quad x-timesA\quad |\quad (n-x)-times{\bar {A}}\quad |}$ The index of the event shows the number of trials. The independence of the Bernoulli experiments means that the probability that X=x is

 ${\displaystyle f(x)}$ ${\displaystyle =P(X=x)=P(A_{1}\cap A_{2}\cap \dots \cap A_{x}\cap {\bar {A}}_{x+1}\cap {\bar {A}}_{x+2}\cap \dots \cap {\bar {A}}_{n})}$ ${\displaystyle P(A_{1})\cdot P(A_{2})\cdot \dots \cdot P(A_{x})\cdot P({\bar {A}}_{x}+1)\cdot P({\bar {A}}_{x}+2)\cdot \dots \cdot P({\bar {A}}_{n})}$ ${\displaystyle =p\cdot p\cdot \dots \cdot p\cdot (1-p)\cdot (1-p)\cdot \dots \cdot (1-p)}$ ${\displaystyle =p^{x}\cdot (1-p)^{n-x}}$

This probability is computed only for the specified ordering of the event A. The probability of this specific ordering is ${\displaystyle f(x)=p^{x}\cdot (1-p)^{n-x}}$. The number of different orderings of these events is denoted as binomial coefficient and it is computed as: ${\displaystyle \left({\begin{array}{c}n\\x\end{array}}\right)={\frac {n!}{x!(n-x)!}}}$ Notice that the different orderings are disjoint events. Hence, we obtain the following probability function: ${\displaystyle P(X=x)=f(x)=\left({\begin{array}{c}n\\x\end{array}}\right)\cdot p^{x}\cdot (1-p)^{n-x}}$ The Binomial distribution is discrete, the probability function can be displayed as a histogram and the distribution function as a step function. The following diagrams illustrate the density function for various values of p, holding n constant. For ${\displaystyle p<0.5}$ the distribution is skewed to the left. The skew is greater for smaller values of p. The distribution is symmetric for p - 0.5 with np being the centre of the distribution. For ${\displaystyle p>0.5}$ the diagrams are skewed to the right. For large values of n, we can approximate this density function using a normal distribution with parameters ${\displaystyle \mu =np}$ and ${\displaystyle \sigma ^{2}=np(1-p)}$. The quality of approximation improves the closer p is to 0.5. The approximation follows from the Central Limit Theorem.