The problem is as following.
Assume $m,n$ are two coprime odd numbers, consider the interval $[0,mn]$. We cut the interval by $m,2m,\ldots,(n-1)m$ and $n, 2n,\ldots, (m-1)n$ into $m+n-1$ pieces of small intervals. And we color them from left to right by black-and-white periodically and black first. The question is to show $$(\textrm{the length of black})-(\textrm{the length of white})=1$$ For example, if $m=3,n=5$, $$\begin{array}{c*{31}}0 &&&&&& 3 &&&&&& 6 &&&&&& 9 &&&&&& 12 &&&&&& 15 \\ \mid & \blacksquare && \blacksquare &&\blacksquare &\mid & \square && \square & \mid & \blacksquare & \mid & \square&& \square&& \square &\mid & \blacksquare &\mid & \square&& \square&\mid & \blacksquare&& \blacksquare&& \blacksquare & \mid \\ 0 &&&&&&&&&& 5 &&&&&&&&&& 10 &&&&&&&&&& 15\end{array} $$The length of black is $8$ and the length of white is $7$.
In my blog, I presented two "analytic" solutions, which are both due to Liu Ben, using the trick of exponential sums. They are so nice in the sense of "analytic" approach.
At the end of the post, I came up a "elementary" solution I want to explain more precisely here.
Consider a billiards table of size $m\times n$, and struck the billiard from one of corners on $45^{\circ}$. Every time the ball knockes the boundary, it changes its color. Then $$(\textrm{the length of black interval})=\sqrt{2}\times (\textrm{the length of orbit of black ball})\qquad {(*)}$$ and $$(\textrm{the length of white interval})=\sqrt{2}\times (\textrm{the length of orbit of white ball})\qquad {(**)}$$ So it suffices to count the length of the grid at the direction of $\diagup$ and $\diagdown$, which is not difficult to compute.
But in this solution, it is not easy to explain why $(*)$ and $(**)$ holds, though we know it from "life experience". And I think there may be some more elementary method to solve this problem. So my questions are
- Is there any elementary solutions to this problem?
- Is there any "strict process" for the billiard problem ?
- Moreover, although I learnt it no more than 1 mouth ago, I think it is so genius that it must be classical and discovered by ancients. So are there any reference for this problem ?



Here is a more formal realization of the billiard ball argument.
Write down a sequence of $mn$ ordered pairs where:
Intuitively, an ordered pair $(x,y)$ in the $i^{\text{th}}$ position means that in the $i^{\text{th}}$ step, the billiard ball is traversing the square at coordinates $(x,y)$.
We color an ordered pair $(x,y)$ black if $x+y$ is even and white if $x+y$ is odd. Then we can see that ordered pairs switch color precisely at points where the first sequence goes $m, m$ or $1,1$, and at points where the second sequence goes $n, n$ or $1,1$. These are points where the billiard ball ricochets, and also points where we go from one interval to another.
So to get the result, we need to show that each pair $(x,y) \in \{1,2,\dots,m\} \times \{1,2,\dots,n\}$ appears exactly once: that the billiard ball passes over every square of the grid. This can be done, but it's slightly annoying.
(Then we'd need to count the number of black pairs and white pairs in this grid. I do this below.)
The following approach is a simpler argument along the same lines. Write down the sequence $(i \bmod m, i \bmod n)$ for $i=0,1,\dots,mn-1$. Once again, color an ordered pair $(x,y)$ black if $x+y$ is even and white if $x+y$ is odd.
(This corresponds to a "teleporting" ball which, when it reaches an edge of the table, teleports to the opposite edge and continues moving in the same direction.)
Now we only have to show three things:
First, the color of ordered pairs in the sequence describes exactly the colors of the intervals. This is because $(i \bmod m, i \bmod n)$ and $(i+1\bmod m, i+1\bmod n)$ have the same color if there is "no carry": if we add $1$ to both coordinates. Parity only switches when we go from $m-1$ to $0$ in the first coordinate or $n-1$ to $0$ in the second.
Second, each possible ordered pair $(x,y)$ occurs exactly once. This is precisely the statement of the Chinese Remainder Theorem.
Third, the number of pairs $(x,y)$ where $x+y$ is even is off by $1$ from the number of pairs $(x,y)$ where $x+y$ is odd. To do this, pair them off: