Coin Toss Streak Calculator
Calculate the probability of getting a streak of consecutive heads or tails in a series of coin tosses. Supports biased coins and custom streak lengths.
About
Getting five heads in a row feels rare. Quantifying that intuition requires the theory of runs in Bernoulli sequences. For n independent tosses, each with success probability p, the chance of observing at least one run of k consecutive successes is non-trivial to compute. Naive approaches (multiplying pk) give the probability of a specific window, not of any window across n trials. This tool uses dynamic programming over the state space of current run lengths to deliver exact results, not approximations. Miscalculating streak probabilities leads to flawed gambling strategies, incorrect quality-control thresholds, and bad experimental design.
The calculator handles biased coins (p ≠ 0.5) and computes the expected number of tosses needed to first observe a streak. Note: the model assumes independent, identically distributed trials. Physical coins have slight bias (0.51) toward the starting face (Diaconis et al., 2007), and real flips are not perfectly i.i.d. For streaks of tails, the relevant probability is q = 1 − p.
Formulas
The probability of observing no streak of k consecutive successes in n tosses is computed via dynamic programming. Let S(i, j) be the probability of reaching toss i with a current run of exactly j consecutive successes and never having completed a run of k.
The final probability of at least one streak of length k:
The expected number of tosses to first observe a streak of k consecutive successes is given by:
Where n = total number of tosses, k = desired streak length, p = probability of success on each toss (e.g. 0.5 for a fair coin), and q = 1 − p = probability of failure.
Reference Data
| Streak Length (k) | P(streak) in 10 tosses | P(streak) in 20 tosses | P(streak) in 50 tosses | P(streak) in 100 tosses | Expected Tosses |
|---|---|---|---|---|---|
| 2 | 98.05% | 99.998% | ≈100% | ≈100% | 6 |
| 3 | 82.62% | 98.68% | 99.997% | ≈100% | 14 |
| 4 | 50.78% | 86.80% | 99.52% | 99.998% | 30 |
| 5 | 24.61% | 61.77% | 95.08% | 99.77% | 62 |
| 6 | 10.94% | 37.35% | 82.07% | 96.78% | 126 |
| 7 | 4.69% | 19.80% | 61.72% | 85.36% | 254 |
| 8 | 1.95% | 9.85% | 41.07% | 65.25% | 510 |
| 9 | 0.78% | 4.72% | 24.55% | 43.07% | 1022 |
| 10 | 0.10% | 2.17% | 13.67% | 25.47% | 2046 |
| 12 | ≈0% | 0.44% | 3.79% | 7.42% | 8190 |
| 15 | ≈0% | 0.01% | 0.48% | 0.96% | 65534 |
| 20 | ≈0% | ≈0% | 0.003% | 0.006% | 2097150 |