A P-set is a set of 9 cells with the same relative Position within a 3x3 block. For example, this grid is SudokuP (the * cells indicate the P-set corresponding to the first position in each block):

- Code: Select all
`*3 9 6 | *1 7 4 | *5 8 2`

1 7 4 | 5 2 8 | 3 6 9

5 2 8 | 3 9 6 | 1 4 7

------------------------

*9 6 3 | *7 4 1 | *2 5 8

4 1 7 | 8 5 2 | 6 9 3

8 5 2 | 6 3 9 | 4 7 1

------------------------

*6 3 9 | *4 1 7 | *8 2 5

7 4 1 | 2 8 5 | 9 3 6

2 8 5 | 9 6 3 | 7 1 4

Random Sudoku grid tests suggest that roughly 1 in 30,000 Sudoku grids have the P property.

But explicit enumeration of several sets of complete Sudoku solutions (with row 1 and column 1 fixed) shows a much higher frequency, more like 1 in 15! That's 3 orders of magnitude difference!

- Code: Select all
`1 2 3 4 5 6 7 8 9`

4 . . . . . . . .

5 . . . . . . . .

2 . . . . . . . .

3 . . . . . . . .

7 . . . . . . . .

6 . . . . . . . .

8 . . . . . . . .

9 . . . . . . . .

Mode = SudokuP

SudP solutions = 50,861,142, solve time = 146s

Mode = Sudoku

Sud solutions = 744,603,884, SudP = 50,861,142, solve time = 2748s

The solver is a standard DLX solver. In normal Sudoku mode it checks each solution and reports the number which have property P.

In SudokuP mode it uses DLX with the extra constraints to arrive at the same number of SudP solutions, but 20 times faster.

I have written the SudP solutions to a file and double-checked them, they all appear to be valid (and different).

The grid template is only biased towards SudokuP by virtue of the fact that R4C1 isn't 4, and R7C1 isn't 7, which hardly goes any way to explaining the anomaly.

WTF??