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