{
  "url": "https://cyrusjavan.com/posts/solving-with-uniqueness/",
  "title": "Sudoku's Hidden Rule",
  "siteName": "Cyrus Javan",
  "wordCount": 801,
  "readingTimeMinutes": 4,
  "cacheStatus": "HIT",
  "markdown": "# Sudoku's Hidden Rule\n\nThe 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.\n\nGiven 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.\n\nI’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.”**\n\nThere 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.\n\n## Unique Rectangles\n\nThe 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.\n\nLook 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.  \n\nThis arrangement is considered “deadly” because it allows for two different possible solutions.  \nSolution 1\n\nSolution 2\n\nThus 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.\n\nIn 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.\n\n## Bivalue Universal Graves\n\nLet’s look at one more deadly pattern.  \n\nFor 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.\n\nSince each cell has two possible values this is known as a Bivalue Universal Grave or BUG.\n\nThus, 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.\n\nThe 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\\].\n\n## Wrap It Up\n\nI 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.\n\nIf you’d just like to have a good time watching someone solve clever sudoku puzzle, check out [Cracking the Cryptic](https://www.youtube.com/@CrackingTheCryptic) on YouTube.\n\n## References\n\n\\[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.\n\n\\[1\\] [sudokuwiki BUG Explainer](https://www.sudokuwiki.org/BUG)\n\n\\[2\\] [EnjoySudoku.com](http://www.enjoysudoku.com/)",
  "html": "<h1>Sudoku's Hidden Rule</h1>\n<p>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.</p>\n<p>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.</p>\n<p>I’m talking about <strong>uniqueness</strong>. Deadly Patterns. Unique Rectangles. Universal Graves. The unstated rule that makes a sudoku “valid” [0]. <strong>“This puzzle has exactly one solution.”</strong></p>\n<p>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.</p>\n<h2>Unique Rectangles</h2>\n<p>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.</p>\n<p>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.  </p>\n<p>This arrangement is considered “deadly” because it allows for two different possible solutions.<br />Solution 1</p>\n<p>Solution 2</p>\n<p>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.</p>\n<p>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.</p>\n<h2>Bivalue Universal Graves</h2>\n<p>Let’s look at one more deadly pattern.  </p>\n<p>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.</p>\n<p>Since each cell has two possible values this is known as a Bivalue Universal Grave or BUG.</p>\n<p>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.</p>\n<p>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].</p>\n<h2>Wrap It Up</h2>\n<p>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.</p>\n<p>If you’d just like to have a good time watching someone solve clever sudoku puzzle, check out <a href=\"https://www.youtube.com/@CrackingTheCryptic\">Cracking the Cryptic</a> on YouTube.</p>\n<h2>References</h2>\n<p>[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.</p>\n<p>[1] <a href=\"https://www.sudokuwiki.org/BUG\">sudokuwiki BUG Explainer</a></p>\n<p>[2] <a href=\"http://www.enjoysudoku.com/\">EnjoySudoku.com</a></p>\n"
}