The Rubik's Cube has 8 corners, and each corner has 3 stickers. A corner can be in 1 of 3 orientations, i.e. any of the three stickers can point up, giving $3^8$ possible permutations of the corner orientations.
However, 1/3 of those permutations are unreachable (more detail here). It's not possible, for example, to disorient one corner. So, there are $3^7$ reachable permutations of the corner orientations.
As an aside, there are 8! arrangements of the corners, so there are $8!*3^7$ possible permutations of the positions and orientations of the corners.
What I can't figure out is how many ways the pieces in the corner positions can be oriented. Instead of looking at the ways the corner pieces--the red-blue-yellow, red-green-yellow, red-green-white, etc.--can be oriented, I want to know how many ways the pieces in the up-left-back, up-right-back, up-right-front, etc. positions can be oriented.
As an example, I'll arbitrarily define a corner cubie as "oriented" if it has a red or orange sticker facing up or down, rotated once if it has a yellow or white sticker pointing up or down, or rotated twice if it has an blue or green sticker pointing up or down. Thus, rotating the UP or DOWN face does not change the orientation of any corner cubies, whereas twisting any of the other four sides changes the orientation of four corner cubies.
I'll also arbitrarily index the corners cubies and positions as follows:
0 1 2 3 4 5 6 7
ULB URB URF ULF DLF DLB DRB DRF
RBY RGY RGW RBW OBW OBY OGY OGW
(In the solved state, the up-left-back position is occupied by the red-blue-yellow cubie, ..., and the down-right-front position is occupied by the orange-green-white cubie.)
So, twisting the FRONT face 90 degrees changes the orientation of four corners, 2, 3, 4, and 7. Subsequently twisting the TOP face 90 degrees, note that the permutation of the orientations of the corner cubies remains the same; however, the orientations of the positions change. E.g. the RBY (0) cubie is still oriented, but the cubie in position ULB (0) is now disoriented.
By position, then, how many ways can the orientations be permuted? For what it's worth, I've empirically found the number to be 6,513. I would like to verify mathematically that that number is correct.
Edit: Here's a snippet of code that illustrates what I'm looking for.
// Permutation of the orientations of the pieces occupying the
// 8 corners.
array<uint8_t, 8> cornerOrientations =
{
iCube.getCornerOrientation(CORNER_POSITION::ULB),
iCube.getCornerOrientation(CORNER_POSITION::URB),
iCube.getCornerOrientation(CORNER_POSITION::URF),
iCube.getCornerOrientation(CORNER_POSITION::ULF),
iCube.getCornerOrientation(CORNER_POSITION::DLF),
iCube.getCornerOrientation(CORNER_POSITION::DLB),
iCube.getCornerOrientation(CORNER_POSITION::DRB),
iCube.getCornerOrientation(CORNER_POSITION::DRF)
};
// Treated as a base-3 number, converted to base-10.
uint32_t permInd =
cornerOrientations[0] * 2187 +
cornerOrientations[1] * 729 +
cornerOrientations[2] * 243 +
cornerOrientations[3] * 81 +
cornerOrientations[4] * 27 +
cornerOrientations[5] * 9 +
cornerOrientations[6] * 3 +
cornerOrientations[7];
return permInd;
Versus:
// Permutation of the orientations of the 8 corner pieces.
array<uint8_t, 8> cornerOrientations =
{
iCube.getCornerOrientation(CORNER_PIECE::RBY),
iCube.getCornerOrientation(CORNER_PIECE::RGY),
iCube.getCornerOrientation(CORNER_PIECE::RGW),
iCube.getCornerOrientation(CORNER_PIECE::RBW),
iCube.getCornerOrientation(CORNER_PIECE::OBW),
iCube.getCornerOrientation(CORNER_PIECE::OBY),
iCube.getCornerOrientation(CORNER_PIECE::OGY),
iCube.getCornerOrientation(CORNER_PIECE::OGW)
};
// Treated as a base-3 number, converted to base-10.
uint32_t permInd =
cornerOrientations[0] * 2187 +
cornerOrientations[1] * 729 +
cornerOrientations[2] * 243 +
cornerOrientations[3] * 81 +
cornerOrientations[4] * 27 +
cornerOrientations[5] * 9 +
cornerOrientations[6] * 3 +
cornerOrientations[7];
return permInd;
Note the CORNER_PIECES
and CORNER_POSITIONS
. For CORNER_PIECES
I calculate (and empirically find) $3^7$ permutations. For CORNER_POSITIONS
I empirically find 6513 permutations with a breadth-first search to depth 9, but don't understand why.