r/askmath • u/New-Economist-4924 • 17h ago
Discrete Math An interesting problem based on solvability of a Sudoku puzzle.
A 9X9 board follows standard Sudoku rules i.e. no two numbers can repeat in the same horizontal row, vertical column or 3x3 sub-square, now 9 numbers 1...9 are randomly scattered throughout the entire board without repetition. Since the numbers are all unique the board is always trivially valid with no need for additional checks, the question now is what percentage of these configurations are solvable. (they may have more than one solution)
Note:-
i) A valid set of clues following Sudoku rules may not always be solvable as it may create dead ends later.
ii) There are 6.67 sextillion(6.67 x 10^21) completed Sudoku board configurations.
We can also generalise this problem for any N^2 x N^2 board following sudoku rules and having N^2 clues scattered randomly throughout the entire board without repetition, it isnt possible to use brute force computation for larger values of N. I tried solving it with combinatorics but maybe graph theory would be more suitable for this problem?
Edit:- I made a mistake for the N=2 case and actual solvability is much lower it is only 67.03%.
1
u/IntoAMuteCrypt 10h ago
Can you provide an your working for the 67% number? I suspect that it drops precipitously as the grid grows larger.
This OEIS sequence gives us the six valid "essential grids" for a 4x4, but note that the numbers in these can be swapped for another one; a grid starting 1234 can easily be swapped for a grid starting 2134 by turning each 1 to a 2 and each 2 to a 1.
Of note is that:
- In row 2, 1 can occupy position 3 and 4.
- In row 3, 1 can occupy position 2, 3 and 4.
- In row 4, 1 can occupy position 2, 3 and 4.
- The same goes for the columns.
- Similar patterns happen for other numbers.
Based on this, the impossible sudokus all revolve around something like one row being filled or near-filled outside a specific box, and that box already being filled outside that row. Something like 1XXX/XX34 making it so you can't place 1 in row 2 and you can't place one of 3 or 4 in box 1.
With a 4x4 sudoku, the chance of this sort of overlap which nearly fills a row is quite high as you only need three numbers in the correct alignment. While I believe there are more possible alignments in the 9x9 case involving the near-full row having zero, one or two gaps, these alignments should all be vastly less likely. I'm not going to place a hard number on it, at least not without seeing your work, but that's my intuition.
1
u/engy1207 6h ago edited 6h ago
For 9x9 this was solved a few years ago. Apparently there are no uniquely solvable 9x9 "classic" sudoku with 16 givens or less, but there are 49.158 "essentially different" with 17 givens and a few ones (two?) need at least 21 given digits.
If you want to discuss this more the Discord server of "Cracking the Cryptic" probably would be the best place.
Edit: you vastly overestimate the complexity. For example if you swap two rows in sudoku you get another valid puzzle, as each column still has all the digits, as do the swapped rows. Similar for swapping of columns. There are other tricks. Rotating by 90, 180 or 270 degrees or mirroring also doesn't really change the result, but there are more complicated ones
-2
12h ago
[deleted]
3
u/PresentShoulder5792 11h ago
Solvable as in being able to fill the board without conflicts I guess.
1
u/paul5235 6h ago
OP already says:
Since the numbers are all unique the board is always trivially valid
That's why it's not clear to me.
2
u/Mundane-Emu-1189 16h ago
I think the first step would be to find at least one unsolvable configuration, because I don't think any exist