The bouncing ball

I've posted a question, so to celebrate, I decided to play pool. Somehow my house has tables with holes at four corners of any dimensions. The ball and the holes are negligibly small (epsilon by epsilon).

My mathematical friend says, "I will give you a m × n m\times n rectangular table where m , n m, n are positive integers summing to 2015. It's up to me to decide. Hahaha. Then we will play." Then he will put the ball at one corner.

I am very bad at aiming, so I only have a machine that will shoot the ball at an angle of 45° to the sides of the table. My evil friend wants the ball to bounce as many times as possible before it reaches any hole so that the ball can lose as much kinetic energy as possible and leave me in suspense.

I calculate that the maximum number of bounces is M M .

For how many ordered pairs ( m , n ) (m, n) does the number of bounces equal M M ?

Clarifications:

As an explicit example, a 1 × 2 1\times2 table needs 1 bounce, and a 2 × 3 2\times3 table needs 3 bounces. A 1 × 2014 1\times2014 table needs 2013 bounces.

You may make the assumption that we are decent mathematicians, although we can't play pool and do weird things. Note also that this is combinatorics, not computer science.


The answer is 1440.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Vu Van Luan
May 4, 2015

Although it is true, why does (m, n) have to be 1?

Joel Tan - 6 years, 1 month ago

Log in to reply

You make a square with length side is m x n. This square made by m x n of m x n rectangular (paint this side by red color) . You draw a yellow diagonal of this square. The number of point meet by the yellow line and red line is the bounce of ball.

vu van luan - 6 years, 1 month ago
Patrick Corn
May 1, 2015

Consider the rectangular lattice generated by ( m , 0 ) (m,0) and ( 0 , n ) (0,n) . The line y = x y = x represents the path of the ball on a series of (possibly reflected) images of the pool table. Bouncing off a wall corresponds to crossing over one of the sides of one of the fundamental rectangles.

The ball goes into the hole at ( m a , n b ) (ma,nb) where m a = n b ma=nb and a a and b b are the minimum positive solutions to this equation. Clearly a = n / d , b = m / d a = n/d, b = m/d where d = g c d ( m , n ) . d = {\rm gcd}(m,n). The ball bounces a + b 2 a+b-2 times. In order to maximize this, we should have d = 1 d = 1 and so M = 2013 M = 2013 . The answer is the number of ( m , n ) (m,n) such that m + n = 2015 m + n = 2015 and g c d ( m , n ) = 1 {\rm gcd}(m,n) = 1 , which is equivalent to g c d ( m , 2015 ) = 1 {\rm gcd}(m,2015) = 1 , so it's φ ( 2015 ) = 1440 \varphi(2015) = \fbox{1440} .

Nice solution!

Joel Tan - 6 years, 1 month ago
Carsten Meyer
Sep 12, 2019

