## Su-Doku's maths

Everything about Sudoku that doesn't fit in one of the other sections
Red Ed wrote:
dukuso wrote:the solution is the sum over some different counts.
So it can have any factor or not. Only the factors which are
in all summands can be explained.
That's not quite true: it's the sum of a bunch of numbers divided by 3359232. It's enough of an achievement that the result is an integer: I'd be quite impressed to see any factors explained away.

**several methods to get the result as a sum. And the GCD of the
** summands is quite large

We shouldn't get excited about the large prime; it's to be expected:
http://www.mail-archive.com/mersenne@base.com/msg03890.html

dukuso wrote:The 5e9 number has not been verified AFAIK.
You're right this hasn't been verified: Frazer and I were hoping you'd do it!

dukuso wrote:Frazer got another number than I for the T-classes
Really? What answer did you get? And how? (in gory detail please: I sometimes find your short-and-clever posts a little hard to follow ...)

... maybe because I'm referring to other posts which I had in mind,

http://www.setbb.com/phpbb/viewtopic.php?t=194&mforum=sudoku

I uploaded a list of 829 T-invariant sudokus and challenged people
to find some others, which had to exist, when yours and
Frazers calculations are both correct.

Hmm, only 829 out of 5e9 are invariant for transposition,
can that be explained ? Are there estimates ?
Examining some million random grids should have some
t-invariants among them, if Frazer's calculation is correct.

how to translate "gory" here ?
dukuso

Posts: 479
Joined: 25 June 2005

Guenter,

in an effort to understand why you are reporting conflicting results to those obtained by Frazer and me, I've been re-reading some old postings: (http://forum.enjoysudoku.com/viewtopic.php?t=44&start=267)
absolutely ages ago dukuso wrote:Let S be the collection of the 84 subsets of {1,..,9} of size 3.
Let T be the collection of the 4741632000 9-tupels (S1,..,S9)
with members from S such that
S1+S2+S3=S4+S5+S6=S7+S8+S9={1,2,3,4,5,6,7,8,9} ,
where "+" is set-union.
Let 2 members from T be equivalent if one can be obtained
from the other by one of the known obvious 6^4*9! operations.
Then we get the collection E of the known 44 minimal elements from T,
one from each equivalence class, called "the gang of the 44".
For M in T let C(M) be its equivalent representative in E.
For M in E let Z(M) be the size of its equivalence class.
For M in E let N(M) be the number of partial 3*9 sudoku grids
compatible with M with respect to the 6^9 operations
of permuting inside a column.
The 2*44 values of N(M),Z(M) are constant within one class and
can be calculated quickly.
I started coding this up and got stuck trying to calculate the equivalence class sizes, Z(.), "quickly". My naive implementation looks like it will take hours to do the job. Do you have a quicker method and, if so, what is it?

Also, I remain unclear about exactly which figures you are disputing. The post I quoted from above goes on to say
How can we calculate the total number of sudoku-classes
as defined by RedEd but discarding transposition
with this method ?

sum over all M in E,
over all (M,A,B) in U(M)
of Z(M)*Q(M)*Q(C(A))*Q(C(B))
gives 19859770556
which is nearly double the 10945437157 that Frazer calculated. I can't believe this is correct, as it would say that, on average, a "random" grid is left essentially unchanged by 1.81 elements of the group; i.e. the identity element plus probably at least one other. Frazer's result, by contrast, says that there's roughly a 1 in 20000 chance that a random grid will have a non-identity group action that leaves it essentially unchanged. To me, this feels far more likely.

For similar reasons, I would be very suspicious of any figure that's very far from 6.67e21 / (3359232*9!) when transpositions are allowed (when, I claim, there are 5472730538 essentially-different grids).

So ... which of these figures do you have alternative suggestions for now? (and what are they?)

Ed.
Red Ed

Posts: 633
Joined: 06 June 2005

Ed wrote:

>in an effort to understand why you are reporting conflicting
>results to those obtained by Frazer and me, I've been re-reading
>some old postings: (http://forum.enjoysudoku.com/viewtopic.php?t
>=44&start=267) absolutely ages ago dukuso wrote:

>>Let S be the collection of the 84 subsets of {1,..,9} of size 3.
>>Let T be the collection of the 4741632000 9-tupels (S1,..,S9)
>>with members from S such that
>>S1+S2+S3=S4+S5+S6=S7+S8+S9={1,2,3,4,5,6,7,8,9} ,
>>where "+" is set-union.
>>Let 2 members from T be equivalent if one can be obtained
>>from the other by one of the known obvious 6^4*9! operations.
>>Then we get the collection E of the known 44 minimal elements from T,
>>one from each equivalence class, called "the gang of the 44".
>>For M in T let C(M) be its equivalent representative in E.
>>For M in E let Z(M) be the size of its equivalence class.
>>For M in E let N(M) be the number of partial 3*9 sudoku grids
>>compatible with M with respect to the 6^9 operations
>>of permuting inside a column.
>>The 2*44 values of N(M),Z(M) are constant within one class and
>>can be calculated quickly.

