\[
\newcommand{\supp}[1]{\textrm{supp}(#1)}
\newcommand{\fix}[1]{\textrm{fix}(#1)}
\newcommand{\stab}[1]{\textrm{stab}(#1)}
\]
Techniques to Build Rubik's Cube Algorithms
I usually solve a Cross then First 2 Layers by intuitive methods and then use Conjugates and Commutators to solve the last layer in a mostly intuitive manner. This webpage should include everything you need to devise your own algorithms for solving the last 2 layers of a Rubik's cube from a mathematical perspective. Don't just take my algorithms as cannon, use the ideas to develop your own algorithms.
Notation:
- Singmaster Notation
- Left to right multiplication with the following conventions: $R'=R^{-1}$, $R2=R^2$
- Conjugates: $$X^Y=YXY'$$ Note alg.cubing.net uses $[Y:X]=X^Y=YXY'$
- Commutators: $$[X,Y]=XYX'Y'$$
- Cycle Notation: One handy way to represent a permutation is to list it's cycles. For example $f=(a, b, c)$ would be a function that takes
- $af=b$ ( or $a \xrightarrow{f} b$ )
- $bf=c$ ( or $b \xrightarrow{f} c$ )
- $cf=a$ ( or $c \xrightarrow{f} a$ )
and fixes everything else. Note the function is acting on variables on the left to make the arrows go in the same order as the functions.
Socks and Shoes:
( Socks and Shoes ) $(XY)'=Y'X'$
What this theorem says is the inverse of a composite operation where both component operations are invertible is equal to the inverse of each component operation in the opposite order. So given a long list of moves, reverse the order and invert each one (just like removing your socks and shoes). e.g.
$$
(R'DRLD'L'R'DR)'=R'D'RLDL'R'D'R
$$
Note $(\varphi')'=\varphi$ and $(X2)'=X2$ for every $X \in \{R,L,U,D,F,B\}$ and every invertible algorithm $\varphi$. It's noteworthy that other puzzles do not necessarily have the $(X2)'=X2$ property and that all algorithms performed by legal turns of the cube are invertible.
Group Action
You can consider the action of twisting the side of a cube as acting on different objects. For example you can act on the following:
- cubies
These are the physical blocks of the cube
- stickers
The color labels that go on each side
- corners
corner cubies
- edges
edge cubies
- faces
the center faces (not usually an issue unless they are oriented)
- F2L pairs
A pair of a color matching edge and corner.
- Any subset of objects
Conjugation:
Many cubers treat conjugation in a fairly colloquial manner. They think, do a setup move, do something useful, then invert the setup Note this is the same thing as saying
$$
XYX'=Y^X
$$
Where $X$ is the setup, $Y$ is the something useful and $X'$ inverts the setup.This structure is a common occurrence in mathematics such as in change of basis for a vector space or similar matrices. Basically, what it allows you to do is keep the same structure as $Y$ while changing it's shape by $X'$.
The following theorem is a formalization of that observation:
( Conjugation Preserves Cycle Structure )
Given $f=(a_1,a_2, \ldots, a_m)$ and $\sigma$ a permutation $f^\sigma=(a_1\sigma', a_2\sigma', \ldots, a_k\sigma')$
Let $f=(a_1,a_2, \ldots, a_m)$ and $\sigma$ be a permutation. First consider the action of $f^\sigma$ on
$x \not\in \{a_1\sigma',a_2\sigma', \ldots, a_m\sigma'\}$. Then
$x\sigma \not\in \{ a_1, a_2, \ldots, a_m\}$ and thus
$$
\begin{align}
xf^\sigma &=(x\sigma) f \sigma'\\
&= (x\sigma) (a_1,a_2,\ldots,a_m) \sigma'\\
&= (x\sigma) \sigma'\\
&= x
\end{align}
$$
Then if $x \in \{a_1\sigma',a_2\sigma', \ldots, a_m\sigma'\}$. Then for some integer $1\le j \le n$ we have $a_j\sigma'=x$. By applying the inverse $x\sigma=a_j$. Consider the action of $f^\sigma$ on $x$:
$$\begin{align}
(a_j\sigma')f^\sigma &= xf^\sigma \\
&=(x\sigma) f \sigma'\\
&= (a_j) (a_1,a_2,\ldots,a_m) \sigma'\\
&= (a_p)\sigma'
\end{align}$$
Where $p = \begin{cases}1 & j=m \\ j+1 & \text{otherwise}\end{cases}$. Therefore $f^\sigma=(a_1\sigma',a_2\sigma', \ldots, a_m\sigma')$.
If $f$ is the product of disjoint cycles $f=c_1c_2\cdots c_n$ where each
$c_i=(c_{i1},c_{i2},\ldots,c_{ik_i})$. Then to see conjugation preservers the cycle structure insert $\sigma'\sigma$ (which is the identity) between each cycle:
$$
\begin{align}
f^\sigma &=\sigma f \sigma'\\
&= \sigma c_1 c_2\cdots c_n \sigma'\\
&= (\sigma c_1 \sigma')(\sigma c_2\sigma')\cdots (\sigma c_n \sigma')\\
&= c_1^\sigma c_2^\sigma \cdots c_n^\sigma
\end{align}
$$
Then each $c_i^\sigma=(c_{i1}\sigma',c_{i2}\sigma',\ldots,c_{ik_i}\sigma')$. So $f^\sigma$ will have the same cycle structure as $f$.
Other important examples of conjugation:
- Cube Rotation
If you conjugate by rotating the cube you can move an algorithm to different positions without learning new moves.
- Reflection
If you consider what the mirror image of moves are it has the mirror image result of the algorithm.
Commutator Examples:
Inverting Commutators and Conjugates:
It's worth remembering how to invert commutators and conjugates. You can get them both from socks and shoes.
- Inverting a conjugate $$(f^g)'=(gfg')'=gf'g'=(f')^g$$
- Inverting a commutator $$[f,g]'=(fgf'g')'=gfg'f'=[g,f]$$
$3$-cycles:
One thing you can notice in the examples of commutators is if you follow certain pieces like the edges in The Sexy Move $[R,U]$ they are a $3$-cycle. That is, considering the action on edge blocks only sexy move has this cycle structure $(a,b,c)$ where $a$ is the green-red edge, $b$ is the white-red edge and $c$ is the blue-white edge. But sexy move is not a $3$-cycle when acting on all blocks because it moves corners also
Suppose we have an algorithm $f$ on the Rubik's cube. We will call
$\fix{f}=\{x \mid xf=x\}$ that is all the objects fixed by $f$. Usually we will be thinking of the objects as blocks, but we can think of them as stickers or edges or any other object the Rubik's cube acts on. The support is the complement of the set of fixed points $\text{supp}(f)=\{x \mid xf \neq x\}$.
( $3$-cycle theorem )
If $f$ and $g$ are algorithms on the Rubik's cube with $\supp{f}$ and
$\supp{g}$ intersecting in exactly one element, then the commutator $[f,g]$
is a 3-cycle.
In practice this is trickier to do that just commuting two adjacent moves on the cube, they all intersect in $3$ elements! Akk! But conjugation rescues us here.
Examples
Permutations Fixing the Last Layer:
If a group $G$ acts on set $\Omega$ and $ X \subseteq \Omega$ then the stabilizer of $X$ is $\stab{X}=\{g \in G \mid (X)g=X\}$. Note this only sends the set to the set, things can be permuted inside the set. We also denote the complement $X^C=\{ x \in \Omega \mid x \not\in X\}$. A permutation $f$ is said to fix $X$ pointwise if $xf=x$ for all $x \in X$. That is, $X \subseteq \fix{f}$.
( Last Layer Commutators )
If $f \in \stab{X}$ and $g$ fixes $X^C$ pointwise then $[f,g]$ also fixes $X^C$ pointwise. That is if $X$ is the last layer, taking the commutator of an algorithm that stabilizes the last layer and a last layer twist results in an algorithm that fixes the first two layers pointwise.
Note since $f \in \stab{X}$ that $f \in \stab{X^C}$ and $f' \in \stab{X} \cap \stab{X^C}$ also. Let $x \in X^C$ then $f(x)=y$ for some $y \in X^C$. Since $g$ pointwise fixes $X^C$ we have $g(x)=x$ and $g(y)=y$.
Then
$$
\begin{align}
x[f,g]&=xfgf'g'\\
&=ygf'g'\\
&=yf'g'\\
&=xg'\\
&=x\\
\end{align}
$$
Therefore, $[f,g]$ pointwise fixes $X^C$. Note $[f,g]'=[g,f]$ will also fix $X^C$ pointwise.
Examples:
- Corners:
$f=(R'DR)(LD'L')(R'DR)$
stabilizes the top layer and switches the top two corners. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
Think $R'DR$ removes the corner from the top layer and puts it on the bottom. Then $LD'L'$ inserts in on the top layer of the other side. Next $R'DR$ inserts it back to the right hand side. Note this is just following
- Edges:
$f=(MDM')D'(SDS')D'(MD'M')$
stabilizes the top layer and switches two top edges. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
Think $MDM'$ removes the edge from the top layer and puts it on the bottom. The $D'$ moves the edge out of the way so it can be inserted by $SDS'$ then $MD'M'$ respectively
- Orientation:
- Corners
$f=(R'DR)(FDF')$
stabilizes the top layer inserting and removing the same corner but with a different orientation. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
- Edges
$f=(MD2M')D(MD'M')$
stabilizes the top layer inserting and removing the same edge but with a different orientation. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
Think $MD2M'$ removes the edge from the top layer and puts it on the bottom the $D$ re-positions the edge out of the way. Next $MD'M'$ inserts the edge back to the same top layer position with a different orientation.
- F2l pairs
$f=(R'dR)D'(F'd'F)(R'd2R)$
stabilizes the top layer inserting and removing the same corner but with a different orientation. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
Think $R'dR$ removes the F2L pair to the bottom 2 layers then $D'$ re-positions it. Next (F-d-F) inserts the F2L pair back to the top layer and brings another pair down to the bottom 2 layers. Then $R'd2R$ re-inserts the 2nd F2L pair to the 1st pairs original position on the top. Note in whole this gives a $3$-cycle of F2L pairs but most cubers will be a bit more familiar with turning it on the top to make it switching and edge and a corner. For example $[f,U]U'$ is a J-perm and $[f,U2]U'$ is an $N$-perm.
- On Corner-Edge-Corner Tripples
$f=R2D2L2D2R2$
stabilizes the top layer and switches two opposite Corner-Edge-Corner tripples. Commutating it with any of the top twists: $U$, $U2$ or $U'$ yields a permutation that fixes the first 2 layers pointwise.
Think $R2$ removes the tripple from the top layer and puts it on the bottom. The $D2$ moves the tripple into position so it can be inserted by $L2$. Then $D2$ moves the 2nd tripple into position to be inserted by $R2$. Note: $[f,U]$ and $[f,U']$ have the same action on the cube (called an $H$-perm). The algorithm $[f,U2]$ acts trivially so isn't that useful.
Notes:
- Don't forget to Socks-and-shoes the inverse of your move that stabilizes the last layer.
- When remembering your move that stabilizes the last layer try only remembering where the top sticker went. Remembering a spacial path is easier than remembering a sequence of letters.
Thanks:
- To Curt Bennett for getting me started on twisty puzzles.
- To Morley Davidson for showing me some more advanced algorithm building techniques.
- To the alg.cubing.net development team for the awesome web interface :)