How to solve sudoku ways. Logic puzzles

  • tutorial

1. Basics

Most of us hackers know what sudoku is. I will not talk about the rules, but immediately move on to the methods.
To solve a puzzle, no matter how complex or simple, cells that are obvious to fill are initially searched for.


1.1 "The Last Hero"

Consider the seventh square. Only four free cells, so something can be quickly filled.
"8 " on the D3 blocks padding H3 and J3; similar " 8 " on the G5 closes G1 and G2
With a clear conscience we put " 8 " on the H1

1.2 "Last Hero" in a row

After viewing the squares for obvious solutions, move on to the columns and rows.
Consider " 4 " on the field. It is clear that it will be somewhere in the line A .
We have " 4 " on the G3 that covers A3, there is " 4 " on the F7, cleaning A7. And one more " 4 " in the second square prohibits its repetition on A4 and A6.
"The Last Hero" for our " 4 " This A2

1.3 "No Choice"

Sometimes there are several reasons for specific location. "4 " in J8 would be a great example.
Blue the arrows indicate that this is the last possible number squared. Red and blue the arrows give us the last number in the column 8 . Greens the arrows give the last possible number in the line J.
As you can see, we have no choice but to put this " 4 "in place.

1.4 "And who, if not me?"

Filling in numbers is easier to do using the methods described above. However, checking the number as the last possible value also yields results. The method should be used when it seems that all the numbers are there, but something is missing.
"5 " in B1 is set based on the fact that all numbers from " 1 " before " 9 ", Besides " 5 " is in the row, column and square (marked in green).

In jargon it is " naked loner". If you fill in the field with possible values ​​​​(candidates), then in the cell such a number will be the only possible one. Developing this technique, you can search for " hidden loners" - numbers unique for a particular row, column or square.

2. "Naked Mile"

2.1 Naked couples
""Naked" couple" - a set of two candidates located in two cells belonging to one common block: row, column, square.
It is clear that right decisions puzzles will only be in these cells and only with these values, while all other candidates from the general block can be removed.


In this example, there are several "naked pairs".
red in line BUT cells are highlighted A2 and A3, both containing " 1 " and " 6 ". I don't know exactly how they are located here yet, but I can safely remove all the others " 1 " and " 6 " from string A(marked in yellow). Also A2 and A3 belong to a common square, so we remove " 1 " from C1.


2.2 "Threesome"
"Naked Threes"- a complicated version of "naked couples".
Any group of three cells in one block containing all in all three candidates is "naked trio". When such a group is found, these three candidates can be removed from other cells of the block.

Candidate combinations for "naked trio" may be like this:

// three numbers in three cells.
// any combinations.
// any combinations.

In this example, everything is pretty obvious. In the fifth square of the cell E4, E5, E6 contain [ 5,8,9 ], [5,8 ], [5,9 ] respectively. It turns out that in general these three cells have [ 5,8,9 ], and only these numbers can be there. This allows us to remove them from other block candidates. This trick gives us the solution " 3 " for cell E7.

2.3 "Fab Four"
"Naked Four" very a rare thing, especially in full form, and still produces results when found. The solution logic is the same as "naked triplets".

In the above example, in the first square of the cell A1, B1, B2 and C1 generally contain [ 1,5,6,8 ], so these numbers will occupy only those cells and no others. We remove the candidates highlighted in yellow.

3. "Everything hidden becomes clear"

3.1 Hidden pairs
A great way to open the field is to search hidden pairs. This method allows you to remove unnecessary candidates from the cell and give rise to more interesting strategies.

In this puzzle we see that 6 and 7 is in the first and second squares. Besides 6 and 7 is in the column 7 . Combining these conditions, we can assert that in the cells A8 and A9 there will be only these values ​​and we remove all other candidates.


More interesting and complex example hidden pairs. The pair [ 2,4 ] in D3 and E3, cleaning 3 , 5 , 6 , 7 from these cells. Highlighted in red are two hidden pairs consisting of [ 3,7 ]. On the one hand, they are unique for two cells in 7 column, on the other hand - for a row E. Candidates highlighted in yellow are removed.

3.1 Hidden triplets
We can develop hidden couples before hidden triplets or even hidden fours. The Hidden Three consists of three pairs of numbers located in one block. Such as, and. However, as in the case with "naked triplets", each of the three cells does not have to contain three numbers. will work Total three numbers in three cells. For example , , . Hidden triplets will be masked by other candidates in the cells, so first you need to make sure that troika applicable to a specific block.


In that complex example there are two hidden triplets. The first, marked in red, in the column BUT. Cell A4 contains [ 2,5,6 ], A7 - [2,6 ] and cell A9 -[2,5 ]. These three cells are the only ones where there can be 2 , 5 or 6, so they will be the only ones there. Therefore, we remove unnecessary candidates.

Second, in a column 9 . [4,7,8 ] are unique to cells B9, C9 and F9. Using the same logic, we remove candidates.

3.1 Hidden fours

Perfect example hidden fours. [1,4,6,9 ] in the fifth square can only be in four cells D4, D6, F4, F6. Following our logic, we remove all other candidates (marked in yellow).

4. "Non-rubber"

If any of the numbers appear twice or thrice in the same block (row, column, square), then we can remove that number from the conjugate block. There are four types of pairing:

  1. Pair or Three in a square - if they are located in one line, then you can remove all other similar values ​​​​from the corresponding line.
  2. Pair or Three in a square - if they are located in one column, then you can remove all other similar values ​​​​from the corresponding column.
  3. Pair or Three in a row - if they are located in the same square, then you can remove all other similar values ​​​​from the corresponding square.
  4. Pair or Three in a column - if they are located in the same square, then you can remove all other similar values ​​\u200b\u200bfrom the corresponding square.
