How coin flip probability works
A sequence of coin flips is the textbook example of a binomial experiment: a fixed number of independent trials (n flips), each with two outcomes (heads or tails) and the same probability of heads on every trial (p). If you want the chance of getting exactly k heads in n flips, the answer is the binomial probability mass function:
P(X = k) = C(n, k) · pk · (1 − p)n − k
Here C(n, k) = n! / (k! · (n − k)!) is the binomial coefficient — the number of distinct orderings in which k heads can appear among n flips. The term pk is the probability of the k heads and (1 − p)n − k is the probability of the remaining tails. Multiplying the count of arrangements by the probability of one arrangement gives the total probability. For a fair coin p = 0.5, so the formula simplifies to P(X = k) = C(n, k) / 2n.
Worked example: 5 heads in 10 flips
With n = 10, k = 5, and a fair coin (p = 0.5): C(10, 5) = 252, and 210 = 1024, so P = 252 / 1024 = 0.24609 ≈ 24.6%. Five heads is the single most likely count, yet it still occurs less than a quarter of the time — because the ten other possible counts (0–4 and 6–10) split up the remaining ~75%. This surprises many people and is a good reminder that "the most likely outcome" is not the same as "a likely outcome."
Exactly, at least, and at most
- Exactly k: use the formula above directly.
- At most k: P(X ≤ k) = Σi=0..k C(n, i) · pi · (1 − p)n − i — add up the exact probabilities from 0 heads through k heads.
- At least k: P(X ≥ k) = Σi=k..n C(n, i) · pi · (1 − p)n − i, or equivalently 1 − P(X ≤ k − 1). Using the complement is usually easier than summing many terms.
The calculator above reports all three plus the expected number of heads, the mean of the distribution, which is simply μ = n · p (5 for ten fair flips). The spread is measured by the standard deviation σ = √(n · p · (1 − p)) = √2.5 ≈ 1.58 heads for that case.
Reference values for a fair coin
- P(exactly 1 head in 1 flip) = 1/2 = 50%.
- P(2 heads in a row) = 1/4 = 25%; P(3 in a row) = 1/8 = 12.5%; P(10 in a row) = 1/1024 ≈ 0.098%.
- P(exactly 2 heads in 3 flips) = 3/8 = 37.5%.
- P(at least 1 head in 10 flips) = 1 − (1/2)10 = 1023/1024 ≈ 99.9%.
- P(0 heads in 4 flips, i.e. all tails) = 1/16 = 6.25%.
Independence and the gambler's fallacy
Every flip is independent: the coin has no memory, so a run of heads does not "owe" you tails. After ten heads in a row, the eleventh flip is still 50/50. What the law of large numbers actually says is that the proportion of heads converges toward p as n grows, not that short-run streaks get corrected. A related mistake is assuming a specific ordering (HHHHH) is rarer than a mixed one (HTHTH) — for a fair coin both exact sequences have identical probability (1/32); mixed counts are more likely only because more orderings produce them.