There are 12 students forming a circle, numbered from 1 to 12. The students numbered 1 to 4 hold red, green, yellow, and black balls, respectively. Each student can pass their ball to the left or right to another student whose position has a difference of 5. Balls cannot be passed to someone who has one in hand. After some time, the balls are back to the students numbered 1 to 4 but the ball in student 1 is black. What are the colors of balls in students' hand from 2 to 4?
-
2$\begingroup$ Is this a puzzle you made yourself, or did you find it somewhere? If the latter, please could you include the source of the puzzle? $\endgroup$– Rand al'ThorCommented Nov 16 at 15:06
-
$\begingroup$ It's from a friend so don't know the source. Sorry. $\endgroup$– LilyCommented Nov 16 at 15:13
-
1$\begingroup$ Welcome to PSE (Puzzle Stack Exchange). Would you agree that [number-theory] tag fits question better than [combinatorics] tag? If so, I can change it, or, consider changing it yourself. $\endgroup$– FirstName LastNameCommented Nov 16 at 21:15
-
1$\begingroup$ @FirstNameLastName Thanks for your advice. I've already changed it. $\endgroup$– LilyCommented Nov 17 at 1:23
-
$\begingroup$ Very nice (+1), this will make it into a homework sheet next time I am teaching number theory. $\endgroup$– tkfCommented Nov 18 at 22:22
3 Answers
First, we can observe that
if we rearrange the 12 students in such a way that new neighbours were exactly five spaces apart, they will once again be standing in a circle (since 5 and 12 are coprime).
This procedure now has the advantage that
the rules about passing simplify: Each student may now pass their ball to their direct neighbour if they are currently empty handed. In this description, it is very clear that we can never change the cyclical ordering of the balls. If we trace the balls through this renumbering, we find that they will originally occur in the order red - black - green - yellow (- red etc.), which will finally be shifted one step (since the first student ends up with the black ball).
As a consequence, the balls will now be arranged in this order:
1. Black, 2. Yellow, 3. Red and 4. Green in the original numbering.
Key observations are:
- the graph of possible moves is isomorphic to a circle (since 5 and 12 are coprime: but I am borrowing this one from Tim Seifert's very good answer); and,
- however the balls get passed around, swapping the place of any two balls is not allowed, so the balls will stay in their initial (cyclic) order.
That said, here is a little diagram that shows the solution:
In 5 'time steps'
t 0 1 2 3 4 5 - - - - - - R 1 6 11 4 4 4 G 2 7 12 5 10 3 Y 3 8 1 1 1 1 B 4 9 2 2 2 2 - - - - - -
total of 12 moves (all moves, each 'time step', allowed) (all moves to the right),
all four balls are back on positions 1 2 3 4
and
order
R G Y B 1 2 3 4
becomes
R G Y B 4 3 1 2
Doing this 2 more times gives
R G Y B 1 2 3 4 4 3 1 2 2 1 4 3 3 4 2 1
where black is now first.
The positions taken are now
B 1 Y 2 R 3 G 4
same as other solution.
note:
every number 1 2 3 4 cycles through same circle
1 4 3 2
albeit from different starting point, when keeping adding multiples of 5 and taking remainder modulo 12, and, when, doing so, reaching and taking one of the first 4 positions again
this is a consequence of 5 and 12 being co-prime and a special simple case of applying the CRT
1: 1 4 2 3 2: 2 3 1 4 3: 3 1 4 2 4: 4 2 3 1
this somehow illustrates (I do not claim this is a proof)
that B Y R G is only possible solution
and cycles from solution confirm this
number 1 cycle 1 : 1 6 11 4 cycle 2 : 4 9 2 cycle 3 : 2 7 12 5 10 3 number 2 cycle 1 : 2 7 12 5 10 3 cycle 2 : 3 8 1 cycle 3 : 1 6 11 4 number 3 cycle 1 : 3 8 1 cycle 2 : 1 6 11 4 cycle 3 : 4 9 2 number 4 cycle 1 : 4 9 2 cycle 2 : 2 7 13 5 10 3 cycle 3 : 3 8 1