ENIGMA 1565 — It’s a Rollover

by Bob Walker

Joe’s puzzle was no rollover for Penny. Joe drew a mini-chess board on a card and made a dice with the letters E N I G M A in place of the numbers. Penny had to select a letter and then place the dice on the X with the selected letter on the top. The she moved the dice by rolling it (rotating it by 90°), from square to square to the corresponding lettered square on the right of the board, finishing with the selected letter on top. For each letter the number of moves had to be a minimum. What are the minimum number of moves of moves for each of the letters E N I G M and A?
          E
          N
          I
          G
          M
X         A

          E
          N
          I
          G
a       f M
X b c d e A
Figure 1
The puzzle is a matter of rolling a dice from the bottom left-hand corner to each of the squares in the right-hand row, so that the number on the top at the end of the roll is the same as at the start of the roll. For the sake of simplicity(?) we will always start with 1 at the top of the dice with the 2 facing north. The puzzle is to find the shortest path to each of the right-hand squares ending up with the 1 back on the top again.

We look first at the bottom letter, A (see figure 1). If we roll it four times first to a then to b, c, d and e, we will then have the number 1 on top.
If the dice rolls north, east and then south it moves one square east overall, but with the same number at the top.
So, rolling from e to A via FF and M gets us where we want to be. The path has to be a minimum, because the only shorter path is a straight line along the bottom which ends up with the wrong number on the top.
Another solution is to go from X to a and then head east to M, and then south to A.

In general, any path that uses only northerly and easterly moves will be the shortest possible.
Each southerly move needs to be compensated by an extra northerly move; so the next best route is 2 moves longer than the best. We need to find routes which also have the one on top at the end. Where we find an optimum route with this property that is the answer. Where we find a second best route with this property that is the answer, if we can also show that none of the optimum routes gives the one on top finish.

For an optimum path for the letter M we need to make one northerly move along the way. The red italic letters in figure 2 show the orientation of the number 1 face of the dice.
          E
          N
          I
          G
W T E B W M
X E B W T E
Figure 2
          E
          N
          I
    S S   G
  E B B W M
X E       A
Figure 3
The A row (bottom row) shows where this will be if rolled eastwards from the square X.
The M row shows where this will be if rolled westwards from the square M.
None of the possible northly moves can achieve the desired change.
For the 1-face to be on east or west on row M, it would have to be on the same face on the bottom row.
For it to be on the top on the M row, it would need to be on the south face on the bottom row.
For it to be on the bottom on the M row, it would need to be on the north face on the bottom row.
Therefore, there is no minimum path solution for the letter M.

Note: When rolling east or west, neither the north face nor the south face changes. Similarly, when rolling north or south, neither the east face nor the west face changes.

We note that one of the east-facing squares on the bottom row is to the south-west of an east-facing square on the M row. If we roll northwards on either of those squares, we shall shift the remaining redletters on the M row one place to the left, arriving with the 1-face on the top one square early.
Moving one north, one east and one south always preserves the top and bottom faces, so we can use this to produce a second-best solution which has to be the result, e.g. as seen in figure 3.

There is an easy optimum solution for letter I. Take the SS square on the G row, roll it all the way to the G square, and then one north.

      B W E
      N   N
      T   I
    S S   G
  E B     M
X E       A
Figure 5
          E
          N
          I
          G
    S S S S
X E B     A
Figure 4
The is also an optimum solution for the letter G. From the square labelled B on the bottom row, go one north to make an S, and then roll east all the way to the M square, from where a northwards roll give us the letter G in its right place (se figure 4).

We can get an optimum solution for the N row, if we can get a south-facing 1-face on the I row. which is easily achieved by three rolls north from the starting position. Then we roll all the way to the I square, and then one to the north.

An optimum solution for the E square is shown in figure 5.

In summary the path lengths are:
E N I G M A
10 9 8 7 8 7