Skip to content
Part IA Easter Term

Bernoulli and Binomial Distributions

Bernoulli Distribution

Definition

A random variable XX follows the Bernoulli distribution with parameter pp if:

P(X=1)=p,P(X=0)=1pP(X = 1) = p, \quad P(X = 0) = 1 - p

Write: XBern(p)X \sim \text{Bern}(p).

Context: Models a single trial with two outcomes: success (1) with probability pp, or failure (0) with probability 1p1-p.

PMF

p(x)={1px=0px=10otherwisep(x) = \begin{cases} 1 - p & x = 0 \\ p & x = 1 \\ 0 & \text{otherwise} \end{cases}

Or compactly: p(x)=px(1p)1xp(x) = p^x(1-p)^{1-x} for x{0,1}x \in \{0,1\}.

Expectation

E[X]=0(1p)+1p=pE[X] = 0 \cdot (1-p) + 1 \cdot p = p

Variance

E[X2]=02(1p)+12p=pE[X^2] = 0^2 \cdot (1-p) + 1^2 \cdot p = p

Var(X)=E[X2]E[X]2=pp2=p(1p)\text{Var}(X) = E[X^2] - E[X]^2 = p - p^2 = p(1-p)

Examples

  • Coin flip: XBern(0.5)X \sim \text{Bern}(0.5) for a fair coin
  • Defective item: XBern(0.02)X \sim \text{Bern}(0.02) if 2% are defective
  • Pass/fail: XBern(p)X \sim \text{Bern}(p) where pp is pass rate

Binomial Distribution

Definition

XBin(n,p)X \sim \text{Bin}(n, p) if XX counts the number of successes in nn independent Bernoulli trials, each with success probability pp.

PMF

P(X=k)=(nk)pk(1p)nk,k=0,1,,nP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0, 1, \ldots, n

Why this formula?

  • Choose which kk of nn trials are successes: (nk)\binom{n}{k} ways
  • Each such arrangement has probability pk(1p)nkp^k (1-p)^{n-k}

Range

X{0,1,2,,n}X \in \{0, 1, 2, \ldots, n\}

Expectation

Let X=X1+X2++XnX = X_1 + X_2 + \cdots + X_n where XiBern(p)X_i \sim \text{Bern}(p) are independent.

E[X]=E[X1]++E[Xn]=npE[X] = E[X_1] + \cdots + E[X_n] = np

Intuition: If each trial succeeds with probability pp, expect npnp successes in nn trials.

Variance

Since the XiX_i are independent:

Var(X)=Var(X1)++Var(Xn)=np(1p)\text{Var}(X) = \text{Var}(X_1) + \cdots + \text{Var}(X_n) = n \cdot p(1-p)

Shape

  • For small pp: distribution is skewed right (concentration near 0)
  • For p=0.5p = 0.5: symmetric around n/2n/2
  • For large pp: distribution is skewed left (concentration near nn)

Binomial PMF shapes

Example: Coin Flips

Flip a fair coin 100 times. Expected number of heads?

XBin(100,0.5)X \sim \text{Bin}(100, 0.5)

E[X]=100×0.5=50E[X] = 100 \times 0.5 = 50 Var(X)=100×0.5×0.5=25\text{Var}(X) = 100 \times 0.5 \times 0.5 = 25 σX=5\sigma_X = 5

Example: Quality Control

A factory produces items with 2% defect rate. In a sample of 200, what is the probability of exactly 3 defects?

XBin(200,0.02)X \sim \text{Bin}(200, 0.02)

P(X=3)=(2003)(0.02)3(0.98)197P(X = 3) = \binom{200}{3} (0.02)^3 (0.98)^{197}

Compute: (2003)=2001991986=1,313,400\binom{200}{3} = \frac{200 \cdot 199 \cdot 198}{6} = 1{,}313{,}400

P(X=3)1,313,400×0.000008×0.0180.19P(X = 3) \approx 1{,}313{,}400 \times 0.000008 \times 0.018 \approx 0.19

Relation Between Bernoulli and Binomial

The sum of nn independent Bern(p)\text{Bern}(p) variables is Bin(n,p)\text{Bin}(n, p):

i=1nBern(p)=Bin(n,p)\sum_{i=1}^{n} \text{Bern}(p) = \text{Bin}(n, p)

This gives us the expectation and variance immediately by linearity and independence.

Binomial as Sampling

The binomial arises from sampling with replacement or from a large population where the success probability stays constant.

If sampling is without replacement from a small population, use the hypergeometric distribution instead.

Normal Approximation

For large nn, Bin(n,p)\text{Bin}(n, p) is approximately normal:

XN(np,np(1p))X \approx N(np, np(1-p))

Rule of thumb: use when np5np \geq 5 and n(1p)5n(1-p) \geq 5.

Summary Table

DistributionPMFMeanVariance
Bernoulli(pp)p1(1p)1xp^1(1-p)^{1-x}ppp(1p)p(1-p)
Binomial(n,pn,p)(nk)pk(1p)nk\binom{n}{k}p^k(1-p)^{n-k}npnpnp(1p)np(1-p)