4.1 Pointing pairs, triplets

Let me show you this puzzle as an example. In the third square 3 "is only in B7 and B9. Following the statement №1 , we remove candidates from B1, B2, B3. Likewise, " 2 " removes from the eighth square possible meaning from G2.


Special puzzle. Very difficult to solve, but if you look closely, you can see a few pointing pairs. It is clear that it is not always necessary to find them all in order to advance in the solution, but each such find makes our task easier.

4.2 Reducing the irreducible

This strategy involves carefully parsing and comparing rows and columns with the contents of the squares (rules №3 , №4 ).
Consider the line BUT. "2 "are possible only in A4 and A5. following the rule №3 , remove " 2 " them B5, C4, C5.


Let's continue to solve the puzzle. We have a single location 4 "within one square in 8 column. According to the rule №4 , we remove unnecessary candidates and, in addition, we obtain the solution " 2 " for C7.

The first thing that should be determined in the methodology of problem solving is the question of actually understanding what we achieve and can achieve in terms of problem solving. Understanding is usually thought of as something that goes without saying, and we lose sight of the fact that understanding has a definite starting point of understanding, only in relation to which we can say that understanding really takes place from a specific moment we have determined. Sudoku here, in our consideration, is convenient in that it allows, using its example, to some extent to model the issues of understanding and solving problems. However, we will start with several other and no less important examples than Sudoku.

A physicist studying special relativity might talk about Einstein's "crystal clear" propositions. I came across this phrase on one of the sites on the Internet. But where does this understanding of "crystal clarity" begin? It starts with learning mathematical notation postulates, from which all multi-storey mathematical constructions of SRT can be built according to well-known and understandable rules. But what the physicist, like me, does not understand is why the postulates of SRT work in this way and not otherwise.

First of all, the vast majority of those discussing this doctrine do not understand what exactly lies in the postulate of the constancy of the speed of light in the translation from its mathematical application to reality. And this postulate implies the constancy of the speed of light in all conceivable and inconceivable senses. The speed of light is constant relative to any resting and moving objects at the same time. The speed of the light beam, according to the postulate, is constant even with respect to the oncoming, transverse and receding light beam. And, at the same time, in reality we only have measurements that are indirectly related to the speed of light, interpreted as its constancy.

Newton's laws for a physicist and even for those who simply study physics are so familiar that they seem so understandable as something taken for granted and it cannot be otherwise. But let's say the application of the law gravity begins with its mathematical notation, according to which even the trajectories of space objects and the characteristics of orbits can be calculated. But why these laws work in this way and not otherwise - we do not have such an understanding.

Likewise with Sudoku. On the Internet, you can find repeatedly repeated descriptions of "basic" ways to solve Sudoku problems. If you remember these rules, then you can understand how this or that Sudoku problem is solved by applying the "basic" rules. But I have a question: do we understand why these "basic" methods work in this way and not otherwise.

So we move on to the next key position in problem solving methodology. Understanding is possible only on the basis of some model that provides a basis for this understanding and the ability to perform some natural or thought experiment. Without this, we can only have rules for applying the learned starting points: the postulates of SRT, Newton's laws, or "basic" ways in Sudoku.

We do not and in principle cannot have models that satisfy the postulate of the unrestricted constancy of the speed of light. We do not, but unprovable models consistent with Newton's laws can be invented. And there are such "Newtonian" models, but they somehow do not impress with productive possibilities for conducting a full-scale or thought experiment. But Sudoku provides us with opportunities that we can use both to understand the actual problems of Sudoku, and to illustrate modeling as a general approach to solving problems.

One possible model for Sudoku problems is the worksheet. It is created by simply filling in all the empty cells (cells) of the table specified in the task with the numbers 123456789. Then the task is reduced to the sequential removal of all extra digits from the cells until all the cells of the table are filled with single (exclusive) digits that satisfy the condition of the problem.

I'm creating such a worksheet in Excel. First, I select all the empty cells (cells) of the table. I press F5-"Select"-"Empty cells"-"OK". A more general way to select the desired cells: hold Ctrl and click the mouse to select these cells. Then for the selected cells I set blue color, size 10 (original - 12) and font Arial Narrow. This is all so that subsequent changes in the table are clearly visible. Next, I enter empty cells numbers 123456789. I do it as follows: I write down and save this number in a separate cell. Then I press F2, select and copy this number with the Ctrl + C operation. Next, I go to the table cells and, sequentially bypassing all the empty cells, enter the number 123456789 into them using the Ctrl + V operation, and the worksheet is ready.

Extra numbers, which will be discussed later, I delete as follows. With the operation Ctrl + mouse click - I select cells with an extra number. Then I press Ctrl + H and enter the number to be deleted in the upper field of the window that opens, and the lower field should be completely empty. Then it remains to click on the "Replace All" option and the extra number is removed.

Judging by the fact that I usually manage to do more advanced table processing in the usual "basic" ways than in the examples given on the Internet, the worksheet is the most a simple tool in solving Sudoku problems. Moreover, many situations regarding the application of the most complex of the so-called "basic" rules simply did not arise in my worksheet.

At the same time, the worksheet is also a model on which experiments can be carried out with the subsequent identification of all the "basic" rules and various nuances of their application arising from the experiments.

