๐Ÿงฎ Brain Teaser

Bertrand's Ballot Problem

Why it's beautiful: The answer is shockingly clean โ€” just (aโˆ’b)/(a+b)(a - b)/(a + b) โ€” and the proof uses a gorgeous geometric trick called the reflection principle: you count "bad" paths by reflecting them into "good" paths, creating a perfect bijection.


Problem

In an election, candidate A receives aa votes and candidate B receives bb votes, where a>ba > b.

The a+ba + b ballots are counted one by one in a uniformly random order.

What is the probability that A is strictly ahead of B throughout the entire counting process (i.e., at every point during the count, A has strictly more votes than B)?


Hint: Think about counting paths on a grid. Each vote for A is a step right (+1), each vote for B is a step left (-1). You want paths from 0 to aโˆ’ba - b that never touch 0 after the start.

Ballot problemReflection principleCounting paths

Answer: Bertrand's Ballot Problem

Answer: aโˆ’ba+b\dfrac{a - b}{a + b}


Step 1: Think of votes as a path

Imagine drawing a graph as you count votes one by one:

  • Vote for A โ†’ move up (+1)
  • Vote for B โ†’ move down (โˆ’1)

You start at height 0 and end at height aโˆ’ba - b (since A wins by aโˆ’ba - b votes).

We want: the path never touches or goes below 0 after the very first step.


Step 2: Count the bad paths using the Cycle Lemma

Here is the key trick โ€” the Cycle Lemma.

Take any fixed ordering of the a+ba + b ballots (a specific sequence of A's and B's). Now consider all a+ba + b cyclic rotations of this sequence โ€” i.e., start the count from ballot 2, 3, 4, ... instead of ballot 1.

Claim: Among all a+ba + b rotations of any given sequence, exactly aโˆ’ba - b of them have A strictly ahead at every point.

This is a non-obvious but provable combinatorial fact. It follows because the path visits each "height level" in a regular pattern, and a simple counting argument shows exactly aโˆ’ba - b starting positions yield a "good" path.


Step 3: Compute the probability

Since every sequence has a+ba + b rotations, and exactly aโˆ’ba - b of those rotations are "good":

P(Aย alwaysย strictlyย ahead)=aโˆ’ba+bP(\text{A always strictly ahead}) = \frac{a - b}{a + b}


Example: a=3a = 3, b=1b = 1

P=3โˆ’13+1=12P = \frac{3 - 1}{3 + 1} = \frac{1}{2}

List all 4 orderings of (A, A, A, B):

| Sequence | Running tallies (A โˆ’ B) | A always ahead? | |----------|------------------------|-----------------| | A A A B | 1, 2, 3, 2 | โœ“ | | A A B A | 1, 2, 1, 2 | โœ“ | | A B A A | 1, 0, 1, 2 | โœ— (ties at step 2) | | B A A A | โˆ’1, 0, 1, 2 | โœ— (B ahead at step 1) |

2 out of 4 = 1/2 โœ“


Intuition for the answer

  • If aโ‰ซba \gg b: probability โ‰ˆ1\approx 1 โ€” A is so far ahead, they're almost certainly always leading.
  • If a=b+1a = b + 1: probability =12b+1= \frac{1}{2b+1} โ€” surprisingly small! A barely wins overall, so there are many ways the lead could flip.
  • If a=ba = b: probability =0= 0 โ€” A must tie at the very end, so A cannot be strictly ahead throughout.

Why it's beautiful

The answer aโˆ’ba+b\dfrac{a-b}{a+b} is shockingly simple given how complex the question sounds. The proof uses pure rotational symmetry โ€” no heavy computation, just the insight that every cyclic rotation of a ballot sequence is equally likely, and exactly aโˆ’ba - b of them are "good."

Type: ProbabilityEdit on GitHub โ†—