23 Nov 2011

```
There is a billiard ball on a square table (with no holes).
Find angles in which the ball is shot and travel in a cyclic manner.
```

This simply means that at some point of time in the future the ball must travel through the initial point with the exact same angle.

It is obvious that if the ball travels horizontally or vertically, its path is cyclic.

Since the reflected angle is always equal to the incident angle, therefore, the path of the ball is always deterministic.

Let's say the ball starts at (x,y) and travels to v1, v2, v3, …, vn and vn = v1

As long as the the initial position is on the path, the ball will travel along the same path with the same order.

Traveling in the reverse direction can also be ignored because it is the same.

With this observation, we can consider only the case where:

- The ball starts from the bottom border
- We always shoot the ball toward upper-right corner
- 0 < A < 90, where A = The angle between the initial path and the bottom border (or the inclination angle)

I can think of the case where

- the ball is in the middle
- the ball is shot with the angle 45 degrees

It will travel in cycle after 4 bounces.

Actually, the ball can start anywhere on the bottom border, it will travel in cycle after 4 bounces.

Anything that is bounced more than 4 is just too difficult to draw or imagine.

It is the time that we change the representation because the current one is too difficult to figure out the case where the ball is bounced more than 4 times.

In the current representation, we fix the table and let the ball bounce.

We can try letting the ball travel in a straight line and extending the table instead.

There is a difference though, because if we extend the current table with a new one, a new one must be flipped, as shown below:

Now that is much easier. The ball to come back to the initial position with the same direction if the table is on its initial orientation and the ball hits the initial position.

If we use the angle of 45 degrees, we get the image below:

Amazingly, the critical pattern can be recognized with this representation.

To get back to the same position, the ball must travel vertically for some integer number of blocks and horizontally for some integer number of blocks.

Therefore, only an angle whose tangent is a rational number can cause the ball to travel cyclically.

We have noticed that the table must be flipped back to the initial orientation.

But this is easy. If the table is flipped vertically twice, the vertical position is in its initial setting. So does flipping horizontally.

Flipping twice means that the ball travels exactly two blocks.

We can see that the number of flipping is equal to the distance and that the table must be flipped in an even number of times.

Therefore, the tangent of angle must be (2V / 2H), so it is (V/H).

Therefore, any angle whose tangent is a rational number is fine.

If the tangent of the angle is (4/5), then the ball travels up 8 blocks and right 10 blocks in order to reach its initial position.

What if the table is not square anymore?

```
There is a billiard ball on a table whose width is twice of its height (with no holes).
Find angles in which the ball is shot and travel in a cyclic manner.
```

Using the same technique, it is just too easy.

If it travels up V blocks and right L blocks, then the tangent must be in the form of (Vh / L(2h)), which is (V / 2L).

V and L must be an even number according to the flipping rules.

Therefore, the answer is the same because (x/y) = (4x)/((2)(2y)), and we can assign V = 4x and L = 2y.

If the tangent of the angle is (3/5), then the ball travels up 12 blocks and right 20 blocks in order to reach its initial position.

We generalize the problem to:

```
There is a billiard ball on a table, whose width is w and height is h (with no holes).
Find angles in which the ball is shot and travel in a cyclic manner.
```

Using the same technique, if the ball travel up V blocks and right R blocks, then the tangent must be in the form of (Vh) / (Rw).

Don't forget that V and R must be even.

The answer is still the same because for any rational number, we could multiply it by (hw / wh) and (2 / 2) to make it compatible with the form above.

What if we have a triangle table, with equal sides , instead?

First, we have seen that the number of flips to reach the initial orientation is irrelevant, since we can multiply any numbers to the tangent.

Let's say the side is 1 unit length. The height of the triangle is (Root(3)/2), an irrational number.

However, this does not make it more difficult. If you draw the picture, you will see that:

- the ball travels up for some number, which is a multiple of Root(3)/2.
- the ball travels right for some number, which is a multiple of 1/2.

Therefore, the tangent of a valid angle must be in the form of (Root(3) V / H).

What is the table is a circle?

… too difficult …