Thursday, April 14, 2011

How Sudoku Works

Solving a Sudoku: Simple Logic There is no right place to start a sudoku puzzle. You can shut your eyes and put your finger on the puzzle and start there, and that's as correct a place as any. Probably the most logical place to start, though, is at a row, column or box that has a lot of numbers in it.
Columns 4 and 6 each have six numbers filled in. Let's start the puzzle at column 4, which already has its 1, 3, 4, 5, 8 and 9.

In order to have one and only one of each digit from 1 to 9, we're going to hav e to provide column 4 with its 2, its 6 and its 7. But we can't just put them anywhere -- each number has a specific location in the puzzle's answer. So where does each number go? To find out, we need to look at the rows and boxes that interact with column 4. Take a look at the empty square at row 3, column 4 (3,4), and the row and box that interact with it:

The "simple logic" approach to sudoku requires only visual analysis and goes something like this: Can the 2 go in the empty square? It can't, because box 2 already has a 2, and it can only have one of each number. Can the 7 go there? Row 3 already has its 7, so we can't put a 7 there, either. That leaves us with the 6. Neither row 3 nor box 2 already has a 6, so we know the 6 is correct for that cell. We've solved our first number!


Now let's solve the rest of column 4, which still needs its 2 and its 7. The empty square at 5,4 interacts with row 5 and box 5, and the empty square at 7,4 interacts with row 7 and box 8.


Since box 5 already has its 7, we can't put a 7 in the 5,4 square. So right there we know the 2 goes at 5,4, and the 7 must go at 7,4:

We've now solved all of column 4, and we used only simple logic to do it. Since this is an easy puzzle, we could probably solve a good portion of it this way. But it's not always so clear-cut. There are strategies we can use when the solution is not so obvious, and it all starts with some little pencil marks.

No comments:

Post a Comment