>I started coding this up and got stuck trying to calculate the
>equivalence class sizes, Z(.), "quickly". My naive implementation
>looks like it will take hours to do the job. Do you have a quicker
>method and, if so, what is it?

probably - I don't remember. I think I used a slower method first too,
and only later, when I tried to estimate how fast the whole
6.67e21 calculation could be done, I re-estimated these older
times and are likely correct.
I was pretty much convinced at that time (and still am)
that it can all be done in a few minutes.

>Also, I remain unclear about exactly which figures you are disputing.
>The post I quoted from above goes on to say Quote:

>>How can we calculate the total number of sudoku-classes
>>as defined by RedEd but discarding transposition
>>with this method ?

from this introduction you can conclude, that the following part was
a bit more speculative...

>>sum over all M in E,
>>over all (M,A,B) in U(M)
>>of Z(M)*Q(M)*Q(C(A))*Q(C(B))
>>gives 19859770556

>which is nearly double the 10945437157 that Frazer calculated.

I think,I wasn't claiming that this were the number of T-classes.
In fact, I think the factor of almost two can be explained
because I didn't consider permutation of the 2nd and 3rd bands.
Maybe I was hoping this gave a factor of exactly two or
that the difference-numbers could be identified as the counts
of some other class or such.
I wrote, how the number was obtained - but the exact interpretation
and implications for the classes was not so clear to me.
There could be some grids with certain "symmetries" which
disturb the calculation

>I can't believe this is correct, as it would say that, on average,
>a "random" grid is left essentially unchanged by 1.81 elements of
>the group; i.e. the identity element plus probably at least one other.
>Frazer's result, by contrast, says that there's roughly a 1 in 20000
>chance that a random grid will have a non-identity group action that
>leaves it essentially unchanged. To me, this feels far more likely.

Of course. It's pretty clear that the exact number of classes

See my other post, where I claim that there are exactly 829 grids,
(upto isomorphism) which are isomorphic to their transpose.
This calculation was independent of the one quoted above
and done months later.

>For similar reasons, I would be very suspicious of any figure that's
>very far from 6.67e21 / (3359232*9!) when transpositions are allowed
>(when, I claim, there are 5472730538 essentially-different grids).
>
>So ... which of these figures do you have alternative suggestions
>for now? (and what are they?)
>
>Ed.

we have 3 calculations whicht don't fit together:
(1) yours with the 5472730538 classes
(2) Frazer's with the number of T-classes
(3) mine with the exactly 829 T-invariant classes.

at least the calculations (2) and (3) were reported here
as "not too trustworthy" so to say. They could be wrong with
probability of 30% or such. I don't know in what probability
class you'd put (1) . Well, at least one of the three must be wrong...

I suggested to test my uploaded 829 grids by examining random sudoku-grids.
If there were 20000 invariant classes as suggested by Frazer,
based on his calculation and yours , then we should be able
to find some of them with random trials.
We should be able to find some which are not in my list of the 829.
Maybe we can even construct some T-invariant sudokus.
Maybe starting from a symmetric B1B2B3B4B7.

-Guenter
dukuso

Posts: 479
Joined: 25 June 2005

Thanks for the comments. A pity you can't remember how the Z(.) calculations worked -- I'll have to try to come up with something myself.

Anyway, on to more pressing matters ...
dukuso wrote:See my other post, where I claim that there are exactly 829 grids,
(upto isomorphism) which are isomorphic to their transpose.
This calculation was independent of the one quoted above
and done months later.

...

we have 3 calculations whicht don't fit together:
(1) yours with the 5472730538 classes
(2) Frazer's with the number of T-classes
(3) mine with the exactly 829 T-invariant classes.
OK, so in Frazer's notation where G is the whole group and H is the subgroup excluding t = transposition, we're saying that:
(1) there are 5472730538 orbits of G on sudoku grids
(2) of those, 23919 equal some H orbit; the other 5472706619 each split into 2 H orbits
(3) the set of all t-invariant grids is covered by 829 G orbits

My group theory isn't good enough to tell me whether or not (2) and (3) contradict each other. Perhaps Gordon or Frazer can comment?

I'd like to try to reproduce your 829 by counting grids fixed by various group elements (since I can do these counts easily), but I can't see how to do that. Any ideas -- or is this just Frazer's 23919 again?
Red Ed

