Suppose
and
are candidates for office and there are
voters,
voting for
and
for
. In how many ways can the ballots be counted so that
is never ahead of
? The solution is a Catalan number
.
A related problem also called "the" ballot problem is to let receive
votes and
votes with
.
This version of the ballot problem then asks for the probability that
stays ahead of
as the votes are counted (Vardi 1991). The solution is
, as first shown by M. Bertrand
(Hilton and Pedersen 1991). Another elegant solution was provided by André
(1887) using the so-called André's
reflection method.
The problem can also be generalized (Hilton and Pedersen 1991). Furthermore, the TAK function is connected with the ballot problem (Vardi 1991).