## HCSSiM Workshop, day 14

This is a continuation of this, where I take notes on my workshop at HCSSiM.

We switched it up a bit and I went to talk about Rubik’s Cubes in Benji Fisher’s classroom whilst Aaron Abrams taught in mine and Benji taught in Aaron’s. We did this so we could meet each other’s classes and because we each had a presentation that we thought all the classes might want to see.

In my class, besides what Aaron talked about (which I hope to blog about tomorrow), we talked about representing groups with generators and relations and we looked at how to create fractals on the complex plane using Mathematica.

**Solving the Rubik’s Cube with group theory**

First I talked about the position game, so ignoring orientation of the pieces. In other words, if all the pieces are in the correct position but are twisted or flipped, that’s ok.

Consider the group acting on the set which is the Rubik’s cube. We can fix the centers, and then this group is clearly generated by 90 degree clockwise turns on each of the 6 faces (clockwise when you look straight at the center of the face). It has a bunch of relations too, of course, including (for example) that the “front” move commutes with the “back” move and that any of these generators is trivial if you do it 4 times in a row.

Next we noted that the 8 corners always move to other corners on any of these moves, and that the 12 edges always move to edges. So we could further divide the “positions game” into an “edges game” and a “corners game.” Furthermore, because of this separation, any action can be realized as an element of the group

But there’s more: any one of these generators is a 4-cycle on both edges and corners, which is odd in both cases, so so is a product of the generators. This means the group action actually lands inside

where I denote by the *odd* permutations of

Next I stated and proved that the 3-cycles generate , by writing any product of two transpositions as a product of two or three 3-cycles.

The reason that’s interesting is that, once I show that I can act by arbitrary 3-cycles on the edges or corners, this means I get that entire group up there of the form (even, even) or (odd, odd).

Next I demonstrated a 3-cycle on three “bad pieces” where one needs to go into the position of one of the other two. Namely:

- Put two “bad” pieces on the top and one below, including the piece which is the destination of the third.
- Do some move U which moves the third bad piece below to its position on the top
*without changing anything else*. - Move the top so you decoy the new piece with the other bad piece on top. Call this decoy move V.
- Undo the U move.
- Undo the V move.

Seen from the perspective of the top, all that happens is that suddenly it has one piece in the right place (after U), then it gets rid of a piece it didn’t want anyway. From the perspective of the bottom, it sent up a piece it didn’t want to the top, then unmessed itself by taking back another piece from the top.

That’s a 3-cycle on the pieces, on the one hand (and a commutator on the basic moves), and we can perform it on *any* three corners or edges by first performing some move to get 2 out of the 3 pieces on the same face and the third not on that face. This is essentially acting by conjugation (and it’s still a commutator).

Moreover, the overall effect on the puzzle is that it took 3 pieces that were messed up and got at least 1 in the right spot.

The overall plan now is that you solve the corners puzzle, then the edges puzzle, and you’re done. Specifically, I get to the (even, even) situation by turning one face once if necessary, and then I can perform arbitrary 3-cycles to solve my problem. If I have fewer than three messed up corners (resp. edges), then I have either 0, 1, or 2 messed up corners (resp. edges). But I can’t have exactly 1, and exactly 2 would be odd, so I have 0.

That’s the position game, and I’ve given an algorithm to solve it (albeit not efficient!).

What about the orientations?

Shade the left and right side of a solved cube. Both the position (cubicle) and the piece of plastic (cubie) can be considered as shaded. Also shade a strip on the front and on the back, so we get the top and bottom edge of the front and back shaded.

Convince yourself that every edge and every corner position has exactly one shaded face.

When the cube is messed up, the shaded face of the position may not coincide with the shaded face of the cubie in that position. For edges it’s either right or wrong – assign each a value of 0 (if it’s right) or 1 (if it’s wrong). These can be considered orientation values modulo 2.

For corners, it can be wrong in two ways. The cubie’s shaded face could coincide with the position’s shaded face (give it a value 0), or it could be clockwise 120 degrees (value 1), or counterclockwise 120 degrees (value -1). These numbers are modulo 3.

Next, convince yourself that all of the generators of the group of actions on the rubik’s cube preserve the fact that the sum of the orientation numbers is 0, considered either mod 3 for the corners or mod 2 for the edges.

In particular, this means we can’t have exactly one edge flipped but everything in the right position. If you see this on a Rubik’s cube then someone took it apart and put it back together wrong.

However, you can twist one corner clockwise and another one counterclockwise, which means you can get any configuration of orientation numbers on the corners that satisfy that their sum is 0. Same with edges – it’s possible to flip two.

Finally, I exhibit how to do each of these basic orientation moves by 2 3-cycles. First I choose a pivot corner and perform a 3-cycle on those three corners, and then I do another 3-cycle, which uses the same 3 corners but is slightly different and results in everything being back in the right position but two corners twisted. I can do the same thing for edges, and I have thus totally solved the cube.

This method of 3-cycles is slow but it generalizes to all Rubik’s puzzles, so for example the 7 by 7 cube:

Or, with some work, something else like this:

p.s. I learned all of this when I was 15 from Mike Reid at HCSSiM 1987.

p.p.s. This was what we ate after singing our Yellow Pig Carols last night:

I’m jealous; that sounds like a lot of fun. My background is physics, so I’ve never gone through the basic entertaining math, like abstract algebra, but one of these days I’m going to plow through Herstein or something similar until at least I know enough Galois theory to understand why quintics can’t be solved by radicals.

The 3-cycle technique works well for the 3×3 cube but the 4×4 cube can enter states where you cannot solve it using that technique (caveat: at least I can’t see how to leave the state since visual “parity” is preserved by the move). The state I’ve entered with a 4×4 cube is with one edge flipped but its companion edge piece is correctly oriented (all other pieces are correctly oriented).

We talked about that too. It’s solvable by 3-cycles, but it’s hard to see why because the 4 centers of each color are indistinguishable. You can find yourself with two edges in the wrong position, which is impossible to have with a 3×3 cube.

The way to deal with this is to do a center slice (i.e. don’t move the corners but move an internal slice by 90 degrees). This is an odd permutation on the edges and the centers but the centers “don’t care.” If the edges looked odd before (like with a permutation) it’s even now and can be solved with 3-cycles.

Cathy, I don’t know if this would help your students, but I think the story behind your U and V moves is the following assertion. If you take the commutator [g,h] = g h g^{-1}h^{-1} in the symmetric group of two elements which have only one point a in their common support, you get a 3-cycle:(a g(a) h(a)). You might start by asking them to show that if g and h have no common support, the commutator [g,h] is the identity.

Dick,

Cool! That’s a good and more general explanation of why this trick works. I’ll put it in problem set tomorrow night.

Thanks,

Cathy