Learn R Programming

permutations (version 1.1-5)

megaminx: megaminx

Description

A set of generators for the megaminx group

Arguments

Author

Robin K. S. Hankin

Details

Each element of megaminx corresponds to a clockwise turn of 72 degrees. See the vignette for more details.

megaminx[, 1]WWhitemegaminx[, 2]
PuPurplemegaminx[, 3]DY
Dark Yellowmegaminx[, 4]DBDark Blue
megaminx[, 5]RRedmegaminx[, 6]
DGDark Greenmegaminx[, 7]LG
Light Greenmegaminx[, 8]OOrange
megaminx[, 9]LBLight Bluemegaminx[,10]
LYLight Yellowmegaminx[,11]Pi
Pinkmegaminx[,12]GyGray

Vector megaminx_colours shows what colour each facet has at start. Object superflip is a megaminx operation that flips each of the 30 edges.

These objects can be generated by running script inst/megaminx.R, which includes some further discussion and technical documentation and creates file megaminx.rda which resides in the data/ directory.

See Also

megaminx_plotter

Examples

Run this code

data(megaminx)
megaminx
megaminx^5  # should be the identity
inverse(megaminx)  # turn each face anticlockwise


megaminx_colours[permprod(megaminx)]  # risky but elegant...

W    # turn the White face one click clockwise (colour names as per the
     # table above)


megaminx_colours[as.word(W,129)]      # it is safer to ensure a size-129 word;
megaminx_colours[as.word(W)]          # but the shorter version will work


# Now some superflip stuff:

X <- W * Pu^(-1) * W * Pu^2 * DY^(-2) 
Y <- LG^(-1) * DB^(-1) * LB * DG      
Z <- Gy^(-2) * LB * LG^(-1) * Pi^(-1) * LY^(-1)


sjc3 <- (X^6)^Y * Z^9  # superflip (Jeremy Clark)


p1 <- (DG^2 * W^4 * DB^3 * W^3 * DB^2 * W^2 * DB^2 * R * W * R)^3
m1 <- p1^(Pi^3)

p2 <- (O^2 * LG^4 * DB^3 * LG^3 * DB^2 * LG^2 * DB^2 * DY * LG * DY)^3
m2 <- p2^(DB^2)

p3 <- (LB^2 * LY^4 * Gy * Pi^3 * LY * Gy^4)^3
m3 <- p3^LB

# m1,m2 are 32 moves, p3 is 20, total = 84

stopifnot(m1+m2+m3==sjc3)




Run the code above in your browser using DataLab