Probability Distribution of Runs in Coin Flips

3.1k Views Asked by At

If you flip a coin $n$ times, what is the probability distribution of the longest "run" (sequence of consecutive heads or tails) which will occur? Or if that's not possible, what is the average?

I have tried everything I know of and have never been able to solve this... I wondered if someone would have any ideas.

I'm assuming the answer to this is known - it is related to the iconic "stats magic trick" where the professor tells which sequences of coin flips are real and which are human-created by looking at the length of the longest run (humans naturally switch too often).

As my "contribution" here are some computer simulations that got the average for the first few $n$ flips (I averaged over 100,000 trials): $$\begin{cases}n=1&1.0\\n=2&1.49856\\n=3&2.00221 \\n=4&2.37459 \\n=5&2.6846 \\n=10&3.66115 \\n=50&5.97501 \\n=200&7.98442 \end{cases}$$

Clarification: Given $n$ flips of a fair coin, what is the probability that the longest run is of length $k$? And (if that has no closed form) what is the average longest run?

1

There are 1 best solutions below

1
On

I'm not too sure if this is what you're looking for, but given that your asking for the 'longest run' in $n$ flips, well, the longest possible run in $n$ flips would be a run of $n$.

Then this will have a probability of $$ P = \left(\frac{1}{2}\right)^{n-1} $$

since you don't mind what you get on the first flip, and then the probability is 1/2 for each flip thenceforth.