QouratR&D centreContact

The longest run in a fair coin

Ten identical flips become common once the coin has enough chances to start a streak.

A run of 10 heads or 10 tails occurs in 8.67% of 100-flip strings and 62.39% of 1,000-flip strings.

Both probabilities count a string once, however many times it reaches ten.

On this page

A streak somewhere in the string

Let L be the longest run of either face in n independent fair flips. A string such as HHTTTH has L = 3. A run longer than k counts toward “at least k” because it contains k consecutive identical outcomes. For one specified starting position, the chance of k identical flips is 2 to the power 1 − k. A longer string gives a streak many possible places to start. Nearby starting positions overlap, so multiplying the single-position probability by the number of positions does not give the probability of at least one streak.

Count the strings that stay below k

Write A(m,k) for the number of m-flip strings whose longest run is shorter than k. For a positive threshold k, every string qualifies when m is smaller than k, including the empty string. At m = k, only the all-heads and all-tails strings fail. For each later flip, the exact recurrence is

A(m,k) = 2^m                         for 0 ≤ m < k
A(k,k) = 2^k − 2
A(m,k) = 2 A(m−1,k) − A(m−k,k)       for m > k

The first term in the last line appends either face to an admissible string. A string that first reaches k at its last flip has an admissible prefix of length m − k. Its final k flips must all be the opposite of the prefix’s last face. Each such prefix has exactly one forbidden extension. Subtracting its count removes each first hit once.

The count immediately gives the cumulative distribution, the probability of any particular longest length, and the chance of at least one qualifying run.

P(L ≤ k) = A(n,k+1) / 2^n
P(L = k) = [A(n,k+1) − A(n,k)] / 2^n
P(L ≥ k) = 1 − A(n,k) / 2^n

For n positive, a run of at least one is certain. A run of at least n requires a constant string and has probability 2 to the power 1 − n. Longer runs have probability zero. Schilling gives an equivalent check. Once the first face is known, the indicators of “same as the previous flip” determine the entire sequence. All indicator strings are equally likely. The longest either-face run equals one plus the longest string of repeats in those n − 1 indicators. Schilling, pp. 198–199.

Distribution and threshold probabilities

Four probability curves move toward longer streaks with increasing sample size. Simulated points closely follow the curves at every size.
Longest run of either face (flips)The line joins exact probabilities at integer run lengths. Circles show 20,000 simulated strings per panel. The horizontal axis shows lengths through 32.Open full-size figure
At least half the strings reach the median length, and the percentile columns show how far the maximum varies across strings.7 columnsCSV
FlipsMean2.5th %ileMedian97.5th %ileSimulated meanSimulated median
1006.97743247116.99797
1,00010.2986158101510.285010
10,00013.62046811131813.634613
1,000,00020.26431618202520.277020

The median and percentile endpoints are the smallest integers reaching 50%, 2.5% or 97.5% cumulative probability. The two outer percentiles give a central model range. Because the length is a whole number, the range can contain more than 95% of strings.

The chance of reaching the same threshold changes sharply with the number of flips available.7 columnsCSV
Flips≥ 5 (%)≥ 10 (%)≥ 15 (%)≥ 20 (%)≥ 25 (%)≥ 30 (%)
10097.1689678.6659040.2652580.0078200.0002290.000007
1,000>99.99999962.3870412.9684580.0936090.0029120.000091
10,000>99.99999999.99472326.2813170.9474580.0297290.000929
1,000,000>99.999999>99.999999>99.99999961.4677602.9361970.093086

Each row counts both faces. In one million flips, the median longest run is 20. The most likely single length is 19 (23.69%), just ahead of exactly 20 (23.54%). The chance of at least 20 is 61.47% because that also counts every longer streak. The detailed file gives point, cumulative and exceedance probabilities and the corresponding simulation counts for every integer through 50, plus the remaining tail. A displayed probability may round to one. Distribution and simulation counts (CSV).

Numerical precision

All avoidance counts use integer arithmetic. For large n the program reads the n-th coefficient of the generating function (1 − z^k)/(1 − 2z + z^k). Multiplying numerator and denominator by the denominator evaluated at −z leaves an even denominator. Keeping the appropriate odd or even numerator terms halves the requested index. This evaluates the same recurrence without rounding intermediate counts. The displayed probabilities divide the final counts by 2^n. Coefficient algorithm.

