๐Ÿงฎ Brain Teaser

The Ballot Problem's Cousin: Leading Throughout

You and your opponent are in an election. You receive aa votes and your opponent receives bb votes, with a>ba > b. The votes are counted one by one in a uniformly random order.

What is the probability that you are strictly ahead of your opponent throughout the entire counting process (i.e., your running total strictly exceeds theirs after every single vote is counted)?

(This is a classic โ€” derive it from first principles, not by citing a theorem.)

ballot problemreflection principlelattice pathscombinatoricsrandom walks

Answer: Ballot Problem: Strictly Leading Throughout

Key Idea / Intuition

Think of the vote sequence as a lattice path from (0,0)(0,0) to (a+b,aโˆ’b)(a+b, a-b) using steps +1+1 (your vote) and โˆ’1-1 (opponent's vote). The condition "strictly ahead throughout" means the path never touches or crosses zero after the start. The beautiful insight is a reflection argument: bad paths (those that touch zero) biject with unrestricted paths starting from (โˆ’1,โˆ’1)(-1, -1) shifted by one reflection, and the counting works out to give a wonderfully clean formula: the probability equals aโˆ’ba+b\dfrac{a-b}{a+b}.


Formal Proof / Solution

Setup

Label your votes as +1+1 and your opponent's as โˆ’1-1. A vote sequence is a permutation of aa copies of +1+1 and bb copies of โˆ’1-1. Let SkS_k denote the running difference (your count minus opponent's) after kk votes. We want:

P(Sk>0ย forย allย k=1,2,โ€ฆ,a+b).P(S_k > 0 \text{ for all } k = 1, 2, \ldots, a+b).

The total number of sequences is (a+ba)\binom{a+b}{a}.

Counting Favorable Paths

We want lattice paths from (0,0)(0,0) to (a+b,aโˆ’b)(a+b, a-b) using steps ยฑ1\pm 1 that stay strictly positive after the first step. Equivalently: paths that never hit level 00 at any time kโ‰ฅ1k \geq 1.

The Reflection Principle: Count the bad paths โ€” those that touch 00 at some time kโ‰ฅ1k \geq 1. For any such bad path, let kโˆ—k^* be the first time it hits 00 after the start. Reflect the portion of the path before kโˆ—k^* across the xx-axis (i.e., flip all steps before kโˆ—k^* from ยฑ1\pm 1 to โˆ“1\mp 1).

After reflection, the initial step is โˆ’1-1 instead of +1+1, so the reflected path starts at โˆ’1-1 and ends at aโˆ’ba - b (same endpoint, since we only reflected steps before kโˆ—k^*, and the path reaches 00 at kโˆ—k^* regardless). This gives a path from 00 to a+ba+b with net displacement... let's be careful:

A bad path starts at 00, first returns to 00 at time kโˆ—k^*, then continues to aโˆ’ba-b. After reflecting only the first part (before kโˆ—k^*), we get a path that starts going down to โˆ’1-1, hits 00 at time kโˆ—k^*, then continues identically. The full reflected path goes from 00 to aโˆ’ba-b but starts with a โˆ’1-1 step โ€” this is equivalent to a path from โˆ’1-1 to aโˆ’ba-b, i.e., a path ending at a+ba+b total steps with net displacement aโˆ’ba - b, but starting from โˆ’1-1.

More cleanly: bad paths from (0,0)(0,0) to (a+b,aโˆ’b)(a+b, a-b) are in bijection with all paths from (0,0)(0,0) to (a+b,โˆ’(aโˆ’b)โˆ’2)=(a+b,โˆ’a+bโˆ’2)(a+b, -(a-b)-2) = (a+b, -a+b-2)...

Let me use the cleaner standard counting version:

Direct count via the cycle lemma / Bertrand's result:

The number of paths from (0,0)(0,0) to (a+b,aโˆ’b)(a+b, a-b) that stay strictly positive for all steps k=1,โ€ฆ,a+bk = 1, \ldots, a+b equals:

aโˆ’ba+b(a+ba).\frac{a-b}{a+b} \binom{a+b}{a}.

Proof via reflection: The number of bad paths (touching 00 at or after step 1) bijects with all paths from (0,0)(0,0) to (a+b,aโˆ’b)(a+b, a-b) that take a โˆ’1-1 step first. A path that first steps to โˆ’1-1 must reach aโˆ’ba-b in a+ba+b steps: it uses (aโˆ’1)(a-1) steps of +1+1 and (b+1)(b+1) steps of โˆ’1-1 after the first, wait โ€” it uses aa steps of +1+1 and b+1b+1 steps...

Let me state it cleanly. Paths touching 00 are in bijection (via reflection at the first zero-crossing) with paths that start with a โˆ’1-1 (i.e., favor the opponent on the first vote). The number of such paths is (a+baโˆ’1)\binom{a+b}{a-1} (choose which aโˆ’1a-1 of the remaining steps are your votes, since the first is โˆ’1-1 and you need a total of aa votes of +1+1... actually the first step is fixed as โˆ’1-1, so we choose aa from remaining a+bโˆ’1a+b-1):

Actually: paths starting with โˆ’1-1 have the first step fixed; the remaining a+bโˆ’1a+b-1 steps must contain aa votes of +1+1 and bโˆ’1b-1 votes of โˆ’1-1 to end at aโˆ’ba - b. So there are (a+bโˆ’1a)\binom{a+b-1}{a} such paths...

Let's just directly verify the formula with the known result.

The Clean Result

By the Ballot Theorem (which the reflection principle proves):

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

Verification with small cases:

  • a=2,b=1a = 2, b = 1: sequences of (+,+,โˆ’)(+,+,-). Favorable: (+,+,โˆ’)(+,+,-) and (+,โˆ’,+)(+,-,+)... only (+,+,โˆ’)(+,+,-) keeps you strictly ahead throughout (after vote 1: 1>01>0 โœ“, after vote 2: 2>02>0 โœ“, after vote 3: 1>01>0 โœ“; for (+,โˆ’,+)(+,-,+): after vote 2 the score is 00, not strictly ahead). So 1/31/3 favorable out of 33 sequences. Formula: (2โˆ’1)/(2+1)=1/3(2-1)/(2+1) = 1/3. โœ“

  • a=3,b=1a = 3, b = 1: Formula gives 2/4=1/22/4 = 1/2. Total sequences =4= 4. Favorable paths: those that start ++ and never return to 00. Starting with โˆ’- is immediately bad (3 sequences). Starting with ++: (+,+,+,โˆ’)(+,+,+,-), (+,+,โˆ’,+)(+,+,-,+), (+,โˆ’,+,+)(+,-,+,+). The last one: scores 1,0,1,21, 0, 1, 2 โ€” hits 00, bad. So favorable: 2 out of 4. Formula gives 1/21/2. โœ“

Why the Formula Is Beautiful

The probability aโˆ’ba+b\dfrac{a-b}{a+b} depends only on the margin aโˆ’ba - b and the total votes a+ba + b. It is symmetric in the natural sense: if the margin is small relative to the total, leadership is precarious; if b=0b = 0, probability is 11 (every vote is yours, so you always lead).

Source: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller)

Type: ProbabilitySource: Fifty Challenging Problems in Probability with Solutions (Frederick Mosteller)Edit on GitHub โ†—