Posts: 633
Joined: 06 June 2005

wait - there is definitely an error with some of my programs/calculations.
I tried to examine random grids now and found two new t-invariant
classes, so I have 831 now.
I also found enough t-invariants to match with Frazer's predicted
frequency but out of about 30, only two were new to my list !
Maybe there is a problem with my generator and the grids were
not really random. or maybe there is still some other problem.
Maybe I can find out later...
Just wanted to tell you immediately.

-Guenter
dukuso

Posts: 479
Joined: 25 June 2005

Back on p.16 of this thread(!), Ed gave a figure that he had worked out for the total number of grids essentially invariant under transposition. I forget how this number was computed, but suspect that it comes from a brute force count. If so, we could take the file of all of these, and see if they are T-equivalent to any on Guenter's list. This was one of the first calculations Ed did as part of the Burnside's Lemma argument.

I'm still too busy at work this week, but I might get a chance at the weekend to think some more. It should be possible to use the Burnside argument to get an upper bound on the numbers involved, without using Ed's numbers at all. If it is Guenter's result that is wrong, it may already be possible to prove it.
frazer

Posts: 46
Joined: 06 June 2005

I'm down from my "829+some" figure.
It's clear, that I missed a lot and that there are
probably thousands.
I don't yet know where I made the mistake,
my 306993 figure for the number of G-classes could be wrong too.

Maybe I can look through my old programs
and modify them to get the correct count,
which will hopefully confirm Frazer's and thus
indirectly also Ed's.

-Guenter
dukuso

Posts: 479
Joined: 25 June 2005

>Thanks for the comments. A pity you can't remember how
>the Z(.) calculations worked -- I'll have to try to come
>up with something myself.

why is it important ? Just take the (already confirmed) published numbers

>Anyway, on to more pressing matters ... dukuso wrote:
>>See my other post, where I claim that there are exactly 829 grids,
>>(upto isomorphism) which are isomorphic to their transpose.
>>This calculation was independent of the one quoted above
>>and done months later.
>>
>>...
>>
>>we have 3 calculations whicht don't fit together:
>>(1) yours with the 5472730538 classes
>>(2) Frazer's with the number of T-classes
>>(3) mine with the exactly 829 T-invariant classes.

>OK, so in Frazer's notation where G is the whole group
>and H is the subgroup excluding t = transposition, we're saying that:
>(1) there are 5472730538 orbits of G on sudoku grids
>(2) of those, 23919 equal some H orbit; the other 5472706619 each split
>into 2 H orbits
>(3) the set of all t-invariant grids is covered by 829 G orbits
>
>My group theory isn't good enough to tell me whether or not (2)
> and (3) contradict each other. Perhaps Gordon or Frazer can comment?

but these numbers in (2) and (3) should coincide, shouldn't they ?

>I'd like to try to reproduce your 829 by counting grids fixed by
>various group elements (since I can do these counts easily), but
>I can't see how to do that. Any ideas -- or is this just Frazer's
>23919 again?

My calculation takes an estimated 10days when walking through all
306993(?) G-classes. When someone wants to do it - I can send
the files.
There could be some shortcuts.
But I have to be more careful that they are legal :-(

-Guenter
dukuso

Posts: 479
Joined: 25 June 2005

>Back on p.16 of this thread(!), Ed gave a figure that he had
>worked out for the total number of grids essentially invariant
>under transposition. I forget how this number was computed,
>but suspect that it comes from a brute force count. If so,
>we could take the file of all of these, and see if they are
>T-equivalent to any on Guenter's list. This was one of the
>first calculations Ed did as part of the Burnside's Lemma argument.

Ed had written on page 16:
> The number of grids essentially invariant under transposition
> appears to be 30258432 x 9! = 10980179804160

with 6^8*9! members per average class this would be
18 classes only, while you have 24000 and I have already >800.
So this can't be correct. Or he must have meant something else
with "essentially invariant under transposition".

Ed had written later that he could not easily calculate
the number of T-classes, so I assume that he has no such file.

>I'm still too busy at work this week, but I might get
>a chance at the weekend to think some more. It should
>be possible to use the Burnside argument to get an
>upper bound on the numbers involved, without using
>Ed's numbers at all. If it is Guenter's result that
>is wrong, it may already be possible to prove it.
dukuso

Posts: 479
Joined: 25 June 2005

Cor, this discussion's revived itself quickly 8-)

Some notation before I start: by H', I mean the group of 9!*6^8 elements generated by row/col/band/stack swapping and digit relabelling, but excluding transpositions. (Frazer has H = as above but without relabelling.)

dukuso wrote:with 6^8*9! members per average class this would be
18 classes only, while you have 24000 and I have already >800.
So this can't be correct.

I don't think you're right. Let x be some transpo-invariant grid. The orbit H'(x) = { hx : h \in H' } consists of, I guess, very nearly 9!*6^8 grids. But only some fraction p of these will be transpo-invariant: so H'(x) accounts for ~p*9!*6^8 out of 1.10e13 of the transpo-invariant grids, meaning the transpo-invariant grids split into ~18/p classes. Frazer's result implies p ~ 18/23919, which seems perfectly plausible to me.

