Unofficial Hacker News companion — get notified on comment replies, and more.

Sudoku's Hidden Rule (opens external site)

478 points by multifasciatus 1 day ago | cyrusjavan.com | 213 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (10)

  1. Yes, that is precisely it! It feels like a circular proof. You assuming what you haven't proven yet. It feels unearned.
    Replies (3)
    1. gently disagree. uniqueness is one of the axioms of a Sudoku, you don't prove it, you rely on it.
      Replies (2)
      1. It's an axiom of a valid, solvable (that is to say, well-constructed) Sudoku. You technically do not know this to be true. At best you are assuming the Sudoku is well-constructed based on the reputation of the source

        If you do not rely on uniqueness you can check the other trivial constraints (nine rows, nine columns, etc), solve the sudoku, and then you know that it was well-constructed. If you use the property that it is well-constructed to solve it, your solution no longer showed that the Sudoku is well-constructed

      2. I don't disagree that puzzles can be designed with that axiom as a critical tool in reaching solutions - I just vastly prefer puzzles that do not require either of the techniques outlined to reach the solution. This is entirely a matter of personal preference though, I don't reject Sudokus that have deadly rectangle traps in them as invalid - I just don't enjoy needing to rely on them since they, I suppose, break my immersion that I'm solving a problem instead of playing a game.

        Many problems in the real world have zero or many solutions, it feels artificial to me to leverage the fact that there must be a single valid solution to reach a solution.

    2. The perhaps obvious question: is it actually possible to design a sudoku with multiple solutions, BUT if people use BUG, they will get stuck and not get a solution at all?

      If such a thing is not possible, the reasoning is not actually circular.

      Replies (2)
      1. It is possible. Imagine a sudoku with just one number filled in at the start. Clearly there could be multiple solutions.
        Replies (1)
        1. But there is a second constraint. If someone were to use BUG, would they be unable to find any solution at all? For the one-number-at-the-start, BUG doesn't (obviously) lead to deadlocks later.
      2. Counterexample: the case from the blog post could be filled in like so:

            8 5 7 |   6   |     2
              4   | 2 8 7 |     5
              2   |   5   | 8   7
            ------+-------+------
            1 7 4 | 5 2 3 | 6 8 9
            2 8 5 | 4 9 6 | 3 7 1
            3 9 6 | 7 1 8 | 5 2 4
            ------+-------+------
            4 1 2 | 6 3 5 | 7 9 8
            5 3 8 | 9 7 2 | 4 1 6
            7 6 9 | 8 4 1 | 2 5 3
        
        If you fill in a 3 where the blog post tells you then you get a contradiction, 0 solutions. But the puzzle as it stands has two.

        You are correct to suspect that there's an impossibility result here but it requires a stronger logical model than Sudoku can provide or something. (The theorem is called Löb’s theorem, and says that if a logic can prove “if P is provable, then P is true” then it can prove P, as long as it was sophisticated enough to start with.)

    3. I think there is truth to this. I think it is possible that a Sudoku puzzle does not have a unique solution, but using the deduction methods explained in the article will lead to only one of those solutions.

      For example, consider the following situation:

      2,3 - 2,3

      1,2,3 - 2,3 - 1,3

      1,2,3 - X - 1,3

      Then

      2 - 3

      3 - 2 - 1

      1 - X - 3

      and

      2 - 3

      1 - 2 - 3

      3 - X - 1

      are both possible solutions, but applying the unique rectangles deduction in the article would only lead us to the second solution.

      Replies (1)
      1. There's actually a third solution, made by swapping the 2s and 3s of your first solution:

        3-2

        2-3-1

        1-X-3

        This solution looks identical to the first one from the perspective of the rest of the puzzle. Nothing can force a single solution. Since sudoku designers/publishers have an unwritten rule that solutions are unique, one can assume that neither of those are the solution. Something somewhere else in the puzzle will force the 1s to be placed in order to create your second solution.