Equal Heads and Tails?

James Tanton (@jamestanton): You flip a coin until you see an equal number of heads and tails. Ooh! Hang on! Are you sure to eventually see an equal count of each?

Plot heads across and tails up. Equal counts means landing on the 1:1 line, and every ratio H:T = a:b is a ray from the origin. Which rays is a random walk sure to touch?

Scroll to zoom · drag to pan

Results after 10,000 flips, 1,000 walks

Simulated values beside exact ones. "Touched" means the walk landed on the line at least once after the start.

This table fills in when you run 1,000 walks of 10,000 flips each.

Ratio Touched by now
simulated · exact
Ever, in the long run
exact
Touches per walk
mean · exact mean · median [IQR]
Never touched First touch, among walks that touched (flip number, log scale)