Bernoulli Distribution
Definition
A random variable X follows the Bernoulli distribution with parameter p if:
P(X=1)=p,P(X=0)=1−p
Write: X∼Bern(p).
Context: Models a single trial with two outcomes: success (1) with probability p, or failure (0) with probability 1−p.
PMF
p(x)=⎩⎨⎧1−pp0x=0x=1otherwise
Or compactly: p(x)=px(1−p)1−x for x∈{0,1}.
Expectation
E[X]=0⋅(1−p)+1⋅p=p
Variance
E[X2]=02⋅(1−p)+12⋅p=p
Var(X)=E[X2]−E[X]2=p−p2=p(1−p)
Examples
- Coin flip: X∼Bern(0.5) for a fair coin
- Defective item: X∼Bern(0.02) if 2% are defective
- Pass/fail: X∼Bern(p) where p is pass rate
Binomial Distribution
Definition
X∼Bin(n,p) if X counts the number of successes in n independent Bernoulli trials, each with success probability p.
PMF
P(X=k)=(kn)pk(1−p)n−k,k=0,1,…,n
Why this formula?
- Choose which k of n trials are successes: (kn) ways
- Each such arrangement has probability pk(1−p)n−k
Range
X∈{0,1,2,…,n}
Expectation
Let X=X1+X2+⋯+Xn where Xi∼Bern(p) are independent.
E[X]=E[X1]+⋯+E[Xn]=np
Intuition: If each trial succeeds with probability p, expect np successes in n trials.
Variance
Since the Xi are independent:
Var(X)=Var(X1)+⋯+Var(Xn)=n⋅p(1−p)
Shape
- For small p: distribution is skewed right (concentration near 0)
- For p=0.5: symmetric around n/2
- For large p: distribution is skewed left (concentration near n)

Example: Coin Flips
Flip a fair coin 100 times. Expected number of heads?
X∼Bin(100,0.5)
E[X]=100×0.5=50
Var(X)=100×0.5×0.5=25
σ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?
X∼Bin(200,0.02)
P(X=3)=(3200)(0.02)3(0.98)197
Compute: (3200)=6200⋅199⋅198=1,313,400
P(X=3)≈1,313,400×0.000008×0.018≈0.19
Relation Between Bernoulli and Binomial
The sum of n independent Bern(p) variables is Bin(n,p):
∑i=1nBern(p)=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 n, Bin(n,p) is approximately normal:
X≈N(np,np(1−p))
Rule of thumb: use when np≥5 and n(1−p)≥5.
Summary Table
| Distribution | PMF | Mean | Variance |
|---|
| Bernoulli(p) | p1(1−p)1−x | p | p(1−p) |
| Binomial(n,p) | (kn)pk(1−p)n−k | np | np(1−p) |