The mean of L is the sum of P(L ≥ k) over positive k. We summed through 50. Counting possible run starts gives a bound of n/2^50 flips on the omitted mean, below 0.000000001 even for a million flips. Both ends of this numerical bound round to the same six decimal places.

To evaluate another sample size or threshold, run code/reproduce.sh --query 1000000 20 from the research directory with your chosen n and k. Add --fraction to print the exact probability of at least one run as a ratio of integers.

Simulation and independent calculation

The simulation drew individual random bits from the 64-bit Mersenne Twister with seed 2026112704. It used sample sizes in ascending order, read each word from its least significant bit and discarded unused bits at the end of each string. A lookup table counted runs inside words and joined runs that crossed a word boundary.

All four simulated cumulative distributions stayed within the simultaneous 95% sampling bound.6 columnsCSV
FlipsStringsSeedLargest gap (pp)95% bound (pp)Result
10020,00020261127040.52131.1264Inside
1,00020,00020261127040.37481.1264Inside
10,00020,00020261127040.41371.1264Inside
1,000,00020,00020261127040.32961.1264Inside

A gap of one percentage point means one additional string per hundred up to that threshold. For 20,000 strings, the two-sided Dvoretzky–Kiefer–Wolfowitz bound, with the 5% error allowance divided among the four sizes, is 1.1264 percentage points over all thresholds. The largest measured gap was 0.5213 points. Uniform simulation bound.

Integer counts and an independent probability model agree at the precision shown.7 columnsCSV
FlipsExact mean¹Chain mean¹Exact medianChain medianExact ≥ median (%)Chain ≥ median (%)
1006.9774326.9774327754.2336855554.23368555
1,00010.29861510.298615101062.3870405262.38704052
10,00013.62046813.620468131370.5130992970.51309929
1,000,00020.26431620.264316202061.4677597361.46775973

The second model keeps a state for each current run length below k. The next flip resets the length to one or extends it by one, each with probability one half. Once the length reaches k, the model records a hit permanently. Raising its transition matrix to the power n − 1 gives the hit probability. The mean columns marked ¹ use the tail bound above. Enumeration of every string up to ten flips also checked both support boundaries and all intervening lengths.

This is research on past data, not advice and not a forecast.

Cite this study

Titles are italic in Harvard, APA, MLA and Chicago.

First published .

Harvard

Qourat 2026, How long do runs of the same outcome get in a fair coin, and do one-minute currency moves look any different?, Research 016, Qourat Research and Development Centre, https://doi.org/10.5281/zenodo.24775755

APA (7th edition)

Qourat. (2026). How long do runs of the same outcome get in a fair coin, and do one-minute currency moves look any different? (Research 016). Qourat Research and Development Centre. https://doi.org/10.5281/zenodo.24775755

IEEE

[1] Qourat, “How long do runs of the same outcome get in a fair coin, and do one-minute currency moves look any different?” Qourat Research and Development Centre, Research 016, Nov. 27, 2026. [Online]. Available: https://doi.org/10.5281/zenodo.24775755

MLA (9th edition)

Qourat. How Long Do Runs of the Same Outcome Get in a Fair Coin, and Do One-Minute Currency Moves Look Any Different? Research 016, Qourat Research and Development Centre, 27 Nov. 2026, https://doi.org/10.5281/zenodo.24775755.

Chicago (author-date)

Qourat. 2026. How Long Do Runs of the Same Outcome Get in a Fair Coin, and Do One-Minute Currency Moves Look Any Different? Research 016. Qourat Research and Development Centre. https://doi.org/10.5281/zenodo.24775755.

BibTeX

@techreport{qourat-016,
  author = {Qourat},
  title = {{How long do runs of the same outcome get in a fair coin, and do one-minute currency moves look any different?}},
  institution = {Qourat Research and Development Centre},
  number = {Research 016},
  year = {2026},
  date = {2026-11-27},
  url = {https://doi.org/10.5281/zenodo.24775755}
}

Add the date you read the page if your style asks for one.