Coin Flip Probability Calculator
Calculate exact, cumulative, and at-least probabilities for coin flips using binomial distribution. Visualize the full PMF chart.
About
Misjudging coin-flip odds leads to flawed experimental design, lost bets, and broken simulations. A single fair coin produces a binary Bernoulli trial with p = 0.5, but sequences of n flips follow the binomial distribution B(n, p). This calculator computes the exact probability of observing k heads (or tails) in n flips, plus cumulative probabilities for "at least" and "at most" scenarios. It also supports biased coins where p โ 0.5. The tool uses the Lanczos log-gamma approximation to evaluate binomial coefficients C(n, k) accurately for n up to 10,000 without integer overflow.
Limitation: the model assumes independent, identically distributed trials. Physical coins exhibit slight bias (estimated 0.51 toward the starting face per Diaconis et al., 2007). For critical applications, adjust p accordingly. The cumulative computation iterates over the PMF, so extremely large n with mid-range k may take a moment. Pro tip: use the distribution chart to visually identify the mode and spread before committing to a sample size in an experiment.
Formulas
The probability of getting exactly k successes (heads) in n independent Bernoulli trials, each with success probability p, is given by the binomial probability mass function:
The binomial coefficient is computed via log-gamma to avoid overflow:
In log-space: ln C(n, k) = lnฮ(n + 1) โ lnฮ(k + 1) โ lnฮ(n โ k + 1)
Cumulative probabilities are obtained by summation:
Expected value and standard deviation:
Where n = number of coin flips, k = desired number of heads (or tails), p = probability of heads on a single flip (0.5 for a fair coin), C(n, k) = binomial coefficient, ฮ = gamma function, ฯ = standard deviation.
Reference Data
| Flips (n) | Desired Heads (k) | P(X = k) | P(X โฅ k) | Odds (1 in โฆ) |
|---|---|---|---|---|
| 1 | 1 | 50.000% | 50.000% | 2 |
| 2 | 2 | 25.000% | 25.000% | 4 |
| 3 | 3 | 12.500% | 12.500% | 8 |
| 5 | 3 | 31.250% | 50.000% | 3.2 |
| 5 | 5 | 3.125% | 3.125% | 32 |
| 10 | 5 | 24.609% | 62.305% | 4.1 |
| 10 | 7 | 11.719% | 17.188% | 8.5 |
| 10 | 10 | 0.098% | 0.098% | 1,024 |
| 20 | 10 | 17.620% | 58.810% | 5.7 |
| 20 | 15 | 1.479% | 2.069% | 67.6 |
| 50 | 25 | 11.227% | 55.614% | 8.9 |
| 50 | 30 | 4.186% | 10.135% | 23.9 |
| 50 | 40 | 0.009% | 0.013% | 10,907 |
| 100 | 50 | 7.959% | 53.979% | 12.6 |
| 100 | 60 | 1.084% | 2.844% | 92.3 |
| 100 | 75 | 0.000% | 0.000% | >106 |
| 200 | 100 | 5.635% | 52.817% | 17.7 |
| 200 | 120 | 0.060% | 0.141% | 1,670 |
| 500 | 250 | 3.566% | 51.780% | 28.0 |
| 1000 | 500 | 2.523% | 51.262% | 39.6 |