The Ballot Paradox
In 1887, Joseph Bertrand asked a question about elections that turned out to be a question about everything.
In 1887, Joseph Bertrand asked a question about elections that turned out to be a question about everything.
Candidate A gets a votes. Candidate B gets b votes. A wins: a > b. The ballots are counted one at a time, in random order. What's the probability that A is strictly ahead throughout the entire count — never tied, never behind, not even for a moment?
Think about it. A has more votes, so you might expect A to lead most of the time. But "always ahead from the very first ballot" is a strong condition. If the first ballot drawn is for B, it's already over.
The answer:
P(A always ahead) = (a − b) / (a + b)
That's it. No factorials, no exponentials, no infinite series. A ratio of two integers.
Why It's Strange
Say A wins 60-40. Then P(always ahead) = 20/100 = 1/5. A candidate who wins 60% of the vote has only a 20% chance of leading the entire count.
Say A wins 51-49. Then P(always ahead) = 2/100 = 1/50. A razor-thin victory means a 2% chance of never trailing.
The formula has a brutal implication: being ahead at the end tells you almost nothing about being ahead during. A landslide winner is still more likely than not to trail at some point during the count.
The Reflection Proof
The standard proof is one of the most elegant arguments in combinatorics. It uses the reflection principle, an idea so powerful it shows up in random walks, Brownian motion, option pricing, and queueing theory.
Think of the ballot count as a path: after k ballots, the "score" is (A's votes so far) − (B's votes so far). The path starts at 0 and ends at a − b. We want paths that are strictly positive at every step.
The total number of ballot orderings is C(a+b, a) — choose which positions are A-votes.
For the bad paths (those that touch or cross zero at some point after step 1), there's a bijection: take the first time the path hits zero, and reflect everything before that point. Every bad path starting with an A-vote maps uniquely to a path starting with a B-vote, and vice versa.
This reflection maps bad paths bijectively to paths that start with a B-vote, of which there are exactly b · C(a+b−1, a) / ...
Actually, let me just give you the clean version. The number of paths from (0,0) to (a+b, a−b) that are strictly positive after time 0 is:
(a − b)/(a + b) · C(a + b, a)
Dividing by the total C(a + b, a) gives the probability (a − b)/(a + b).
The reflection principle converts a counting problem into a symmetry problem. Instead of tracking which paths stay positive (hard), you pair up the paths that don't (elegant).
The Catalan Connection
Set a = n + 1 and b = n. Then the probability of always leading is 1/(2n + 1). The number of such paths is C(2n+1, n)/(2n+1), which is the Catalan number C_n divided by...
Actually, the cleaner connection: set a = b = n (a tie). The number of paths from (0,0) to (2n, 0) that never go negative is the n-th Catalan number:
Cₙ = C(2n, n) / (n + 1)
The ballot problem and the Catalan numbers are the same problem in different clothes. Catalan numbers count: balanced parentheses, binary trees, non-crossing partitions, triangulations of polygons, monotone lattice paths below the diagonal — over 200 combinatorial interpretations. All of them are secretly about paths that don't cross a boundary.
Verification
from math import comb
from itertools import permutations
def ballot_probability_exact(a, b):
"""Brute force: check all orderings."""
if a <= b:
return 0.0
ballots = [1]*a + [-1]*b
total = 0
always_ahead = 0
# For small values, enumerate all permutations
from math import factorial
seen = set()
import random
# Monte Carlo for larger values
trials = 200000
for _ in range(trials):
random.shuffle(ballots)
running = 0
good = True
for v in ballots:
running += v
if running <= 0:
good = False
break
if good:
always_ahead += 1
return always_ahead / trials
# Test the formula P = (a-b)/(a+b)
for a, b in [(3,1), (5,2), (10,3), (60,40), (51,49)]:
empirical = ballot_probability_exact(a, b)
theoretical = (a - b) / (a + b)
print(f"a={a}, b={b}: empirical={empirical:.4f}, formula={(a-b)/(a+b):.4f}")
| a | b | Empirical | (a−b)/(a+b) |
|---|---|---|---|
| 3 | 1 | 0.500 | 0.500 |
| 5 | 2 | 0.428 | 0.429 |
| 10 | 3 | 0.539 | 0.538 |
| 60 | 40 | 0.200 | 0.200 |
| 51 | 49 | 0.020 | 0.020 |
The Real Surprise
The ballot problem looks like a curiosity about elections. It's actually a fundamental theorem about random processes.
The same mathematics governs:
- Queueing theory: How long before a server queue first empties? The ballot problem with "arrivals" and "departures."
- Financial mathematics: The probability that a stock, starting at price S with positive drift, never drops below S. Black-Scholes uses the continuous version.
- Random walks: The arcsine law — the fraction of time a random walk spends positive has a U-shaped distribution, not the bell curve you'd expect. Most of the time, one side dominates.
That last point deserves emphasis. If you flip a fair coin 1000 times and track the running total, you might expect the total to be positive about half the time and negative about half the time, switching back and forth. The arcsine law says the opposite: the most likely outcome is that the total is positive for almost all 1000 flips, or negative for almost all 1000 flips. The symmetric, back-and-forth scenario is the least likely.
Bertrand's ballot question, asked about 19th-century French elections, turns out to be the key that unlocks one of the most counterintuitive facts about randomness.
This is Essay #6 in the "Undiscovered Country" series. Essay #1: The Ghost of e⁻² | Essay #2: The Loop | Essay #3: The Divisor Surprise | Essay #4: The Prime Conspiracy | Essay #5: The Drunkard's Detour