Sliding Coins
To read the problem statement, I encourage you to go to Rodrigo's blog post here. Now for the solution.
Let
For the case with
You will notice that these are the triangular numbers! For
Now, we know that for
If we analyze the parity of the triangular numbers we see that they follow a nice sequence, the first two are odd, and the following two are even. And this keeps repeating for every four new numbers. If we put this in modular arithmetic terms
(
Case where
If
As you can see, we first try to pair coins so that they are at the same distance, and then we can just move each grouped pair to the right until we reach the end. As a remark, notice that it does not matter how far away the coins are from the right column, we can always reach the end!
Okay, but then what goes wrong for the
Okay, so for any
- Suppose we number the coins so that coin number
is the farthest away from the right and coin number is the closest. - In the first step we will move coin
and , then and ; and so on until we move . Because we know that this is always possible, as half the coins is still an even number. - After these steps we get a configuration where each coin in a pair is always the same distance away from the right. And so we can just move each pair seperately until the end!
Case where
Let us do a neat trick. If we compare this configuration to the previous one, we have something like this
What happens if we just move the first and last coin? The last coin reaches the end column. And the first gets paired up with the second. As we know, we can just bring this pair of coins to the end together. What about the other
And that is it! We now know if it is possible to solve this initial diagonal configuration of coins, for any
Source: https://mathspp.com/blog/problems/sliding-coins
Tags: invariants