Sudoku Logic 数度逻辑
数独逻辑 Shù dú luójí.
Sudoku is NOT a game of mathematics. It is a game of logic.
Sudoku comprises a 9 x 9 grid of eighty-one cells. It has nine boxes, each box has nine cells. The cells are arranged in nine rows and nine columns. We name the Row 1, Row2, Row 3, Row 4, Row 5, Row 6, Row 7, Row 8, and Row 9. We name the Columns A, B, C, D, E, F, G, H, I. Each cell therefore has a name dependent on its position in the grid. Cells A1, B1, C1, A2, B2, C2, A3, B3 and C3 forming Box # 1, and the boxes going from left to right and from top to bottom. So the last Box # 9 comprises cells G7, G8, G9, H7, H8, H9, I7, I8 and I9 .
Each cell may contain a number from one to nine, and each number can only occur once in each row, column, and box. A Sudoku Challenge starts with some cells containing numbers (these become our clues), and the goal of the Challenge is to assign the remaining cells with numbers 1 through 9. A Proper Sudoku Challenge should have only one solution.
数独不是数学游戏。这是一个逻辑游戏。Shù dú bùshì shùxué yóuxì. Zhè shì yīgè luójí yóuxì. 数独包括一个由 81 个单元格组成的 9 x 9 网格。它有九个盒子,每个盒子有九个单元格。单元格排列成九行九列。我们将第 1 行、第 2 行、第 3 行、第 4 行、第 5 行、第 6 行、第 7 行、第 8 行和第 9 行命名。我们将列命名为 A、B、C、D、E、F、G、H、 I. 因此,每个单元格都有一个取决于它在网格中的位置的名称。单元格 A1、B1、C1、A2、B2、C2、A3、B3 和 C3 形成框 #1,框从左到右,从上到下。所以最后一个框 #9 包含单元格 G7, G8, G9, H7, H8, H9, I7, I8 和 I9 。 Shù dú bāokuò yīgè yóu 81 gè dānyuán gé zǔchéng de 9 x 9 wǎng gé. Tā yǒu jiǔ gè hézi, měi gè hézi yǒu jiǔ gè dānyuán gé. Dānyuán gé páiliè chéng jiǔ xíng jiǔ liè. Wǒmen jiāng dì 1 xíng, dì 2 xíng, dì 3 xíng, dì 4 xíng, dì 5 xíng, dì 6 xíng, dì 7 xíng, dì 8 xíng hé dì 9 xíng mìngmíng. Wǒmen jiāng liè mìngmíng wèi A,B,C,D,E,F,G,H, I. Yīncǐ, měi gè dānyuán gé dōu yǒu yīgè qǔjué yú tā zài wǎng gé zhōng de wèizhì de míngchēng. Dānyuán gé A1,B1,C1,A2,B2,C2,A3,B3 hé C3 xíngchéng kuāng#1, kuāng cóng zuǒ dào yòu, cóng shàng dào xià. Suǒyǐ zuìhòu yīgè kuāng#9 bāohán dānyuán gé G7, G8, G9, H7, H8, H9, I7, I8 hé I9. 每个单元格可能包含一个从 1 到 9 的数字,并且每个数字在每一行、每列和框中只能出现一次。数独挑战从一些包含数字的单元格开始(这些成为我们的线索),挑战的目标是为剩余的单元格分配数字 1 到 9。正确的数独挑战应该只有一个解决方案。 Měi gè dānyuán gé kěnéng bāohán yīgè cóng 1 dào 9 de shùzì, bìngqiě měi gè shùzì zài měi yīxíng, měi liè hé kuāng zhōng zhǐ néng chūxiàn yīcì. Shù dú tiǎozhàn cóng yīxiē bāohán shùzì de dānyuán gé kāishǐ (zhèxiē chéngwéi wǒmen de xiànsuǒ), tiǎozhàn de mùbiāo shì wèi shèngyú de dānyuán gé fēnpèi shùzì 1 dào 9. Zhèngquè de shù dú tiǎozhàn yīnggāi zhǐyǒu yīgè jiějué fāng'àn.
How to play Sudoku for an absolute beginner - Watch this video if you are an absolute beginner of Sudoku. https://youtu.be/kvU9_MVAiE0
如何为绝对初学者玩数独 - 如果您是数独的绝对初学者,请观看此视频。 https://youtu.be/kvU9_MVAiE0 Rúhé wèi juéduì chū xuézhě wán shù dú - rúguǒ nín shì shù dú de juéduì chū xuézhě, qǐng guānkàn cǐ shìpín. Https://Youtu.Be/kvU9_MVAiE0
Now let us consider how to solve an actual Sudoku Challenge given below.
现在让我们考虑如何解决下面给出的实际数独挑战。 Xiànzài ràng wǒmen kǎolǜ rúhé jiějué xiàmiàn gěi chū de shíjì shù dú tiǎozhàn.
There are a total of thirty exposed cells (that is, cells with numbers in them). Because Sudoku Challenges are computer generated and have differing degrees of difficulties, we do not recommend solving any Challenge with less than twenty-six exposed cells. Also, because some challenges can sometimes be unsolvable (they may have more than one answer, for instance), we have to be mentally prepared to abandon a game when a complete solution cannot be found.
总共有三十个暴露的单元格(即其中带有数字的单元格)。由于数独挑战是计算机生成的,并且难度各不相同,我们不建议使用少于 26 个暴露单元格来解决任何挑战。此外,由于某些挑战有时无法解决(例如,它们可能有多个答案),因此我们必须做好在找不到完整解决方案时放弃游戏的心理准备。 Zǒnggòng yǒu sānshí gè bàolù de dānyuán gé (jí qízhōng dài yǒu shùzì de dānyuán gé). Yóuyú shù dú tiǎozhàn shì jìsuànjī shēngchéng de, bìngqiě nándù gè bù xiāngtóng, wǒmen bù jiànyì shǐyòng shǎo yú 26 gè bàolù dānyuán gé lái jiějué rènhé tiǎozhàn. Cǐwài, yóuyú mǒu xiē tiǎozhàn yǒushí wúfǎ jiějué (lìrú, tāmen kěnéng yǒu duō gè dá'àn), yīncǐ wǒmen bìxū zuò hǎo zài zhǎo bù dào wánzhěng jiějué fāng'àn shí fàngqì yóuxì de xīnlǐ zhǔnbèi.
We start the game by looking at the three rows 1, 2, and 3, then rows 4, 5, and 6, and then rows 7, 8, 9 to see whether we can find solutions to enter some numbers into some of the blank cells.
Looking at rows 1, 2, and 3, we find that cell A2 = 2 and equals to cells G5 and I7. Therefore cell H1 must be a “2”. Then cell A3 = E2 = 3 and equals to G6. So, cell I 1 must equal to 3.
Then for rows 4, 5, and 6, we have C5 = H6 = 4 and F1 = 4. So, cell D4 = 4. For rows 7, 8, and 9, we have cell B8 = cell F9 = 9 and cell H3 = 9. So, cell G7 = 9.
我们先看第1、2、3行三行,然后第4、5、6行,然后第7、8、9行,看看能不能找到解决办法,把一些数字输入一些空白细胞。 查看第 1、2 和 3 行,我们发现单元格 A2 = 2 并且等于单元格 G5 和 I7。因此,单元格 H1 必须是“2”。然后单元格 A3 = E2 = 3 并等于 G6。因此,单元格 I 1 必须等于 3。然后对于第 4、5 和 6 行,我们有 C5 = H6 = 4 和 F1 = 4。因此,单元格 D4 = 4。对于第 7、8 和 9 行,我们有单元格 B8 = 单元格 F9 = 9 和单元格 H3 = 9。因此,单元格 G7 = 9。 Wǒmen xiān kàn dì 1,2,3 xíng sān xíng, ránhòu dì 4,5,6 xíng, ránhòu dì 7,8,9 xíng, kàn kàn néng bùnéng zhǎodào jiějué bànfǎ, bǎ yīxiē shùzì shūrù yīxiē kòngbái xìbāo. Chákàn dì 1,2 hé 3 xíng, wǒmen fāxiàn dānyuán gé A2 = 2 bìngqiě děngyú dānyuán gé G5 hé I7. Yīncǐ, dānyuán gé H1 bìxū shì “2”. Ránhòu dānyuán gé A3 = E2 = 3 bìng děngyú G6. Yīncǐ, dānyuán gé I 1 bìxū děngyú 3. Ránhòu duìyú dì 4,5 hé 6 xíng, wǒmen yǒu C5 = H6 = 4 hé F1 = 4. Yīncǐ, dānyuán gé D4 = 4. Duìyú dì 7,8 hé 9 xíng, wǒmen yǒu dānyuán gé B8 = dānyuán gé F9 = 9 hé dānyuán gé H3 = 9. Yīncǐ, dānyuán gé G7 = 9.
We have solved 4 cells now. For the next step, we look at columns A, B, and C and can you see that cell B3 = 4? Why? Because cell A8 = cell C5 = 4 and is equal to cell F4.
我们现在已经解决了 4 个单元格。对于下一步,我们查看 A、B 和 C 列,您能看到单元格 B3 = 4 吗?为什么?因为单元格 A8 = 单元格 C5 = 4 并且等于单元格 F4。Wǒmen xiànzài yǐjīng jiějuéle 4 gè dānyuán gé. Duìyú xià yībù, wǒmen chákàn A,B hé C liè, nín néng kàn dào dānyuán gé B3 = 4 ma? Wèishéme? Yīnwèi dānyuán gé A8 = dānyuán gé C5 = 4 bìngqiě děngyú dānyuán gé F4.
Similarly, for columns D, E, and F, can you figure out that cell D2 = 9, cell D8 = 2 and cell F8 = 3 along the same logic. [E6 = F9 = 9 = H3; F3 = E4 = 2; E2 = D5 = 3 = B7.].
类似地,对于 D、E 和 F 列,您能否按照相同的逻辑计算出单元格 D2 = 9、单元格 D8 = 2 和单元格 F8 = 3。 [E6 = F9 = 9 = H3; F3 = E4 = 2; E2 = D5 = 3 = B7。] Lèisì de, duìyú D,E hé F liè, nín néng fǒu ànzhào xiàng tóng de luójí jìsuàn chū dānyuán gé D2 = 9, dānyuán gé D8 = 2 hé dānyuán gé F8 = 3. [E6 = F9 = 9 = H3; F3 = E4 = 2; E2 = D5 = 3 = B7.]
For columns G, H, and I, we have I 1 = 3 = G6 = B7; so, H9 = 3.
对于 G、H 和 I 列,我们有 I 1 = 3 = G6 = B7;所以,H9 = 3。Duìyú G,H hé I liè, wǒmen yǒu I 1 = 3 = G6 = B7; suǒyǐ,H9 = 3.
And, if we now look at rows 1, 2, and 3 again, we have cell B3 = 4 = F1. Therefore cell G2 = 4. Having get G2 = 4, we can look at columns G, H, and I to see that cell I 9 = 4 [because G2 = H6 = 4] and in rows 7, 8, and 9, we can find that cell E7 = 4 [because A8 = I 9 = 4 = F1]. Logical?
Then in columns D, E, and F, we can have E9 = 8 because D1 = F5 = 8. In Box # 8 (cells D7, E7, F7, D8, E8, F8, D9, E9, and F8) there is now only one empty cell left, cell F7. The only number left in that box must be 6. F7 = 6.
而且,如果我们现在再次查看第 1、2 和 3 行,我们有单元格 B3 = 4 = F1。因此,单元格 G2 = 4。获得 G2 = 4 后,我们可以查看 G、H 和 I 列以看到单元格 I 9 = 4 [因为 G2 = H6 = 4] 以及在第 7、8 和 9 行可以找到单元格 E7 = 4 [因为 A8 = I 9 = 4 = F1]。合乎逻辑吗?然后在 D、E 和 F 列中,我们可以有 E9 = 8,因为 D1 = F5 = 8。在框 #8(单元格 D7、E7、F7、D8、E8、F8、D9、E9 和 F8)中有现在只剩下一个空单元格,单元格 F7。该框中剩下的唯一数字必须是 6。F7 = 6. Érqiě, rúguǒ wǒmen xiànzài zàicì chákàn dì 1,2 hé 3 xíng, wǒmen yǒu dānyuán gé B3 = 4 = F1. Yīncǐ, dānyuán gé G2 = 4. Huòdé G2 = 4 hòu, wǒmen kěyǐ chákàn G,H hé I liè yǐ kàn dào dānyuán gé I 9 = 4 [yīnwèi G2 = H6 = 4] yǐjí zài dì 7,8 hé 9 xíng kěyǐ zhǎodào dānyuán gé E7 = 4 [yīnwèi A8 = I 9 = 4 = F1]. Héhū luójí? Ránhòu zài D,E hé F liè zhōng, wǒmen kěyǐ yǒu E9 = 8, yīnwèi D1 = F5 = 8. Zài kuāng#8(dānyuán gé D7,E7,F7,D8,E8,F8,D9,E9 hé F8) zhōng yǒu xiànzài zhǐ shèng xià yīgè kōng dānyuán gé, dānyuán gé F7. Gāi kuāng zhōng shèng xià de wéiyī shǔ zì bìxū shì 6.F7 = 6.
To summarise, the first fiftteen steps of the solution are given below: 总而言之,解决方案的前十五个步骤如下: Zǒng’éryánzhī, jiějué fāng’àn de qián shíwǔ gè bùzhòu rúxià:
| Step # 步 | Look at: 看 一看(行列框) | Logical Analysis: 逻辑分析: | Cell # 细胞 | Solution 解决 |
| 1 | Rows 1, 2, 3 | A 2 = F 3 = 2 = G 5 = I 7 | H 1 | 2 |
| 2 | Rows 1, 2, 3 | A 3 = E 2 = 3 = G 6 | I 1 | 3 |
| 3 | Rows 4, 5, 6 | C 5 = H 6 = 4 = F1 | D 4 | 4 |
| 4 | Rows 7, 8, 9 | B 8 = F 9 = 9 = H 3 | G 7 | 9 |
| 5 | Columns A, B, C | A 8 = C 5 = 4 = F1 | B 3 | 4 |
| 6 | Columns D, E, F | E 6 = F 9 = 9 = H 3 | G 2 | 9 |
| 7 | Columns D, E, F | F 3 = E 4 = 2 | D 8 | 2 |
| 8 | Columns G, H, I | I 1 = G 6 = 3 = B 7 | H 9 | 3 |
| 9 | Columns D, E, F | E 6 = F 8 = 9 = H3 | D 2 | 9 |
| 10 | Columns G, H, I | G 2 = G 6 = 4 = A 8 | I 9 | 4 |
| 11 | Rows 7, 8, 9 | A 8 = I 9 = 4 = F 1 | E 7 | 4 |
| 12 | Rows 7, 8, 9 | B 7 = H 9 = 3 | F 8 | 3 |
| 13 | Columns D, E, F | D 1 = F 5 = 8 | E 9 | 8 |
| 14 | Box # 8 | Remaining Cell F 7, remaining digit | F 7 | 6 |
| 15 | Box # 2 | E 8 = B 2 = 7 | D 3 | 7 |
It is now easy to follow the logical reasons for the rest of the solution to the Challenge recorded in the tabulation below: 现在很容易理解下表中记录的挑战的其余解决方案的逻辑原因: Xiànzài hěn róngyì lǐjiě xià biǎo zhōng jìlù de tiǎozhàn de qíyú jiějué fāng’àn de luójí yuányīn:
| Step 步 | Look at: 看 - 行列框 | Logical Analysis: 逻辑分析 | Cell 细胞 | Solution 解决 |
| 16 | Column D | Remaining Cell D 6, remaining digit | D 6 | 6 |
| 17 | Box # 3 | Remaining 1,5,7: D 3 = 7; I 8 = 1 | I 3 | 5 |
| 18 | Box # 3 | Remaining 1,7: D3 = 7 | G 3 | 1 |
| 19 | Box # 3 | Remaining Cell G1, remaining digit | G1 | 7 |
| 20 | Row 3 | Remaining 6.8: D 1 = 8 | E 3 | 6 |
| 21 | Row 3 | Remaining Cell C 3, remaining digit | C 3 | 8 |
| 22 | Box # 7 | G 3 = 8 = E 9 | A 7 | 8 |
| 23 | Rows 7, 8, 9 | D 9 = I 8 = 1 | C 7 | 1 |
| 24 | Row 7 | Remaining Cell H7, remaining digit | H 7 | 9 |
| 25 | Box # 9 | Remaining 6,8: E 9 = 8 | G 9 | 6 |
| 26 | Box # 9 | Remaining Cell G 8, remaining digit | G 8 | 8 |
| Step 步 | Look at: 看 - 行列框 | Logical Analysis: 逻辑分析 | Cell 细胞 | Solution 解决 |
| 27 | Row 8 | Remaining Cell C 8, remaining digit | C 8 | 6 |
| 28 | Row 2 | Remaining 1,5: C 7 = 1 | C 2 | 5 |
| 29 | Row 2 | Remaining Cell F2, remaining digit | F 2 | 1 |
| 30 | Box # 2 | Remaining Cell E 1, remaining digit | E 1 | 5 |
| 31 | Column E | Remaining Cell E 5, remaining digit | E 5 | 1 |
| 32 | Columns A, B, C | B 4 = C 8 = 6 | A 1 | 6 |
| 33 | Box # 1 | Remaining 1,9: B 8 = 9 | B 1 | 1 |
| 34 | Box # 1 | Remaining Cell C 1, remaining digit | C 1 | 9 |
| 35 | Columns A, B, C | A 7 = C 3 = 8 = F 5 | B 6 | 8 |
| 36 | Columns G, H, I | H 2 = G 8 = 8 = F 5 =B 6 | I 4 | 8 |
| Step 步 | Look at: 看 - 行列框 | Logical Analysis: 逻辑分析 | Cell 细胞 | Solution 解决 |
| 37 | Column G | Remaining Cell G4; remaining digit | G 4 | 5 |
| 38 | Column H | Remaining 1,6: C 5 = 1 | H 4 | 1 |
| 39 | Column H | Remaining Cell H 5; remaining digit | H 5 | 6 |
| 40 | Column I | Remaining 7,9: E 6 = 9 | I 5 | 9 |
| 41 | Column I | Remaining Cell I 6; remaining digit | I 6 | 7 |
| 42 | Column C | Remaining 2,7: I 6 = 7 | C 9 | 7 |
| 43 | Column C | Remaining Cell C 6; remaining digit | C 6 | 2 |
| 44 | Rows 4, 5, 6 | H 4 = E 5 = 1 | A 6 | 1 |
| 45 | Row 6 | Remaining Cell F 6, remaining digit | F 6 | 5 |
| 46 | Box # 5 | Remaining Cell F 4, remaining digit | F 4 | 7 |
| 47 | Row 4 | Remaining Cell A 4; remaining digit | A 4 | 9 |
| 48 | Row 5 | Remaining 5,7: B 2 = 7 | A 5 | 7 |
| 49 | Row 5 | Remaining Cell B 5; remaining digit | B 5 | 5 |
| 50 | Column A | Remaining Cell A 9; remaining digit | A 9 | 5 |
| 51 | Column B | Remaining Cell B 9; remaining digit | B 9 | 2 |
Kindly note that when the entire grid is completed, all digits in each row add up to 45. Similarly, all digits in each column as well as each box also add up to 45.
请注意,当整个网格完成时,每行的所有数字加起来为 45。同样,每列以及每个框中的所有数字加起来也为 45。 Qǐng zhùyì, dāng zhěnggè wǎng gé wánchéng shí, měi xíng de suǒyǒu shùzì jiā qǐlái wèi 45. Tóngyàng, měi liè yǐjí měi gè kuāng zhōng de suǒyǒu shùzì jiā qǐlái yě wèi 45.