← Tue, Sep 15 digest

There are only twelve 4x4 sudokus (and a cool trick for finding minimal subsets)

read article ↗ hn thread ↗

summary

While 9x9 Sudokus are astronomically complex, 4x4 Sudokus are small enough to be fully mapped using brute-force computation. There are only 288 total valid solutions, which boil down to 12 structurally distinct patterns when permutations of digits are ignored. By iterating through all possible cell subsets, one can identify exactly 85,632 minimal puzzles that yield a unique solution.

key points

  1. Structural distinctness is determined by whether one solution can be transformed into another by simply swapping the digits used, meaning the 288 total solutions are just permutations of 12 core patterns.
  2. Minimal puzzles are those where removing any single given digit would result in the puzzle having more than one valid solution.
  3. Using binary bitmasks to represent cell subsets allows for an efficient way to check for minimality by iterating through subsets in increasing numerical order.

who should read it

People interested in recreational mathematics, basic combinatorics, or those who enjoy using simple Python scripts to solve logic puzzles.

discussion warm

consensus

Commenters agree that the 4x4 Sudoku grid possesses a surprisingly small number of unique solutions. The discussion evolves from basic counting to exploring rotational and mirror symmetries, with several users attempting to identify truly unique grids. There is a general appreciation for the recreational math aspect and the application of group theory to categorize equivalence classes.

top insight

The interaction between probably_wrong and Fran314 reveals that normalizing a grid by replacing the first row with '1234' is an effective method for simplifying the identification of duplicate puzzles. This technique allows for easier comparison of grids that are otherwise identical under rotation or permutation. It transforms a structural problem into a manageable string-matching task.

Generated by an LLM from the article and thread. Check the sources before relying on it.