50 people have voted in an election, in which they are two candidates, and 25 people have voted for one candidate, and 25 people have voted for the other. You don’t know this yet, and are counting the votes, by looking at the ballots in sequence. What is the number of sequences for which, as you count the votes, neither candidate is ever ahead of the other by more than 15 votes, but the end result is a tie?
There is an answer already here, very neat answer: Vote Counting Problem
However, I would like to have a more systematic way to tackle these kind of questions and would like to use generating functions. Would anyone please start me or give me an idea on how to use GF on this problem?