Biostatistics Study NotesFrom concepts and derivations to interpretation

CHAPTER 02 · TOPIC 08

Binomial Distribution

Model success counts in independent repeated trials and derive the PMF, mean, variance, and normal approximation.

On this page
  1. Four conditions for using the binomial distribution
  2. Binomial distribution notation
  3. Probability of success exactly x times
  4. Calculating cumulative probability
  5. Average number of successes and variation
  6. When does the binomial distribution approach the normal distribution?
  7. Relationship with other distributions

The binomial distribution is the probability distribution of the number of successes, X, in repeated trials where the number of trials is fixed, independent of each other, and the probability of success is equal. It is classified as a discrete probability distribution.

Four conditions for using the binomial distribution#

  1. The number of trials n is fixed in advance
  2. There are only two mutually exclusive outcomes in each trial
  3. Each trial is independent and one result does not change another's result
  4. The probability of success for each trial is the same p, and the probability of failure is q=1−p

Binomial distribution notation#

If X is the number of successes in n trials and p is the probability of success in each trial, then X follows the binomial distribution with parameters n and p, and takes only integers from 0 to n.

Distribution notationXBinomial(n,p)X\sim\operatorname{Binomial}(n,p)
possible valuesx=0,1,2,,nx=0,1,2,\ldots,n
Probability of failureq=1pq=1-p
symbolmeaning
XTotal number of successes in n trials
xPossible values ​​of X
nFixed total number of attempts
pProbability of success for each trial
qProbability of failure for each trial, q=1−p

Probability of success exactly x times#

The probability of a given array of x successes and n−x failures is the product of the probabilities of each trial. Since there are multiple ways to select a successful position, multiply it by the number of combinations in which x can be selected from n positions.

Probability of a specified arraypx(1p)nxp^x(1-p)^{n-x}
total probability of success exactly x timesP(X=x)=(nx)px(1p)nx,x=0,1,,nP(X=x)=\binom{n}{x}p^x(1-p)^{n-x},\qquad x=0,1,\ldots,n
Number of successful position combinations(nx)=n!x!(nx)!\binom{n}{x}=\frac{n!}{x!(n-x)!}

Calculating cumulative probability#

"At most" or "at least" or a range of probabilities sums the probabilities of multiple x's satisfying the condition. The probability of at least k times can be easily calculated with co-events.

Successful at most k timesP(Xk)=x=0k(nx)px(1p)nxP(X\le k)=\sum_{x=0}^{k}\binom{n}{x}p^x(1-p)^{n-x}
Successful at least k timesP(Xk)=1P(Xk1)P(X\ge k)=1-P(X\le k-1)

Average number of successes and variation#

Each trial contributes an average of p successes, so the average of the total number of n successes is np. Adding the variance p(1−p) of each independent success indicator gives np(1−p).

Expected valueE(X)=npE(X)=np
dispersionVar(X)=np(1p)=npq\operatorname{Var}(X)=np(1-p)=npq
standard deviationSD(X)=np(1p)\operatorname{SD}(X)=\sqrt{np(1-p)}
Supplement: Deriving the mean and variance from success indicators

If Iᵢ=1 when the i-th trial is successful and Iᵢ=0 when it fails, the total number of successes is the sum of the indicators. Expected values ​​can always be added, and if they are independent, the covariance is 0, so the variances can also be added.

Number of successesX=I1+I2++InX=I_1+I_2+\cdots+I_n
one tryE(Ii)=p,Var(Ii)=p(1p)E(I_i)=p,\qquad \operatorname{Var}(I_i)=p(1-p)
averageE(X)=i=1nE(Ii)=npE(X)=\sum_{i=1}^{n}E(I_i)=np
dispersionVar(X)=i=1nVar(Ii)=np(1p)\operatorname{Var}(X)=\sum_{i=1}^{n}\operatorname{Var}(I_i)=np(1-p)
Supplement: Deriving E(X) and Var(X) from the formula

In the combinatorial identity, remove x or x(x−1) before the sum, replace the subscript, and recognize the remainder as the sum of complete binomial probabilities. Since the sum is 1, we can simplify the expression.

Definition of expected valueE(X)=x=1nx(nx)px(1p)nxE(X)=\sum_{x=1}^{n}x\binom{n}{x}p^x(1-p)^{n-x}
combinatorial identityx(nx)=n(n1x1)x\binom{n}{x}=n\binom{n-1}{x-1}
complete binomial probability sumj=0n1(n1j)pj(1p)(n1)j=1\sum_{j=0}^{n-1}\binom{n-1}{j}p^j(1-p)^{(n-1)-j}=1
Expected valueE(X)=npE(X)=np

Instead of finding E(X²) directly, we can first calculate the factorial moment E[X(X−1)], which can be easily organized in the same way.

Second combinatorial identityx(x1)(nx)=n(n1)(n2x2)x(x-1)\binom{n}{x}=n(n-1)\binom{n-2}{x-2}
factorial momentE[X(X1)]=n(n1)p2E[X(X-1)]=n(n-1)p^2
second momentE(X2)=E[X(X1)]+E(X)=n(n1)p2+npE(X^2)=E[X(X-1)]+E(X)=n(n-1)p^2+np
dispersionVar(X)=E(X2)[E(X)]2=np(1p)\operatorname{Var}(X)=E(X^2)-[E(X)]^2=np(1-p)

When does the binomial distribution approach the normal distribution?#

If n is large and p is not too close to 0 or 1, the binomial distribution approaches a bell-shaped normal distribution. Check whether not only n, but also the expected number of successes np and number of failures n(1−p) are large enough.

approximate normal distributionXN ⁣(np,np(1p))X\approx N\!\left(np,\,np(1-p)\right)
standardizationZ=Xnpnp(1p)N(0,1)Z=\frac{X-np}{\sqrt{np(1-p)}}\approx N(0,1)

Continuity correction can be used in probability calculations to approximate a discrete distribution with a continuous distribution. For example, for P(X≤k), change the boundary to k+0.5.

P(Xk)P(Yk+0.5),YN ⁣(np,np(1p))P(X\le k)\approx P(Y\le k+0.5),\qquad Y\sim N\!\left(np,np(1-p)\right)

Relationship with other distributions#

  • Bernoulli distribution: binomial distribution with n=1
  • Multinomial distribution: extension to cases where each trial has three or more outcomes
  • Poisson distribution: approximated by λ=np when n is large, p is small, and np is moderate
  • Normal distribution: Approximate with mean np and variance np(1−p) when np and n(1−p) are sufficiently large.