Rubiks Cube/Tuple: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 1: | Line 1: | ||
=4x4 Rubiks Cube Representation= | =4x4 Rubiks Cube Representation= | ||
==Types of Pieces== | |||
To represent the 4x4 cube as a permutation, so that we can move toward a permutation algebra for 4x4 Rubiks Cubes, we have to think about the cube as being composed of three separate types of pieces: | |||
* 8 corner pieces, 3 orientations each | |||
* 24 squares, 6 of each color in groups of 4 | |||
* 12 left dedge pieces, 12 right dedge pieces | |||
(Note: dedge = double edge) | |||
While we can think about the 24 center squares and 24 dedge pieces as being as simple to represent as two 24-tuples, the 8 corner pieces require a bit more care. | |||
We might think of representing the corners using an integer to indicate which of the 8 corner pieces a piece is, and a second tuple that would represent the orientation of each corner piece, with 0, 1, 2 labeling some predetermined (but ultimately arbitrary) scheme of corner orientations. Thus, a solved cube might be represented as: | |||
(1 2 3 4 5 6 7 8) (0 0 0 0 0 0 0 0) | |||
while a cube with corners mixed up might look something like: | |||
(2 1 4 3 8 7 5 6) (1 2 2 0 1 0 2 2) | |||
The difficulty is that one tuple has a single integer per item (no repeats), while the other can have any number per item (with repeats). | |||
Instead, what we'll do is waste some space, and make the tuple representation longer, to simplify the representation. | |||
Consider a single corner - the white, red, green corner. This corner can be represented using a 3-tuple, with a letter for each face: | |||
(W R G) (G W R) (R G W) | |||
So an alternative representation of the corners is to use a 3-tuple for each corner, with the orientation specified by which of the three-tuples represents the corner. | |||
==Specifying Cube State== | |||
We must specify an order for our tuple to represent the cube state. We define the following arbitrary ordering: | |||
The '''corners''' are labeled by the tuple first. Each corner is represented by three slots, which are the three colors of the cube specified in clockwise order, starting with the upper or downward face. Thus, WRG means the upper face is white, then the face to the bottom right is red, then the face to the bottom left is green. | |||
It is easiest to orient the cube as U = WHITE, F = GREEN, R = RED | |||
=Flags= | =Flags= | ||
Revision as of 05:06, 9 January 2018
4x4 Rubiks Cube Representation
Types of Pieces
To represent the 4x4 cube as a permutation, so that we can move toward a permutation algebra for 4x4 Rubiks Cubes, we have to think about the cube as being composed of three separate types of pieces:
- 8 corner pieces, 3 orientations each
- 24 squares, 6 of each color in groups of 4
- 12 left dedge pieces, 12 right dedge pieces
(Note: dedge = double edge)
While we can think about the 24 center squares and 24 dedge pieces as being as simple to represent as two 24-tuples, the 8 corner pieces require a bit more care.
We might think of representing the corners using an integer to indicate which of the 8 corner pieces a piece is, and a second tuple that would represent the orientation of each corner piece, with 0, 1, 2 labeling some predetermined (but ultimately arbitrary) scheme of corner orientations. Thus, a solved cube might be represented as:
(1 2 3 4 5 6 7 8) (0 0 0 0 0 0 0 0)
while a cube with corners mixed up might look something like:
(2 1 4 3 8 7 5 6) (1 2 2 0 1 0 2 2)
The difficulty is that one tuple has a single integer per item (no repeats), while the other can have any number per item (with repeats).
Instead, what we'll do is waste some space, and make the tuple representation longer, to simplify the representation.
Consider a single corner - the white, red, green corner. This corner can be represented using a 3-tuple, with a letter for each face:
(W R G) (G W R) (R G W)
So an alternative representation of the corners is to use a 3-tuple for each corner, with the orientation specified by which of the three-tuples represents the corner.
Specifying Cube State
We must specify an order for our tuple to represent the cube state. We define the following arbitrary ordering:
The corners are labeled by the tuple first. Each corner is represented by three slots, which are the three colors of the cube specified in clockwise order, starting with the upper or downward face. Thus, WRG means the upper face is white, then the face to the bottom right is red, then the face to the bottom left is green.
It is easiest to orient the cube as U = WHITE, F = GREEN, R = RED
Flags