The mathematics behind Sudoku involves many ideas such as combinatorics, graph theory, and computational complexity. This is because a completed grid is a specific type of Latin square. “An n × n square is a Latin rectangle with k = n. Specifically, a Latin square consists of n sets of the numbers 1 to n arranged in such a way that no orthogonal (row or column) contains the same number twice” (Weisstein, n.d.).
Below in Figure 1 is an example of two Latin squares of order two. Figure 2 shows two of the 576 Latin squares of order 4. As you can see in both figures, no symbol, or in our case, no number, appears more than once in each row or column, and they appear at least once.
Figure 1
Figure 2
Now let’s talk about strategy. Sudoku puzzles today are usually a 9×9 grid. In this grid, there are 9 squares, and each one contains 9 elements or boxes that need to be filled in. Each square can be thought of as a matrix. In each matrix, every element must appear once and only once. Each element also can appear once and only once in each row and column. So, not only does someone have to worry about the square or matrix they’re working on, but they also have to think about all the other squares and where the elements fall in those squares too.
There are countless techniques used to solve for the missing elements. Some include scanning strategies such as scanning in one direction, scanning in two directions, searching for single candidates, eliminating numbers from rows, columns, and boxes, and searching for missing numbers in rows and columns. Other techniques include analyzing the grid, like eliminating squares using naked pairs in a box, using naked pairs in rows and columns, using hidden pairs in rows and columns, and eliminating squares using x-wing. The most basic one to start with is scanning in one direction. However, this technique only works well for boards that have more numbers given at the beginning. After someone gets the hang of the game, they usually develop their own strategies and ways of solving, but these techniques help if someone is struggling to get started.
In order to understand why all Latin squares cannot be Sudoku grids, you first have to understand how Sudoku works. Now that we have plenty of strategies to help with that, we can look back at Figure 2. There are two Latin squares of order 4, and if we tried to turn them into Sudoku boards, one would work and one would not. This comes down to combinatorics, which is “the field of mathematics concerned with problems of selection, arrangement, and operation within a finite or discrete system” (Encyclopaedia Britannica, n.d.). More specifically, it relates to permutations, which are a type of combinatoric idea. In our case, the 4×4 grid is our finite system. A permutation is an arrangement where the order does matter. In other words, “a permutation is an ordered combination” (Pierce, n.d.).
There are two different types of permutations: ones where repetition is allowed and ones where it is not. For example, a lock box has a specific code that must be in a specific order, but the numbers could repeat, like 2-3-2. The order matters, but repetition is still allowed. An example of a permutation without repetition would be a race. The first three people who finish have a specific order—first, second, and third—but there is no repetition, because one runner cannot be both first and second.
With that understanding of permutations, we can take a look at a 4x4 sudoku grid as shown below. In order to fill it in correctly, it has to be in a specific arrangement and order matters. Not only does one have to worry about making sure each number appears once and only once in each column and row, they also have to worry about the subdivided squares. The top right square has to have a 3 in the missing spot because in that sub square there is already 1,2, and 4. There is more to worry about than just in a Latin square because as shown in figure 1, there are sub squares where numbers are repeated. Looking back at figure 2, the latin square on the left would not work as a sudoku puzzle because 1 and 2 are in the same sub square on the top left. There are other problems with that latin square that wouldn’t make it a puzzle, but if it breaks any of the rules it doesn’t work. The latin square on the right in figure 2 would work as a sudoku puzzle because each number appears once and only once in each row and column and each number appears once in every sub square as well.