Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

A Mathematical Approach To Solving Rubik's Cube

by Raymond Tran, UBC Math308 Fall 2005

History: ''We turn the Cube and it twists us.'' --Erno Rubik The Rubiks Cube is a cube consisting of 6 sides with 9 individual pieces on each. The ain ob!ective when using one is to recreate it's original position" a solid color for each side" with out re oving an# piece fro the cube. Though it is colorful and looks like a children's to#" there have been an# cha pionships for it's co pletion. $t a used five#ear-olds #et inspired athe aticians. $t's uni%ue design was ade b# an engineer na ed Erno Rubik" a socialist bureaucrat who lived in &udapest" 'ungar#. 'e built the si ple to# in his other's apart ent and did not know of the ()) illion people who were going to beco e overl# perple*ed over it. 'is first idea of the cube ca e in the +pring of ,9-.. What inspired Erno was the popular pu//le before his called the ,( 0u//le. $nvented in the late ,1-)'s" this pu//le consisted of ,( consecutivel# nu bered" flat s%uares that can be slid around inside a s%uare fra e. +a 2o#d created this two di ensional version of the Rubiks Cube. The pu//le was originall# called the 3agic Cube" or &uvuos 4ocka in 'ungarian. $t was later rena ed in honor of it's creator to the Rubiks Cube. 3an# different cube variations have been ade" but the one discussed here is called the standard 5*5*5. $t contains 66 little blocks of plastic. The Rubiks Cube has been a successful product for an# #ears. Though created without great intentions" people have spent illions of dollars on it. 3ath classes to this da# stud# the co ple*it# of the Cube. Erno" the creator of the cube" beca e an overl# rich an fro his ingenious creation.

Introduction: The cube can rotate around it's center in an# wa# possible" no pieces are restricted to an# singular ove ent. The cube is not easil# solved because it does not have a definite scra bled point. This eans that there is onl# one co pleted situation" where all the sides have one color each. $f the cube is an#thing but that" it is considered scra bled. 7or e*a ple when the cube is co plete and one si ple rotation is ade it is scra bled even though it would be eas# to undo that. The cube has .5"6(6"))5"6-.".19"1(6"))) 8.5 %uintillion9 possible positions" and onl# one is the correct one. $t has been calculated that if ever# person on earth rando l# twisted a cube once ever# second" about once ever# three centuries one cube would return to its original state. The cube has even been used in college ath classes dealing with group theor#" a branch of algebra having to do with geo etric s# etr# developedin the nineteenth centur#. :roup theor# shows that a 6) degree rotation of a si*-pointed snow flake akes the flakes appearance unchanged. Each group theor# is s# etrical" and the cube represents this is after rotation. The cube can be solved in two wa#s. ;ne can use se%uences to solve piece b# piece" or #ou can atte pt to solve it backwards. This eans that after the cube is co pleted and i*ed" #ou can figure what turns were ade to i* it and undo the . 3athe aticians have tried to find the shortest ethod of unscra bling" which beca e known as :od's algorith . :od's algorith relies on a tree structure of all possible scra bled possitions" where a node is a position found b# aking a ove to scra ble the cube fro a previous node. The root of the tree is the single initial position where the cube is solved. The algorith searches for the atching scra bled position fro the root of the tree and a solution is found b# traversing the actions leading to the path found. <lthough :od's algorith is fast" it is ore of a co puting approach rather than athe atical approach. 'ere" we'll atte pt to illustrate a si plified version of the athe atical approach b# 0rofessor W.=. >o#ner of the ?.+. @aval <cade #.

otation: - X A turn a face B 9) clockwise 8E*C ?clk is illustrated b# the turning the top row of the rubik on the right via direction indicated b# the top arrow.9 - X-1 A turn a face B 9) counterclockwise 8E*C =clk is illustrated b# the turning the botto row of the rubik on the right via direction indicated b# the botto arrow. 9 - X*Y A se%uence B"D in such order.

