Table of Contents
Fetching ...

The generalized Alice HH vs Bob HT problem

Svante Janson, Mihai Nica, Simon Segert

Abstract

In 2024, Daniel Litt posed a simple coinflip game pitting Alice's "Heads-Heads" vs Bob's "Heads-Tails": who is more likely to win if they score 1 point per occurrence of their substring in a sequence of n fair coinflips? This attracted over 1 million views on X and quickly spawned several articles explaining the counterintuitive solution. We study the generalized game, where the set of coin outcomes, {Heads, Tails}, is generalized to an arbitrary finite alphabet A, and where Alice's and Bob's substrings are any finite A-strings of the same length. We find that the winner of Litt's game can be determined by a single quantity which measures the amount of prefix/suffix self-overlaps in each string; whoever's string has more overlaps loses. For example, "Heads-Tails" beats "Heads-Heads" in the original problem because "Heads-Heads" has a prefix/suffix overlap of length 1 while "Heads-Tails" has none. The method of proof is to develop a precise Edgeworth expansion for discreteMarkov chains, and apply this to calculate Alice's and Bob's probability to win the game correct to order O(1/n).

The generalized Alice HH vs Bob HT problem

Abstract

In 2024, Daniel Litt posed a simple coinflip game pitting Alice's "Heads-Heads" vs Bob's "Heads-Tails": who is more likely to win if they score 1 point per occurrence of their substring in a sequence of n fair coinflips? This attracted over 1 million views on X and quickly spawned several articles explaining the counterintuitive solution. We study the generalized game, where the set of coin outcomes, {Heads, Tails}, is generalized to an arbitrary finite alphabet A, and where Alice's and Bob's substrings are any finite A-strings of the same length. We find that the winner of Litt's game can be determined by a single quantity which measures the amount of prefix/suffix self-overlaps in each string; whoever's string has more overlaps loses. For example, "Heads-Tails" beats "Heads-Heads" in the original problem because "Heads-Heads" has a prefix/suffix overlap of length 1 while "Heads-Tails" has none. The method of proof is to develop a precise Edgeworth expansion for discreteMarkov chains, and apply this to calculate Alice's and Bob's probability to win the game correct to order O(1/n).

Paper Structure

This paper contains 29 sections, 26 theorems, 241 equations.

Key Result

Theorem 1.1

Let Alice and Bob play Litt's game with distinct words $A$ and $B$ of the same length $\ell$ in an alphabet $\mathcal{A}$ with $q$ letters, and assume that $n$ letters are chosen at random, uniformly and independently. Exclude the two cases, both with $q=2$: and their variants obtained by interchanging Alice and Bob or $\mathsf{H}$ and $\mathsf{T}$ (or both). Then, with $\theta_{UU}$ given by the

Theorems & Definitions (65)

  • Theorem 1.1
  • Remark 1.2
  • Proposition 2.1
  • proof
  • Remark 2.2
  • Remark 3.1
  • Theorem 3.2
  • Corollary 3.3
  • Theorem 3.4
  • Proposition 4.1
  • ...and 55 more