Permutations

These are called "magic squares". For the case of a three-by-three magic square, there is only one solution. Jul 30 '14 at 1: This question might just have the lowest "views: How the heck did this get so many views? Did it make Hot Network Questions for a year?! Start in the middle of the top row and enter 1. If that square is empty enter the next number; if the square is not empty put the next number underneath the last number you entered. All rows, columns and the two diagonals will sum to the same value.

Here is the 5x5 square: Thank you Alan for explaining it so well and generalising it. Does this method have a name? It helped me very much. Freya No problem, unfortunately I do not know if this method has a name, my father taught me this over 35 years ago and it all came back when I saw your question: It is a very nice way and I am glad to have been taught this. This link me be of use for even squares; m. We call this as rolling numbers. Of course there are some made from larger squares If you catch a train in London, you'll see plenty of commuters with a pen in their hand, a newspaper on their lap and one thing on their mind — Sudoku.

Navigation menu

Sudoku or Su Doku are a special type of Latin squares. They are usually 9 by 9 grids, split into 9 smaller 3 by 3 boxes.

The aim of the game is to fill every cell with one of the numbers from 1 to 9, so that each number appears exactly once in each row, column and 3 by 3 box. To help you complete the puzzle, a few numbers are already given as clues. The person credited with the invention of Sudoku is Howard Garns. The first puzzle appeared in the magazine Dell pencil puzzles and word games in and was called Number Place. The puzzle gained popularity in Japan during the s, and was picked up in by the British newspaper The Times.

Sudoku is Japanese for single number and the name is now a registered trademark of a Japanese puzzle publishing company. It's difficult to tell how many distinct completed Sudoku grids there are, but mathematicians Bertram Felgenhauer and Frazer Jarvis used an exhaustive computer search to come up with the number 6,,,,,,,, which was later confirmed by Ed Russell. Solving Sudoku requires logical thinking and a systematic approach. Normally, sufficiently many numbers are given as clues in the initial grid — the one you start the puzzle with — to ensure that there is only one solution.

The more numbers are filled in initially, the easier the puzzle becomes of course. So real Sudoku addicts probably prefer a small number of initial clues. But what is the minimal number of clues that have to be given to ensure that there is exactly one — and no more — solution? This is a good question, and one that so far mathematicians have been unable to answer, though there is good reason to believe that the number is And what if we turn this question around? Given an individual completed grid, how many minimal initial grids are there which have this grid as a solution? Here we mean those initial grids from which no more number can be removed without making several solutions possible.

Again, mathematicians do not know the answer to this question. But let's have a look at how to go about solving a Sudoku puzzle. Here's one I created to illustrate one of the basic techniques, known as scanning. Looking at the middle three boxes, we have a 3 in the left-hand box and one in the middle box, but we still need to put a 3 in the right-hand box.

So where should it go? Well, it can't go in the top row, because there's already a 3 in that row. For the same reason, it can't go in the bottom row, which leaves the middle row. There's only one free cell in the middle row, so the 3 has to go in it. Now if we look at the bottom three boxes, one of the rows already has 6 numbers.

I've called the empty cells A, B and C in order from left to right , and the numbers that are missing are 3, 7 and 8. If you look at cell C, the only number that can go in it is 7. That's because the column that C lies in already contains 3 and 8. Finding A and B is now pretty simple.

There's already a 3 in the same column as B, so B has to be 8. That means A must be 3. Solving the rest of the puzzle is a bit trickier, but well worth the effort. The Sudoku craze has swept across the globe, and it shows no signs of slowing. Several variations have developed from the basic theme, such as 16 by 16 versions and multi-grid combinations you can try a duplex difference sudoku in the Plus puzzle.

But as with magic squares and Latin squares, the popularity of Sudoku will depend on whether they can continue to offer new challenges. Sat Sri Akal, Your article is very well written and very informative. I am looking for information about a 9 square puzzle. Is it possible to have the numbers 1 to 9 positioned in a 9 square grid in a formation so that the numbers are placed so no adjacent number is next to it horizontally, vertically or diagonally.

