Rubik's Clock

This puzzle consists of a disk with 9 small clocks on each side arranged in a square. The four corner clocks can be twisted (the front and back corner clocks are connected). In between the clocks are four buttons. By pushing then up or down, the front or back clocks adjacent to it are connected to the corner clocks so that they will be turned when the corners are turned. The aim of the puzzle is to set all clocks to 12 o'clock.

The pictures above show the original Rubik's Clock on the left, and an imitation version on the right. That imitation is called the Magic Compass, since it has points of the compass written around each face. It still has 12 positions for each 'compass' even though 8 or 16 positions would be more logical, since the mechanism is a direct copy of the original.

It is a little known fact that the clock was actually not invented by Rubik himself but by Christopher Wiggs and Christopher Taylor. They previously invented the Orb. Rubik's Clock was granted a patent on 26 September 1989, US 4,869,506.

If your browser supports JavaScript, then you can play Rubik's Clock by clicking the link below:

The number of positions:

There are 14 independent clocks, with 12 settings each, giving 1214 = 1,283,918,464,548,864 positions.

Solution:

Note that in this solution, you only turn corners which are next to buttons in the up position. This way none of the clocks on the reverse side move, except for the corner clocks.

1. Push down the bottom two pins, push up the top two.
2. Turn a top corner until the centre clock matches the bottom middle.
3. Rotate the whole puzzle a quarter turn clockwise.
4. Repeat steps 1-3 three more times. Afterwards all the non-corner clocks on the front should match the centre clock.
5. Push up all pins.
6. Turn any corner till the centre clock is 12. All non-corner clocks on the front are now pointing to 12.
7. We are now done with the front side (the corner clocks will be solved later), so turn over the puzzle.
8. Repeat steps 1-4 for this side, so that all the non-corner clocks match. There is no need to do steps 5-6 just yet, as we have to make the corners match before setting everything to 12.
9. Push down the bottom left pin, push the other three up.
10. Turn a top corner till the centre clock matches the bottom left clock.
11. Rotate the whole puzzle a quarter turn clockwise.
12. Repeat steps 9-11 three more times. Afterwards all the clocks on this side should match each other.
13. Repeat steps 5-6 for this side. All the clocks are now at 12, so the puzzle is solved.

Theory:

This is the one of the few non-trivial puzzles I know in which the order that the moves are performed is unimportant (i.e. the puzzle positions form an Abelian group). This means that it is not necessary to do any particular move twice during the solution because we could change the order to do them one after the other, and therefore combine them into one move. Another puzzle of this kind is the Lights Out puzzle.

There are 16 positions that the buttons can be in, and in 14 of these we can turn a corner next to an up button or one next to a down button. In the other two cases all the buttons are the same. This means there are 30 possible types of move that can be performed.

Suppose we choose 14 independent move types. Independent means here that the effect of any of the 14 moves cannot be replicated by using only the other 13. It turns out that these 14 move types can then always solve the puzzle. For any position of the clocks this can be done by writing down 14 independent equations in 14 unknowns and solving them. The unknowns represent the how far you have to turn for each type of move. Each equation represents a clock; the left side is the amount the clock is turned by all the moves, the right side is the amount it has to turn to set it to twelve.

The theoretical solution above is in general not very easy for humans to perform, but is well suited for computers. By rewriting the equations in matrix form, and inverting the matrix, finding a solution becomes nothing more than a simply multiplying the (constant) inverse matrix by a vector representing the current position to be solved. Such linear algebra is explained in the page about the Mathematics of Lights Out. Note however that here we are working in the integers modulo 12 in which we have 3·4≡0, and this could make inverting a matrix impossible because we cannot divide by 2 or 3. Thankfully that situation does not occur here.

The solution for humans above does indeed use exactly 14 moves. By a suitable choice of 14 moves, and by doing them in an easy order there is virtually no mental effort needed at all.

Sometimes fewer than 14 moves are needed, because a clock happened to end up in the correct setting. There are 30 possible moves, and with a fixed choice of 14 independent ones there are always positions that need all 14 moves. Milán Baticz pointed out to me however that it is always possible to choose the set of moves such that fewer than 14 moves are needed. I decided to investigate using computer searches, and got the following results:

• The 9 clocks on one side can always be solved in 8 moves.
• Of the 125 = 248,832 positions for a cross, there are only 18066 that need 5 moves, the rest can be solved in fewer. Therefore there is a 92.7% chance of being lucky with the cross.
• You have the choice of which side to solve first, so the chances of being lucky are even higher. In fact, the chances of being unlucky on both sides is a mere 0.53%.
• If you have one of the 99.47% of cases with a lucky cross, then you can solve that cross in 4 moves, and then the other side in 8 moves - 12 moves all together. The other 0.53% can be done in at most 13 moves (but maybe less).

It turns out however that even those few positions from my analysis that might need 13 moves can actually also be solved in 12 moves or less. Tom Rokicki has calculated God's Algorithm for the Rubik's Clock with the following results:

MovesPositions
0 1
1 330
2 51,651
3 4,947,912
4 317,141,342
5 14,054,473,232
6 428,862,722,294
7 8,621,633,953,202
8101,600,180,118,726
9528,107,928,328,516
10613,251,601,892,918
11 31,893,880,879,492
12 39,248
Total1,283,918,464,548,864

So the average number of moves to optimally solve a random position is 9.4337 moves.