Imagine the ball lies in any corner and is hit at an angle of 45 ° \SI{45}{\degree} . After some distance it will reach a wall and bounce back. Now imagine you mirrored the pool table on the side where it bounced back - on the mirrored table, the ball follows the same line it had been on before (also see Vu Van Luan's solution)!

Notice: By mirroring the table along the side where a bounce occurs, the ball rolls along a line of the form ( x , y ) = t ( ± 1 , ± 1 ) , t R (x,\:y)=t(\pm1,\:\pm1),\quad t\in\mathbb{R} (signs depend on the initial direction the ball was hit to).

Notice: The corners of the mirrored m × n m\times n -table lie at ( k m , l n ) , k , l Z (km,\:ln),\quad k,\:l\in\mathbb{Z}


Now let's find the number of bounces B M B\leq M . The ball reaches a hole of the (mirrored) table if ( x , y ) = ! ( k m , l n ) ± k m = ! ± l n ( k m , l n ) = z lcm ( m , n ) ( ± 1 , ± 1 ) , z Z ( ) \begin{aligned} (x,\:y)&\overset{!}{=}(km,\:ln)&\Rightarrow&&\pm km&\overset{!}{=}\pm ln&\Rightarrow &&(km,\:ln)&=z\operatorname{lcm}(m,\:n)\cdot (\pm1,\:\pm1),&z&\in\mathbb{Z}&&(*) \end{aligned} We need the solution where the ball reaches a hole for the first time , i.e. z = 1 z=1 . The number of bounces against the horizontal and vertical walls until the ball reaches a hole are l 1 , k 1 l-1,\:k-1 respectively. We need to subtract one as there is no bouncing back when the ball reaches the hole: B = l + k 2 = ( ) lcm ( m , n ) m + lcm ( m , n ) n 2 lcm ( m , n ) gcd ( m , n ) = m n = m + n gcd ( m , n ) 2 = N gcd ( m , n ) 2 N 2 m + n = N : = 2015 \begin{aligned} B&=l+k-2\underset{(*)}{=}\frac{\operatorname{lcm}(m,\:n)}{m}+\frac{\operatorname{lcm}(m,\:n)}{n}-2&&\left|\operatorname{lcm}(m,\:n)\cdot \gcd(m,\:n)=mn\right.\\ &=\frac{m+n}{\gcd(m,\:n)}-2=\frac{N}{\gcd(m,\:n)}-2\leq N-2&&\left|m+n=N:=2015\right. \end{aligned} We really can get the maximum number of bounces (consider an 1 × ( N 1 ) 1\times(N-1) -table), so the maximum number of bounces is M = N 2 M=N-2 . Using m + n = N m+n=N , we find gcd ( m , n ) = gcd ( m , N m ) = gcd ( m , N ) \gcd(m,\:n)=\gcd(m,\:N-m)=\gcd(m,\:N)

Notice: We get the maximum number of bounces if (and only if) gcd ( m , n ) = gcd ( m , N ) = 1 \gcd(m,\:n)=\gcd(m,\:N)=1


We can count the number of tables with maximum bounce by counting the numbers 1 m N 1\leq m\leq N with gcd ( m , N ) = 1 \gcd(m,\:N)=1 . That number is given by φ ( N ) = 4 12 30 = 1440 \varphi(N)=4\cdot 12\cdot 30=\boxed{1440}

Abhinav Sinha
Mar 12, 2018

Let m m be on x x -axis and n n on y y -axis.

Then we can see that ball has to travel L C M ( m , n ) n \frac{LCM(m,n)}{n} on x x -axis and L C M ( m , n ) m \frac{LCM(m,n)}{m} on y y -axis

Then the number of bounces on side m = L C M ( m , n ) n 1 m = \frac{LCM(m,n)}{n} - 1 .

Similarly, number of bounces on side n = L C M ( m , n ) m 1 n = \frac{LCM(m,n)}{m} - 1 .

\therefore Total number of bounces = ( L C M ( m , n ) n 1 ) + ( L C M ( m , n ) m 1 ) = L C M ( m , n ) ( 1 m + 1 n ) 2 (\frac{LCM(m,n)}{n} -1)+(\frac{LCM(m,n)}{m}-1) = LCM(m,n)(\frac{1}{m} + \frac{1}{n})-2

\implies Total Bounces = m n ( m + n ) H C F ( m , n ) m n 2 = \frac{mn(m+n)}{HCF(m,n)mn}-2

\implies Total Bounces = 2015 H C F ( m , n ) 2 = \frac{2015}{HCF(m,n)} -2

\therefore For maximum bounces H C F ( m , n ) = 1 HCF(m,n)=1 and M = 2013 M=2013 .

1 = H C F ( m , n ) = H C F ( m , 2015 m ) = H C F ( m , 2015 ) 1=HCF(m,n)=HCF(m,2015-m)=HCF (m,2015)

# m = ϕ ( 2015 ) = 1440 \implies \# m = \phi(2015) = 1440

\therefore Number of solutions = 1440 = 1440 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...