---
created_at: '2016-12-17T19:05:26.000Z'
title: God's Number is 20 (2010)
url: http://cube20.org/
author: rishabhd
points: 259
story_text: 
comment_text: 
num_comments: 56
story_id: 
story_title: 
story_url: 
parent_id: 
created_at_i: 1482001526
_tags:
- story
- author_rishabhd
- story_13201910
objectID: '13201910'

---
[Source](http://cube20.org/ "Permalink to God's Number is 20")

# God's Number is 20

# God's Number is 20

R L U2 F U' D F2 R2 B2 L U2 F' B' U R2 D F2 U R2 U Superflip, the first position proven to require 20 moves. 

New [results:][1] God's Number is 26 in the quarter turn metric! 

Every position of Rubik's Cube™ can be solved in twenty moves or less. 

With about 35 CPU-years of idle computer time donated by Google, a team of researchers has essentially solved every position of the Rubik's Cube™, and shown that no position requires more than twenty moves. We consider any twist of any face to be one move (this is known as the half-turn metric.) 

Every solver of the Cube uses an algorithm, which is a sequence of steps for solving the Cube. One algorithm might use a sequence of moves to solve the top face, then another sequence of moves to position the middle edges, and so on. There are many different algorithms, varying in complexity and number of moves required, but those that can be memorized by a mortal typically require more than forty moves. 

One may suppose God would use a much more efficient algorithm, one that always uses the shortest sequence of moves; this is known as [God's Algorithm][2]. The number of moves this algorithm would take in the worst case is called God's Number. At long last, God's Number has been shown to be 20. 

It took fifteen years after the introduction of the Cube to find the first position that provably requires twenty moves to solve; it is appropriate that fifteen years after that, we prove that twenty moves suffice for all positions. 

## A History of God's Number

By 1980, a lower bound of 18 had been established for God's Number by analyzing the number of effectively distinct move sequences of 17 or fewer moves, and finding that there were fewer such sequences than Cube positions. The first upper bound was probably around 80 or so from the algorithm in one of the early solution booklets. This table summarizes the subsequent results. 

| ----- |
| Date | Lower bound | Upper bound |  Gap | Notes and Links |  
| July, 1981 | 18 | 52 | 34 |  Morwen Thistlethwaite proves [52 moves][3] suffice. |  
| December, 1990 | 18 | 42 | 24 |  Hans Kloosterman improves this to [42 moves.][4] |  
| May, 1992 | 18 | 39 | 21 |  Michael Reid shows [39 moves][5] is always sufficient. |  
| May, 1992 | 18 | 37 | 19 |  Dik Winter lowers this to [37 moves][6] just one day later! |  
| January, 1995 | 18 | 29 | 11 |  Michael Reid cuts the upper bound to [29 moves][7] by analyzing [Kociemba's two-phase algorithm][8]. |  
| January, 1995 | 20 | 29 | 9 |  Michael Reid proves that the ''superflip'' position (corners correct, edges placed but flipped) requires [20 moves][9]. |  
| December, 2005 | 20 | 28 | 8 |  Silviu Radu shows that [28 moves][10] is always enough. |  
| April, 2006 | 20 | 27 | 7 |  Silviu Radu improves his bound to [27 moves][11]. |  
| May, 2007 | 20 | 26 | 6 |  Dan Kunkle and Gene Cooperman prove [26 moves][12] suffice. |  
| March, 2008 | 20 | 25 | 5 |  Tomas Rokicki cuts the upper bound to [25 moves][13]. |  
| April, 2008 | 20 | 23 | 3 |  Tomas Rokicki and John Welborn reduce it to only [23 moves][14]. |  
| August, 2008 | 20 | 22 | 2 |  Tomas Rokicki and John Welborn continue down to [22 moves][15]. |  
| July, 2010 | 20 | 20 | 0 |  Tomas Rokicki, Herbert Kociemba, Morley Davidson, and John Dethridge prove that God's Number for the Cube is exactly 20. | 

## How We Did It

How did we solve all 43,252,003,274,489,856,000 positions of the Cube? 

* We partitioned the positions into 2,217,093,120 sets of 19,508,428,800 positions each.
* We reduced the count of sets we needed to solve to 55,882,296 using symmetry and set covering.
* We did not find optimal solutions to each position, but instead only solutions of length 20 or less.
* We wrote a program that solved a single set in about 20 seconds.
* We used about 35 CPU years to find solutions to all of the positions in each of the 55,882,296 sets.

#### Partitioning

We broke the problem down into 2,217,093,120 smaller problems, each comprising 19,508,428,800 different positions. Each of these subproblems was small enough to fit in the memory of a modern PC, and the way we broke it down (mathematically, using cosets of the group generated by {U,F2,R2,D,B2,L2}, or more concisely, cosets of H) allowed us to solve each set rapidly. 

#### Symmetry

If you take a scrambled Cube and turn it upside down, you have not made it any more difficult; it will still take the same number of moves to solve. Instead of solving both of these positions, you can simply solve one, and then turn the solution upside down for the other. There are 24 different ways you can orient the Cube in space, and another factor of two using a mirror, for a total reduction of a factor of [about 48][16] in the number of positions that need solving. Using similar symmetry arguments and by finding a solution to a large "set cover" problem, we were able to reduce the number of sets that needed solving from 2,217,093,120 down to 55,882,296. 

#### Good vs. Optimal Solutions

| ----- |
|  | Random positions | Cosets of H |  
| Optimally | 0.36 |  2,000,000 |  
| 20 moves or less | 3,900 |  1,000,000,000 | 

Solution rate, in positions/second

An optimal solution to a position is one that requires no more moves than is required. Since a position that required 20 moves was already known, we did not need to optimally solve every position; we just needed to find a solution of 20 moves or less for each sequence. This is substantially easier; the table at left show the rate a good desktop PC has when solving random positions. 

#### Fast Coset Solving Program

Using a combination of mathematical tricks and careful programming, we were able to solve a complete coset of H, either optimally, or with sequences of twenty moves or less, on a single desktop PC, at the rates shown in the table at left. 

#### Lots of Computers

Finally, we were able to distribute the 55,882,296 cosets of H among a large number of computers at Google and complete the computation in just a few weeks. Google does not release information on their computer systems, but it would take a good desktop PC (Intel Nehalem, four-core, 2.8GHz) 1.1 billion seconds, or about 35 CPU years, to perform this calculation. 

### What are the Hardest Positions?

| ----- |
| Distance | Count of Positions |  
| 0 | 1 |  
| 1 | 18 |  
| 2 | 243 |  
| 3 | 3,240 |  
| 4 | 43,239 |  
| 5 | 574,908 |  
| 6 | 7,618,438 |  
| 7 | 100,803,036 |  
| 8 | 1,332,343,288 |  
| 9 | 17,596,479,795 |  
| 10 | 232,248,063,316 |  
| 11 | 3,063,288,809,012 |  
| 12 | 40,374,425,656,248 |  
| 13 | 531,653,418,284,628 |  
| 14 | 6,989,320,578,825,358 |  
| 15 | 91,365,146,187,124,313 |  
| 16 | about 1,100,000,000,000,000,000 |  
| 17 | about 12,000,000,000,000,000,000 |  
| 18 | about 29,000,000,000,000,000,000 |  
| 19 | about 1,500,000,000,000,000,000 |  
| 20 | about 490,000,000 | 

We have known for fifteen years that there are positions that require 20 moves; we have just proved that there are none that require more. 

Distance-20 positions are both rare and plentiful; they are rarer than one in a billion positions, yet there are probably more than one hundred million such positions. We do not yet know exactly how many there are. The table on the right gives the count of positions at each distance; for distances 16 and greater, the number given is just an estimate. Our research has confirmed the prior results for entries 0 through 14 below, and the entry for 15 is a new result, which has since been independently confirmed by another researcher. 

To date we have found about twelve million distance-20 positions. The following position was the hardest for our programs to solve: 

F U' F2 D' B U R' F' L D' R' U' L U B' D2 R' F U2 D2 The hardest position for our programs. 

### Source Released

You may examine [our source code][17], or even rerun part of the proof on your own computer. 

### Known Distance-20 Positions Released

You can download our list of known distance-20 positions [here][18]. 

### Site Content

This site contains some additional content pertaining to computer cubing and the mathematics of the cube. 

* Our [announcement of God's Number in the quarter-turn metric.][19]
* [A copy of the old CubeLovers mailing list][20] that was active from 1980 to 1999 and contains many fascinating messages.
* Results of [solving all symmetric positions of the cube][21] in both the half-turn and quarter-turn metric.
* Some [results on Rubik's Clock][22] including a full state space exploration.
* [Source code][17] for the half-turn God's Number result on this page (quarter-turn code to follow).
* All known [hard positions][18] in both the half-turn and quarter-turn metric.

### Contact

Our group consists of Tomas Rokicki, a programmer from Palo Alto, California, Herbert Kociemba, a math teacher from Darmstadt, Germany, Morley Davidson, a mathematician from Kent State University, and John Dethridge, an engineer at Google in Mountain View. Email may be sent to rokicki@gmail.com or to davidson@math.kent.edu. 

Rubik's Cube is a registered trademark of Seven Towns, Ltd.  
Thanks to Lucas Garron for writing the Cube animator on this page. 

[1]: http://cube20.org/qtm/
[2]: http://en.wikipedia.org/wiki/God%27s_algorithm
[3]: http://www.jaapsch.net/puzzles/thistle.htm
[4]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/michael_reid__an_upper_bound_on_god%27s_number.html
[5]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/michael_reid__new_upper_bound.html
[6]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/Dik_T._Winter__New_upper_bound_on_God%27s_algorithm_for_Rubik%27s_cube.html
[7]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/michael_reid__new_upper_bounds.html
[8]: http://www.jaapsch.net/puzzles/compcube.htm#kocal
[9]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/michael_reid__superflip_requires_20_face_turns.html
[10]: http://cubezzz.dyndns.org/drupal/?q=node/view/37
[11]: http://cubezzz.dyndns.org/drupal/?q=node/view/53
[12]: http://www.northeastern.edu/nupr/news/0507/rubik.html
[13]: http://arxiv.org/abs/0803.3435
[14]: http://cubezzz.dyndns.org/drupal/?q=node/view/117
[15]: http://www.springerlink.com/content/q088143tn805k124/
[16]: http://www.math.rwth-aachen.de/~Martin.Schoenert/Cube-Lovers/Dan_Hoey__The_real_size_of_cube_space.html
[17]: http://cube20.org/src
[18]: http://cube20.org/distance20s
[19]: http://cube20.org/qtm
[20]: http://cube20.org/cubelovers
[21]: http://cube20.org/symmetry
[22]: http://cube20.org/clock