I may have been mistaken but I believe I have seen it completed if so can anybody enlighten me. Skip to main content. The Lo Shu magic square. The magic square appearing in Melencolia shown in close-up. The knight K can move in an L-shape to any of the squares marked with an X. The middle three boxes. The bottom two rows. Is it possible to have the numbers 1 to 9 positioned in a 9 square grid in a formation so that the numbers are placed so no adjacent number is next to it horizontally, vertically or diagonally i.

Permalink Submitted by Richard H on July 10, Hi, Excellent information and very well presented!!

Mathematics of Sudoku - Wikipedia

There are then three constraints on each squares: Apart from the simplest cases where only one choice is available solving a Sudoku puzzle involves analyzing permutations. Each unsolved square can have one or more possibilities. Each unused symbol must be possible in one or more squares in a group. If we look at a Sudoku group on its own then all the unused symbols can occur in any of the unsolved squares.

However taking the other groups that share squares with this group reduces the number of possibilities. Other groups columns, regions may, for example. Each of these is a subset of the missing numbers 1;4;8;9 and it is the pattern of these subsets that are used to deduce additional constraints on the possible content of the squares.

This is the simplest case of how analysis of possibilities can be helpful in reducing the options. By using the knowledge that a symbol may occur only in a subset of the squares we cannot deduce where exactly it can go but deduce where it cannot go. The naked twin rule is just one example of a general rule for Sudoku possibilities. The rule is that if there are 'n' symbols and all possibilities for these symbols are located in a subset of 'n' squares within a group then we have a sub-group of possibilities. Apart from the twin example there are also chains. A chain is a closed loop of symbols that imply that the symbols must occur only in this group but it can not be determined where precisely the numbers go.

The same logic applies to 3 or more symbols it is not limited to just two. Using the chain rule 1; 7 or 9 can not occur in the two other unallocated squares as a 9 occurs in both of the remaining squares, making it a very useful rule. Much of this analysis so far has looked at one Sudoku group in isolation.

Each square is a member of three groups row; column and region and the rules for one group apply equally to the other groups. The usefulness does not end there. Some of the constraints are 'indirect' meaning that the implication for one square will limit what can go in another square, but because of the shared groups it is in. The simplest example of this is the X-Wing. Here four groups are logically inter-linked to form a box. If the possibilities form a particular pattern then the corners of the box must be in one of only two configurations.

The Sudoku rules are applying a two-dimensional constraint involving four groups two rows and two columns because of the X-Wing.

Secondary menu

This can become even more complicated as even more groups can become involved. These cyclic dependencies result from the ways that squares are connected via groups into interconnected grids. Both humans and computers struggle to find these inter-dependencies between possibilities. Luckily most Sudoku puzzles can be solved without needing to work them out.

Anything but square: from magic squares to Sudoku

Finding patterns within these permutation subsets is definitely a hard problem to solve. This is not just for humans, it is just as tough for computers too. Pattern matching problems like Sudoku belong to the class of the difficult problems to solve: Any analysis has to look through all the possible combinations; it cannot do it as a single linear scan of the permutations.

To spot a twin a computer needs to look through all possible combinations of two squares in a group. The time taken to solve NP complete problems does not grow linearly with problem size it grows exponentially. If it takes 2 seconds to solve a problem of size '3' it will take far longer than 4 seconds to solve a problem of double the size.

There is no simple 'trick' that a human or computer can use to solve Sudoku puzzles fast in general, if you find a way you will become a multi-millionaire. The simplest algorithm is the trial and error method which checks all the possibilities in turn without looking for rules such as excluded possibilities or only square. This can take a very long time to do as there just so many options to check - the crudest algorithm would work through something like 10 to the power 47 combinations that's 10 with 47 zeroes after it.

What is the most difficult Sudoku puzzle ever discovered? To be genuinely hard to solve a puzzle must reveal the minimum number of squares and still have a unique solution. There are many examples of puzzles that are not 'solvable' without having to make a guess on the content of the square. This is difficult to determine as there are a number of advanced solution strategies available that need to be tried before being certain that this is the case. Here is an example of a truly difficult standard puzzle that you might like to try to solve. It is not symmetric and so can be considered not a valid Sudoku.

The asymmetry can make puzzles harder to solve. The puzzle has only 21 revealed squares. Many puzzlers reckon that having a large empty space in the middle creates some very tricky puzzles.