So, before you is a fragment of a worksheet with nine blocks, numbered from left to right and top to bottom. In this case, we have the fourth block filled with numbers 123456789. This is our model. Outside the block, we highlighted in red the "activated" (finally defined) numbers, in this case, fours, which we intend to substitute in the table being drawn up. The blue fives are figures that have not yet been determined regarding their future role, which we will talk about later. The activated numbers assigned by us, as it were, cross out, push out, delete - in general, they displace the same numbers in the block, so they are represented there in a pale color, symbolizing the fact that these pale numbers have been deleted. I wanted to make this color even paler, but then they could become completely invisible when viewed on the Internet.

As a result, in the fourth block, in cell E5, there was one, also activated, but hidden four. "Activated" because she, in turn, can also remove extra digits if they are on her way, and "hidden" because she is among other digits. If the cell E5 is attacked by the rest, except for 4, activated numbers 12356789, then a "naked" loner will appear in E5 - 4.

Now let's remove one activated four, for example from F7. Then the four in the filled block can be already and only in cell E5 or F5, while remaining activated in row 5. If activated fives are involved in this situation, without F7=4 and F8=5, then in cells E5 and F5 there will be a naked or hidden activated pair 45.

After you have sufficiently worked out and comprehended different variants with naked and hidden singles, twos, threes, etc. not only in blocks, but also in rows and columns, we can move on to another experiment. Let's create a bare pair 45, as we did before, and then connect the activated F7=4 and F8=5. As a result, the situation E5=45 will occur. Similar situations very often arise in the process of processing a worksheet. This situation means that one of these digits, in this case 4 or 5, must necessarily be in the block, row and column that includes cell E5, because in all these cases there must be two digits, not one of them.

And most importantly, we now already know how frequently occurring situations like E5=45 arise. In a similar way, we will define situations when a triple of digits appears in one cell, etc. And when we bring the degree of comprehension and perception of these situations to a state of self-evidence and simplicity, then the next step is, so to speak, a scientific understanding of situations: then we will be able to do a statistical analysis of Sudoku tables, identify patterns and use the accumulated material to solve the most the most difficult tasks.

Thus, by experimenting on the model, we get a visual and even "scientific" representation of hidden or open singles, pairs, triples, etc. If you limit yourself to operations with the described simple model, then some of your ideas will turn out to be inaccurate or even erroneous. However, once you get to the solution specific tasks, then the inaccuracies of the initial ideas will quickly come to light, but the models on which the experiments were carried out will have to be rethought and refined. This is the inevitable path of hypotheses and refinements in solving any problems.

I must say that hidden and open singles, as well as open pairs, triples and even fours, are common situations that arise when solving Sudoku problems with a worksheet. Hidden couples were rare. And here are the hidden triples, fours, etc. I somehow didn’t come across when processing worksheets, just like the methods for bypassing the “x-wing” and “swordfish” contours that have been repeatedly described on the Internet, in which there are “candidates” for deletion with any of the two alternative ways of bypassing contours. The meaning of these methods: if we destroy the "candidate" x1, then the exclusive candidate x2 remains and at the same time the candidate x3 is deleted, and if we destroy x2, then the exclusive x1 remains, but in this case the candidate x3 is also deleted, so in any case, x3 should be deleted , without affecting the candidates x1 and x2 for the time being. In more general plan, This special case situations: if two alternative ways lead to the same result, then this result can be used to solve a Sudoku problem. In this, more general, situation, I met situations, but not in the "x-wing" and "swordfish" variants, and not when solving Sudoku problems, for which knowledge of only "basic" approaches is sufficient.

The features of using a worksheet can be shown in the following non-trivial example. On one of the sudoku solver forums http://zforum.net/index.php?topic=3955.25;wap2 I came across a problem presented as one of the most difficult sudoku problems, not solvable in the usual ways, without using enumeration with assumptions about the numbers substituted in the cells . Let's show that with a working table it is possible to solve this problem without such enumeration:

On the right is the original task, on the left is the working table after the "deletion", i.e. routine operation of removing extra digits.

First, let's agree on notation. ABC4=689 means that cells A4, B4 and C4 contain the numbers 6, 8 and 9 - one or more digits per cell. It's the same with strings. Thus, B56=24 means that cells B5 and B6 contain the numbers 2 and 4. The ">" sign is a conditional action sign. Thus, D4=5>I4-37 means that due to the message D4=5, the number 37 should be placed in cell I4. The message can be explicit - "naked" - and hidden, which should be revealed. The impact of the message can be sequential (transmitted indirectly) along the chain and parallel (act directly on other cells). For example:

D3=2; D8=1>A9-1>A2-2>A3-4,G9-3; (D8=1)+(G9=3)>G8-7>G7-1>G5-5

This entry means that D3=2, but this fact needs to be revealed. D8=1 passes its action on the chain to A3 and 4 should be written to A3; at the same time, D3=2 acts directly on G9, resulting in G9-3. (D8=1)+(G9=3)>G8-7 – combined influence of factors (D8=1) and (G9=3) leads to the result G8-7. Etc.

The records may also contain a combination of type H56/68. It means that the numbers 6 and 8 are prohibited in cells H5 and H6, i.e. they should be removed from these cells.

So, we start working with the table and for a start we apply the well-manifested, noticeable condition ABC4=689. This means that in all other (except A4, B4 and C4) cells of block 4 (middle, left) and the 4th row, the numbers 6, 8 and 9 should be deleted:

Apply B56=24 in the same way. Together we have D4=5 and (after D4=5>I4-37) HI4=37, and also (after B56=24>C6-1) C6=1. Let's apply this to a worksheet:

In I89=68hidden>I56/68>H56-68: i.e. cells I8 and I9 contain a hidden pair of digits 5 and 6, which forbids these digits from being in I56, resulting in the result H56-68. We can consider this fragment in a different way, just as we did in experiments on the worksheet model: (G23=68)+(AD7=68)>I89-68; (I89=68)+(ABC4=689)>H56-68. That is, a two-way "attack" (G23=68) and (AD7=68) leads to the fact that only the numbers 6 and 8 can be in I8 and I9. Further (I89=68) is connected to the "attack" on H56 together with previous conditions, which leads to H56-68. In addition to this "attack" is connected (ABC4=689), which in this example looks redundant, but if we were working without a worksheet, then the impact factor (ABC4=689) would be hidden, and it would be appropriate to pay special attention to it.

Next action: I5=2>G1-2,G6-9,B6-4,B5-2.

I hope it is already clear without comments: substitute the numbers that come after the dash, you can't go wrong:

H7=9>I7-4; D6=8>D1-4,H6-6>H5-8:

Next series of actions:

D3=2; D8=1>A9-1>A2-2>A3-4,G9-3;

(D8=1)+(G9=3)>G8-7>G7-1>G5-5;

D5=9>E5-6>F5-4:

I=4>C9-4>C7-2>E9-2>EF7-35>B7-7,F89-89,

that is, as a result of "crossing out" - deleting extra digits - an open, "naked" pair 89 appears in cells F8 and F9, which, together with other results indicated in the record, we apply to the table:

H2=4>H3-1>F2-1>F1-6>A1-3>B8-3,C8-5,H1-7>I2-5>I3-3>I4-7>H4-3

Their result:

This is followed by fairly routine, obvious actions:

H1=7>C1-8>E1-5>F3-7>E2-9>E3-8,C3-9>B3-5>B2-6>C2-7>C4-6>A4-9>B4- eight;

B2=6>B9-9>A8-6>I8-8>F8-9>F9-8>I9-6;

E7=3>F7-5,E6-7>F6-3

Their result: the final solution of the problem:

One way or another, we will assume that we figured out the "basic" methods in Sudoku or in other areas of intellectual application on the basis of a model suitable for this and even learned how to apply them. But this is only part of our progress in problem solving methodology. Further, I repeat, follows not always taken into account, but an indispensable stage of bringing the previously learned methods to a state of ease of their application. Solving examples, comprehending the results and methods of this solution, rethinking this material on the basis of the accepted model, again thinking through all the options, bringing the degree of their understanding to automaticity, when the solution using the "basic" provisions becomes routine and disappears as a problem. What it gives: everyone should feel it on their own experience. And the bottom line is that when the problem situation becomes routine, the search mechanism of the intellect is directed to the development of more and more complex provisions in the field of the problems being solved.

And what is "more complex provisions"? These are just new "basic" provisions in solving the problem, the understanding of which, in turn, can also be brought to a state of simplicity if a suitable model is found for this purpose.

In the article Vasilenko S.L. "Numeric Harmony Sudoku" I find an example of a problem with 18 symmetric keys:

