The purpose of this page is not so much to explain how to solve the Rubik's cube but to try to explain how one can use mathematics to model the Rubik's cube, and related puzzles. The first few definitions below try to put the Rubik's cube on a firmer mathematical foundation by defining a permutation puzzle, such as the Rubik's cube, in the context of combinatorial game theory. Some links to web pages on related puzzles and topics are given below, followed by a short explanation of my MAPLE (a commercial computer algebra and graphics program) code for the 3x3 and 4x4 Rubik's cube.

A one person game is a sequence of moves following certain rules satisfying

A permutation puzzle is a one person game (solitaire) with the following five properties listed below. Before listing the properties, we define the puzzle position to be the set of all possible legal moves. The five properties of a permutation puzzle are:
  1. for some n > 1 depending only on the puzzle's construction, each move of the puzzle corresponds to a unique permutation of the numbers in T = {1, 2, ..., n},
  2. if the permutation of T in (1) corresponds to more than one puzzle move then the the two positions reached by those two respective moves must be indistinguishable,
  3. each move, say M, must be "invertible" in the sense that there must exist another move, say M-1, which restores the puzzle to the position it was at before M was performed,
  4. if M1 is a move corresponding to a permutation f1 of T and if M2 is a move corresponding to a permutation f2 of T then M1*M2 (the move M1 followed by the move M2) is either

This page contains information about such puzzles.

My MAPLE code for the rubik's cube is included in release 5 and later of MAPLE's share library. Recently, Werner Knoben, at RWTH Aachen, Lehrstuhl II fuer Mathematik, combined all my packages (including, as well, the megaminx, masterball, pyraminx, skewb, ... maple simulations) and added some of his own into one large package for Maple 6. His site for this new package is at (This link seems to be dead.) All of them are included in the file

Werner's installation instructions:
If you unzip, you find a directory containing three further directories and four files. The file installrubik.bat is an installation file to install the rubiks package on a windows computer. To use this file to install the package you must adapt the Maple 6 path and the path of the rubiks package (e.g. c:\rubik). If you have a unix or a linux computer, you can use the Makefile to install the rubiks package. Here, you must change the Maple 6 path and the path to the rubik directory, too. Both installrubik.bat and the Makefile activates the file makerubik.mpl. Here, you must adapt the pathvariable of your rubik directory, too. The name of the pathvariable, you must change is "rubikpath". You don't have to change anything else in this file. Last but not least, there is a file rubikhelp.mpl. This is a file to install the helppages. The file makerubik.mpl activates this file. If you use a windows computer, just click twice on the file install.bat, if you have a linux or a unix computer open a terminal window change to the rubik directory and type make. Furthermore, there are three directories. The directory with the name lib contains the rubik lib files, the directory with the name src contains the source code of the package and the directory web contains the html pages of the package.

Here are some interesting educational links. There are all free and non-commercial. (I cannot and will not post commercial links on this site so don't ask!)

3x3 and 4x4 Rubik's cube

There is a MAPLE implementation of both the 3x3 and 4x4 Rubik's cube. The commands were purposefully designed to be very similar with the rainbow package. The MAPLE text file for the 3x3 package is rubik3 (~12K) and for the 4x4 package : rubik4 (~22K).

Some MAPLE rubik3 commands are in the example text file and some example MAPLE worksheets using this package are in rubik3 pretty patterns.

  1. A text file containing a very brief description of the strategy and moves I use to solve the cube by hand are in solution .
  2. Here are some pictures of some MAPLE 3d plots created using rubik:
    1. solved 3x3 cube (front) (~19K)
    2. solved 3x3 cube (back) (~16K)
    3. an edge 2-cycle with a flip (~18K)
  3. Some MAPLE rubik4 commands are in the example text file . A MAPLE worksheet using this package:
    rubik4 help/examples
  4. A text file containing the strategy and moves I use to solve the 4x4 cube by hand are in solution .
  5. Here are some pictures of some MAPLE 3d plots created using rubik4:
    1. solved 4x4 cube (front) (~17K)
    2. solved 4x4 cube (back) (~17K)
    3. solved 4x4 cube (view from below) (~20K)
    4. 2-cycle on edges (~19K) (also moves some centers but no corners or other edges - due to Thai)
    5. 3-cycle on centers (front view) (~18K) (moves no other facets - due to J. Adams )
    6. 3-cycle on centers (side view) (~22K)


This background was found at the now dead link,

Last updated 6-22-2007.

Created by wdj

Mathematics Department