kjellfp wrote:PatmaxDaddy wrote:More on estimating N(4x4):

Back on April 22 "tinfoil" gave a method for estimating N(3x3) that produced 6.6571e21, which, although it wasn't known at the time, is only about 0.2% off of the correct value. This method easily generalizes to any size Sudoku grid:

- Code: Select all
` 2k`

b(k)

N(k x k) = -----------

2 k(k-2)

(k )!

where b(k) is the total number of solutions for band 1 when box 1 contians one fixed permutation of symbols.

Nice generalization, this can be used on nxm-sudoku for every n and m, and becomes a generalization of my 3xn-estaimates in

http://forum.enjoysudoku.com/viewtopic.php?t=44&start=412 and

http://forum.enjoysudoku.com/viewtopic.php?t=44&start=416. (What a coincidence on the url: 44 and 416...

)

In general: Let b(n,m) be the number of ways to create the bands of nxm boxes (that is n rows, m columns in each box, n boxes in a band). To make the formula clearer, I say any band, regardless of symbol permutation in the first box.

Then the estimate of numbers of nxm-sudoku is

- Code: Select all
` m n`

b(n,m) * b(m,n)

N(n x m) = -----------------

nm

(nm)!

This is how: Let X be the space of (nm)x(nm)-grids built by legal sudoku bands, but with no attention put on wether the columns follow the rules of Sudoku. The size of X is b(n,m)^m. Let also Y be the set of grids built by legal stacks with no attention put on the rows, #Y is then b(m,n)^n.

The nxm-sudoku grids are then the intersection of X and Y. A random x in X and y in Y are identical in a given box with probability (nm)!, and under the assumption that these probabilities are independent for each box, we arrive at the estimate above.

Btw. you should be credited for the number of legal bands in 4x4-sudoku in the Wikipedia M.o.S-page, though you didn't spell it out. It's just 16!*b(4) = 973038982740573238251518542982676480000 [Edit: I have now put you on M.o.S]

The reduction factor (n*n!)^n*n suggest no independence. For including a certain dependence, I tried (n*n! - f(n))^n*n.

Now, for n=1 f(n)= 0.

For n=2 f(n)= 3/4 reduces the error from 11.1% to 0.925%

For n=3 f(n) = 3/4*128 = 96 reduces the error from 0.207% to 0.031%

I suggest f(n) = (3/4)*(n-1)^(n*n - 2)

but I am missing a good heuristic argument for it.

B.t.w. the correction will be slowing down very fast for larger n.

For n=5 the number of Sudoku solutions is

4.36478 90633 27 E308 for f(5) = 0 and

4.36478 9063699 E308 for(5) according to the above suggestion

At least, the suggestion for f(n) helps in knowing how many of the most significant digits are correct, iff we can give a heurictic argument for f(n).