On construction of the transpo-invariant grids: I can produce a list of the 30258432 transpo-invariant grids with "canonical" digit labelling (i.e. 1 to 9 in order across the top row) if you want that. And, subject to neatening up, the code to do it is free to a good home too. (This code will calculate invariants for any of the 275 classes; a quicker version, taking about an hour to run, is also available to just compute counts.)

Finally, the Z(.) thing. I'm not bothered about this particularly; I just wanted to test your method to see how quick it was. 12 seconds is quite something! I don't need to check the 6.67e21 number as I verified that myself very soon after it was first published.
Red Ed

Posts: 633
Joined: 06 June 2005

### Number of t-invariant classes

Re: number of t-invariant classes

dukuso is pushing up from 831, i.e. 831 and counting.
Ed's estimates looks like: ~18/p, p ~ 18/23919; ~1328

Is the number of t-invariant classes related to the size of the S conjugacy class for transpose, #37, size=1296?

(long silent reader from across the pond, Larry LA)
LarryLACa

Posts: 32
Joined: 24 August 2005

Ed, how exactly do you define "transpo-invariant" ?
Can you post one of your 30258432 transpo-invariant
(normalized) grids ?
dukuso

Posts: 479
Joined: 25 June 2005

dukuso wrote:Ed, how exactly do you define "transpo-invariant" ?
Can you post one of your 30258432 transpo-invariant
(normalized) grids ?
By "transpo-invariant", I mean that transposition merely has the effect of relabelling the digits. I write "essentially invariant under transposition" if I'm being fussy, since of course no grid is totally untouched by transposition.

Here's an example:
Code: Select all
 1 2 4 3 5 6 8 7 9 3 9 7 1 2 8 6 5 4 5 6 8 9 7 4 1 2 3 2 1 9 8 3 7 5 4 6 4 3 6 2 1 5 7 9 8 7 8 5 6 4 9 3 1 2 8 7 1 4 6 2 9 3 5 6 4 3 5 9 1 2 8 7 9 5 2 7 8 3 4 6 1
In this grid, 1s, 9s and 8s are fixed, whereas (2,3), (4,5) and (6,7) are swapped by transposition.

[ Aside: whenever I look at this grid, I think for a moment that I've made a mistake -- the 8s look far too close together! But they are all in separate rows/cols/boxes really ... ]

Ed.
Red Ed

Posts: 633
Joined: 06 June 2005

hmm, that doesn't seem to help us in the enumeration of T-classes.
= grids which are T-isomorphic to their transpose,
i.e. grids which are in the same T-class as their transpose.

This is what Frazer calculated as ~2.4e4 , I think.
Let's call it "T-invariant classes" to distinguish it from your
"transpo-invariant grids" (or -classes modulo 9!)

I tried 1000 out of my 306693 G-classes
finding all T-invariants in it and it seemed
to confirm Frazer's number, approximately.
As I said, the whole calculation would take me about 10 days
but would confirm the ~5.4e9 number and also my
306693 G-classes (somehow)

Another interesting open problem is the number of classes,
if we allow the 9!*6^8*2 symmetry operations plus permuting
inside minirows plus permuting inside minicolumns (iterated)

-Guenter
dukuso

Posts: 479
Joined: 25 June 2005

And yes, I found the error in the program which gave the
wrong 829-number for T-invariant T-classes.

For each G-class member S , I had to permute the minicolumns in
all 3 bands to get all 5.4e9 S-classes, most of them just
twice but some even more often, 11555445688 grids in total.

But I only permuted minicolumns in the last 2 bands.
Maybe because this was sufficient for a similar program
and I overlooked to modify it
Maybe because I thought this were sufficient
here because of some symmetries.
I don't remember.

Now, for each sudoku or sudokugrid we can compute its G-number
and the G-number of its transpose.
This refines the classification by computing the 6 gangster-numbers
of the grid.

Goal is : given a sudoku(-grid) immediately assign a number
from {1..5.4e9} to it, specifying its S-class.
I think, I could do it with {1..306693} and G-classes,
S-classes should also be possible but is more difficult.
dukuso

Posts: 479
Joined: 25 June 2005

PreviousNext