Sudoku's Hidden Rule (opens external site)
Comments loaded (181)
1 comment is not loaded here. Read them on Hacker News ↗.
To get push notifications on iPhone or iPad, add Hack and Chat to your Home Screen: tap Share → Add to Home Screen, then open the installed app and enable push in Settings.
1 comment is not loaded here. Read them on Hacker News ↗.
I've used this "unspoken" rule for many years, and often had a hard time explaining it to others.
I often called it "No two solutions", meaning that the puzzle was not allowed to have two solutions.
Personally, I prefer solving sudoku on paper. Just my preference.
So I've done a lot of sudoku appearing in newspapers. I found that many of the "harder", maybe they were called "5 star" newspaper sudoke, would fall to this rule of "No two solutions", so I generally avoid using it, unless the puzzle is _really- hard, and I can't find any other way.
EDIT: I found this image from when I was emailing a friend about this.
This is how I've typically used this rule:
https://nullimage.org/6xvubQNs7D4zMteBvDRBGm#k=KACWzJ3qsPnoY...
Replies (3)
Replies (2)
Replies (1)
If the sudoku has an answer, it certainly can't be overdetermined. Assuming that, if you spot a contradiction, you know _you_, the solver, made a mistake somewhere.
However, if you have no contradiction at all (each rule checks out: no duplicate numbers on rows, columns and within the 3x3 blocks), yet the answer is different from the "correct" one, you know that the system was underdetermined, and the sudoku had a flawed design, i.e. it wasn't "valid" to begin with.
Replies (1)
Replies (2)
https://www.sudokuwiki.org/Unique_Rectangles is the one that covers the unique solution rectangles with examples.
https://www.sudokuwiki.org/sudoku.htm?bd=0008060002000100740...
This is one such puzzle. Clicking on the 'Solve Path', you'll see the path with it. It is possible to still solve it with some more advanced techniques if rules 8 and 21 are unselected ... being able to solve it with the 'WXYZ-Wing'.It gets to the situation where box 9 has a [[14],[14]] pair and box 8 has a [[14],[1439]] pair. That forces box 8 to not have [[14], [14]], and so the second cell in question must be a [39] because a 1 or a 4 will cause it to fail uniqueness.
This happens again with boxes 4 and 6 with a box 4 having [[158],[158]] and box 6 having [[15],[15]] forcing a 1 into one of those two cells and removing 1 from the other cells in box 4.
This is how I've typically used this rule:
https://nullimage.org/6xvubQNs7D4zMteBvDRBGm#k=KACWzJ3qsPnoY...
Sorry it's a pastebin'd image, re-creating it in text seemed, tedious 8-)
Also, I also didn't find this rule to be intuitive. I just happened to stumble across a few instances where the conclusion was made obvious to me, and so I started using it when necessary.
Replies (1)
Replies (1)
And I think it would be fair to call this a shortcut.
As I mentioned, after discovering it, I tried not to use it unless I could find no other way to solve the puzzle. It felt a little like cheating to me (just my personal impression).
But I "think", there is always another way. It's just that sometimes it was beyond me.
Some sudoku are REALLY hard 8-)
I've looked at some of the the championship trial games and found it amazing that anyone could solve them...
Turns out it was a problem with more than one solution. Once I realized that, the game app immediately left distaste in my mouth, and started feeling like low-quality slop.
After the flight, I immediately checked if sudokus with more than one solution are generally considered valid, and felt vindicated to find out that indeed, they _should_ have only one. The game app was indeed not only buggy, but the puzzle selection/design was also sloppy.
Replies (1)
With that assumption, then you can color code[1] the sudoku and see this a little better than with the numerical indicators.
Making new Sudoku puzzles is a more fun exercise with computers than solving them.
You can turn Sudoku-making into a graph coloring problem instead of a tabular version of it.
[1] - https://notmysock.org/code/sudoku/
A hole of depth (or length) L is drilled through a sphere from pole to pole aligned and centred about an axis. What volume of material remains ?
Replies (3)
volume_of_sphere - volume_of_cylinder
(4/3)π(L/2)³ - πLr²
where r is cylinder radius or half the width of the hole. I can’t see an easy simple form so I asked WolframAlpha to simplify it and it doesn’t get nicer.
What am I missing?
Replies (1)
Replies (1)
I think the original question was asked/worded incorrectly, unless I'm missing something?
Replies (2)
If the hole was very very wide, that depth, from rim to rim, is more clearly not the same as the diameter of the sphere.
I tossed my OG comment off rapidly, perhaps I could have phrased it better .. although I was recalling it from first year high school calculus in the mid 1970s.
Replies (2)
In my experience, colloquially, a hole can be deep but that means something else.
Continue this thread (1 replies) →
Continue this thread (1 replies) →
The reason that uniqueness fast-tracks you is that you can assume the drill has infinitesimal diameter and thus the resulting shape is just a sphere with radius L/2.
If you’re playing on your own, solving the sudoku may be more satisfying, in which case you can’t assume uniqueness because proving uniqueness is part of proving the solution.
Replies (4)
Well, the argument here is:
1. The solution is unique.
2. If [this square had value X], the solution wouldn't be unique.
3. Therefore, [this square does not have value X].
That isn't a proof by contradiction. It's just contraposition: step 2 says P ⟶ Q, step 1 says ¬Q, and our conclusion in step 3 says ¬P. You can do the whole thing constructively. The relevant proof (that from any implication you can derive the contrapositive) is the 7th exercise in session 4 at https://incredible.pm/ . Classical reasoning starts in session 5. (And the principle of a proof by contradiction is the fourth exercise there, sort of. You could make a strong argument that the principle of a proof by contradiction is inherent in the definitional choice that equates "P ⟶ ⊥" with "¬P".)
Sudoku has a much more direct equivalent of the concept of proof by contradiction. A sudoku proof by contradiction is just trial and error: "If this square is 3, then... [a constraint is violated]. Therefore, this square isn't 3."
Even that is still just contraposition, though, because the rules of sudoku tell you what the constraints are and guarantee that they aren't violated. You don't need to assume the law of the excluded middle when it's given to you explicitly.
Replies (2)
But I operate at a high school level, so I could be wrong.
Replies (1)
At the same time, Soduko is finite, so the differences between constructive and non-constructive reasoning can be subtle, or non-existent, depending on your perspective or how you state the problem.
Anyway, I immediately think of the Kolmogorov-interpretation of logic, with Aufgabe (≈problems) and Lösung (≈solutions). And the problem of Soduku is to find which numbers the cells have, not which numbers they don't have. So I find the third step in your post to stop short of what we are after.
As some of the others, my first thought was that there was something about non-constructiveness that caused using uniqueness to feel unsatisfying to some. But I've not thought it through, nor thought about how other satisfying tactics are from a constructive perspective.
I think another potential reason why some find it unsatisfying could be impredicativity.
I wonder if anyone have tried to make different kinds of formal axiomatizations/logics for Soduko, and looked at how different tactics manifest. For instance, if a tactic essentially is provable in the logic itself, or need to be proven for each instance. Maybe reverse math for soduko-tactics?
But using uniqueness in sudoku feels really cheap and anticlimactic. It gives me the same empty feeling as solving through bifurcation
Replies (1)
Replies (1)
Replies (3)
But say, the Halting Problem is proved by contradiction. And lots of other things are proved using it -- for instance, the Busy Beaver function must grow faster than any computable function because otherwise it could be used to test whether a Turing machine halts, and we know that isn't possible.
That argument is true but by itself doesn't give much insight on how it grows, does it?
I wanted to find some links about individual values of BB(n) being shown to be independent of ZFC but a) my time is up and b) I don't know how much contradiction those use.
Replies (1)
Unlike proof of negation. it can be used to "prove" things exist that cannot be obtained.
A more accurate maxim would be: "Taking the principle of excluded middle from the mathematician would be the same, say, as proscribing astrology to the astronomer or to the boxer the use of nuclear weapons."
https://math.andrej.com/2005/05/13/the-law-of-excluded-middl...
why is there stigma in using them when it's what's need to solve regular sudokus?
From another direction, are there people who solve sudoku's without the idea that the puzzle has 1 solution? That seems very boring.
Replies (9)
Replies (1)
Replies (4)
I really cannot explain it logically, but unlike every other obscure technique uniqueness just feels wrong. I think it might have to do with wanting the puzzle to contain logic which clearly shows its one unique solution without having to trust it to have one?
It's almost like a magic trick which requires you to understand the trick or you won't be fooled. It feels backwards.
Replies (3)
Replies (1)
Replies (1)
1. there's no clear/obvious logical step/steps -- e.g. identifying hidden pairs, X/Y wings, or other patterns;
2. the chain of logic goes above ~3-4 moves where you can't easily keep the state in your head and/or clearly annotate on the grid, so have to effectively play the move assuming it's correct and have to backtrack if that assumption is wrong.
An X-Wing is a common technique, and similar to the examples in the OP. When you have four cells that form a rectangle that can only be 2 or 5, for example, you can exclude 2 and 5 from all other cells in the rows and columns these cells belong to.
Replies (1)
Replies (1)
Replies (1)
Replies (1)
https://news.ycombinator.com/item?id=50699970
This isn't a standard Sudoku solving technique. You can have a Sudoku problem where 1) there's a unique solution if you assume there's a unique solution and 2) there are multiple solutions if you do not assume there's a unique solution
To give a comparison, the equation:
has an infinite number of solutions. Now, if you assume there's a unique solution to the equation, you get x = a = 0. You're only able to get the unique solution by assuming there's a unique solutionUniqueness also assumes the puzzle is correct. Especially if you're a test solver you can't assume that, as the setter may have made a mistake.
I will say I don't think that way about solves with a BUG in them. The BUG usually only appears as the absolute last step of a solve. If you encounter it, it's probably the intended solve.
Replies (1)
Why would you bother a human test solver before checking mechanically for uniqueness and other 'correctness' issues?
The reason I don't like it is other deduction techniques are 'resistant to broken puzzles', you won't ever accidentally 'solve' an incorrect puzzle using them (I'm assuming you are deducing here, not guessing).
Using uniqueness if the puzzle isn't unique can get you a solution, when other solutions existed -- you should have got stuck but you 'skipped'.
You might argue that it's not a proper sudoku puzzle if it has multiple solutions, but the problem is if you encounter a random puzzle in the corner of non specialized newspaper or magazine how do you know it's a proper sudoku puzzle. Majority of people working for a newspaper are not sudoku experts and lack the expertise and don't care to verify that the random puzzle they found online for adding as filler is a "proper sudoku". There are some which employ a puzzle expert, which if not a sudoku specialist at least will have enough care to use a high quality source or know which software to use and how to configure it for verifying it's proper sudoku with unique solution. Do you think a factory somewhere in China making novelty toilet paper with sudoku puzzles printed on it (among many other decorative patterns) care about making high quality puzzles?
Assuming that puzzle has unique solution when it doesn't can lead to contradiction/dead end.
Sure if you are participating in serious speed sudoku competition, you can be quite sure the organizers did their diligence while preparing proper puzzles, and even if they didn't there is motivation to use every technique available for speedup. The risk is sufficiently low and a more likely result of incorrect puzzle is finding one of the solution instead of conflict from assumption of uniqueness rule.
There is a bit of similarity with sport. For the highest level professional games every official rule will be more are less followed. But when you play football with your friends for fun, quite a lot of rules will not be followed as strictly or are completely impractical to check or enforce. Even for amateur league, there is high chance of taking some leeway. Does it mean that no one except few thousand top level professional athletes have ever played football and whatever they did with ball at school during PE should be renamed to fake football.
Replies (5)
Replies (1)
Replies (1)
One game I often feel I have to rely on uniqueness is "Willas Walk" ( https://www.kaser.com/ww.html ). But there it's almost the core of the game and I'm not sure it would go without. The thing is that you need to enter all rooms once, in one door and out another, and you can never move straight through a room.
Here's one example: https://imgur.com/a/sratGHk
In the marked room, there's two valid exits to the left. I know that would break uniqueness, so it must be the exit to the right.
https://sudokupad.app/dwa3x2ld09 (Photocopied #4 "Group Theory" by Gabriel Kammer)
I really dislike using uniqueness. Not because it feels like cheating. Every time it becomes relevant it just feels inelegant. I love spotting a swordfish, Y-wing or empty rectangle. But uniqueness feels lazy and anticlimactic. In all other cases I simply find using every advantage to reason about the puzzle and deriving constraints exhilarating. But uniqueness somehow feels like it's not about the structure of the puzzle. It gives me the same feeling as bifurcation. There I can clearly tell why I dislike it: it usually feels like brute force rather than elegant logic. Not sure why I feel similarly about uniqueness.
I remember in one of the Cracking the Cryptic videos Simon said he was sure uniqueness wasn't required for the current puzzle because a setter of this caliber wouldn't design a puzzle to rely on it. Which is why I was really surprised to find that one of the puzzles in the Classic Sudoku app from CTC used uniqueness this way.
Replies (11)
Replies (2)
Replies (3)
Replies (1)
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
If such a thing is not possible, the reasoning is not actually circular.
Replies (2)
Replies (1)
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.)
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)
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.
Replies (2)
Replies (1)
Replies (1)
Continue this thread (1 replies) →
Replies (5)
Replies (2)
This is a number puzzle.
Replies (1)
"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.
Continue this thread (1 replies) →
Replies (1)
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.
Continue this thread (1 replies) →
I dislike uniqueness so much I refuse to use unique numbers in rows, columns or blocks. It's a complete grid of ones for me.
Replies (1)
Could a Sudoku puzzle be designed such that you do have to use uniqueness? Is “you never have to use uniqueness” a statement about the rules of the puzzle, or an observation about how people tend to design them?
Replies (2)
Now, in practice people don't solve which backtracking, they use increasingly clever logical reasoning steps. You can technically solve any problem with sufficiently clever reasoning steps (because you could in principle capture in your brain 'if I consider all options this is the solution), in practice people have a limit, and this varies from player to player.
So you could have a Sudoku which can be solved with uniqueness, and which no human player can solve without using uniqueness, but I haven't seen one.
( Random comment for interested parties, this is literally my area of research: https://github.com/stacs-cp/demystify-rs )
Replies (1)
It also means just trying something is often faster than thinking about the right move when you're stuck. That just feels wrong.
Replies (1)
Accordingly, all sudokus have a single valid solution set. I have no problem with that.
Replies (1)
Replies (1)
Unfortunately, I probably can't share it with anyone because of how it was made and how it works, but it's definitely made it easier for me to play some great puzzles.
I also dislike uniqueness as a rule, and I think the CTC hosts have expressed on several occasions that they'll generally refuse to use it unless the puzzle is truly otherwise unsolvable. I think they're a bit more tolerant of bifurcation, but only if the contradiction emerges quickly, and double bifurcation isn't nice. I get the impression that bifurcation is used more in competitive play because it can sometimes be faster than trying to spot something the "intended" way.
---
My app can't play all the puzzles, because some of them have unusually large grids that have impossibly small tap targets on phones. But otherwise, any puzzles that don't work are just down to bugs on my end.
I'm curious if anyone else solves their sudoku without pencil marking?
Replies (1)
As in, for a great puzzle the setter laid out one or two paths for the solver, and part of the solve is teasing out that plan the setter had in mind. Or, also fun, finding a way through that maybe the setter didn't anticipate.
With that in mind, you know that uniqueness wasn't in the setter's plan, and so using it becomes a bit rude let's say, since you're opting out of that conversation.
edit: someone else posted it in another comment: https://sudokupad.app/dwa3x2ld09
If you do not believe me, I give you: the Miracle Sudoku video:
https://www.youtube.com/watch?v=yKf9aUIxdb4
It's about a Sudoku puzzle with additional chess-piece-style restrictions, that starts off with a seemingly impossibly empty board.
If you don't share his glee as he goes about it, you may be a bit dead inside.
Replies (2)
Replies (1)
Just created a multiplayer version to play with my daughter.
I have not implemented solving hints yet and some of the "easy" problems can be challenging.
Maybe it would be fun to make a non unique version...
Replies (1)
I don't see how it follows from finding a solution that that was the only possible solution.
https://coopsudoku.xyz/
https://www.youtube.com/watch?v=pezlnN4X52g
Here it is explained in text for those that would prefer that to the Numberphile video above:
https://johnrandall.substack.com/p/the-phistomefel-ring
Replies (3)
Replies (1)
Replies (1)
It's actually one of a broader set of techniques that solvers call "set theory", which involves highlighting partially overlapping sets of cells and then removing ones that overlap, and using that to equate the values of the remaining cells. It's extremely useful in a lot of variant sudoku puzzles.
https://garbles.github.io/sudoku/
(Should work in the Pro Move too.)
For example when the puzzle is about finding some measurement of a geometric shape, knowing that it's exactly one value you can slide vertices of the shape (while preserving what's given in the puzzle) to make this value simpler to find.
For example if the answer must exist for any angle, you can transform the question to assume the angle is 90deg which might make the setup way easier to reason about. Or sometimes even 0 or 180 deg.
[1] https://pzlgames.com/games/sunflowersmaster/
Replies (2)
The first pattern described can't be affected by anything else. If you insert a 2 or 3 elsewhere you go from 2 solutions to that square to 0.
Replies (2)
I might find two promising moves A and B for White, such that Black's only good response to A is C and their only good response to B is D. However, after A C, I have two good followups, B or E. While after B D, I only have A as a followup, not E. Since the move pairs A C and B D transpose, doing both would destroy uniqueness. And thus I know I need to play A C to reach the alternative followup of E.
This pattern, which closely mirrors the almost deadly pattern in Sudoku, applies to any two-player games that allows transpositions.
Replies (2)
The engine promoted the pawn to a bishop. Stalemate ideas were clearly not present. This left as the only explanation for the underpromotion that the engine had evaluated the queen and bishop promotion exactly the same, which meant that either I had forced mate in n, or the lines would transpose (i. e. I would have to take the promoted piece rather soon anyway).
Replies (1)
This is just my theory based on observations I’m not super familiar with the inner workings of the top chess engines
Replies (2)
It was also a prize puzzle (i.e. send in the two shaded digits and be entered into a prize draw) and one of the shaded cells differed between solutions!
If you had used the uniqueness condition from the article, you might have found one of the solutions and incorrectly thought you'd found "the" solution.
Replies (1)
Back in the day someone sent around a challenge in my group and it had 37 solutions. You can brute force those after you apply the heuristics. You can basically generate all valid final puzzles. The fun part is actually figuring out how to create a valid puzzle.
Replies (1)
Replies (1)
However, if you randomly generate puzzles of a certain difficulty you'll often notice towards the end of the solve that there's very little to go on but assuming uniqueness will resolve most of the remaining cells.
Replies (1)
Replies (1)
Put one unique digit in each box, to solve the arithmetic equation: 8 * _ = 2 _
Same as sudoku, uniqueness depends on what intial information is given.
See also, initial value problems in differential equations.
Can someone explain this to me?
Replies (1)
> The only difference here is that a single cell has three options instead of two, breaking us out of the bivalue grave. To avoid the BUG, that third value must be the only valid option.
I think that maybe we need to use non-uniqueness more in puzzle games.
Replies (1)
But the uniqueness of a solution was my primary aha-moment when I started implementing my idiotic Sudoku game. It's not perfect and not suitable for very advanced players though.
The maximum difficulty there is swordfish, X- and XY-wing.
Personally, everything above "locked candidates" already goes over my stupid head :)
https://strlns.github.io/ksuduo/index.html