Inspired by Mehul Arora

There are A A friends at an amusement park. They all fancy a ride, which takes exactly B B people on at a time, with B < A B < A .

If each of them want to ride it the same (positive) number of times, what is the minimum number of times that each of these people have to ride it?

Assume that no other people are available to ride with them, and that they can ride it as many times as they want.


Inspiration

lcm ( A , B ) \text{lcm} (A, B) A gcd ( A , B ) \frac{ A } { \gcd (A, B) } B gcd ( A , B ) \frac{ B } { \gcd ( A, B) } ( A / gcd ( A , B ) B / gcd ( A , B ) ) { A / \gcd ( A, B) \choose B / \gcd ( A, B ) } ( A B ) { A \choose B } Not possible for some values of A and B

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.

2 solutions

Calvin Lin Staff
Mar 17, 2015

Here's the easy solution.

Suppose that the ride runs b b times, and each person rides it for a a times. Then, A a = B b A a = B b .

Let G = gcd ( A , B ) G = \gcd (A, B) and A = G A , B = G B A = G A^*, B = G B^* . Then, dividing throughout by G G , we obtain A a = B b A^* a = B^* b . Now, since gcd ( A , B ) = 1 \gcd(A^*, B^* ) = 1 , it follows that B a B^* \mid a , and hence a B = B G a \geq B^* = \frac{ B}{ G} . This shows that B gcd ( A , B ) \frac{ B } { \gcd(A, B) } is the minimum possible.

We now need to construct it such that this is possible. To do so, we simply create a b × B b \times B block, and then list out all of the friends in order, repeating when we get to the end of the list of friends. Then, from the condition, each person will appear in this list exactly a a times. Now, we define each ride, to simply be a row in this block, and we are done. Note: The condition of B < A B <A ensures that everyone will be on a particular ride at most once.

As an explicit construction, say that A = 6 , B = 4 A = 6, B = 4 . Let the friends be i , j , k , l , m , n i, j, k, l, m, n . Then, we have a = 2 , b = 3 a = 2, b = 3 . The 3 × 4 3 \times 4 block that we are creating is

i j k l
m n i j
k l m n

So, the 3 rides are taken by "i,j,k,l" and by "m,n,i,j" and by "k,l,m,n". Of course, they are many ways to form this construction, and this is just one of them.

Can you please solve this for 10 friends and at each time, only 3 people can go?

Shreyans Nahar - 6 years, 1 month ago

Log in to reply

10 rides, 3 times for each friend.

Saya Suka - 4 months ago
Pranshu Gaba
Mar 15, 2015

Define k k to be the total number of people that go on the ride (by counting the same person multiple times if necessary). For example: If there are 6 6 friends, and each person rides 3 3 times, then k = 6 × 3 = 18 k = 6 \times 3 = 18 . You can also think of k k as the number of tickets sold.

k k can be counted in two ways.

  1. Let x x be the number of times each person goes on the ride, then k = A x k = Ax .
  2. Let y y be the number of times the ride is ridden, then k = B y k = By .

Since we counted the same item in two different ways, they must be equal. Therefore,

A x = B y Ax = By

The question is asking the minimum value of x x . x x will be minimum when y y is minimum since x x is proportional to y y .

x = B A y x = \frac{B}{A} y

Claim: I claim that the minimum value of x x is B gcd ( A , B ) \frac{B}{\gcd(A, B )}

Proof: We can make two cases:

Case 1: gcd ( A , B ) = 1 \gcd(A, B) = 1

Since gcd ( A , B ) = 1 \gcd(A, B) = 1 , A A does not divide B B . LHS is an integer, so A A must divide y y , ie y y must be an integral multiple of A A . The smallest positive integral multiple of A A is A A itself. We now prove that y y can be attain this value.

We will show systematically that as B B increases from 1 1 to A A , in each case it is possible for all friends to ride equal number of times with y = A y = A .

We can visualize a A × A A \times A matrix with each row i i for ride number and column j j for friend number. If element a i j = 1 a_{ij} = 1 , then it shows that friend j j goes on ride i i . If element a i j = 0 a_{ij} = 0 , then it shows that friend j j does not go on ride i i . The order of the matrix is A × A A \times A since there are A A friends so matrix has A A columns and y = A y = A rides, so matrix has A A rows.

