Quant interview toolkit · streaks and selection

Ten wins in a row may be ordinary in a long trade log

A trader highlights ten consecutive winners in a log of one thousand trades. The chance of ten wins on ten preselected fair bets is only 1/10241/1024, so the streak looks extraordinary. But the trader searched the entire log for the best run. That changes the question: how often would somewhere in a thousand fair bets contain ten wins in a row?

Count windows, then notice their overlap

There are n−r+1n-r+1 windows of length rr in a sequence of nn results. Each particular window is all wins with probability 2−r2^{-r} under independent fair bets. For n=1000n=1000 and r=10r=10, the expected number of all-win windows is

E[C]=1000−10+1210=9911024≈0.968.E[C]=\frac{1000-10+1}{2^{10}}=\frac{991}{1024}\approx0.968.

That is not a 96.8% chance of at least one streak. Windows overlap. A run of 12 wins creates three different all-win windows of length ten, and they arrive together. An expected count can be close to one even when the probability of seeing at least one is much smaller.

Track only the current run length

Let at(j)a_t(j) be the probability that after tt flips we have seen no run of ten wins and the current run of consecutive wins has length jj, where j=0,…,9j=0,\ldots,9. Start with a0(0)=1a_0(0)=1. A loss resets the run; a win extends it, unless that win would complete the forbidden streak:

at+1(0)=12∑j=09at(j),at+1(j+1)=12at(j)(0≤j<9).a_{t+1}(0)=\tfrac12\sum_{j=0}^{9}a_t(j),\qquad a_{t+1}(j+1)=\tfrac12 a_t(j)\quad(0\le j<9).

The missing probability from a win in state 9 is precisely the probability of first reaching ten in a row at that step. Iterate the recurrence 1,000 times and subtract the probability still in the safe states:

P(at least one ten-win run)=1−∑j=09a1000(j)≈38.54%.P(\text{at least one ten-win run}) =1-\sum_{j=0}^{9}a_{1000}(j) \approx38.54\%.

That is common enough to expect many fair strategies to show such a streak by chance. It is also far below the expected window count of 0.968 because long runs create clusters of overlapping windows.

0.10%Chance in one preselected window
38.54%Chance somewhere in the log
0.968Expected number of matching windows
Each trade wins independently with probability 50%.
def chance_of_run(n, length):
    safe = [1.0] + [0.0] * (length - 1)
    for _ in range(n):
        nxt = [0.0] * length
        nxt[0] = 0.5 * sum(safe)  # loss resets the run
        for j in range(length - 1):
            nxt[j + 1] = 0.5 * safe[j]  # win extends it
        safe = nxt
    return 1.0 - sum(safe)

print(chance_of_run(1000, 10))  # 0.3854497524...

Ask when the streak was specified

If a researcher declared in advance that trades 201–210 would all win, the 1/10241/1024 calculation is relevant under the fair, independent model. If the researcher scanned every ten-trade window and reported the prettiest one, the 38.54% calculation matches that search. Searching many strategies, parameters and markets creates still more opportunities to find a striking run; multiple-testing bias addresses that broader selection problem.

Real trade outcomes are not necessarily independent or equally likely to win. A changing regime or correlated positions can produce longer streaks than the fair-coin model. This puzzle isolates the selection effect before those complications. For the related question of waiting time until a pattern occurs, see first-step analysis.

Practice

Preselected windowWhat is the chance that one specified block of eight independent fair trades contains eight wins?
Show answer

2−8=1/256≈0.391%2^{-8}=1/256\approx0.391\%. This is for one block selected before seeing the outcomes.

Expected windowsIn 100 fair independent trades, how many ten-win windows do you expect, counting overlapping windows separately?
Show answer

There are 100−10+1=91100-10+1=91 windows. The expected count is 91/1024≈0.088991/1024\approx0.0889. This expectation is not the probability of at least one; the exact probability is about 4.41%.