Strategy: 7irst" we label cube as accroding to their faces as followC

Flat r !r " ntat#on o$ #n#t#al %&b

3' r !r " ntat#on o$ #n#t#al %&b

7ro

here" the group is generated b# the following generators" corresponding to the si* faces of the cubeC
( 1, 3, 8, 6)( 2, 5, 7, 4)( 9,33,25,17)(10,34,26,18)(11,35,27,19), ( 9,11,16,14)(10,13,15,12)( 1,17,41,40)( 4,20,44,37)( 6,22,46,35), (17,19,24,22)(18,21,23,20)( 6,25,43,16)( 7,28,42,13)( 8,30,41,11), (25,27,32,30)(26,29,31,28)( 3,38,43,19)( 5,36,45,21)( 8,33,48,24), (33,35,40,38)(34,37,39,36)( 3, 9,46,32)( 2,12,47,29)( 1,14,48,27), (41,43,48,46)(42,45,47,44)(14,22,30,38)(15,23,31,39)(16,24,32,40).

U:= L:= F:= R:= B:= D:=

The si/e of the group generated b# these per utations is .56(6))56-..191(6))). $t should be noted" however" that the center facet of each face labeled ?" 2" 7" R" &" = does not ove like the other facets. The following denotes the athe atical notations used in the solving ethodC
Let xy=y-1*x*y de !te "! #$%&t'! & d (x,y)=x-1*y-1*x*y de !te t*e "!++$t&t!,, -!, x,y %,!$. e/e+e t0. 1- x,y,2 de !te 3 %,!$. e/e+e t0, /et (x,y,2)=x-1*y-1*2-1*x*y*2. 1- x '0 & %,!$. e/e+e t & d 30 '0 & ' te%e, t*e x =x*x*...*x ( t'+e0).

The rubik should be solved in 5 stages or levels as followC 2evel ,C +olve the ?pper face and the facets around its edges totaling 6, facets.

