TExcelTAD
Home › Probability Theory › Returns, Leads and the Arc Sine Law

Returns, Leads and the Arc Sine Law

Toss a fair coin 1000 times and track who is ahead, Heads or Tails. Intuition says the lead should change hands often and each side should be ahead about half the time. The truth is the opposite: the most likely outcome is that one side leads almost the whole game. This is the arc sine law, one of the most counter-intuitive results in probability.

Time in the lead

Let SkS_k be the simple random walk (heads minus tails after kk tosses), and say Heads leads during step kk if the path segment from Sk−1S_{k-1} to SkS_k lies above 0. Let L2nL_{2n} be the number of steps in 1,…,2n1, \ldots, 2n during which Heads leads. Then L2nL_{2n} is always even, and

Pr⁡[L2n=2k]=u2k u2n−2k,u2m=(2mm)2−2m\Pr[L_{2n} = 2k] = u_{2k}\,u_{2n-2k}, \qquad u_{2m} = \binom{2m}{m}2^{-2m}

This distribution is U-shaped: the extreme values 00 and 2n2n are the most likely, and an even split is the least likely. As n→∞n \to \infty, the fraction of time in the lead, L2n/(2n)L_{2n}/(2n), has the arc sine density

f(x)=1πx(1−x),F(x)=2πarcsin⁡xf(x) = \frac{1}{\pi\sqrt{x(1 - x)}}, \qquad F(x) = \frac{2}{\pi}\arcsin\sqrt{x}
python · try it yourself
from math import comb, asin, sqrt, pi

def u(m2):
    m = m2 // 2
    return comb(2 * m, m) / 4 ** m

