Say I have a billiard ball and I launch it from the bottom-left corner of a table with length $x$ and width $y$. Given $x$ and $y$ will the ball reach a corner again, which corner and in how many times will it need to bounce off the edge.
*I launch it from a $45$ degree angle at the start and it always bounces off the edges at $45$ degrees
I have an idea how to model the problem. Look at the picture: when the ball bounces, it may be thought as entering a virtual pool placed next to the one it's coming from. Now, thinking of a coordinate system whose origin is in the bottom left corner, the tables corners have coordinates $(nx, my)$ with $n, m \in \mathbb N$, and you want them to be equal so that they can be touched by the ball travelling at $45°$. So $nx=my$ for some $m, n$, that is $n/m = y/x$. I think this is providing the solution: to ever reach another corner the sides of the table must be commensurable. And the number of bounces is $n+m-2$.