(h#t $a% t" d not " tho" that ar not o$ %on% rn at th#" "ta)

To solve level ," we have the following

ovesC

,.,9 E onotwistEC(F,R-1)2 =(F-1*R*F*R-1)2


F-1 F F-1

,.69 E onoswapEC D

* D

* D

-1

= (F*D*F-1)*(F-1*D*D*F)*(F*D-1*F-1)

,.59 E onoflipEC(4 R)4, 5*e,e e.0'/! (4) '0 t*e "!$ te,"/!"65'0e +'dd/e 0/'"e 7$&,te, t$, .
8' "e t$, ' % t*e +'dd/e 0/'"e 90 '0 t*e 0&+e &0 t$, ' % t*e t!. & d 9!tt!+ 0/'"e0 -90, t*'0 "& 9e ,e*e "e "& 9e ,e5,'te &0 (U-1*D-1*R)4
(R2*L2)

,..9 EedgeswapEC U 2evel 6C +olve the

= (L-1*L-1*R-1*R-1)*(U*U)*(R*R*L*L) iddle band of ,6 facets while leaving results of level , in tact.

To solve level 6" we have the following Fclean edgeG

ovesC

6.,9 R2*U*F*B-1*R2*F-1*B*U*R2 '0 t*e t!. ed%e 3-"y"/e ($-,$9,$,) 6.69 (U,F-1,R)*(U-1,B,R-1)L :*'0 -/'.0, 9$t d!e0
= (U-1*F*R-1*U*F-1*R)*L-1*(U*B-1*R*U-1*B*R-1)*L !t .e,+$te, t*e t!. ed%e0 $-, $9

6.59 (R2*U2)3
= (R*R*U*U)3

.e,+$te0 2 .&',0 !, ed%e0 ($-,$9)(-,,9,)

6..9 (L2*F2*B2*R2*F2*B2);(D*B2*F2) .e,+$te0 2 .&',0 !- t!. ed%e0 ($-,$/)($,,$9)


= (F-1*F-1*B-1*B-1*D-1)*(L*L*F*F*B*B*R*R*F*F*B*B)*(D*B*B*F*F)

2evel 5C +olve the =own face and the facets around its edges totaling 6, facets while leaving results fro levels , and 6 intact.

To solve level 5" we have the following Fclean cornerG and Fclean corner-edgeG 5.,a9 ((D2)R*(U2)B)2

ovesC

t5'0t0 t*e $-, "!, e, "/!"65'0e & d t*e 9/d "!, e, "!$ te,"/!"65'0e = ((R-1*D*D*R)*(B-1*U*U*B))2

5.,b9 :*e +!<e ((U2(D2);(F*R-1))2);(R-1) *&0 t*e 0&+e 2-"!, e,-t5'0t e--e"t &0 t*e ! e &9!<e.
= R*(U*U)*(R*F-1)*(D*D)*(F*R-1)*(U*U)*(R*F-1)*(D*D)*(F*R-1)*R-1

5.69 ((D2);(F*D-1*R)*U2)2 5.59 ((D-1)R,U-1)

.e,+$te0 2 .&',0 !- "!, e,0 ($-,,$-/)($9,,$9/) = ((R-1*D*F-1)*(D*D)*(F*D-1*R)*U*U)2 "!, e, 3-"y"/e (9,$,9/$,9,d)

= (R-1*D*R)*U*(R-1*D-1*R)*U-1

5..9 B;(U-1*F)*U2*UB*U2*B-1 .e,+$te0 t5! t!. ed%e0 & d 2 t!. "!, e,0 ($/9,$,9)($9,$,)
= (F-1*U*B*U-1*F)*U*U*B-1*U*B*U*U*B-1

A Simpler MethodC &ased on the above ethod" there is a si pler version which works on the sa e 5-stage principle" but with si pler ove se%uences. We will now illustrate this ethod and use to solve a scra bled rubik as an e*a ple. The scra bled cube is created fro the initial position using the following ovesC ?H2H=HRH7H&-,H?-,2-, 8ie. ?clk" 2clk" =clk" Rclk" 7clk" &cnt" ?cnt" 2cnt9. The resulting rubik is shown on the right.

7ig +)- scra bled cube

+tage ,C We first tr# to get the cross on the ?p face as shown on the left. This is achieve b# the following ovesC ,.,9 B-," or 8B-,96" or BI si pl# rotate the piece back into place using one of the 5 ove variations depend on piece position on edges surounding B. $n case below" ove used is B-,.

,.69 BHD

We now appl# such oves to scra bled cube of fig. +) The se%uence 87-,9H8&9H8R-,9H8?-,H7-,9 thus gives us

<fter we have the cross in place" we can put the corners of the ?p face back into place using the following ovesC ,.59 =-,HD-,H=HD

7ig +,- crossed-top scra bled cube ,..9 =HBH=-,HB-,

The following face swapping se%uence will ove the ? corner facet to position ,.. if we place it directl# under the corner it should ove to. ,.(9 =HBH8=-,96HB-,

<ppl# oves ,.5-,.( to +," we haveC 8=-,H7-,H=H79H=6H8=-,H2-,H=H29

7ig +6- +tage , co plete scra bled cube

+tage 6C We look for the following pattern and applies the appropriate edge oving se%uence. 6.,9 =-,HD-,H=HDH=HBH=-,HB-,

6.69 =HBH=-,HB-,H=-,HD-,H=HD

<ppl#ing stage 6 oves to +6" we haveC 8=-,HR-,H=HRH=H7H=-,H7-,9

@otice that se%uence 6., K 6.6 both swaps a iddle edge piece with the one across fro it" which is precisel# what we wanted" so appl# 6.6 with D A 7" B A 2" we haveC 8=H2H=-,H2-,H=-,H7-,H=H79

