We present a complete solution to the so-called tennis ball problem, which is equivalent to counting the number of lattice paths in the plane that use North and East steps and lie between certain boundaries. The solution takes the form of explicit expressions for the corresponding generating functions.
Our method is based on the properties of Tutte polynomials of matroids associated to lattice paths. We also show how the same method provides a solution to a wide generalization of the problem.
de Mier, A.; Noy, M. A solution to the tennis ball problem. "Theoretical computer science", 2005, vol. 346, núm. 2-3, p. 254-264.