Skip to content

Counting HHHHHHTTTTTT runs in a million flips

Question

A fair coin is flipped one million times. On average, how many times does the exact pattern of six consecutive heads immediately followed by six consecutive tails appear (overlapping occurrences counted, though this pattern cannot overlap itself)?

Short answer

About 244244. The pattern has length 1212, so it can start at 106−1110^6-11 positions, each with probability 2−122^{-12}. By linearity of expectation the mean count is 999,9894096≈244.1\tfrac{999{,}989}{4096}\approx244.1.

Adapted from Joshi, Denson & Downes, Quant Job Interview Questions and Answers, Q3.12, p.81; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question

Start with a free lesson: Expectation, Variance and Covariance is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.

Read it free