# Launching billiard balls at 45 degree angles and bouncing of off edges.

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

• Right off the bat, it is obvious that if $y=2nx$ for some integer $n$, then the number of bounces is $n-1$ and is will end up in the bottom right corner if $n$ is even, and in the top right corner if it is odd. May 24, 2017 at 19:28
• Would there ever be a situation where the ball would never stop? I don't think so but I don't have a proof. May 24, 2017 at 19:30
• I don't think it would ever stop if $x$ was rational and $y$ was irrational, or vice versa, but I'm not sure how to prove this. Is it safe to assume that $x$ and $y$ are rational? If so, that would make the problem a little easier to handle, since if $x$ and $y$ are rational, then we can "dilate" the table to make $x$ and $y$ integers without altering the shape of the path. Also, can we assume that $y \ge x$ just for the sake of convenience? May 24, 2017 at 19:34
• Oh sorry, I meant to put integers in the question. But I now think this is cooler. For integer values, I think the ball would stop eventually. For funky values it won't, probably May 24, 2017 at 19:36
• We can say definitively that the ball can never end in the corner it started in, since, to do this, it would have to "go back" on its path at some point, and the only way to do this is to bounce horizontally and vertically at the same time, and this could only happen by entering a corner. But if the ball enters another corner, that is where it will end instead. May 24, 2017 at 19:41

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$.

• Nicely done. Proof with a picture. May 24, 2017 at 20:15
• There must be a way to prove in this model why the first reached angle cannot be the original one, I'm out of time to think about this right now May 24, 2017 at 20:23

Let's set this up in a coordinate plane. Just for the sake of convenience, I'm going to have the ball be launched from the bottom left corner instead so that I can let the origin be the launching point. Then let the top left corner be $(0,y)$, the bottom right corner be $(x,0)$, and the top right corner be $(x,y)$. Let us make $x\gt y$ (we are avoiding the trivial case $x=y$ when it is a square, since it will go directly into the opposite corner). Then the first bounce will occur at the point $(x,x)$.

Here is what we must do to make this problem manageable. Instead of having the ball bounce off the left and right sides, we will have it pass through them like portals and come out the opposite side. This will not affect whether or not the ball reaches a corner.

Then we only want to count the bounces on the top and bottom of the table, since the left and right are now "portals". In this case each bounce will occur at a multiple of $y$. The abscissa of the nth bounce will be $$yn \bmod x$$ and the final bounce in the hole will be when $$yn \bmod x=0$$ and the smallest $n$ for which this is true is $$n_h=\frac{x}{GCD(x,y)}$$ Then the number of bounces on the top and bottom is $n_h$. Then number of side bounces is the number of times the ball passes through the "portal", which is $$\frac{yn_h}{x}-1$$ excluding the final bounce in the hole, since the number of vertical bounces counts it. Then the total number of bounces is $$n_h+\frac{yn_h}{x}-2$$ where $x \gt y$ and $n_h=\frac{x}{GCD(x,y)}$.

This expression can be simplified to $$\frac{x+y}{GCD(x,y)}-2$$ And, if we assume that $x$ and $y$ are relatively prime, $$x+y-2$$

But wait... doesn't a billiards table have side pockets?

Okay, so by following the reasoning used previously, the ball will enter a side pocket when $$yn \bmod x=\frac{1}{2}x$$ So, of course, this can only happen when $x$ is even. We can change this to $$2yn \bmod 2x=x$$ This is the same as when $$\frac{2yn-x}{2x}$$ is an integer. If we simplify this to $$\frac{yn}{x}-\frac{1}{2}$$ If we assume again that $x$ and $y$ are relatively prime, then we have that the smallest $n$ for which this is true must be $$n_h=\frac{x}{2}$$ However, this can still only occur when $x$ is even. If we have that $n_h=x$, then the number of bounces on the top and bottom is $$\frac{x}{2}-1$$ and the total distance travelled by the ball horizontally is $$\frac{yx}{2}$$ so the number of bounces on the left and right sides is $$\lfloor\frac{yx}{2x}\rfloor$$ $$\lfloor\frac{y}{2}\rfloor$$ and the total number of bounces is then $$\frac{x}{2}+\lfloor\frac{y}{2}\rfloor-1$$ Which, given our assumptions, can be simplified to $$\frac{x}{2}+\frac{y}{2}-\frac{3}{2}$$ $$\frac{x+y-3}{2}$$ And so, if we let $b(x,y)$ be a function taking in two relatively prime integers as arguments, and outputting the number of bounces made by the billiards ball shot on a table with those side lengths, we get b(x,y) = \left\{\begin{aligned} \frac{x+y-3}{2} && 2|x\\ x+y-2 && else \end{aligned} \right.