loading...
Not run yet: solves 100 random scrambles and plots the solution lengths.
running...
How to use
Read the net: the unfolded cube shows U on top, then L F R B in a row and D below. Click a face centre to turn that face clockwise (Shift-click or right-click: anticlockwise). Click any other sticker to inspect the piece: which cubie sits in that slot and how it is twisted or flipped.
Keyboard: U R F D L B M E S x y z turn the matching layer (Shift = anticlockwise), Space plays or pauses the solution, Backspace undoes your last move, or type notation such as R U R' U'.
Try this: (1) Scramble, press Solve, and step through the solution with the Step buttons while watching the graphs: stickers-home climbs, and corners and edges come home. (2) Tick Mark stickers that are on their own face. (3) Click a corner, then turn U and watch its twist coordinate change. (4) Load Checkerboard. (5) Run the 100-scramble experiment to see the distribution of solution lengths.
The 3D version with a Blender-made desk scene is one click away: use the Switch to 3D button.
The science
The cube as a group. A 3x3x3 cube has 8 corner cubies and 12 edge cubies; the 6 centres are fixed to the core. A move permutes cubies and twists corners (3 states) and flips edges (2 states). Counting the positions that real turning can reach:
|G| = 8! · 37 · 12! · 211 / 2 = 43,252,003,274,489,856,000
The factors 37 and 211 appear because the last corner twist and the last edge flip are forced (sum of twists = 0 mod 3, sum of flips = 0 mod 2), and the final 1/2 is the parity law: corner and edge permutations always have the same parity. The page checks all three invariants after random turns.
Representation. The state is the colour of 54 facelets. Every move (U, R, F, D, L, B; wide u r f d l b; slices M E S; rotations x y z; suffix ' or 2) is a fixed permutation of those 54 positions, derived here from 3D geometry: a quarter turn is a rotation by −90 degrees about the outward normal of the layer,
v' = n (n·v) − n × v (clockwise seen from outside)
Coordinates. The solver converts the facelets to cubie coordinates: corner twist (37 = 2187 values), edge flip (211 = 2048), and which 4 of the 12 edge slots hold the middle-layer edges (C(12,4) = 495). They appear in the live readout and are zero exactly when the cube is in the subgroup used by phase 2.
Two-phase solving (Kociemba). Phase 1 uses all 18 turns to bring twist, flip and slice coordinates to zero, i.e. into the subgroup H = 〈U, D, R2, L2, F2, B2〉. Phase 2 stays inside H, permuting corners (8! = 40,320), the 8 non-middle edges (40,320) and the 4 middle edges (24). Both phases use iterative-deepening A* with lower bounds taken from pruning tables built by breadth-first search (twist x slice 1,082,565 entries, flip x slice 1,013,760, corners x slice-order 967,680, edges x slice-order 967,680). The search keeps improving the answer until the time budget is used.
length = L1 + L2, IDA*: expand while g + h(state) ≤ bound, h = max of two table distances
Honest limits. The solver is not optimal: it usually returns 19-22 half-turn-metric moves. The true worst case, "God's number", is 20 moves (Rokicki, Kociemba, Davidson, Dethridge 2010, about 35 CPU-years of search); the superflip preset needs exactly 20, and this solver typically finds 22 for it. Scrambles are random move sequences, not uniformly random states, so the batch histogram is representative rather than a statistical sample of the group. Turn animations are kinematic (no friction, no mechanical jamming) and the solve timer is a plain stopwatch, not a competition-grade one. Metrics: HTM counts every face turn (R, R', R2 = 1); QTM counts R2 as 2.
Independent checks run in the page. (1) All 18 face turns have the correct order. (2) The sequence R U returns to solved only after 105 repetitions and R U2 D' B D' after 1260, the known largest element order. (3) Breadth-first search from the solved cube must give exactly 3,240 positions at depth 3 and 43,239 at depth 4 (the published values 18, 243, 3,240, 43,239). (4) The group-order formula is evaluated with exact integers. (5) The twist/flip/parity invariants hold after random turns. (6) After every solve, replaying scramble + solution must give the solved cube.