Coin Toss Streak Calculator
Flip a fair coin ten times. What are the odds a run of three heads appears somewhere in the ten? Most people guess low — and the exact answer, 50.78%, is already a coin flip. Streaks are not rare intrusions into randomness; they are its texture. This calculator computes the exact probability of at least one run of a given length in a given number of fair flips — no simulation, no approximation — using the recursion the problem actually obeys, and it handles the sizes where intuition fails hardest: a hundred flips produce a run of five heads over four times out of five.
How the Exact Calculation Works
Counting sequences with no run of k heads is a Fibonacci-flavoured problem, and the calculator solves it the way combinatorics prescribes: track, after each flip, the probability of sitting at each possible current run length (0 through k−1 heads in a row, not yet absorbed into success). Each flip moves every state: a tails (probability ½) resets the run to 0; a heads (½) advances it — and advancing from k−1 completes the streak, moving that probability into the success column permanently. After n flips, the success column holds the exact answer, computed in full floating precision — and the same recursion, run mentally for tiny cases, reproduces the classics by direct enumeration: two flips with a streak of 2 → 25% (only HH of the 4 sequences); three flips with a streak of 2 → 37.5% (HHH, HHT and THH of the 8). For the probabilist, the no-streak counts are the k-step Fibonacci (tribonacci for k = 3) numbers in disguise: of the 1,024 sequences of 10 flips, 504 contain no three consecutive heads, leaving 520 that do — 50.78%.
The Numbers That Break Intuition
Run the defaults first: n = 10, k = 3 → 50.78%. A run of three heads in ten flips is not a curiosity; it is the median outcome. Stretch the horizon: n = 20, k = 4 → 47.80%. And the long game: n = 100, k = 5 → 81.01%, while a run of six somewhere in a hundred flips sits at 54.61% — better than even. The pattern behind the surprises is the expected count: the expected number of (possibly overlapping) run-starts is roughly (n−k+1)/2^k... for 100 flips and k = 5, about 3 windows in expectation — of course the streak almost always lands. The gambler's error is to price a streak at one named window (the next five flips: 1/32) when the question life actually asks is about any window in a long sequence — ninety-six windows, each a lottery ticket. This calculator exists to keep those two questions separated, in numbers.
Where Streak Arithmetic Earns Its Keep
The same recursion prices real patterns. Quality control and runs tests: the Wald–Wolfowitz runs test judges whether a sequence is plausibly random by comparing its streak structure against exactly these probabilities — a production line whose defect pattern streaks too often (or suspiciously never) fails randomness in a computable way. The hot-hand debates: sports' famous fallacy arguments turn on conditional probabilities of streaks, and the careful literature re-derives them from run distributions of this kind — the streak calculator is the intuition pump, set to exact. Waiting times: the expected wait for a run of k heads is 2^(k+1) − 2 flips (for k = 3, fourteen flips — longer than the naive 8, because failed attempts overlap themselves), a result worth one experiment with the inputs above: set n = 14, k = 3 and find the probability still short of two-thirds. And gambling systems: martingale folklore imagines long losing streaks as impossibilities; at a roulette wheel, a run of 6 reds somewhere in 100 spins is the same 54%-style certainty wearing colours — the streak was never unlikely, only unpriced.
Either Face, and Loaded Coins
Two honest extensions frame the tool's edges. A streak of k tails obeys the identical probability by symmetry, and a streak of k of either face is likelier than either alone — roughly, though not exactly, double for small probabilities; the exact either-face figure needs its own recursion (two run-lengths tracked at once) and is a fine exercise once this page's method is familiar. A biased coin (heads probability p ≠ ½) also breaks the simple recursion's symmetry — the state machine survives intact with p and 1−p in place of the halves, and casino-grade questions (streaks in a shooter's roll, a biased wheel's runs) are answered by that generalisation. The calculator ships the fair case, the fair case being where intuition's failures are measurable in their purest form: nothing to blame but the mathematics of runs, which the numbers above state without apology.
A Small Table Worth Memorizing
Three more reference points, computed by the same recursion, calibrate most real arguments. A run of 5 heads in 30 flips: 36.82% — a month of daily handfuls still misses it two times in three. A run of 4 in 50 flips: 82.74% — the shorter streak in the longer field is nearly banked. And the expected-wait checkpoint from the earlier section, verified: a run of 3 within its own expected wait of 14 flips reaches only 64.8%, because the wait is an average over a skewed distribution — many waits end at flip 3, and a long tail of droughts drags the mean while the median wait is shorter. Keep the trio beside the headline defaults (10/3: 50.78%; 100/5: 81.01%) and most bar-room claims about streaks can be settled from memory: streaks are common in aggregate, tardy on schedule, and never, ever owed.
Penney's Game: When Equal Patterns Are Not Equal
The deepest streak result in elementary probability is Walter Penney's 1969 game: two players each name a pattern of length 3 — say you take HHH — and a coin is flipped until one pattern appears first. Every pattern has the same chance, 1/8, at any named triple of flips, yet the race is rigged by overlap: against HHH, the reply THH wins with probability 7/8, because HHH can only arrive first if it occupies the very first three flips — in every later case, the T that must precede the final HHH run completes THH one flip before HHH can close. Against HTH, the counter HHT wins 2/3 of races. For every pattern of length 3 or more there exists a counter-pattern favoured to beat it — probability's rock-paper-scissors, non-transitive and exact. The machinery underneath is this page's recursion wearing a second hat (pattern-matching automata instead of run lengths), and the moral is the streak lesson completed: in sequences, when a pattern can occur matters as much as how often — a fact this calculator's run-length version quantifies every time it is run.
Streaks at the Office: Auditors and the Runs Test in Practice
One applied coda: auditors screening ledgers for fabrication run streak logic over digit and sign patterns, because invented numbers streak wrongly — humans fabricating "random" data alternate too much, avoiding runs a genuine sequence produces half the time at these lengths. A claimed-random record with no run of 3 in a hundred entries is not reassuring; by this page's arithmetic it is a roughly 1-in-3,800 accident under honesty (a streak appears 99.97% of the time), and exactly the kind of anomaly that starts investigations. Randomness has a texture, the texture is computable, and this recursion is the texture's fingerprint kit.
Related Tools
More from the Statistics Calculators hub: the Monty Hall Problem Calculator for probability's other famous ambush, the Implied Probability Calculator for the probabilities hidden in odds, and the Descriptive Statistics Calculator for summarising the data streaks hide in.
Frequently Asked Questions
Is a streak of 3 heads in 10 flips really 50/50?
Yes — exactly 520 of the 1,024 equally likely sequences contain HHH somewhere, 50.78%. The surprise is the lesson: a specific triple at a specific position is 1-in-8, but ten flips offer eight overlapping windows for the streak to start in, and their combined claim passes half.
How long is the expected wait for a run of k heads?
2^(k+1) − 2 flips for a fair coin: 2 flips for k = 1, 6 for k = 2, 14 for k = 3, 30 for k = 4, 62 for k = 5. The wait outruns the naive 2^k because attempts overlap — a run of HHHT restarts the next attempt one flip deep rather than from zero.
Does a long streak make the opposite outcome due?
No — that is the gambler's fallacy in its purest form. Each flip is independent; the coin has no memory and no conscience. Streaks are likely somewhere in a long sequence precisely because the sequence is long, not because outcomes balance themselves locally.
What about streaks of tails, or of either face?
Tails mirror heads exactly by symmetry. Either-face streaks are more likely than single-face ones (for the defaults, a run of 3 of either face in 10 flips is about 83%): not exactly double, because sequences can contain both, but the same recursion extended to two run-lengths computes it exactly.
Can I use this for roulette or dice?
For even-money roulette bets (red/black), yes — treat red as heads, with the caveat that the zeros slightly change the base rate (18/37 or 18/38 per spin rather than 1/2), which a biased-coin version of the recursion handles. Dice patterns (a run of sixes) need the generalisation to six faces: streaks of one named face behave like a biased coin with p = 1/6.
Why not just simulate?
Simulation estimates; this recursion computes. A million simulated sequences pin 50.78% down to about ±0.05% — the recursion returns the exact figure instantly, which is why it is printed here as the arbiter when enumeration arguments (like the three-flip case in the method section) get tangled.