Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

number of possible sudoku puzzles [closed]

Wiki http://en.wikipedia.org/wiki/Mathematics_of_Sudoku says Sudoku has 6,670,903,752,021,072,936,960 possible permutations.I tried to find out but it seems difficult.Can someone tell me how this number is calculated.

like image 808
Jagan Avatar asked Aug 11 '11 08:08

Jagan


3 Answers

You can find all about it in this Wiki: http://en.wikipedia.org/wiki/Mathematics_of_Sudoku.

"the number of valid Sudoku solution grids for the standard 9×9 grid was calculated by Bertram Felgenhauer and Frazer Jarvis in 2005 to be 6,670,903,752,021,072,936,960 . This number is equal to 9! × 722 × 27 × 27,704,267,971, the last factor of which is prime. The result was derived through logic and brute force computation."

like image 109
Valli Avatar answered Oct 13 '22 02:10

Valli


You can read the most recent rewrite of the original publication by Bertram Felgenhauer and Frazer Jarvis : Mathematics of Sudoku, it details the computation over 7 pages. The calculation actually isn't trivial (the idea being to enumerate distinct and valid Sudoku grids, rather than all possible arrangements of digits over a 9x9 grid).

like image 23
Francois G Avatar answered Oct 13 '22 02:10

Francois G


Interestingly there was an estimation of the number of possible sudokus posted in an internet forum before the actual value was calculated and published by Felgenhauer & Jarvis. The author of the post points out that there are some unproven assumptions in his guess. But the estimated value differs by 0.2% from the actual value published later.

In this Wiki you can find some estimation of other types of sudoku based on similar guesses.

Here is the full post from The New Sudoku Players' Forum:

by Guest » Fri Apr 22, 2005 1:27 pm

Lets try this from a whole different direction:

Step A:
Pretend that the only 'rule' was the 'block' rule, and that the row and column rules did not exist. Then each block could be arranged 9! ways, or 9!^9 ways to populate the puzzle (1.0911*10^50 'solutions').

Step B1:
If we then say 'let us add a rule about unique values in a row', then the top three blocks can be filled as follows:
Block 1: 9! ways
Block 2: 56 ways to select which values go in each 3-cell row, and 3! ways to arrange them (remember that we haven't invented a column rule yet).
Block 3: with 1 and 2 filled, the values that go in each row is now defined, but each row can be arranged 3! ways.
Therefore, we have 9! * 56 * 3!^6 ways to fill the top three blocks, and this value cubed to fill all nine blocks. (or 8.5227*10^35 solutions). Note that this represents a 'reduction ratio' (denoted as R) of 1.2802*10^14, by adding this one new rule.

Step B2: But we could have just as easily added a 'unique in columns' rule, and achieved the same results downward instead of across, with the same value of R.

Step C: (and here is where my solution is not rigorous) What if we assume that each of these rules would constrain the number of valid solutions by exactly the same ratio? Then there would be a combined reduction ratio of R^2. So the intitial value of 1.0911*10^50 solutions would reduce by a factor of R^2, or 1.639*10^28, leaving 6.6571*10^21 valid solutions.

This post and the account are attributed to Kevin Kinfoil (Felgenhauer & Jarvis).


Additional notes

Assume the Block 1 is

1 2 3
4 5 6
7 8 9

Then we have the following possibilities for Block2, if we ignore the order of the rows

1 2 3    4 5 6
4 5 6    7 8 9
7 8 9    1 2 3
  this is 1 possibility

1 2 3    7 8 9 
4 5 6    1 2 3 
7 8 9    4 5 6
  this is 1 possibility

1 2 3    two of 4,5,6, one of 7,8,9                                      3*3
4 5 6    the two remaining of 7,8,9, one of 1,2,3                         3
7 8 9    the two remaining of 1,2,3, the remaining of (two of 4,5,6)      1
                                                these are (3*3)*3*1=27 possibilities

1 2 3    two of 7,8,9, one of 4,5,6                                      3*3
4 5 6    two of 1,2,3, the remaining of 7,8,9                             3
7 8 9    the two remaining of 4,5,6, the remaining of two of 1,2,3        1
                                                these are (3*3)*3*1=27

So all in all these are 1+1+27+27=56 possibilities.

like image 35
miracle173 Avatar answered Oct 13 '22 01:10

miracle173