sebastiano.tronto.net

Source files and build scripts for my personal website
git clone https://git.tronto.net/sebastiano.tronto.net
Download | Log | Files | Refs | README

figure-it-out.md (17941B)


      1 # Rubik's cube: how to figure it out
      2 
      3 So you decided to try and solve a
      4 [Rubik's Cube](https://en.wikipedia.org/wiki/Rubik%27s_Cube).  Maybe it
      5 is for a bet. Maybe your parents grounded you for playing too much
      6 Minecraft and now you have to find an off-line hobby.  Maybe you have
      7 been fascinated by this toy since you were a kid and now that you have
      8 retired from work you finally have the time to try and solve it.
      9 
     10 Of course it is and all you have to do it to learn how to solve
     11 this puzzle is asking your favorite search engine (or AI? I guess search
     12 engines are *so* 2021...). Sure you can do that, and you will find plenty
     13 of tutorials that teach you how to build it up *layer by layer*, and with
     14 the help of some pre-mmemorized sequences of moves you can easily learn
     15 it in a few hours (or days). Also, there are probably apps that can take a
     16 picture of a scrambled cube and tell you how to solve it move by move.
     17 
     18 But that feels a bit like cheating, doesn't it?  What if you want to
     19 figure it out on your own, without relying on someone else's instructions?
     20 
     21 This is where this page comes in. Here I will try to explain just enough
     22 about the Rubik's cube so that you can try and tackle it alone. After
     23 explaining some basics about how the cube works as a 3D puzzle, I will
     24 introduce a couple of general-purpose techniques to help you move the
     25 pieces around, without telling you directly what steps to take.
     26 
     27 So, let's dive in!
     28 
     29 ## How it works
     30 
     31 The first thing you should do to understand how the cube works is taking
     32 it all apart and inspect the pieces it is made of and the mechanism
     33 holding them together.
     34 
     35 Well actually don't do it, just look at the picture below:
     36 
     37 ![A disassembled Rubik's cube](disassembled.jpg)
     38 
     39 As you can see, there are three types of pieces:
     40 
     41 * **The core**, consisting of 3 axes intersecting in the center. Some
     42 screws and springs keep the **6 center pieces** attached to it, in such
     43 a way that they can spin. This is what makes the faces turn.
     44 * **Edge pieces**, with only two colored faces each. When the cube is
     45 assembled, they lie between two center pieces. There are 12 of them.
     46 * **Corner pieces**, with three colored faces each. When the cube is
     47 assembled, each corner piece is adjacent to 3 edge pieces, and it
     48 touches 3 center pieces "diagonally". There are 8 corner pieces.
     49 
     50 So far so good. But what does this tell us about solving the cube
     51 by turning its sides?
     52 
     53 First of all, the fact that the centers are attached to the core implies
     54 that their relative position does not change, ever. In other words, you
     55 can think of the **centers as fixed** pieces, and **build the rest
     56 around them**.
     57 
     58 Another important thing that is made clear by looking at the disassembled
     59 cube is that **you should think about pieces, not stickers** or colors.
     60 When naïvely attempting to solve the cube without a clue, many would
     61 think about "moving this color there". But what you have to always keep
     62 in mind is that you can never move a single colored sticker: the other
     63 colored stickers attached to the same piece, be it an edge or a corner,
     64 will always move with it.
     65 
     66 Now we are ready to move on to some fundamental techniques. If you have
     67 actually disassebled your cube, put it back together *in a solved state*:
     68 if you don't, there is a good chance (11 out 12) that you will reassamble
     69 it in an **unsolvable state**, just like a
     70 [15 puzzle](https://en.wikipedia.org/wiki/15_Puzzle) with the
     71 last two number swapped.
     72 
     73 ## Building blocks
     74 
     75 Most methods to solve a Rubik's cube a divided into steps, where:
     76 
     77 * In the first few steps, you put together blocks of pieces. This is 
     78 also known as **blockbuilding**. These steps are often "intuitive",
     79 which means that they do not require memorizing sequences of moves
     80 to apply blindly.
     81 * In the last few steps, you need to move around a few remaining pieces
     82 without destroying the progress made in the previous steps. Most of the
     83 time steps like these rely on memorized sequences of moves that are known
     84 to only affect the position of certain pieces; but there are alternative
     85 approaches, as we will see later.
     86 
     87 So, what do we mean exactly by "block of pieces"? To be precise we could
     88 say that two or more adjacent pieces form a block when adjacent stickers
     89 of different pieces have the same color. For example, the simplest kind
     90 of block is a **pair**, that you can see in the picture below:
     91 
     92 ![A corner-edge pair](pair.svg)
     93 
     94 To be precise, the one above is a coner-edge pair. There are also center-edge
     95 pairs, consisting of a center and an edge, but they are rarely referred to
     96 as "pairs". In any case, they do fit our definition of "block".
     97 
     98 A more complex example of a block is a **layer**, which is the result of
     99 the first two steps of the classic "layer by layer" method. This one is
    100 a correctly solved layer:
    101 
    102 ![A layer](layer.svg)
    103 
    104 On the other hand, this is **not a layer**:
    105 
    106 ![A non-solved layer, but with a solve "face"](face.svg)
    107 
    108 It is worth pausing here to reflect a bit. The last two pictures both
    109 clearly show a solved white face, don't they? For a most people, they
    110 could look equivalent. But remember what we said earlier: you should
    111 think about *pieces*, not *stickers*. In the last picture, the pieces
    112 have all white on top, but their side colors do not match (except for
    113 the blue-white edge and the blue-orange-white corner). So they do not
    114 form a block, which means that their **relative position** is incorrect.
    115 By contrast, the second to last picture shows a block: all side colors
    116 match, not only the white top. This means that the pieces are in correct
    117 relative position with respect to each other.
    118 
    119 With this in mind, you can starting making your own way through
    120 the first few steps of your solving method: try to build multiple
    121 blocks of pieces and put them together to make even bigger blocks.
    122 
    123 If you want some more hints, Ryan Heise's website contains some nice
    124 examples about building blocks in his
    125 [fundamental techniques page](https://www.ryanheise.com/cube/fundamental_techniques.html).
    126 
    127 ## Commutators
    128 
    129 *In the rest of this page I am going to use the standard
    130 [Rubik's cube notation](../notation) to write down sequences of moves.
    131 You should familiarize with it at least a bit before continuing. Don't
    132 worry, it's very easy.*
    133 
    134 The more blocks you build, the harder it becomes to make progress. The
    135 reason for this is that you want to avoid destroying the blocks you
    136 have already built, so your options become more and more restricted
    137 as you go. This is completely normal.
    138 
    139 The most common speedsolving methods go around this issue by
    140 prescribing the use of memorized sequences, somewhat improperly
    141 called "algorithms".  For example the layer by layer method relies
    142 on blockbuilding to build the first layer, but on at least 5
    143 "algorithms" to complete the last two layers.  The more advanced
    144 [CFOP](https://www.speedsolving.com/wiki/index.php/CFOP_method) method
    145 uses blockbuilding for the first two layers, but it then requires
    146 78 different "algorithms" to complete the last layer.
    147 
    148 Here I am going to outline an alternative, more flexible approach,
    149 based on
    150 [commutators](https://www.speedsolving.com/wiki/index.php?title=Commutator).
    151 They are generally considered an advanced technique, I believe that
    152 they are perfectly fine to learn as a beginner. Ryan Heise's page that
    153 I linked above has a
    154 [section about them](https://www.ryanheise.com/cube/commutators.html),
    155 too.
    156 
    157 If you have not done it already, you should have a look at my page on
    158 [the Rubik's cube notation](../notation) before continuing.
    159 
    160 ### Corner commutators
    161 
    162 Suppose that you manage, via blockbuilding, to reach the following state:
    163 
    164 ![A commutator](comm1.svg)
    165 
    166 First of all, this would be an amazing achievement! The whole cube is
    167 solved except for three corners. The bottom-left corner (only one red
    168 sticker visible) is white-green-red, and it should go to the place where
    169 the white-red-blue corner is right now. The latter should in turn take
    170 the place of the corner on the right whose visible stickers are orange
    171 and yellow (the hidden sticker being green). In Mathematical terms, these
    172 3 corner form a **permutation cycle of 3 pieces**, or 3-cycle for short.
    173 
    174 Commutators are a general technique to solve 3-cycles of pieces. They
    175 can be decomposed in 4 small steps:
    176 
    177 1. **Interchange**: a single move that interchanges two of the three
    178 pieces.
    179 2. **Insertion**: a sequence of moves (usually 3) that inserts the third
    180 piece into the place of one of the other two, without affecting the
    181 "interchange" face of the cube in any other way.
    182 3. **Inverse interchange**: the inverse of the move done in step 1.
    183 4. **Inverse insertion**: the inverse of the sequence of moves done in step 2.
    184 
    185 **Note:** step 1 and 2 can appear in the other order; if they do, steps
    186 3 and 4 should also be swapped.
    187 
    188 Let's look at an example. From the position in the picture above, you
    189 can interchange the top two corners using the move U. More precisely, U
    190 brings the orange-yellow-green corner into the position currently occupied
    191 by the white-red-blue corner. The move U' also works, as it moves the
    192 white-red-blue corner to the position of the orange-yellow-green one.
    193 
    194 An interchange move is worth nothing without a compatible insertion
    195 sequence. In this case, you can use R' D R as insertion: this sequence
    196 of 3 moves moves the red-green-white corner to the place currently
    197 occupied by the white-red-blue one and, very importantly, **it does not
    198 affect any other piece in the U layer**. To put it in another way,
    199 **the interchange and the insertion only "clash" on one corner**.
    200 
    201 The last thing to decide before we put all of this together is which
    202 one should go first: the interchange or the insertion? This is not hard
    203 to figure out: I described both of them as "moving a certain piece into
    204 a certain position"; only one of the two moves a piece in its correct
    205 final position, and that is the sequence that must go first. In our case
    206 it is the insertion, because the red-green-white corner's final position
    207 is the one occupied by the white-red-blue one.
    208 
    209 So our commutator looks like this: R' D R U R' D' R' U'. Let's split
    210 this up to review it:
    211 
    212 * **R' D R**: the insertion sequence, moving the red-green-white corner
    213 to the position of the white-red-blue one.
    214 * **U**: the interchange move, moving the orange-yellow-green corner
    215 to the position now occupied by the red-green-white one.
    216 * **R' D' R**: the inverse of the insertion sequence. To invert a sequence
    217 of moves, you have to **read it backwards inverting every single move**.
    218 Here we start with R', because it is the inverse of R, the last move of
    219 the insertion sequence; then we have D', the inverse of the second move; 
    220 and finally R, the inverse of the first move of the insertion sequence.
    221 * **U'**: the inverse of the interchange move.
    222 
    223 To help understanding all of this, you can visualize this commutator
    224 [alg.cubing.net](https://alg.cubing.net/?setup=%5BU,_R-DR%5D&alg=R-_D_R_%2F%2FInsertion%0AU_%2F%2FInterchange%0AR-_D-_R_%2F%2FInverse_insertion%0AU-_%2F%2FInverse_interchange).
    225 
    226 **Note:** looking at the position of the pieces is not enough to
    227 determine a correct commutator to permute them. Their **orientation**
    228 is also important. For example, consider the following case:
    229 
    230 ![Another commutator](comm2.svg)
    231 
    232 The three corners are permuted in exactly the same way, so everything
    233 we said above could be repeated word by word, move by move. However,
    234 if you apply the commutator we constructed to this case, you'll get
    235 something like this:
    236 
    237 ![Two twisted corners](twist.svg)
    238 
    239 What's wrong here? Well, obviously the cube is not solved. All the pieces
    240 are in their correct position, but two corners are twisted in place!
    241 
    242 To avoid situations like this when creating your commutators, you need to
    243 keep track of **which sticker goes where**. I know, I know: I said at the
    244 beginning that *pieces* are important, not *stickers*. This is still true,
    245 but sometimes it is important to keep track of both.
    246 
    247 Let's highlight the difference between the two 3-cycles. In the first one:
    248 
    249 ![A commutator](comm1.svg)
    250 
    251 1. The red-green-white corner must go to the place of the white-red-blue one,
    252 *with the white sticker of the first going to the place of the white sticker
    253 of the latter*.
    254 2. The white-red-blue corner must go to the place of the
    255 orange-yellow-green one, *with the white sticker of the former going to
    256 the place of the orange sticker of the latter*.
    257 3. The orange-yellow-green corner must go to the place of the red-green-white
    258 one, *with the orange sticker of the former going to the place of the
    259 white sticker of the latter*.
    260 
    261 While in the second case:
    262 
    263 ![Another commutator](comm2.svg)
    264 
    265 1. The red-green-white corner must go to the place of the white-red-blue one,
    266 *with the white sticker of the first going to the place of the* **blue** *sticker
    267 of the latter*.
    268 2. The white-red-blue corner must go to the place of the
    269 orange-yellow-green one, *with the* **blue** *sticker of the former going to
    270 the place of the* **green** *sticker of the latter*.
    271 3. The orange-yellow-green corner must go to the place of the red-green-white
    272 one, *with the* **green** *sticker of the former going to the place of the
    273 white sticker of the latter*.
    274 
    275 The main point here is that not only interchange and insertion moves
    276 should swap the correct pieces around, but they must also move each
    277 "reference sticker" to the position of the next "reference sticker".
    278 For example, using the commutator R' D R U R' D' R U' for the second
    279 case does not work, because the insertion sequence R' D R moves the
    280 white sticker of the red-green-white corner to the position of the
    281 red sticker of the white-red-blue one, while it should move it
    282 to the position of the blue sticker!
    283 
    284 I won't repeat the whole construction for the second commutator,
    285 but you can visualize a solution
    286 [here](https://alg.cubing.net/?setup=%5BR-,_UL-U-%5D&alg=U_L-_U-_%2F%2FInsertion%0AR-_%2F%2FInterchange%0AU_L_U-_%2F%2FInverse_insertion%0AR_%2F%2FInverse_interchange).
    287 
    288 ### Edge commutators
    289 
    290 So far I have only talked about *corner* commutators, but what if you
    291 are also left with some unsolved edges? For example, consider this case:
    292 
    293 ![A edge 3-cycle](edgecomm.svg)
    294 
    295 The picture shows a 3-cycle of edges.  You might think that the same
    296 reasoning can be applied and that you can use commutators to solve
    297 edge 3-cycles of edges. This is exactly the case, and this is why this
    298 subsection is so short.
    299 
    300 Let's see how to solve the case above. As interchange move, you can use
    301 the **inner-layer move** E' (check out the [notation page](../notation)
    302 if you are unfamiliar with these). The insertion sequence to be used
    303 with it is L' U2 L. Putting everything together, you get
    304 [E' L' U2 L E L' U2 L](https://alg.cubing.net/?setup=%5BL-U2L,E-%5D&alg=E-_%2F%2FInterchange%0AL-_U2_L_%2F%2FInsertion%0AE_%2F%2FInverse_interchange%0AL-_U2_L_%2F%2FInverse_insertion).
    305 
    306 ### Commutators with set-up moves
    307 
    308 At this point I have good news and bad news.
    309 
    310 The good news is that commutators are so powerful that you could solve
    311 the whole cube using just commutators and at most one single move (this
    312 sentence might sound a bit strange, but it is Mathematically correct -
    313 the best kind of correct). Although it would not be very efficient, you
    314 could avoid blockbuilding altogether and move pieces around
    315 only with commutators - this is how advanced
    316 [blindsolving](https://www.speedsolving.com/wiki/index.php?title=Blindfolded_Solving)
    317 methods work.
    318 
    319 The bad news is that not every 3-cycle can be solved directly with a
    320 commutator, at least not one of the form I described above. Sometimes
    321 you need to use **set-up moves**, also known as 
    322 [conjugates](https://www.ryanheise.com/cube/conjugates.html).
    323 
    324 Consider the following case:
    325 
    326 ![A 3-cycle of corners requiring a set-up move](setup.svg)
    327 
    328 No matter how much you try, you are not going to find valid interchange
    329 and insertion moves as above. The fundamental problem is that you would
    330 like to use U (or U', or U2) as an interchange move, but this move affects
    331 all 3 of the corners. You might think of using R or F as interchange; they
    332 do affect only two of the pieces, but they do not move the the stickers in
    333 the correct position: any commutator based on R or F as interchange move
    334 would lead not to a solved cube, but to some corners twisted in place.
    335 
    336 So, how can we deal with this case? The solution is to use one or more
    337 moves to set up a better case. These moves will be done at the
    338 beginning and then undone at the end.
    339 
    340 For example in this case you can start by doing L as a setup move.
    341 This has the effect of moving the white-red-green corner out of the U
    342 layer, so that you can then use U (or rather, U') as interchange move.
    343 The insertion sequence that makes it all work here is R D2 R', and
    344 putting it all together you get:
    345 
    346 * Set-up: L
    347 * Interchange: U'
    348 * Insertion: R D2 R'
    349 * Inverse interchange: U
    350 * Inverse insertion: R D2 R'
    351 * Inverse set-up: L'
    352 
    353 **Note:** in this case the insertion coincides with its inverse. This
    354 can happen and there is nothing particular about it.
    355 
    356 As usual, you can visualize the final result on
    357 [alg.cubing.net](https://alg.cubing.net/?setup=L2B2R-F-RB2R-FRL2&alg=L_%2F%2FSet%26%2345%3Bup%0AU-_%2F%2FInterchange%0AR_D2_R-_%2F%2FInsertion%0AU_%2F%2FInverse_interchange%0AR_D2_R-_%2F%2FInverse_insertion%0AL-_%2F%2FInverse_set%26%2345%3Bup)
    358 
    359 ## Conclusion
    360 
    361 With what you have learned so far, you can now try and solve the Rubik's
    362 cube on your own, without further help. Granted, it won't be a walk
    363 in the park: this short tutorial is not meant to explain everything. I
    364 could have given you advice on which blocks to build first or on when to
    365 stop building blocks and start using commutators, I could have shown you
    366 many more examples, I could have told you how to address tricky cases
    367 like permutation parity or pieces twisted in place. But I think it can
    368 be more fun to try and figure all of this out by yourself - and if you
    369 disagree, just look for a more complete tutorial online.
    370 
    371 Happy cubing!