Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
12. Rubik’s <strong>Magic</strong> <strong>Cube</strong><br />
Robert Snapp<br />
snapp@cs.uvm.edu<br />
Department of Computer Science<br />
University of Vermont<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 1 / 45
Rubik’s <strong>Magic</strong> <strong>Cube</strong><br />
Ernö Rubik invented this celebrated puzzle in 1974.<br />
When completed, each of the six faces displays a<br />
common color, usually white, yellow, red, orange, blue<br />
and green.<br />
Questions:<br />
1 How many different ways can six<br />
colors be assigned to the six faces?<br />
2 How are the colors of each pair of<br />
opposite faces related at right?<br />
The cube actually consists of 26 visible cubies, consisting of<br />
6 single faced, centers, which are stationary.<br />
12 double faced, edges.<br />
8 triple faced, corners.<br />
Rubik’s standard color<br />
arrangement.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 2 / 45
David Singmaster’s Notation<br />
David Singmaster 1 published one of the first analyses of the <strong>Magic</strong> <strong>Cube</strong>. He<br />
introduced the following notation:<br />
U , for the Upper face,<br />
F , for the Front face,<br />
D, for the Down face,<br />
B, for the Back face,<br />
L, for the Left face, and<br />
R, for the Right face.<br />
Note that the <strong>Magic</strong> <strong>Cube</strong> can be oriented 24 ways within this coordinate system:<br />
the upper face can be chosen 6 different ways.<br />
for each upper face, the front face can be chosen 4 different ways.<br />
6 4 D 24.<br />
1. David Singmaster, Notes on Rubik’s <strong>Magic</strong> <strong>Cube</strong>, Enslow, Hillside, NJ, 1981.<br />
L<br />
F<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 3 / 45<br />
D<br />
U<br />
B<br />
R
Singmaster’s Operations: U<br />
Once the cube has been positioned, we define a<br />
set of rotation operations that maintain the<br />
orientation of the center cubies.<br />
For example, U denotes a quarter turn of the<br />
Upper face in the clockwise direction.<br />
U 2 denotes a half turn of the Upper face. (N.B.,<br />
U 2 D U U .)<br />
U 0 denotes a quarter turn of the Upper face in<br />
the counter-clockwise direction. (N.B.,<br />
U 0 D U 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 4 / 45<br />
U<br />
U 2<br />
U 0
Singmaster’s Operations: F<br />
F denotes a quarter turn of the Front face in the<br />
clockwise direction.<br />
F 2 denotes a half turn of the Front face. (N.B.,<br />
F 2 D FF .)<br />
F 0 denotes a quarter turn of the Front face in the<br />
counter-clockwise direction. (N.B., F 0 D F 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 5 / 45<br />
F<br />
F 2<br />
F 0
Singmaster’s Operations: D<br />
D denotes a quarter turn of the Down face in the<br />
clockwise direction.<br />
D 2 denotes a half turn of the Down face. (N.B.,<br />
D 2 D DD.)<br />
D 0 denotes a quarter turn of the Down face in<br />
the counter-clockwise direction. (N.B.,<br />
D 0 D D 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 6 / 45<br />
D<br />
D 2<br />
D 0
Singmaster’s Operations: B<br />
B denotes a quarter turn of the Back face in the<br />
clockwise direction.<br />
B 2 denotes a half turn of the Back face. (N.B.,<br />
B 2 D BB.)<br />
B 0 denotes a quarter turn of the Back face in the<br />
counter-clockwise direction. (N.B., B 0 D B 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 7 / 45<br />
B<br />
B 2<br />
B 0
Singmaster’s Operations: L<br />
L denotes a quarter turn of the Left face in the<br />
clockwise direction.<br />
L 2 denotes a half turn of the Left face. (N.B.,<br />
L 2 D LL.)<br />
L 0 denotes a quarter turn of the Left face in the<br />
counter-clockwise direction. (N.B., L 0 D L 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 8 / 45<br />
L<br />
L 2<br />
L 0
Singmaster’s Operations: R<br />
R denotes a quarter turn of the Right face in the<br />
clockwise direction.<br />
R 2 denotes a half turn of the Right face. (N.B.,<br />
R 2 D RR.)<br />
R 0 denotes a quarter turn of the Right face in the<br />
counter-clockwise direction. (N.B., R 0 D R 3 .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 9 / 45<br />
R<br />
R 2<br />
R 0
Restore the <strong>Cube</strong>: Outline<br />
Part I: Restore the upper face.<br />
1. Restore the upper edges.<br />
2. Restore the upper corners.<br />
Part II: Restore the middle layer.<br />
3. Turn the entire cube upside<br />
down.<br />
4. Restore the middle edges.<br />
Part III: Restore the final face.<br />
5. Invert the upper edges.<br />
6. Reposition the upper edges.<br />
7. Reposition the upper corners.<br />
8. Twist the upper corners.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 10 / 45
Part I: Step 1 — Restore the Upper Cross<br />
1a Select a color for the upper face (e.g, green), and<br />
an adjacent color for the front face (e.g., white).<br />
1b Identify the cubie that belongs in the upper-front<br />
(uf ) edge, e.g., the green-white edge. It should<br />
be easy to bring this cubie to the correct<br />
location.<br />
1c If this colors of the uf edge need to be flipped,<br />
then apply the sequence<br />
F 0 UL 0 U 0 :<br />
1d Rotate the entire cube one-quarter turn, and<br />
repeat the above until all four upper edges are in<br />
place. You should see a green cross.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 11 / 45
Part I: Step 2 — Restore the Upper Corners<br />
2a For each corner cubie in the Down layer that<br />
belongs in the Upper layer:<br />
i Rotate the Down layer (using the D operation) until<br />
this cubie is directly below its desired postion.<br />
Rotate the entire cube so that the desired position<br />
is under your right thumb (upper-right-front<br />
position).<br />
ii Apply the operation R 0 D 0 RD one, three, or five<br />
times, until this corner cubie is in the correct<br />
position, with the correct orientation. (This will not<br />
destroy the cross, obtained in Step 1.)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 12 / 45<br />
urf<br />
drf
Part I: Step 2 — Restore the Upper Corners (cont.)<br />
2b For each Upper layer corner cubie that is<br />
incorrectly placed, or incorrectly rotated,<br />
i Rotate the entire cube until the misplaced cubie is<br />
under your right thumb.<br />
ii Place the cubie in the Down layer using R 0 D 0 RD:<br />
iii Then apply step 2a (above) to move this cubie in<br />
the correct position.<br />
2c Apply the above steps until the entire upper layer<br />
is complete.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 13 / 45
Part I: Step 2 — Restore the Upper Corners (cont.)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 14 / 45
Part II: Step 3 — Turn the <strong>Cube</strong> Upside Down<br />
Turn the entire cube upside down, so that the completed<br />
green layer is the bottom (or down) layer. The<br />
new upper layer should have a blue center.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 15 / 45
Part II: Step 4 — Restore the Middle Layer<br />
The key operation is RU 0 R 0 FR 0 F 0 RU 0 which swaps and inverts ul and fr.<br />
4a Rotate the entire cube until a front-right (fr) edge<br />
is incorrect, or flipped. (Assume the right edge of<br />
the white face is incorrect.)<br />
4b Locate the correct edge (e.g., the red-white<br />
edge).<br />
Case A: If the correct edge is in the middle<br />
layer:<br />
i Rotate the entire cube so that<br />
the correct edge is a front-right<br />
(fr) edge. (Note, the red-white<br />
edge is in the middle layer.)<br />
ii Perform the sequence<br />
RU 0 R 0 FR 0 F 0 RU 0 which will<br />
place the correct edge in the<br />
upper layer (at ul ).<br />
iii Apply Case B.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 16 / 45<br />
ul<br />
fr
Part II: Step 4 — Restore the Middle Layer (cont.)<br />
Case B: If the correct edge is on the top layer:<br />
i Ensure that the misplaced edge<br />
is still the front-right (fr ) edge.<br />
ii Rotate the upper layer (using U<br />
operations) so that the correct<br />
edge is an upper-left (ul ) edge.<br />
iii Apply the operation<br />
RU 0 R 0 FR 0 F 0 RU 0 .<br />
iv If the correct edge needs to be<br />
flipped, apply Case C.<br />
Case C: If a middle edge is flipped in the<br />
correct location:<br />
i Apply the operation<br />
RU 0 R 0 FR 0 F 0 RU 0 twice.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 17 / 45
Part II: Step 4 — Restore the Middle Layer (cont.)<br />
The top row illustrates two successive occurrences of Case B. The left two diagrams show how<br />
the red-yellow edge is moved into its correct position with RU 0 R 0 FR 0 F 0 RU 0 . The right two,<br />
show how the orange-yellow edge is moved into its correct position by the same operation.<br />
The bottom row illustrates an occurrence of Case B, that leads to a Case C. First the<br />
orange-white edge is moved into its correct position, but with an incorrect orientation. Applying<br />
RU 0 R 0 FR 0 F 0 RU 0 moves it back into the top layer, but flipped. A third application, brings<br />
the orange-white edge into the correct position and orientation.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 18 / 45
Part III: Restoring the Upper Layer<br />
Now that the bottom and middle layers are complete, every cubie in the upper layer<br />
has a single blue face. In order to restore the upper face, one needs to<br />
5. Flip the edge cubies so that the blue face of each<br />
faces upwards.<br />
6. Move the edge cubies to their final locations,<br />
without destroying their orientation.<br />
7. Move the corner cubies to their final locations.<br />
8. Rotate the corner cubies (in place) so that the<br />
blue face of each faces upwards.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 19 / 45
Part III: Step 5 — Flip the New Upper Edges<br />
5. Orient the cube so that it matches one of the four orientations:<br />
“Blue Dot” “Blue Corner” “Blue Line” “Blue Cross”<br />
a. If the ”Blue Cross” is displayed, move on to Step 6.<br />
b. If the ”Blue Cross” is not displayed, apply the maneuver<br />
FRUR 0 U 0 F 0<br />
and repeat Step 5 as many times as required.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 20 / 45
Part III: Step 6 — Restore the New Upper Edges<br />
At this point of the solution, the bottom two layers should be solved, and a blue cross,<br />
should appear on the top face. If you are very lucky, the red, white, yellow and orange<br />
sides of the blue cross match all four of the corresponding center cubies. (Twist the<br />
upper layer using a succession of U operations, to see if this occurs. If so procede to<br />
Step 7.) If you are not so lucky, twist the upper layer until exactly one of the sides of<br />
the blue cross matches its center cubie. Rotate the cube so that the matching side<br />
cubie is in the front face. In the figures below the matching cubie happens to be red.<br />
RWYO ROWY RYOW<br />
Apply the sequence RUR 0 URU 2 R 0 until the sides of the four top edge cubies match.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 21 / 45
Part III: Step 7 — Place the Upper Corners<br />
We shall now ensure that each upper corner is in the<br />
correct position. (Don’t worry now about their orientations;<br />
those will be restored in Step 8.)<br />
Compare the colors of each upper corner with those of<br />
the adjacent centers. If all three match, even if the orientation<br />
is wrong, then this piece is in the correct position.<br />
In the diagram at right, the upper-left-front (ulf)<br />
corner (red-white-blue) is in the correct position. The<br />
upper-right-front (urf ) corner (yellow-orange-blue) is<br />
not.<br />
ulb urb<br />
ulf<br />
The key sequence of Step 7 is L 0 URU 0 LUR 0 U 0 , which rotates (or cycles) the upper<br />
three corners (ulf, ulb, urb ), in a clockwise direction, while maintaining the positions<br />
and orientation of the remaining 23 cubies.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 22 / 45
Step 7 — Place the Upper Corners (cont.)<br />
7a. If no upper corners are in their correct positions, apply L 0 URU 0 LUR 0 U 0 (once<br />
or twice) until one is. Then continue.<br />
7b. If one corner is in its correct position, then rotate the entire cube so that the<br />
correctly placed corner is near your right thumb, in the upper-right-front (urf )<br />
position. Then apply L 0 URU 0 LUR 0 U 0 (once or twice) until all four upper corners<br />
are correctly placed.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 23 / 45
Part III: Step 8 — Twist the Upper Corners<br />
At this point every cube is in the correct position. However, two or more corners may<br />
have an incorrect orientation.<br />
The key sequence of Step 8 is R 0 D 0 RD, which you already practiced in Step 2.<br />
8a. Rotate the entire cube until an incorrectly<br />
oriented (twisted) corner is located near your<br />
right thumb. (It should be in the urf position.)<br />
8b. Apply the sequence R 0 D 0 RD (two or four times)<br />
until this corner cube has the correct orientation.<br />
Don’t worry about the middle and bottom layers:<br />
they are temporarily messed up.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 24 / 45<br />
urf<br />
urf
Part III: Step 8 — Twist the Upper Corners (cont.)<br />
8c. Now rotate only the upper layer, by applying one<br />
or more U operations, until the next twisted cube<br />
is near your right thumb in the urf position.<br />
8d. Repeat steps 2 and 3 until every corner is<br />
correctly oriented.<br />
8e. Finally, restore the cube using one or more U<br />
operations.<br />
8f. Fix yourself an ice-cream cone.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 25 / 45<br />
urf<br />
urf<br />
urf<br />
urf
Summary<br />
Step Operations Goal<br />
upper<br />
(green)<br />
cross<br />
upper<br />
(green)<br />
corners<br />
flip<br />
entire<br />
cube<br />
middle<br />
edges<br />
Use the six basic operations to move the desired edge immediately below<br />
its home, without moving the other upper edges. Then rotate that<br />
face one-half turn.<br />
To flip an inverted edge, apply F 0 UL 0 U 0 .<br />
Use R 0 D 0 RD to swap (and twist) the urf and drf corners. After each<br />
misplaced corner has been moved to the down (blue) layer, use the D<br />
operator to move it immediately below its home. Then apply R 0 D 0 RD<br />
a sufficient number of times, so that it is correctly placed and correctly<br />
oriented.<br />
Easy as pie! Turn the entire cube upside down so that the blue center<br />
on top and the completed green face is the new down layer.<br />
Use RU 0 R 0 FR 0 F 0 RU 0 to swap and flip the ul and fr edges, without<br />
displacing the other cubies on the lower two layers.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 26 / 45
Summary (cont.)<br />
Step Operations Goal<br />
orient<br />
upper<br />
edges<br />
restore<br />
upper<br />
edges<br />
place<br />
upper<br />
corners<br />
twist<br />
upper<br />
corners<br />
If the blue facets on the upper face form a corner, rotate the cube so<br />
that the corner is at ul, u, and ub. If the upper facets of the upper edges<br />
form a blue line, rotate the cube so that the blue line runs from left to<br />
right (ul, u, ur). Apply FRUR 0 U 0 F 0 until a blue cross is displayed.<br />
Apply U until the the uf edge matches the color of the front face. Then<br />
apply RUR 0 URU 2 R 0 until every upper edge matches the side faces.<br />
If an upper corner is correctly placed, rotate the entire cube so that<br />
this becomes the urf corner. Then apply L 0 URU 0 LUR 0 U 0 until each<br />
corner is correctly placed.<br />
Apply U until urf is twisted. Then apply R 0 D 0 RD until this urf is correct.<br />
Repeat until every corner is untwisted. Apply U to restore the<br />
cube.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 27 / 45<br />
urf
How Many States are in the <strong>Cube</strong>?<br />
Claim: A 3 3 3 Rubik’s cube can be placed in exactly<br />
N D 43; 252; 003; 274; 489; 856; 000<br />
different configurations, using a sequence of legal moves based on L, R, U , D, B<br />
and F , more than the number of seconds in 10 billion centuries.<br />
Counting this number is sort of like counting the number of anagrams that can be<br />
formed from a given set of letters. We thus count permutations.<br />
Recall that there are three kinds of cubies: 8 corners, 12 edges, and 6 centers. First<br />
note that it is impossible to exchange a three-sided corner with a two-sided edge,<br />
and likewise we can’t exchange a center with either a corner or edge.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 28 / 45
How Many States are in the <strong>Cube</strong>?<br />
We will use the multiplication principle to count the number N of configurations that<br />
can be obtained by a sequence of the operations, L, R, U , D, B and F .<br />
Let,<br />
Then, our first estimate of N is<br />
What is the value of N1?<br />
N1 D number of configurations of the 6 centers<br />
N2 D number of configurations of the 12 edges<br />
N3 D number of configurations of the 8 corners<br />
N D N1 N2 N3:<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 29 / 45
Estimating N1<br />
Since the locations of the centers are unchanged by each of the six basic operations,<br />
they are also unchanged by any sequence of these operations. Thus,<br />
Thus,<br />
What is the value of N2?<br />
N1 D 1:<br />
N D 1 N2 N3:<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 30 / 45
Estimating N2<br />
Since there are 12 locations (cubicles) for each edge, there are 12Š ways to order the<br />
edges. In addition, each edge can be flipped in two different ways: e.g., the red-blue<br />
edge can be red-side up, or blue-side up. This suggests that there are at most<br />
ways to arrange the 12 edges.<br />
What can we say about N3?<br />
N2 D 12Š 2 12 D 1; 961; 990; 553; 600<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 31 / 45
Estimating N3<br />
Since there are 8 corner cubicles (locations for the corners), there are 8Š ways to<br />
order the corners. In addition each corner can be twisted three different ways. This<br />
suggests that, at most,<br />
N3 D 8Š 3 8 D 264; 539; 520<br />
ways to arrange the eight corners.<br />
Does<br />
N D 1 .12Š 2 12 / .8Š 3 8 /‹<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 32 / 45
Counting the Configurations of Rubik’s <strong>Cube</strong><br />
This number,<br />
1 .12Š 2 12 / .8Š 3 8 / D 519; 024; 039; 293; 878; 272; 000<br />
actually represents (exactly) the number of different ways that Rubik’s cube can be<br />
reassembled, assuming that the centers are not rearranged.<br />
Anne Scott (cf., Berlekamp, Conway, Guy, 2004), showed that this value<br />
overestimates the correct value of N by a factor of 12.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 33 / 45
Invariants<br />
Consider a “puzzle” that concerns the value of a variable x. Initially, x D 0. Every<br />
second a coin is tossed. If the coin lands heads then we add 4 to x. If the coin lands<br />
tails, we subract 2. Here is a sample sequence.<br />
time (s.) 0 1 2 3 4 5 6 7 8 9 10<br />
coin toss H T H H T T T T T H<br />
x 0 4 2 6 10 8 6 4 2 0 4<br />
Question: Can x ever equal 1?<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 34 / 45
Invariants<br />
Correct! The answer is no. Since x begins as an even number, and every possible<br />
operation (adding 4 or subtracting 2) preserves evenness, x will always be even.<br />
In this context, evenness is said to be an invariant property, or an invariant (for short),<br />
of x.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 35 / 45
Invariants and Loyd’s 14-15 Puzzle<br />
Sam Loyd (1841–1911) created many popular puzzles, including the celebrated<br />
14–15 puzzle, shown above. Can you interchange just tiles labeled 14 and 15, by<br />
sliding tiles horizontally or vertically into the space? (Loyd offered a $1000 prize to<br />
anyone who could.)<br />
How many states are realizable?<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 36 / 45
Invariants (cont.)<br />
For the space to wind up in the lower-right corner, there must have been an even<br />
number of vertical moves, and an even number of horizontal moves. Consequently,<br />
only permutations that swap and even number of pieces are possible. For Loyd’s<br />
puzzle, only half of the 16Š states are realizable.<br />
Anne Scott used invariants to exactly count the number of possible states for Rubik’s<br />
cube.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 37 / 45
Reexamining the allowed corner twists<br />
Place a 0, 1, or a 2 on each corner face,<br />
as shown at right. The initial sums are then<br />
computed for each face, and recorded under<br />
column I of the table. Sums are also computed<br />
following each legal quarter turn. Note<br />
that ever entry is a multiple of 3. This latter<br />
property is preserved for every sequence of<br />
legal operations.<br />
However, if one were able to twist a single<br />
corner, one-third of a turn, in either direction,<br />
the sums of the adjacent faces change<br />
to numbers that are not multiples of 3.<br />
Consequently, only one-third of the total<br />
number of corner twists 3 8 can be realized<br />
using a sequence of legal operations.<br />
2<br />
1<br />
1<br />
2<br />
0<br />
1<br />
2<br />
2 1<br />
0<br />
0 0<br />
0<br />
1<br />
2<br />
0 0<br />
0<br />
Face Sums<br />
Face I L R U D F B<br />
left 6 6 6 6 6 3 3<br />
right 6 6 6 6 6 3 3<br />
upper 0 3 3 0 0 3 3<br />
down 0 3 3 0 0 3 3<br />
front 6 3 3 6 6 6 6<br />
back 6 3 3 6 6 6 6<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 38 / 45<br />
2<br />
2<br />
1<br />
1<br />
1<br />
2
Reexamining the allowed edge flips<br />
Place a 0 or 1 on each edge, and construct<br />
a stationary blue window for each face, as<br />
shown. The initial sum of the values that appear<br />
in the blue windows is computed under<br />
column I in the table. It can be shown that<br />
the window sum will always be a multiple of<br />
2, and even number, after every sequence of<br />
operations. (After F U , for example, it equals<br />
6.)<br />
However, flipping any single edge results in<br />
an odd window sum. Consequently, it is not<br />
possible to invert a single edge using a sequence<br />
or rotations.<br />
Thus only one-half of the 2 12 edge states are<br />
realizable.<br />
0<br />
1<br />
1<br />
0<br />
1<br />
1<br />
0 0<br />
1<br />
0<br />
0<br />
1<br />
1<br />
0 0<br />
1<br />
1<br />
1<br />
0 0<br />
1<br />
Blue-Window Sums<br />
I L R U D F B<br />
sum 12 8 8 8 8 8 8<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 39 / 45<br />
0<br />
0<br />
1
How many states are expressible by the cube?<br />
The final reduction factor is obtained by observing that only one-half of the 12Š 8Š<br />
permutations of the locations of the 12 edges and 8 corners are realizable. Each<br />
sequence of operations always moves a multiple of 4 pieces. It is thus impossible to<br />
interchange just two corners, or just two edges.<br />
Thus,<br />
N D 1<br />
2<br />
1<br />
2<br />
1<br />
3<br />
12Š 2 12<br />
8Š 3 8<br />
D 43; 252; 003; 274; 489; 856; 000:<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 40 / 45
Some Symmetrical States<br />
Let Fs D FB 0 denote a move called a front slice. Similarly,<br />
let Rs D RL 0 denote the right slice, and Us D UD 0 denote the upper slice.<br />
“Dots” “Chessboard” “Cross”<br />
RmF 0 m R0 m Fm<br />
The definitions of Rm, R 0 m , Fm, and F 0 m<br />
F 2<br />
s R2 s U 2 s<br />
appear below.<br />
R0L2F 2<br />
s U 2R2 2<br />
s Fs D2R0 Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 41 / 45
Singmaster’s Operations: Rm<br />
Start with yellow on top, blue in front, and red at<br />
right. Rm denotes a quarter turn of the middle<br />
layer (only) parallel to the direction of R. The<br />
easiest way to complete this is to rotate both the<br />
right face, and the middle layer behind the right<br />
face, one quarter turn clockwise, followed by R 0 .<br />
R 2 m<br />
denotes a half turn of the middle layer<br />
behind the right face.<br />
R0 m denotes a quarter turn of the middle layer,<br />
behind the right face, in the counter-clockwise<br />
direction, i.e., parallel to R0 . (N.B., R0 m D R3 m .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 42 / 45<br />
Rm<br />
R 2 m<br />
R 0 m
Singmaster’s Operations: Fm<br />
Fm denotes a quarter turn of the middle layer<br />
(only) parallel to the direction of F . The easiest<br />
way to complete this is to rotate both the front<br />
face, and the middle layer behind the front face,<br />
one quarter turn clockwise, followed by F 0 .<br />
F 2 m<br />
denotes a half turn of the middle layer<br />
behind the front face.<br />
F 0 m denotes a quarter turn of the middle layer,<br />
behind the front face, in the counter-clockwise<br />
direction, i.e., parallel to F 0 . (N.B., F 0 m D F 3 m .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 43 / 45<br />
Fm<br />
F 2 m<br />
F 0 m
Singmaster’s Operations: Um<br />
Um denotes a quarter turn of the middle layer<br />
(only) parallel to the direction of U . The easiest<br />
way to complete this is to rotate both the upper<br />
face, and the middle layer behind the upper face,<br />
one quarter turn clockwise, followed by U 0 .<br />
U 2 m<br />
denotes a half turn of the middle layer<br />
behind the upper face.<br />
U 0 m denotes a quarter turn of the middle layer,<br />
behind the upper face, in the counter-clockwise<br />
direction, i.e., parallel to U 0 . (N.B., U 0 m D U 3 m .)<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 44 / 45<br />
Um<br />
U 2 m<br />
U 0 m
References<br />
1 Christoph Bandelow, Inside Rubik’s <strong>Cube</strong> and Beyond, Birkhäuser, Boston, 1982.<br />
2 Elwyn R. Berlekamp, John H. Conway, and Richard K. Guy, Winning Ways For Your<br />
Mathematical Plays, Second Edition, Vol. 4, A. K. Peters, Natick, MA, 2004.<br />
3 John Ewing and Czes Ko´sniowski, Puzzle It Out: <strong>Cube</strong> Groups and Puzzles, Cambridge<br />
University Press, Cambridge 1982.<br />
4 Alexander H. Frey, Jr. and David Singmaster, Handbook of Cubik Math, Enslow, Hillside,<br />
NJ, 1982.<br />
5 Martin Gardner, ed., The Mathematical Puzzles of Sam Loyd, Dover, NY, 1959.<br />
6 David Joyner, Adventures in Group Theory: Rubik’s <strong>Cube</strong>, Merlin’s <strong>Magic</strong> & Other<br />
Mathematical Toys, Johns Hopkins University Press, Baltimore, 2002.<br />
7 Ernö Rubik, Tamás Varga, Gerzson Kéri, Györgi Marx, and Tamás Vkerdy, Rubik’s Cubic<br />
Compendium, Oxford University Press, Oxford, 1987.<br />
8 David Singmaster, Notes on Rubik’s <strong>Magic</strong> <strong>Cube</strong>, Enslow, Hillside, NJ, 1981.<br />
Robert R. Snapp © 2012 12. Rubik’s <strong>Magic</strong> <strong>Cube</strong> CS 32, Fall 2012 45 / 45