n2 = 20
probs = [u(2 * k) * u(n2 - 2 * k) for k in range(n2 // 2 + 1)]
for k, p in enumerate(probs):
    print(f"Heads leads {2 * k:2d} of 20 steps: {p:.4f} " + "#" * int(p * 200))
print("total:", round(sum(probs), 10))
F = lambda x: 2 / pi * asin(sqrt(x))
print("limit: P(leading less than 10% of the time) =", round(F(0.1), 4))
Heads leads  0 of 20 steps: 0.1762 ###################################
Heads leads  2 of 20 steps: 0.0927 ##################
Heads leads  4 of 20 steps: 0.0736 ##############
Heads leads  6 of 20 steps: 0.0655 #############
Heads leads  8 of 20 steps: 0.0617 ############
Heads leads 10 of 20 steps: 0.0606 ############
Heads leads 12 of 20 steps: 0.0617 ############
Heads leads 14 of 20 steps: 0.0655 #############
Heads leads 16 of 20 steps: 0.0736 ##############
Heads leads 18 of 20 steps: 0.0927 ##################
Heads leads 20 of 20 steps: 0.1762 ###################################
total: 1.0
limit: P(leading less than 10% of the time) = 0.2048

So in a long game there is a 20% chance that one particular side is ahead less than 10% of the time, and a 40% chance that one of the two sides is.

A simulation

python · try it yourself
import numpy as np

rng = np.random.default_rng(1)
n, games = 1000, 5000
steps = rng.integers(0, 2, size=(games, n), dtype=np.int8) * 2 - 1
S = np.concatenate([np.zeros((games, 1), dtype=np.int16), steps.cumsum(axis=1, dtype=np.int16)], axis=1)
leading = ((S[:, :-1] + S[:, 1:]) > 0).sum(axis=1) / n        # segment above zero
bins = np.histogram(leading, bins=10, range=(0, 1))[0] / games
for i, b in enumerate(bins):
    print(f"fraction of time Heads leads in [{i / 10:.1f}, {(i + 1) / 10:.1f}): {b:.3f} " + "#" * int(b * 150))
fraction of time Heads leads in [0.0, 0.1): 0.201 ##############################
fraction of time Heads leads in [0.1, 0.2): 0.096 ##############
fraction of time Heads leads in [0.2, 0.3): 0.076 ###########
fraction of time Heads leads in [0.3, 0.4): 0.063 #########
fraction of time Heads leads in [0.4, 0.5): 0.067 ##########
fraction of time Heads leads in [0.5, 0.6): 0.062 #########
fraction of time Heads leads in [0.6, 0.7): 0.064 #########
fraction of time Heads leads in [0.7, 0.8): 0.069 ##########
fraction of time Heads leads in [0.8, 0.9): 0.093 #############
fraction of time Heads leads in [0.9, 1.0): 0.210 ###############################

The histogram is high at both ends and low in the middle, matching the arc sine density.

Why intuition fails

The walk returns to 0 with certainty, but the return times have infinite mean. Once one side gets ahead, the expected time to the next tie is enormous, so long stretches with the same leader are normal. Ties become rarer as the game goes on: the expected number of returns to 0 in 2n2n steps grows only like n\sqrt{n}.

The last tie

A second arc sine law: let T2nT_{2n} be the time of the last return to 0 before 2n2n. Then Pr⁡[T2n=2k]=u2ku2n−2k\Pr[T_{2n} = 2k] = u_{2k}u_{2n-2k}, the same distribution. In a game of 2000 tosses, the probability that the last tie happened in the first 200 tosses (and one side led for the last 1800) is about 2πarcsin⁡0.1≈0.205\frac{2}{\pi}\arcsin\sqrt{0.1} \approx 0.205.

python · try it yourself
import numpy as np
from math import asin, sqrt, pi

rng = np.random.default_rng(7)
n, games = 2000, 5000
S = (rng.integers(0, 2, size=(games, n), dtype=np.int8) * 2 - 1).cumsum(axis=1, dtype=np.int16)
zero = S == 0
has_zero = zero.any(axis=1)
last = np.where(has_zero, n - np.argmax(zero[:, ::-1], axis=1), 0)     # time of the last tie (0 if none)
print("P(last tie in the first 10%) ~", round(float((last <= n // 10).mean()), 4), " arc sine:", round(2 / pi * asin(sqrt(0.1)), 4))
P(last tie in the first 10%) ~ 0.2122  arc sine: 0.2048

In software

The arc sine law warns against reading meaning into long streaks: a trading strategy that has led a benchmark for most of a year, or a variant that has "consistently" led an A/B test, may be pure chance. Sequential testing methods exist precisely because peeking at a running comparison and stopping when one side leads inflates false positives.

Exercises

Exercise 1: Small case

For 4 tosses, list the probabilities that Heads leads 0, 2 or 4 of the steps.

Answer

3/83/8, 1/41/4, 3/83/8.

Solution

u0=1u_0 = 1, u2=1/2u_2 = 1/2, u4=3/8u_4 = 3/8. Pr⁡[L4=0]=u0u4=3/8\Pr[L_4 = 0] = u_0u_4 = 3/8, Pr⁡[L4=2]=u2u2=1/4\Pr[L_4 = 2] = u_2u_2 = 1/4, Pr⁡[L4=4]=3/8\Pr[L_4 = 4] = 3/8.

Exercise 2: Arc sine probabilities

In the limit, what is the probability that Heads leads more than 90% of the time? Between 40% and 60%?

Answer

About 0.205; about 0.128.

Solution

1−F(0.9)=F(0.1)≈0.2051 - F(0.9) = F(0.1) \approx 0.205 by symmetry. F(0.6)−F(0.4)=2π(arcsin⁡0.6−arcsin⁡0.4)≈0.128F(0.6) - F(0.4) = \frac{2}{\pi}(\arcsin\sqrt{0.6} - \arcsin\sqrt{0.4}) \approx 0.128.

Exercise 3: Brute force for small nn (code)

Enumerate all 2102^{10} paths of 10 steps and count, for each kk, the paths in which Heads leads during exactly kk steps. Compare with uku10−ku_{k}u_{10-k}.

Answer

The counts divided by 1024 match the formula for every even kk; odd kk never occur.

Solution
python · try it yourself
from itertools import product
from collections import Counter
from math import comb

u = lambda m: comb(m, m // 2) / 2 ** m
c = Counter()
for steps in product((-1, 1), repeat=10):
    s, lead = 0, 0
    for x in steps:
        prev, s = s, s + x
        lead += (prev + s) > 0
    c[lead] += 1
print(sorted(c.items()))
print([round(u(k) * u(10 - k) * 1024) for k in range(0, 11, 2)])
[(0, 252), (2, 140), (4, 120), (6, 120), (8, 140), (10, 252)]
[252, 140, 120, 120, 140, 252]

Test yourself

In a long fair coin game, which fraction of time in the lead is most likely for Heads?

  1. About 1/2
  2. Close to 0 or close to 1
  3. Exactly 1/2
  4. About 1/4

Why are long leads common in a fair game?

  1. The coin is biased
  2. Returns to 0 are certain but have infinite expected waiting time
  3. Because of the law of large numbers
  4. They are not common