🧮 Brain Teaser

The Ballot Problem: Winning from the Start

An urn contains nn red balls and mm blue balls, with n>mn > m. You draw all balls one by one, uniformly at random, without replacement.

What is the probability that the number of red balls drawn strictly exceeds the number of blue balls drawn at every point throughout the entire drawing?

(In other words: at every prefix of the sequence, reds are strictly ahead.)

ballot problemcycle lemmacombinatoricsrandom walkselegant formula

Answer: Cycle Lemma: Staying Strictly Ahead

Key Idea / Intuition

At first glance this seems to require tracking a complicated path. The magical insight is a reflection/cycle-lemma argument: among all (n+m)!/(n!m!)(n+m)!/(n!\,m!) equally likely orderings, each one corresponds to exactly n+mn+m cyclic shifts, and the fraction of those shifts that keep red strictly ahead throughout equals (nm)/(n+m)(n-m)/(n+m). This is a purely combinatorial symmetry — no calculation needed, just a clever counting of cycles.

The result is strikingly clean: the probability depends only on the surplus of red over blue, divided by the total.


Formal Proof / Solution

Setup. Label each sequence of nn red (+1+1) and mm blue (1-1) balls. Let SkS_k denote the running total after kk draws. We want

P(Sk>0 for all k=1,2,,n+m).P(S_k > 0 \text{ for all } k = 1, 2, \ldots, n+m).

The Cycle Lemma. Consider any sequence a1,a2,,an+ma_1, a_2, \ldots, a_{n+m} with nn values +1+1 and mm values 1-1, so the total sum is nm>0n - m > 0. Form the n+mn+m cyclic shifts:

a1,a2,,an+ma_1, a_2, \ldots, a_{n+m} a2,a3,,an+m,a1a_2, a_3, \ldots, a_{n+m}, a_1 \vdots

Claim: Among these n+mn+m cyclic shifts, exactly nmn - m of them have all partial sums strictly positive.

Why? The partial sums of the original sequence return to 00 exactly mm times from below (loosely speaking), and the cycle lemma (Dvoretzky and Motzkin, 1947) gives this exact count via a parity/rotation argument. More precisely: define Sk=a1++akS_k = a_1 + \cdots + a_k. The shift starting at position j+1j+1 has all positive partial sums if and only if position jj achieves the minimum of all S0,S1,,Sn+m1S_0, S_1, \ldots, S_{n+m-1}. Since the total sum is nm>0n - m > 0, this minimum is achieved exactly nmn - m times (it can be achieved at multiple consecutive indices only when the path touches the minimum plateau, but the strict positivity of the final sum ensures exactly nmn-m valid starting positions by a careful argument).

Conclusion. Since every sequence belongs to an equivalence class of n+mn+m cyclic rotations, and exactly nmn-m of those rotations are "good" (all partial sums >0> 0), the probability is:

P=nmn+m\boxed{P = \frac{n - m}{n + m}}

Quick sanity check. If m=0m = 0: all draws are red, so we are always ahead. Formula gives n/n=1n/n = 1. ✓
If n=m+1n = m+1: formula gives 1/(2m+1)1/(2m+1), which matches the classic ballot problem result. ✓

Why it's beautiful. The answer nmn+m\frac{n-m}{n+m} is not just elegant — it says the probability equals the fraction by which red exceeds blue in total count. A purely combinatorial symmetry (cyclic rotation) collapses a complex path-counting problem into a single line.

Source: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller) — related ballot/path problems; cycle lemma is mathematical folklore (Dvoretzky–Motzkin 1947)

Type: ProbabilitySource: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller) — related ballot/path problems; cycle lemma is mathematical folklore (Dvoretzky–Motzkin 1947)Edit on GitHub ↗