← SciSim / Statistics
Binomial Distribution
📊 Tier: Standard Undergraduate
§1 Interactive Simulation
n trials
20
p (success prob)
0.500
E[X]=np
10.00
Var=np(1-p)
5.000
P(X=k)
P(X≤k)
n trials 20
p probability 0.50
k query value 10
Speed 20/s
§2 The Idea, Step by Step
START — just count

Flip a coin 10 times and count the heads. Maybe you get 4, maybe 6, only rarely 0 or 10. Flip again and the count changes. The binomial distribution is simply the bookkeeping of "how often does each count show up?" Anything you repeat a fixed number of times, where each try ends one of two ways — heads or tails, makes the shot or misses, item defective or fine — follows this one pattern.

BUILD — three numbers and one formula

Three numbers describe everything: $n$ is how many times you repeat the trial, $p$ is the chance of "success" on a single try, and $k$ is the particular count you're asking about. The probability of getting exactly $k$ successes is $P(X=k)=\binom{n}{k}\,p^k(1-p)^{n-k}$. The piece $p^k(1-p)^{n-k}$ is the chance of one specific sequence with $k$ successes and $n-k$ failures; the $\binom{n}{k}$ counts how many different sequences give that same total. For a fair coin ($p=0.5$) flipped $n=10$ times, the chance of exactly 3 heads is $\binom{10}{3}(0.5)^3(0.5)^7=120/1024\approx0.117$ — about one in nine.

DEEPEN — average, spread, and the bell curve

On average you expect $E[X]=np$ successes (10 flips $\times\,0.5=5$ heads), and the spread is $\text{Var}(X)=np(1-p)$ — widest at $p=0.5$ and shrinking toward zero as $p$ nears 0 or 1. Once $np\ge5$ and $n(1-p)\ge5$, the jagged bars smooth into a bell curve, $X\approx\mathcal{N}\!\big(np,\,np(1-p)\big)$. That is the de Moivre–Laplace theorem and your first glimpse of the Central Limit Theorem. In the sim, the $n$ slider sets the number of trials, the $p$ slider sets the per-trial success chance, and the $k$ slider highlights the bar whose $P(X=k)$ and $P(X\le k)$ appear in the cards.

TRY IT — three experiments in the sim above

Set $p=0.5$ and drag $n$ from 5 up to 100: the PMF spreads out but grows steadily more bell-shaped. Next drop $p$ to about 0.02 and open the Normal Approx tab — the green curve no longer fits the skewed blue bars, because $np<5$. Finally switch to Live Sampling, press Play, and add 1000 draws: the orange empirical bars settle right onto the blue theoretical dots — the law of large numbers happening in front of you.

§3 Mathematical Derivation

Binomial Distribution — Jacob Bernoulli ~1700 / de Moivre 1730

$X\sim\text{Bin}(n,p)$ = number of successes in $n$ independent Bernoulli($p$) trials

$$\boxed{P(X=k)=\binom{n}{k}p^k(1-p)^{n-k},\quad k=0,1,\ldots,n}$$

$E[X]=np,\quad \text{Var}(X)=np(1-p)$

Symbol Table

SymbolMeaningRangeInterpretation
$n$Number of trials$\{1,2,\ldots\}$Fixed and known in advance
$p$Success probability per trial$(0,1)$Same for every trial (iid Bernoulli)
$k$Number of successes$\{0,1,\ldots,n\}$Random variable outcome
$\binom{n}{k}$Binomial coefficient$\mathbb{N}$Ways to choose $k$ successes from $n$ trials
$E[X]=np$Expected successes$[0,n]$Long-run average number of successes
$\text{Var}(X)=np(1-p)$Variance$[0,n/4]$Maximized at $p=0.5$
STEP 1 — Intuition

We count successes across $n$ independent trials. Each trial has the same probability $p$ of success. The binomial coefficient $\binom{n}{k}$ counts how many distinct orderings give exactly $k$ successes.

STEP 2 — Derive Mean via Linearity

Write $X=\sum_{i=1}^n X_i$ where $X_i\sim\text{Bernoulli}(p)$. By linearity of expectation: $E[X]=n\cdot E[X_1]=n\cdot p$.