Regarding this task, it is stated that it can be solved using "basic" methods only up to a certain state, after reaching which it remains only to apply a simple enumeration with a trial substitution into the cells of some supposed exclusive (single, single) digits. This state (advanced a little further than in Vasilenko's example) looks like:

There is such a model. This is a kind of rotation mechanism for identified and unidentified exclusive (single) digits. In the simplest case, some triple of exclusive digits rotates in the right or left direction, passing by this group from row to row or from column to column. In general, at the same time, three groups of triples of numbers rotate in one direction. In more difficult cases, three pairs of exclusive digits rotate in one direction, and a triple of singles rotates in the opposite direction. So, for example, the exclusive digits in the first three lines of the problem under consideration are rotated. And, most importantly, this kind of rotation can be seen by considering the location of the numbers in the processed worksheet. This information is enough for now, and we will understand other nuances of the rotation model in the process of solving the problem.

So, in the first (upper) three lines (1, 2 and 3) we can notice the rotation of the pairs (3+8) and (7+9), as well as (2+x1) with unknown x1 and the triple of singles (x2+4+ 1) with unknown x2. In doing so, we may find that each of x1 and x2 can be either 5 or 6.

Lines 4, 5 and 6 look at the pairs (2+4) and (1+3). There should also be a 3rd unknown pair and a triple of singles of which only one digit 5 ​​is known.

Similarly, we look at rows 789, then the triplets of columns ABC, DEF and GHI. We will write down the collected information in a symbolic and, I hope, quite understandable form:

So far, we need this information only to understand the general situation. Think it through carefully and then we can move forward further to the following table specially prepared for this:

I highlighted the alternatives with colors. Blue means "allowed" and yellow means "prohibited". If, say, allowed in A2=79 allowed A2=7, then C2=7 is forbidden. Or vice versa – allowed A2=9, forbidden C2=9. And then permissions and prohibitions are transmitted along a logical chain. This coloring is done in order to make it easier to view different alternatives. In general, this is some analogy to the "x-wing" and "swordfish" methods mentioned earlier when processing tables.

Looking at the B6=7 and, respectively, B7=9 options, we can immediately find two points that are incompatible with this option. If B7=9, then in lines 789 a synchronously rotating triple occurs, which is unacceptable, since either only three pairs (and three singles asynchronously to them) or three triples (without singles) can rotate synchronously (in one direction). In addition, if B7=9, then after several steps of processing the worksheet in the 7th line we will find incompatibility: B7=D7=9. So we substitute the only acceptable of the two alternative B6=9, and then the problem is solved simple means normal processing without any blind enumeration:

Next, I have finished example using a rotation model to solve a problem from the World Sudoku Championship, but I omit this example so as not to stretch this article too much. In addition, as it turned out, this problem has three solutions, which is poorly suited for the initial development of the digit rotation model. I also puffed a lot on Gary McGuire's 17-key problem pulled from the Internet to solve his puzzle, until, with even more annoyance, I found out that this "puzzle" has more than 9 thousand solutions.

So, willy-nilly, we have to move on to the "most difficult in the world" Sudoku problem developed by Arto Inkala, which, as you know, has a unique solution.

After entering two quite obvious exclusive numbers and processing the worksheet, the task looks like this:

The keys set in black and in larger font are original problem. In order to move forward in solving this problem, we must again rely on an adequate model suitable for this purpose. This model is a kind of mechanism for rotating numbers. It has already been discussed more than once in this and previous articles, but in order to understand the further material of the article, this mechanism should be thought out and worked out in detail. Approximately as if you had worked with such a mechanism for ten years. But you will still be able to understand this material, if not from the first reading, then from the second or third, etc. Moreover, if you persist, then you will bring this "difficult to understand" material to the state of its routine and simplicity. There is nothing new in this regard: what is very difficult at first, gradually becomes not so difficult, and with further incessant elaboration, everything becomes the most obvious and does not require mental effort in its proper place, after which you can free your mental potential for further progress on the problem being solved or on other problems.

A careful analysis of the structure of Arto Incal's problem shows that the whole problem is built on the principle of three synchronously rotating pairs and a triple of asynchronously rotating pairs of singles: (x1+x2)+(x3+x4)+(x5+x6)+(x7+x8+ x9). The rotation order can be, for example, as follows: in the first three lines 123, the first pair (x1+x2) goes from the first line of the first block to the second line of the second block, then to the third line of the third block. The second pair jumps from the second row of the first block to the third row of the second block, then, in this rotation, jumps to the first row of the third block. The third pair from the third row of the first block jumps to the first row of the second block and then, in the same direction of rotation, jumps to the second row of the third block. A trio of singles moves in a similar rotation pattern, but in the opposite direction to that of pairs. The situation with columns looks similar: if the table is mentally (or actually) rotated by 90 degrees, then the rows will become columns, with the same character of movement of singles and pairs as before for rows.

Turning these rotations in our minds in relation to the Arto Incal problem, we gradually come to understand the obvious restrictions on the choice of variants of this rotation for the selected triple of rows or columns:

There should not be synchronously (in one direction) rotating triples and pairs - such triples, in contrast to the triple of singles, will be called triplets in the future;

There should not be pairs asynchronous with each other or singles asynchronous with each other;

There should not be both pairs and singles rotating in the same (for example, right) direction - this is a repetition of the previous restrictions, but it may seem more understandable.

In addition, there are other restrictions:

There must not be a single pair in the 9 rows that matches a pair in any of the columns and the same for columns and rows. This should be obvious: because the very fact that two numbers are on the same line indicates that they are in different columns.

You can also say that very rarely there are matches of pairs in different triples of rows or a similar match in triples of columns, and also there are rarely matches of triples of singles in rows and / or columns, but these are, so to speak, probabilistic patterns.

Research blocks 4,5,6.

In blocks 4-6, pairs (3+7) and (3+9) are possible. If we accept (3+9), then we get an invalid synchronous rotation of the triplet (3+7+9), so we have a pair (7+3). After substituting this pair and subsequent processing of the table by conventional means, we get:

At the same time, we can say that 5 in B6=5 can only be a loner, asynchronous (7+3), and 6 in I5=6 is a paragenerator, since it is in the same line H5=5 in the sixth block and, therefore, it cannot be alone and can only move in sync with (7+3.

and arranged the candidates for singles by the number of their appearance in this role in this table:

If we accept that the most frequent 2, 4 and 5 are singles, then according to the rules of rotation, only pairs can be combined with them: (7 + 3), (9 + 6) and (1 + 8) - a pair (1 + 9) discarded since it negates the pair (9+6). Further, after substituting these pairs and singles and further processing tables by conventional methods we get:

Such a recalcitrant table turned out to be - it does not want to be processed to the end.

You will have to work hard and notice that there is a pair (7 + 4) in columns ABC and that 6 moves synchronously with 7 in these columns, therefore 6 is a pairing, so only combinations (6 + 3) are possible in column "C" of the 4th block +8 or (6+8)+3. The first of these combinations does not work, because then in the 7th block in column "B" an invalid synchronous triple will appear - a triplet (6 + 3 + 8). Well, then, after substituting the option (6 + 8) + 3 and processing the table in the usual way, we come to the successful completion of the task.

The second option: let's return to the table obtained after identifying the combination (7 + 3) + 5 in rows 456 and proceed to the study of columns ABC.

Here we can notice that the pair (2+9) cannot take place in ABC. Other combinations (2+4), (2+7), (9+4) and (9+7) give a synchronous triple - a triplet in A4+A5+A6 and B1+B2+B3, which is unacceptable. There remains one acceptable pair (7+4). Moreover, 6 and 5 move synchronously 7, which means they are steam-forming, i.e. form some pairs, but not 5 + 6.

Let's make a list of possible pairs and their combinations with singles:

The combination (6+3)+8 does not work, because otherwise, an invalid triple-triplet is formed in one column (6 + 3 + 8), which has already been discussed and which we can verify once again by checking all the options. Of the candidates for singles, the number 3 scores the most points, and the most likely of all the above combinations: (6 + 8) + 3, i.e. (C4=6 + C5=8) + C6=3, which gives:

Further, the most likely candidate for singles is either 2 or 9 (6 points each), but in any of these cases, candidate 1 (4 points) remains valid. Let's start with (5+29)+1, where 1 is asynchronous to 5, i.e. put 1 from B5=1 as an asynchronous singleton in all columns of ABC:

In block 7, column A, only options (5+9)+3 and (5+2)+3 are possible. But we better pay attention to the fact that in lines 1-3 the pairs (4 + 5) and (8 + 9) have now appeared. Their substitution leads to a quick result, i.e. to the completion of the task after the table has been processed by normal means.

Well, now, having practiced on the previous options, we can try to solve the Arto Incal problem without involving statistical estimates.

We return to the starting position again:

In blocks 4-6, pairs (3+7) and (3+9) are possible. If we accept (3 + 9), then we get an invalid synchronous rotation of the triplet (3 + 7 + 9), so for substitution in the table we have only the option (7 + 3):

5 here, as we see, is a loner, 6 is a paraformer. Valid options in ABC5: (2+1)+8, (2+1)+9, (8+1)+9, (8+1)+2, (9+1)+8, (9+1) +2. But (2+1) is asynchronous to (7+3), so there are (8+1)+9, (8+1)+2, (9+1)+8, (9+1)+2. In any case, 1 is synchronous (7 + 3) and, therefore, paragenerating. Let's substitute 1 in this capacity in the table:

The number 6 here is a paragenerator in bl. 4-6, but the conspicuous pair (6+4) is not on the list of valid pairs. Hence the quad in A4=4 is asynchronous 6:

Since D4+E4=(8+1) and according to the rotation analysis forms this pair, we get:

If cells C456=(6+3)+8, then B789=683, i.e. we get a synchronous triple-triplet, so we are left with the option (6+8)+3 and the result of its substitution:

B2=3 is single here, C1=5 (asynchronous 3) is a pairing, A2=8 is also a pairing. B3=7 can be both synchronous and asynchronous. Now we can prove ourselves in more complex tricks. With a trained eye (or at least when checking on a computer), we see that for any status B3=7 - synchronous or asynchronous - we get the same result A1=1. Therefore, we can substitute this value into A1 and then complete our, or rather Arto Incala, task by more usual simple means:

One way or another, we were able to consider and even illustrate three general approaches to solving problems: determine the point of understanding the problem (not a hypothetical or blindly declared, but a real moment, starting from which we can talk about understanding the problem), choose a model that allows us to realize understanding through a natural or mental experiment and - thirdly - to bring the degree of understanding and perception of the results achieved in this case to a state of self-evidence and simplicity. There is also a fourth approach, which I personally use.

Each person has states when the intellectual tasks and problems facing him are solved more easily than is usually the case. These states are quite reproducible. To do this, you need to master the technique of turning off thoughts. At first, at least for a fraction of a second, then, more and more stretching this disconnecting moment. I can’t tell further, or rather recommend, something in this regard, because the duration of the application of this method is a purely personal matter. But I resort to this method sometimes for a long time, when a problem arises in front of me, to which I do not see options for how it can be approached and solved. As a result, sooner or later, a suitable prototype of the model emerges from the storerooms of memory, which clarifies the essence of what needs to be resolved.

I solved the Incal problem in several ways, including those described in previous articles. And always in one way or another I used this fourth approach with switching off and subsequent concentration of mental efforts. I got the fastest solution to the problem by simple enumeration - what is called the "poke method" - however, using only "long" options: those that could quickly lead to a positive or negative result. Other options took more time from me, because most of the time was spent on at least a rough development of the technology for applying these options.

A good option is also in the spirit of the fourth approach: tune in to solving Sudoku problems, substituting only a single digit per cell in the process of solving the problem. That is, most of the task and its data are "scrolled" in the mind. This is the main part of the process of intellectual problem solving, and this skill should be trained in order to increase your ability to solve problems. For example, I am not a professional Sudoku solver. I have other tasks. But, nevertheless, I want to set myself the following goal: to acquire the ability to solve Sudoku problems of increased complexity, without a worksheet and without resorting to substituting more than one number into one empty cell. In this case, any way to solve Sudoku is allowed, including a simple enumeration of options.

It is no coincidence that I recall the enumeration of options here. Any approach to solving Sudoku problems involves a set of certain methods in its arsenal, including one or another type of enumeration. At the same time, any of the methods used in Sudoku in particular or in solving any other problems has its own area of ​​\u200b\u200bit effective application. So, when deciding on simple tasks sudoku simple "basic" methods are most effective, described in numerous articles on this topic on the Internet, and the more complex "rotation method" is often useless here, because it only complicates the course simple solution and at the same time, it does not provide any new information that appears in the course of solving the problem. But in the most difficult cases, like Arto Incal's problem, the "rotation method" can play a key role.

Sudoku in my articles is just an illustrative example of approaches to problem solving. Among the problems I have solved, there are also an order of magnitude more difficult than Sudoku. For example, located on our website computer models operation of boilers and turbines. I wouldn't mind talking about them either. But for now, I chose Sudoku, so that enough visually show your young fellow citizens possible ways and stages of progress towards the ultimate goal of the problems being solved.

That's all for today.

Hello! In this article, we will analyze in detail the solution of complex Sudoku using a specific example. Before starting the analysis, we agree to call the small squares numbers, numbering them from left to right and from top to bottom. All the basic principles of solving Sudoku are described in this article.

As usual, we will first look at open singles. And there were only two such b5-5, e6-3. Next, we place possible candidates on all empty fields.

Candidates will be placed in small print Green colour to distinguish from already standing digits. We do this mechanically, simply sorting through all the empty cells and entering in them the numbers that can be in them.

The fruit of our labors can be seen in Figure 2. Let's turn our attention to the cell f2. She has two candidates 5 and 9. We will have to go with the guessing method, and in case of an error, return to this choice. Let's put number five. Let's remove the five from the candidates of row f, column 2 and square four.

We will constantly remove possible candidates after setting the number, and in this article we will no longer focus on that!

We look further at the fourth square, we have a tee - these are cells e1, d2, e3, which have candidates 2, 8 and 9. Let's remove them from the rest of the unfilled cells of the fourth square. Move on. In square six, the number five can only be on e8.

More on this moment there are no pairs, no tees, let alone fours. Therefore, let's go the other way. Let's go through all the verticals and horizontals in order to remove unnecessary candidates.

And so on the second vertical, the number 8 can only be on the cells -h2 and i2, let's remove the figure eight from the other unfilled cells of the seventh square. On the third file, the number eight can only be on e3. What we got is shown in Figure 3.

There is nothing more to grab on to. We got a pretty tough nut, but we'll crack it anyway! And so, consider again our pair e1 and d2, arrange it in this way d2-9, e1 -2. And in case of our mistake, we will return again to this pair.

Now we can safely write a deuce into the cell d9! And there are seven in the square, nine can only be on h1. After that, on the vertical 1, a five can only be on i1, which in turn gives the right to place a five on the h9 cell.

Figure 4 shows what we have done. Now consider the next pair, these are d3 and f1. They have candidates 7 and 6. Looking ahead, I will say that the arrangement variant d3-7, f1-6 is erroneous and we will not consider it in the article, so as not to waste time.

Figure 5 illustrates our work. What is left for us to do next? Of course, again go through the options for setting numbers! We put a triple in the cell g1. Save as always so you can come back. One is set on i3. now in the seventh square we get a pair of h2 and i2, with the numbers 2 and 8. This gives us the right to exclude these numbers from the candidates for the entire unfilled vertical.

Based on the last thesis, we arrange. a2 is a four, b2 is a three. And after that we can put down the entire first square. c1 - six, a1 - one, b3 - nine, c3 - two.

Figure 6 shows what happened. On i5 we have a hidden loner - the number three! And i2 can only have the number 2! Accordingly, on h2 - 8.

Now let's turn to the cells e4 and e7, this is a pair with candidates 4 and 9. Let's arrange them like this: e4 four, e7 nine. Now a six is ​​placed on f6, and a nine is placed on f5! Further on c4 we get a hidden loner - the number nine! And we can immediately put four from 8, and then close the horizontal with: c6 eight.

SUDOKU is a popular puzzle game that is a number puzzle that can be overcome only by building logical conclusions. In the name Sudoku, translated from Japanese, “su” means “number”, and doku “doku” means “standing apart”. Therefore, "SUDOKU" roughly translates to "single digit".

The name "Sudoku" was given to this puzzle by the Japanese publisher Nicoli in 1984. Sudoku is an abbreviation for "Suuji wa dokushin ni kagiru", which means "there must be only one number" in Japanese. Publisher Nikoli not only came up with a sonorous name, but also for the first time introduced symmetry in tasks for their puzzles. The name of the puzzle was given by the leader of Nicoli - Kaji Maki. The whole world adopted this new Japanese name, but in Japan itself the puzzle is called "Nanpure". Nicoli has registered the word "Sudoku" as a trademark in its country.

Origins of SUDOKU

India is considered the birthplace of chess, England is considered the birthplace of football. The game of Sudoku (sudoku), which quickly spread throughout the world, has no homeland as such. The prototype of Sudoku can be considered the Magic Square puzzle, which appeared in China 2000 years ago.

The history of Sudoku as a game goes back to the famous Swiss mathematician, mechanic and physicist Leonhard Euler (1707 - 1783).

The papers in his archive, dated October 17, 1776, contain notes on how to form a magic square with certain number cells, especially 9, 16, 25 and 36. In another document entitled " Scientific research new varieties of the magic square " Euler placed in cells letters(Latin square), later he filled the cells Greek letters and called the square Greco-Latin. Exploring various options magic square, Euler drew attention to the problem of combining symbols in such a way that not one of them is repeated in any row and in any column.

AT modern form Sudoku puzzles were first published in 1979 in Word Games magazine. The author of the puzzle was Harvard Garis of Indiana. Puzzle "Number Place" (translated into Russian - "the place of the number") - this can be considered one of the first releases of modern Sudoku. It added blocks of 3x3 cells, which was an important improvement, as it allowed to make the puzzle more interesting. He used the principle of Euler's Latin square, applied it in a 9x9 matrix and added additional restrictions, the numbers should not be repeated in internal 3x3 squares.

Thus, the idea of ​​Sudoku did not come from Japan, as many people think, but the name of the game is really Japanese.

In Japan, this puzzle was published by Nicoly Inc., a major publisher of collections of various puzzles, in the Monthly Nicolist newspaper in April 1984 under the title "Number can only be used once". On November 12, 2004, The Times published the first Sudoku puzzle on its pages. This publication became a sensation, the puzzle quickly spread throughout Britain, Australia, New Zealand; gained popularity in the US.

Sudoku variants

So what is Sudoku? Currently, there are many upgrades for this popular type of puzzle, but the classic Sudoku is a 9x9 square, divided into sub-squares with sides of 3 cells each. Thus, the total playing field is 81 cells. In an appendix to my work, I will put different types Sudoku and possible solutions (my parents helped me solve them).

Sudoku vary in level of difficulty depending on the size of the square:

  • 1. For little lovers of puzzles, Sudoku is made with fields of 2x2, 6x6 cells.
  • 2. For professionals, there are Sudoku 15x15 and 16x16 cells

There are Sudoku different levels:

  • easy
  • average
  • complicated
  • very complicated
  • super complex

Decision Rules

Sudoku puzzles have only one rule. It is necessary to fill in the free cells so that in each row, in each column and in each small 3X3 square, each number from 1 to 9 would occur only 1 time. Some cells in Sudoku are already filled with numbers, and it remains for you to fill in the rest. The more numbers are initially, the easier it is to solve the puzzle. By the way, a correctly composed Sudoku has only one solution.

Sudoku solution

Sudoku solving strategy includes three steps:

  • learning the location of the numbers in the puzzle
  • preliminary arrangement of numbers
  • analysis

The best way solutions - write candidate numbers at the top of the left corner of the cell. After that, you can see exactly the numbers that should occupy this cell. Sudoku should be played slowly as it is a relaxing game. Some puzzles can be solved in minutes, but others can take hours or, in some cases, even days.

Mathematical basis. The number of possible combinations in 9x9 Sudoku is 6,670,903,752,021,072,936,960 according to Bertham Felgenhauer's calculations.

Which will help you in the development of one of the most important organs - the brain. Of course, the well-known Japanese sudoku puzzles are one of them. With their help, you can pretty much “pump up the brains”, because in addition to the need to calculate a huge number of options for the arrangement of numbers, you also need to be able to do this a couple of dozen moves ahead. In a word, this is a real paradise if you want to keep your neurons from drying out. And today we will look at the main tricks that Sudoku experts use. It will be useful for both beginners and longtime fans of these puzzles. After all, someone needs to take their first steps in the art of Sudoku, and someone needs to improve the efficiency of their decisions!

rules

If you are not yet familiar with, then first you should familiarize yourself with the rules. Believe me, they are very simple.

The playing field is a square that has dimensions of 9×9. At the same time, it is divided into smaller squares with dimensions of 3 × 3. That is, the entire field consists of 81 cells.

The condition of the problem is the numbers that are already placed in these cells.

Block (block of cells) - a small square, line or line.

What you need to do: arrange all the other numbers, following a few rules. First, there should be no repetitions in each of the small squares. Secondly, in all columns and rows there should also be no repetitions. That is, each number must occur only once in each of these blocks. In order to make everything even clearer, pay attention to the solved Sudoku:

Basic solution

As a rule, if you solve simple Sudoku, then all you need to do is write down all the possible options for each of the 81 cells and gradually cross out the unsuitable options. It's very simple.

But if you go up a level, to more complex Sudoku, then things get more interesting. It will often happen that there is no way to put new numbers, and you will have to go through the assumptions: “Let there be such a number”, after which you will need to consider this hypothesis and either come to a solution to the problem, or to a contradiction of your assumption.

But of course, there are special tricks that will help you do all this more efficiently.

tricks

1. Naked Pairs/Threes/Fours

If you have two cells in one block (square, row or column), in which you can put only 2 numbers, then it is obvious that these numbers can be removed from the possible options for other cells of this block.

More than that, this trick can be easily done with both triples and fours:

2. Hidden Pairs

A very useful technique, in a way, the opposite of naked couples. If in some two cells of one square in “ options” you have numbers that are not repeated anywhere else (within this square), then all other numbers from these two cells can be removed.

To make it even clearer, pay attention to examples (one simple and more complicated):

Fortunately, this works for both triples and fours, but it is worth mentioning a very important and very cool trick. It is not necessary that three/four cells contain the same 3 digits of the form (a;b;c) (a;b;c) (a;b;c). This option will be enough for you: (a;b) (b;c) (a;c).

3. Nameless rule

If you have a pair or triple in one column / row, which are located in the same square, you can safely remove these numbers from other cells of this square.

4. Pointing pairs

If there are two options in one row/column in “options” same digits, then such numbers can be removed from the corresponding column/row.

This can be very useful at times, especially if you find several of these pairs:

Of course, in this case, these numbers should be absent in other cells of the square, but according to the unnamed rule, this is not required.

Love Sudoku and other riddles, games, puzzles and tests aimed at developing different aspects of thinking? Get access to all interactive materials on the site to develop more efficiently.

Conclusion

We have reviewed the basic techniques that are used in solving Sudoku. I note that this is only the beginning, and in the following articles we will consider more complex and more interesting chips, thanks to which the solution of such problems will become even more interesting and easier.

As a training, the 4brain edition invites you to familiarize yourself with the file that contains sudoku different levels difficulties. Take the time to practice, because if you devote enough time to this lesson, then at the end of this course of articles, believe me, you will become a real ace in solving Japanese puzzles.

If you have any questions about these methods or Sudoku that we attach to the article, feel free to ask them in the comments!

Loading...Loading...