7ig +5- +tage 6 partial scra bled cube. <t this configuration" we run into a proble because we do not have one of the two two configurations 7ig +. L +tage 6 partial scra bled cube. necessar# to co plete stage 6. $norder to proceed" we @ow with the positioning of facets ,6J5-" we can ust relocate facets ,6J5- and 6)J,5 into positions appl# stage 6 se%uence again. of ,(J.." 65J.6" 59J.-" or 5,J.( without disturbing the progress we've ade so far. +e%uence 6., can be applied with B A &" D A 2. 8=-,H2-,H=H2H=H&H=-,H&-,9 +e%uence 6.6 can be applied with B A 2" D A 7. 8=H2H=-,H2-,H=-,H7-,H=H79

7ig +( L +tage 6 partial scra bled cube. @ow with the positioning of facets ,5J6)" we can appl# stage 6 se%uence again.

7ig +6 L +tage 6 co plete scra bled cube.

+tage 5C We again tr# to achieve the cross as in stage ,. 'owever" the si ple se%uence of stage , would not work here because it will destro# previous results. $t should be recogni/ed that the =own face can onl# fall into one of the following . patternsC

Therefore" once the pattern is recogni/ed" the following se%uence can be applied repeatedl# to go fro one pattern to the ne*t" ulti atel# resulting in pattern .. 5.,9 BH=HDH=-,HD-,HB-,

+ince our cube in +6 falls into pattern ," it will take us We now have pattern 6. ?sing the orientation of the 5 applications of se%uence 5., to achieve pattern ." pattern as reference" we can choose B A R" D A 7C starting at pattern )" there is no orientation" so we can 8RH=H7H=-,H7-,HR-,9 pick an# side being B. 7or si plicit#" we'll choose B A 7" D A 2C 87H=H2H=-,H2-,H7-,9

7ig +1 L +tage 5 partial pattern 5 7ig +- L +tage 5 partial pattern 6 @ow that we have pattern 5. ?sing the orientation of The ne*t stage now involves re-orienting the iddle the pattern as reference" we ust choose B A R" D A 7 =own facets. 7ro +9" we can see that .6 and .- are 8RH=H7H=-,H7-,HR-,9 in the correct positions" .( and .. are not. Reorienting also re%uires a special se%uence in order not to disturb what we have achieved. $n order to use this se%uence" we ust first rotate & so that at least one corner piece line up with its colour. That side is now the side opposite B.

5.69 8B-,H=-,HBH=-,HB-,H8=-,96HBH8=-,969

7ig +9 L stage 5 partial pattern . <ppl#ing 5.6 with B A 7 on +9" we have 87-,H=-,H7H=-,H7-,H8=-,96H7H8=-,969 <ppl#ing 5.6 again with B A 7 on +,)" we have 87-,H=-,H7H=-,H7-,H8=-,96H7H8=-,969 and =-,H8R-,H=-,HRH=-,HR-,H8=-,96HRH8=-,969H=H=

7ig +,) L stage 5 partial 7ig +,, L stage 5 partial @ow that at ost . corners are out of place" we can e plo# the following se%uence to fi* it one b# one. <t this point" there should be at least , corner piece in the correct place. $f so" that piece will be on D on one side and the other side is M" the side opposite B. $f no correct corner piece at this point" pick an#. 5.59 8B-,H=HMH=-,HBH=HM-,H=-,9 ;nce the corner pieces are in place and !ust needed to be rotated" the following se%uence can be applied. The corner to fi* should be have D" B" & on 5 sides 5..9 8DHB-,HD-,HB96

Reference:

,9 'istor# of Rubik's Cube httpCNNwww.cs.buffalo.eduNOwli.NrubicNhistor#.ht l 69 3athe atical solution to 5*5 rubik b# 0rofessor W.=. >o#ner httpCNNwww.cs.buffalo.eduNOwli.NrubicNsolve5.t*t

You might also like