Monday, January 09, 2006

Sudoku

At some point over the past couple of months, someone introduced my wife to Sudoku. For the uninitiated, Sudoku is a puzzle where your are given a 9x9 box with some of the boxes filled in. A successful solution will use those numbers to fill each row, column and 3x3 box (top left, top middle, top right, ...) with the numbers 1-9. Here's a sample solution

123456789
456789123
789123456
231645978
564978312
897312645
312564897
645897231
978231564

In general, the more numbers they fill in, the easier the puzzle is. For example, if I only remove one number from the solution above,

X23456789
456789123
789123456
231645978
564978312
897312645
312564897
645897231
978231564

it is trivial to figure out what number is missing (1).

So, I've been trying to figure out how many unique solutions there are. For every unique solution there are 6^8*2 or 3359232 related solutions. I get this by taking a solution

123456789
456789123
789123456
231645978
564978312
897312645
312564897
645897231
978231564

and switching the first two columns

213456789
546789123
879123456
321645978
654978312
987312645
132564897
465897231
798231564

and you can check that it still works. You can permute the first three columns in six different ways. Then the second three and the third three. And then you can do the same thing by permuting the groups of columns. You can also do the same thing with rows

546789123
213456789
879123456
321645978
654978312
987312645
132564897
465897231
798231564

And then I'm not sure but I'm pretty sure that there is another related solution reflected across the diagonal. So 6 * 6 * 6 * 6 * 6 * 6 * 6 * 6 * 2. But this assumes that all of these are unique solutions,

Greater minds than mine have already attempted this problem: Mathmatics of Sudoku. But that isn't going to stop me from thinking about it.

It would seem that each puzzle has a finite number of unique signatures - combinations of givens that points to a particular solutions. But given that there are apparently 6x10^22+ solutions, it seems unlikely that the signatures will every be known.

2 Comments:

Anonymous Anonymous said...

There's an interesting page on the mathematics of sudoku here:

http://theory.tifr.res.in/~sgupta/sudoku/algo.html

12:54 AM  
Blogger Steven Van Vaerenbergh said...

Someone should count the number of colour sudokus as well :-p

10:22 AM  

Post a Comment

<< Home