## Thursday, 27 November 2008

### god's algorithm(plz read even if it is long)

relates to rubik's cube... have fun reading

## The cube in numbers

A standard ‘3x3x3’ Rubik’s Cube has 6 coloured sides, 21 pieces and 54 outer surfaces.

This means there are more than 43 quintillion possible configurations, or 43,252,003,274,489,856,000 to be exact. But there is only one solution.

"God’s algorithm is the name given to the formula for solving the cube in the least possible number of moves."

Allowing a second for each turn, it would take 1400 trillion years to go through all the possible configurations. By comparison, the universe is around 13 billion years old.

Widely used in schools and universities, the Rubik’s Cube can help explain complex particle physics and mathematical algorithms.

‘God’s algorithm’ is the name given to the formula for solving the cube in the least possible number of moves. Scientists put this figure at 25.

## The mathematics of the 3x3 Cube

As the centre pieces of each face of the Cube do not move, the total number of possible configurations is calculated by multiplying the number of possible arrangements of the corner pieces by the number of possible arrangements of edge pieces.

There are 8 corner pieces, so the number of possible arrangements equals 8! (or 8x7x6x5x4x3x2x1), which is 40320. Each corner piece has 3 different orientations, so this figure must be multiplied by 38 (3x3x3x3x3x3x3x3), which equals 6561. But when the Cube is almost complete, the number of possible moves diminishes, so the equation must be adjusted. In this case, once the second from last corner piece is placed, the last piece can have only one automatic orientation, so 6561 must be divided by 37, which is 2187. Finally, the total possible arrangements of corner pieces

40320 x 2187 = 88,179,840.

With the 12 Edge Pieces, the number of possible arrangements equals 12! (12x11x10…), which is 479,001,600. However, unlike corner pieces, it is impossible to exchange just two edge pieces, so once the third from last is placed, the remaining two can have only one possible arrangement, which means this figure must be divided by 2, leaving 239,500,800. Each edge piece has two different orientations, so this must now be multiplied by 212, which gives 6561. This figure must also be adjusted because once the third from last edge piece is placed, one of the remaining two can be reoriented but the last will always have a fixed orientation in relation to it. So 6561 must be divided by 211, which is 2048. Finally, the total possible arrangements of edge pieces

239,500,800 x 2048 = 490,497,638,400.

So the total possible arrangements of Rubik's Cube

88,179,840 x 490,497,638,400 = 43,252,003,274,489,856,000.

Or, to put it another way,

4.3 times 10 to the power of 19.

(p/s: just read it ok, it done no harm to your brain)