STEP 3 — Derive Variance via Independence

$\text{Var}(X_i)=p(1-p)$. Since trials are independent: $\text{Var}(X)=n\cdot p(1-p)$. Maximized at $p=0.5$: $\text{Var}_{max}=n/4$.

STEP 4 — Normal Approximation (de Moivre-Laplace)

For large $n$ with $np\ge5$ and $n(1-p)\ge5$: $X\approx\mathcal{N}(np,np(1-p))$. With continuity correction: $P(X\le k)\approx\Phi\!\left(\frac{k+0.5-np}{\sqrt{np(1-p)}}\right)$.

STEP 5 — Poisson Limit

If $n\to\infty$, $p\to0$, $np\to\lambda$ (rare events), then $\text{Bin}(n,p)\to\text{Poisson}(\lambda)$. Rule: use Poisson when $n\ge20$ and $p\le0.05$.

Worked Example

Problem: Fair coin, 10 flips. Find $P(X=3)$ and $P(X\le3)$.

$$P(X=3)=\binom{10}{3}(0.5)^3(0.5)^7=120\cdot\frac{1}{1024}\approx\mathbf{0.1172}$$

$$P(X\le3)=\sum_{k=0}^{3}\binom{10}{k}(0.5)^{10}=(1+10+45+120)/1024\approx\mathbf{0.1719}$$

Ross — A First Course in Probability, Ch. 4.6
DeGroot & Schervish — Probability and Statistics, Ch. 5.2
§4 FAQ
StatQuest — youtube.com/@statquest
Seeing Theory — seeing-theory.brown.edu
§5 Misconceptions & Common Errors
❌ Misconception 1 — Gambler's Fallacy

"After 7 heads in a row, tails is 'due' — probability of tails is now higher than 0.5."
Each flip is independent. P(heads) = p regardless of history. The coin has no memory. The law of large numbers describes long-run averages but never "corrects" short-run outcomes. The gambler's fallacy is one of the most common probability errors in everyday reasoning. The binomial model REQUIRES independence.
📖 Ross — A First Course in Probability, Ch. 3.3

❌ Misconception 2

"Normal approximation is always accurate for large n."
The approximation requires BOTH np≥5 AND n(1-p)≥5. For p=0.01 and n=50, np=0.5 — approximation fails completely. Use exact binomial or Poisson approximation for rare events. The Normal Approx tab shows this: try p=0.02 and see the mismatch.
📖 DeGroot & Schervish — Ch. 5.4

❌ Misconception 3

"Sampling without replacement from a population still gives a binomial distribution."
Sampling WITHOUT replacement from a finite population gives the hypergeometric distribution, not binomial. Binomial requires independent identical trials — sampling without replacement makes probabilities change with each draw (dependence). Only when population size N >> sample size n does binomial approximate hypergeometric.
📖 Ross — Ch. 4.8

❌ Error 1

Wrong: $\binom{n}{k}=n!/k!$ (permutation instead of combination)
✅ $\binom{n}{k}=n!/(k!(n-k)!)$. Both k! and (n-k)! appear in the denominator. The binomial coefficient counts unordered selections (combinations), not ordered arrangements (permutations).
🔍 Confusing $P(n,k)=n!/(n-k)!$ (permutation) with $C(n,k)=n!/(k!(n-k)!)$ (combination).

❌ Error 2

Forgetting continuity correction in normal approximation
✅ $P(X=k)\approx P(k-0.5\le Y\le k+0.5)$ where $Y\sim N(np,np(1-p))$. For $P(X\le k)$, use $P(Y\le k+0.5)$. Without continuity correction, errors can be substantial for moderate n.
🔍 Students compute $\Phi((k-np)/\sigma)$ directly without the ±0.5 correction.

❌ Error 3

Using binomial when p is not constant across trials
✅ Binomial requires identical p for every trial. If success probability changes (fatigue effects, learning, different subpopulations), use a mixture model or beta-binomial. Always verify the iid assumption before applying binomial.
🔍 Applying binomial to clinical trials where treatment effect changes over time.

Ross — A First Course in Probability, Ch. 4
DeGroot & Schervish — Probability and Statistics, Ch. 5.2–5.4