Sandbox · exhibit 0067

Ahead the whole way, one game in three

Two of you toss a fair coin, over and over, a point each time. Nobody has an edge and nothing is loaded, so you would expect the lead to swap back and forth and the score to sit near level most of the way. It does not. Over twenty tosses, the likeliest thing that can happen is that one of you is ahead for every single toss and the other never leads at all — that is 35.2 per cent of games, against 6.1 per cent for the even split of ten each. The shape does not soften as the game gets longer, it only stops depending on the length: over ten thousand tosses one player leads for at least 96 per cent of them in 25.7 games in a hundred, and the score stays inside 45 to 55 per cent in 6.4. The lead is least likely to be shared evenly, and a fair coin is the reason rather than the excuse.

One game

The line is the score: up one for a head, down one for a tail. Whoever is above the axis is ahead. The shading is the time each of you spends in front — and that, not the final score, is what this page is about.

200
heads is ahead tails is ahead the last time it was level

The game you land on is the first from seed 20260907 at whatever length the dial is set to — not one picked for what it shows, and not one drawn afresh each time you open the page. The seed is the day this page was written, chosen before anybody had seen what it draws; the game it happens to give is a lopsided one, which is the page's whole subject and is also exactly the kind of coincidence a reader is entitled to be told about. Another game takes the next seed along. tests/test_arcsine.py rebuilds this generator in Python and fails if the two ever part.

Where the time goes

Play the game a great many times and ask, of each one, what fraction of the tosses the first player spent in front. If the lead behaved the way people expect, that fraction would pile up around a half. It piles up at the ends: the distribution is a U, its two lowest points are in the middle, and its highest are the two outcomes where one player never once trails.

one player in front for 96% of it or more between 45% and 55% — a level game the arcsine law, which is what the U becomes

The exact statement is small enough to write here. Let u(m) be the chance that 2m tosses come out level, which is C(2m,m)/4^m. Then the chance that the first player leads for exactly 2k tosses out of 2n is u(k) × u(n−k) — a product, perfectly symmetric, and largest when one of its two factors is u(0) = 1. That is the whole U in one line. As the game lengthens it settles onto a curve that does not depend on the length at all: the chance of leading for a share x of the time or less is (2/π)·arcsin(√x), which is where the law gets its name.

The same shape at every length

An even split needs the tosses to divide by four, so at fifty there is no such outcome at all and the column is empty rather than small. The column that moves is the first one: leading every single toss gets harder as the game gets longer, because it is one exact outcome out of more and more. The columns that barely move are the ones stated as shares of the game, and by ten thousand tosses they are within a tenth of a point of the limit. A longer game does not make the lead fairer. It makes the same lopsidedness happen on a bigger scale.

How often the lead changes hands

The other half of the same surprise. In ten thousand tosses the lead changes hands about 39 times, not thousands — and the single likeliest number of changes, at any length whatever, is zero. Every further change is less likely than the one before it, so this bar chart can only ever fall.

There is an exact reason for the shape, and it is the prettiest thing on this page: the number of lead changes in N tosses has precisely the distribution of how far ahead the winner is at the end. The chance of exactly r changes is twice the chance of finishing 2r+1 in front. So the bar chart above is a half of the bell curve you would have drawn for the final score, relabelled — which is why it has no hump, and why its average grows like √(N/2π) rather than like N.

What this page checks about itself