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

Sudoku's Hidden Rule (opens external site)

479 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 (32)

  1. Uniqueness feels like the thing I'm trying to prove. On a meta level I understand that the puzzle in front of me has exactly one solution, because it wouldn't be satisfying if it had multiple or none. But unless it's explicitly stated in the puzzle rules, I'd rather not use it. The goal isn't just to find a solution, but to find it using strict deductions, so that your steps of reasoning become like a proof that this is the unique solution.
    Replies (3)
    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.

    2. Why wouldn't it be satisfying if it had multiple solutions?
      Replies (2)
      1. Because you will not solve it by filling in all spots, but instead by reducing it until you spot the "deadly patterns" that admit multiple solutions.
        Replies (1)
        1. And then you pick a number and fill out a solution? These aren't deadly, which to me implies no solution. You have a free choice. Consider this crossword puzzle, for example: https://x.com/matttomic/status/1490690612672315398
          Replies (1)
          1. That's not what riddles are about though. There ought to be freedom regarding how to arrive at the solution, not what the solution is. The latter is what real life is about, but the point of doing riddles is in part to escape from real life :)
            Replies (1)
            1. I guess? To each their own. I enjoy puzzles with multiple solutions.
      2. Would a Poirot novel be satisfying if at the end, the detective concluded that suspect A was guilty, but he couldn't rule out that some other suspect was equally guilty?
        Replies (5)
        1. Would a Nolan movie be satisfying if at the end, there is a concrete conclusion to the story?
          Replies (3)
          1. An excellent question. It invites conjecture, but we may never know for sure.
          2. I liked his Batman series just fine.
          3. Pretty sure every Nolan movie has a concrete conclusion. Ambiguity isn't the same as a lack of resolution. Memento and Tenet have definitive endings, they're just not immediately obvious. Even Inception gives you enough clues to figure out the ending if you're paying attention to something other than the spinning top.
        2. I can think of, at least, one Poirot novel that had multiple solutions
        3. In a murder story there can only be one murderer (except in Murder on the Orient Express..), because it is a question about history.

          This is a number puzzle.

          Replies (1)
          1. Let's not give away the ending of the Orient Express. It's a humdinger of a mystery.
        4. Would The Martian be unsatisfying of the astronaut found two ways to survive?
          Replies (1)
          1. Yes.

            "There are seemingly no ways to survive, the protagonist still finds one" is a satisfying narrative.

            "There are two potential ways to survive, but one of them has to be fake, the protagonist chooses one to the best of his ability, but we don't learn until later if he's right" is a satisfying narrative.

            "There are two potential ways to survive, both are perfectly good, the protagonist chooses one of them and the story never comes back to this choice" is a waste of pages.

            Replies (1)
            1. I posit that in most stories, there are multiple ways to achieve a goal, they are equivalently good, the protagonist chooses one of them, and the story never comes back to the others.
        5. Multiple solutions to mystery novels was the entire conceit of the Choose Your Own Adventure series.
          Replies (1)
          1. Not the ones I remember. It was more “choose correctly to not die” multiple times, and the correct choice was not always apparent.

            I can’t remember any story where it was a mystery with multiple possible outcomes, but they wrote a ton of those books so it is possible.

            Replies (2)
            1. The movie Clue had multiple endings released in different theaters. All the endings were included on the VHS (I never saw it on DVD). While the ending itself always collapsed into one perpetrator, the story itself was able to support multiple endings and remained engaging.
            2. I remember reading a few CYA books back then that had multiple not-bad endings. There was still one ending that was generally best, though.

              Quite a few video games have used that same idea since then, especially visual novels.

    3. it wouldn't be satisfying if it had multiple or none

      I think it's satisfying when a puzzle subverts expectations. This is something that only works once in a blue moon though.