A 2x2 Rubik's Cube, has six colored sides (Blue, White, Orange, Yellow, Red, Green), each of which is subdivided into four sections. The exterior surface of the device consists of eight cube segments, one at each corner of the Rubik's Cube. Three colored faces are present on each of the eight corner segments. (Blue, White, Orange), (Blue, Orange, Yellow), (Blue. Yellow, Red), (Blue, Red, White), (Green, White, Orange), (Green, Orange, Yellow), (Green. Yellow, Red), and (Green, Red, White). In total there are 8$\times$3=24 faces on a Rubik's cube.
There are 8! possible permutations of the corner pieces. Any seven of the corner pieces can be rotated with respect to the eighth giving rise to $3^{7}$ possible positions. Moreover, for any given permutation, the 2x2 cube can be arbitrary oriented in twenty-four different ways, (one way for each face). The faces can therefore be permuted in 3,674,160 ways.
\[\frac{8!\times3^{7}}{24} = 3,674,160\]
The following image depicts all 24 faces of a 2x2 Rubik's cube.
Each of the faces can be uniquely identified given its color and its pairing with the other two colors on the same corner segment. For this algorithm I have labelled the Blue face of the corner segment containing a Blue face, White face, and Orange face as Face ID# = 0. Because the puzzle can be oriented as a whole such that any single face can occupy any one of twenty-four positions it is useful therefore to define an origin relative to which other positions can be in turn be defined. If you were to orient a 2x2 Rubik's cube such that Face ID# = 0 was on the top side and was in the back, left quadrant of this side then Face ID# = 0 could be said to occupy Position ID# = 0. The remaining Face ID#s and Position ID#s are assigned based on the solved state of the puzzle. In the puzzle's solved state the face ID# and the position ID# are the same, i.e. face one occupies position one and face two occupies position two etc. In the proceeding image each face was labeled with a number representing the Position ID# (which is the same as the Face ID#) of the face with respect to the origin.
Every permutation of a 2x2 Rubik's cube can be notated by an array where the index is the Position ID# and the value in that location is the Face ID#. The array for the solved state reads as {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23}
Any four co-planar corner sections can be rotated together as one of six 'sides' in either a clockwise or a counter-clockwise manner for a total of 6$\times$2=12 possible types of rotations. In this algorithm the rotations are intuitively labeled 1 through 12. Each rotation transforms the array in a unique way that is analogous to the act of physically rotating a side of the puzzle. If the puzzle began in a solved state and then a single rotation were performed then the resulting array would be modified to the following states corresponding to each of the twelve unique rotations:
(1) - Rotate Top CW:
{2, 0, 3, 1, 6, 7, 8, 9, 10, 11, 4, 5, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}
(2) - Rotate Top CCW:
{1, 3, 0, 2, 10, 11, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}
(3) - Rotate Bottom CCW:
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18, 19, 12, 13, 14, 15, 16, 17, 22, 20, 23, 21}
(4) - Rotate Bottom CW:
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 12, 13, 21, 23, 20, 22}
(5) - Rotate Front CW:
{0, 1, 15, 7, 4, 5, 6, 20, 16, 8, 2, 11, 12, 13, 14, 21, 17, 9, 3, 19, 18, 10, 22, 23}
(6) - Rotate Front CCW:
{0, 1, 10, 18, 4, 5, 6, 3, 9, 17, 21, 11, 12, 13, 14, 2, 8, 16, 20, 19, 7, 15, 22, 23}
(7) - Rotate Right CW:
{0, 9, 2, 17, 3, 5, 6, 7, 8, 21, 18, 10, 1, 13, 14, 15, 16, 23, 19, 11, 20, 12, 22, 4}
(8) - Rotate Right CCW:
{0, 12, 2, 4, 23, 5, 6, 7, 8, 1, 11, 19, 21, 13, 14, 15, 16, 3, 10, 18, 20, 9, 22, 17}
(9) - Rotate Left CW:
{13, 1, 5, 3, 4, 22, 14, 6, 0, 9, 10, 11, 12, 20, 15, 7, 2, 17, 18, 19, 8, 21, 16, 23}
(10) - Rotate Left CCW:
{8, 1, 16, 3, 4, 2, 7, 15, 20, 9, 10, 11, 12, 0, 6, 14, 22, 17, 18, 19, 13, 21, 5, 23}
(11) - Rotate Back CW:
{11, 19, 2, 3, 12, 4, 1, 7, 8, 9, 10, 23, 13, 5, 0, 15, 16, 17, 18, 22, 20, 21, 6, 14}
(12) - Rotate Back CCW:
{14, 6, 2, 3, 5, 13, 22, 7, 8, 9, 10, 0, 4, 12, 23, 15, 16, 17, 18, 1, 20, 21, 19, 11}
The following image depicts these rotations with numbered gray arrows.
For the purpose of this algorithm, the puzzle is considered to be in an unsolved state if Face ID# = 0 does not occupy Position ID# = 0 even if for each side of the puzzle, the four constituent faces share the same color. This is a trivial limitation and is addressed by first orienting Face ID# = 0 into Position ID# = 0 at the beginning of the algorithm.
If the puzzle is in an unsolved state and Face ID# = 0 occupies Position ID# = 0 then the Face ID# of between four and twenty-one of the faces will not occupy a position with the same Position ID# as the Face #ID.
The following two images represent the same permutation labelled according to its Face ID#s and then by its Position ID#s.
When a side is rotated, 4$\times$3=12 faces move at the same time. This can be seen from the following image that depicts the groupings of three faces corresponding to each corner segment.
Consider, for example, that if rotation 1 is immediately followed by rotation 4 then the entire puzzle will have been rotated about a single axis but afterwards each face will still be relatively situated with respect to other faces in the same manner as before the two rotations. A consecutive pair of rotations with this property is a Frame Shift. A complete list of Frame Shifts is: (1,4), (2,3), (5,6), (7,10), (8,9), (11, 12)
The Algorithm
Step 1.) Begin by orienting the puzzle such that Face ID# = 0 occupies Position ID# = 0 using frame shifts. No more than three Frame Shifts will be required.
Step 2.) Preserve Face ID# = 0 in Position ID# = 0 and move Face ID# = 1 to Position ID# = 1
Step 3.) Preserve the previous position changes for Face ID# = 0 and 1 while moving Face ID# = 2 to Position ID# = 2
Step 4.) Preserve the previous position changes for Face ID# = 0,1 and 2 while moving Face ID# = 3 to Position ID# = 3
The puzzle is now half solved.
Step 5.) Preserve the previous position changes for Face ID# = 0,1,2 and 3 while moving Face ID# = 12 to Position ID# = 12
Step 6.) Preserve the previous position changes for Face ID# = 0,1,2,3 and 12 while moving Face ID# = 13 to Position ID# = 13
Step 7.) Preserve the previous position changes for Face ID# = 0,1,2,3,12 and 13 while moving Face ID# = 11 to Position ID# = 15
If Face ID# 16 is in Position ID# 16 then use this rotation sequence:
(2, 8, 5, 1, 10, 5, 3, 6, 2, 6, 8, 5, 1, 5, 3, 6) *16 rotations*
If Face ID# 17 is in Position ID# 16 then use this rotation sequence:
(8, 1, 5, 3, 9, 2, 6, 8, 1, 5, 3, 9, 2, 6, 8, 1, 5, 3, 9, 2, 6, 2, 8, 5, 1, 10, 5, 3, 6, 2, 6, 8, 5, 1, 5, 3, 6) *37 rotations*
If Face ID# 18 is in Position ID# 16 then use this rotation sequence:
(8, 6, 1, 7, 5, 3, 12, 2, 8, 5, 1, 5, 3, 6, 10) *15 rotations*
If Face ID# 20 is in Position ID# 16 then use this rotation sequence:
(2, 6, 8, 5, 1, 5, 3, 6, 9, 5, 4, 6, 2, 6, 7, 1) *16 rotations*
If Face ID# 21 is in Position ID# 16 then use this rotation sequence:
(8, 1, 5, 3, 9, 2, 6, 8, 1, 5, 3, 9, 2, 6, 8, 1, 5, 3, 9, 2, 6) *21 rotations*
If you find rotation sequences that perform the same purpose as the five above, but in fewer steps, please let me know in the comments section.