The binomial distribution models the number of successes in a fixed number of Bernoulli trials — independent experiments that can only end in success or failure.
Four conditions must ALL hold:
1. Fixed n — you know how many trials before you start
2. Independence — each trial's outcome doesn't affect others
3. Constant p — same probability of success on every trial
4. Binary — only two possible outcomes per trial
Classic examples: Number of heads in 10 coin flips. Number of patients who recover out of 20 given a treatment. Number of correct guesses on a 10-question T/F test.
For X ~ Binomial(n, p), the probability of exactly k successes:
P(X = k) = C(n,k) p^k (1-p)^(n-k)
The C(n,k) term counts the number of ways to arrange k successes among n trials. The p^k and (1-p)^(n-k) give the probability of any specific arrangement.
Example: P(exactly 3 heads in 5 flips) = C(5,3) 0.5^3 0.5^2 = 10 0.125 0.25 = 0.3125.
In R, you'll never compute the PMF formula by hand — use these functions:
dbinom vs pbinom: d = density (exact probability at one value). p = probability (cumulative, all values up to and including k). For "at least", remember that P(X >= k) = 1 - P(X <= k-1), not 1 - P(X <= k).
For X ~ Binomial(n, p):
Intuition for the mean: If you flip a coin 20 times (p = 0.5), you expect 10 heads. If p = 0.3, you expect 20 * 0.3 = 6 successes. The mean is just n times the probability of a single success.
The distribution is symmetric only when p = 0.5. For p < 0.5 it's right-skewed; for p > 0.5 it's left-skewed.
How many ways can you arrange k successes in n trials?
C(n,k) = n! / (k! * (n-k)!)
In R:
dbinom(k, n, p) — exact probability P(X = k):
pbinom(k, n, p) — cumulative probability P(X <= k):
qbinom(q, n, p) — quantile (inverse CDF). Find the smallest x where P(X <= x) >= q:
rbinom(n_samples, size, prob) — simulate random samples:
Quick reference: d = density (exact), p = probability (cumulative), q = quantile, r = random sample.
The four required conditions for Binomial(n, p):
Common violation: Sampling without replacement from a small population violates Independence. Rule of thumb: If population size >= 20n, independence is approximately satisfied.
For a DISCRETE distribution these are NOT the same:
1 - pbinom(k-1, n, p)1 - pbinom(k, n, p)Example: X ~ Binomial(10, 0.4)
This is the #1 source of exam errors. "At least 4" means >= 4, so subtract P(X <= 3), NOT P(X <= 4).
You can simulate binomial experiments using rbinom():
The simulated mean (approximately 4) confirms our formula E[X] = np = 10 0.4 = 4. Simulation is a powerful way to verify theoretical results.