# Point in a square

Suppose you have a random point inside a square and you set the point moving in a random direction. When the point hits a side of the square, it bounces off the side like a billiard ball, i.e. angle in $$=$$ angle out.

Will the point always end up in a fixed pattern, i.e. will it always come to a position it has been at before, moving in the same direction it did at that earlier time?

I suspect the answer is No, based on computer simulations, but then computers have limited accuracy. It is clear that there are many cases where a fixed pattern does occur. One example is if the initial angle of movement $$\theta$$ is a multiple of $$45^\circ$$. In fact, it seems to me that if $$\theta = \text{arctan}(\frac{1}{n})$$, where $$n$$ is a positive integer, a fixed pattern will occur.

But will a fixed pattern occur for any starting point and angle? If not, why not?

• Often with these problems about reflection you can instead ask an equivalent question about a straight line traveling through an infinite grid of squares – Zubin Mukerjee Sep 26 '18 at 20:45
• If the gradient of the initial trajectory is rational, it will repeat. Otherwise, not. – TonyK Sep 26 '18 at 20:48
• @TonyK: Sounds good. Could you show this is the case in an answer? – Jens Sep 26 '18 at 20:51
• A fact that is closely related: any irrational number $r$ will have integer multiples arbitrarily close to integers, but none that exactly equal integers (you can use this fact to show that irrational slope lines will never reach a fixed repeating sequence of crossing through squares, because the line will eventually always reach a point where it's closer to a corner than it ever was before) – Zubin Mukerjee Sep 26 '18 at 20:51

• @Jens Going off of Zubin's comment, look at the infinite unit grid and say your line has equation $y=ax+b$ (vertical lines are trivial). A necessary (and sufficient) condition for a pattern to occur is that there exists some positive integer $k$ such that $kb$ is also an integer. This is only possible when $b$ is rational. – N.Bach Sep 26 '18 at 21:09