Although many matrices are possible for each B B , finding one matrix for each B B should suffice.

When B = 1 B = 1 , we can have a square diagonal matrix. One person goes on every ride (since there is one 1 1 in each row) and every person goes exactly once.

( 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 ) \left( \begin{array}{ccccccc} 1 & 0 & 0 & 0 & 0 & \cdots & 0 \\ 0 & 1 & 0 & 0 & 0 & \cdots & 0 \\ 0 & 0 & 1 & 0 & 0 & \cdots & 0 \\ 0 & 0 & 0 & 1 & 0 & \cdots & 0 \\ 0 & 0 & 0 & 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & 0 & 0 & \cdots & 1\\ \end{array} \right)

In this matrix, there are A 1 A - 1 'diagonals' going from left up to right down on both sides of the main diagonal. On each side, there are diagonals of length 1 , 2 , 3 , , A 1. 1, 2, 3, \ldots, A -1.

As we increase B B by 1 1 , we must choose any two diagonals (which are filled with 0 0 's ) - one each from both sides of the main diagonal such that the sum of their lengths is A A - and replace them with 1 1 's. This way, one 1 1 is added to each row and column.

I will show it for A = 5 A = 5 , but it works for any positive A A . The changes in each step are highlighted with the red color.

B = 1 B = 1

( 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 ) \left( \begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ \end{array} \right)

B = 2 B = 2 There are two friends in each ride, and each friend rides twice.

( 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 0 0 0 1 ) \left( \begin{array}{ccccc} 1 & \color{#D61F06}{1} & 0 & 0 & 0 \\ 0 & 1 & \color{#D61F06}{1} & 0 & 0 \\ 0 & 0 & 1 & \color{#D61F06}{1} & 0 \\ 0 & 0 & 0 & 1 & \color{#D61F06}{1} \\ \color{#D61F06}{1} & 0 & 0 & 0 & 1 \\ \end{array} \right)

B = 3 B = 3 There are three friends in each ride, and each friend rides thrice.

( 1 1 0 0 1 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 1 0 0 1 1 ) \left( \begin{array}{ccccc} 1 & 1 & 0 & 0 & \color{#D61F06}{1} \\ \color{#D61F06}{1} & 1 & 1 & 0 & 0 \\ 0 & \color{#D61F06}{1} & 1 & 1 & 0 \\ 0 & 0 & \color{#D61F06}{1} & 1 & 1 \\ 1 & 0 & 0 & \color{#D61F06}{1} & 1 \\ \end{array} \right)

B = 4 B = 4 There are four friends in each ride, and each friend rides four times.

( 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 ) \left( \begin{array}{ccccc} 1 & 1 & \color{#D61F06}{1} & 0 & 1 \\ 1 & 1 & 1 & \color{#D61F06}{1} & 0 \\ 0 & 1 & 1 & 1 & \color{#D61F06}{1} \\ \color{#D61F06}{1} & 0 & 1 & 1 & 1 \\ 1 & \color{#D61F06}{1} & 0 & 1 & 1 \\ \end{array} \right)

There won't be B = 5 B = 5 in this case since gcd ( 5 , 5 ) 1 \gcd(5, 5 ) \neq 1 .

There exists a valid configuration for each possible B B when y = A y = A . So it is proved that y y can attain A A and we can substitute y = A y = A in A x = B y Ax = By . We get the minimum of x x is B = B 1 = B gcd ( A , B ) B = \frac{B}{1} = \frac{B}{\gcd(A, B)} .

Case 2: gcd ( A , B ) 1 \gcd(A, B) \neq 1

In this case we can simply divide both A A and B B by their gcd \gcd to get a coprime integer pair (say ( P , Q ) (P, Q) ) and continue as in case 1.

We get the minimum of x x is Q = B gcd ( A , B ) Q = \frac{B}{\gcd(A, B)}

Thus, in both cases we get the answer = B gcd ( A , B ) = \boxed{\dfrac{B}{\gcd(A, B)}} _\square

There is a very easy solution. The construction is almost immediate / obvious.

Calvin Lin Staff - 6 years, 3 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...