数独的隐藏规则
Sudoku's Hidden Rule

原始链接: https://cyrusjavan.com/posts/solving-with-uniqueness/

数独谜题假定有且仅有一个解,一些解题者将这一假定作为未明确说明的规则。致命模式是会导致多解的排列;因为有效谜题不可能包含它们,解题者可以排除会形成它们的选项。唯一矩形是常见的致命模式,涉及四个只含两个可能值的格子;而 BUG(双值通用墓地)是所有空格都有两个选项、从而形成两个解的模式。在近致命情况下,打破该模式的额外值必须被使用。作者认为这些基于唯一性的技巧在逻辑上有趣且不会损害解题体验,建议使用它们,尤其在较难的谜题中。

Hacker News上关于数独隐藏唯一性规则的讨论。求解者们争论假设一个谜题恰好有一个解是否合理。批评者认为这像作弊/循环论证,绕过了预期的逻辑;支持者将唯一性视为有效谜题的公理。帖子包含技巧(致命矩形、BUG)、需要或利用唯一性的谜题示例,以及与其他谜题/游戏的比较。许多人指出生成的或制作粗糙的谜题可能不唯一,因此假设唯一性可能失败;手工制作的谜题通常避免依赖它。总体而言,求解者们的个人偏好分歧。
相关文章

原文

The sudoku folk are not one without controversy. There is an unstated rule that can push us to the solution of a puzzle without necessarily only using the stated basic sudoku rules. Some find the use of an unstated rule a bit distasteful or at least against the spirit of the solve.

Given I am just someone who likes to have something to do on my phone instead of consuming content. I like to use every advantage I can within reason while not robbing myself of the experience.

I’m talking about uniqueness. Deadly Patterns. Unique Rectangles. Universal Graves. The unstated rule that makes a sudoku “valid” [0]. “This puzzle has exactly one solution.”

There are solving techniques that arise from the assumption of validity, that to me do not muddle the solving experience and are very logically interesting to my brain.

The most common technique is a “unique rectangle” which is a form of “deadly pattern”. A “deadly pattern” is a pattern in the puzzle that would mean this puzzle has more than one solution. If we assume the puzzle is valid, then we can also assume that no deadly pattern can ever exist in the puzzle since it has one and only one solution.

Look at this snippet of a sudoku grid, in the four notated cells we will assume there are only two possible options for values in the cells, either a 2 or 3.

This arrangement is considered “deadly” because it allows for two different possible solutions.
Solution 1

Solution 2

Thus we know that this would never actually appear in a valid sudoku, if it does then our notation is probably wrong. However, what might appear is something like this.

In this case we have an almost deadly pattern, the only thing saving us is the possibility of a 1 in the top left. So, since we know we cannot have a deadly pattern we must use the 1.

Let’s look at one more deadly pattern.

For example’s sake, let’s assume the rest of the grid is filled in correctly and these cells are the only ones left not filled in. We can see that every single open cell has exactly 2 possible options. This means that there are now exactly two solutions to the puzzle, for any given cell, pick an option and the rest of the puzzle will fill in. Pick the other option and you will get a different solution.

Since each cell has two possible values this is known as a Bivalue Universal Grave or BUG.

Thus, again like in the unique rectangle, since the puzzle we are solving is valid, we will never see this pattern. Instead we will see another almost deadly pattern.

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, we the value of the cell must equal the value that was we added to avoid the bug in this case a 3. There is a more logical deduction path to determine which of the three values is correct as well [1].

I think the above techniques are very logically interesting and using them does not feel like it is taking anything away from my solving experience, so I use them whenever I can. I hope these may have been interesting to you as well. If you’d like to try applying these techniques and others try the iOS app “:) Sudoku +” by Enjoy Sudoku [2]. Choose the “Annoying” or “Devious” difficulty setting to see some of these techniques in action.

If you’d just like to have a good time watching someone solve clever sudoku puzzle, check out Cracking the Cryptic on YouTube.

[0] That may seem obvious to you at first blush, a jigsaw puzzle usually has one solution, elementary school algebra problems have one solution, and using a box with the digits 1-9 seems like it would fit right into 5th grade. However, those of you with a little bit of combinatorics under your belt may also notice that the set of digits 1-9 repeated nine times and arranged into 81 cells could be many, many options. If we were just trying to fill the 81 cells with digits 1-9, ignoring the rules of sudoku ,there would be 9^81 options, ~10^77. If we get more precise and say we actually only have nine 1s, nine 2s etc at our disposal we have then 81!/(9!)^9 options, ~10^70. The setter of a sudoku puzzle, if they want a “valid” puzzle, must add enough starting digits so that that huge space of possible fills whittles down to exactly one valid solution.

[1] sudokuwiki BUG Explainer

[2] EnjoySudoku.com

联系我们 contact @ memedata.com