Like HowStuffWorks on Facebook!

How Sudoku Works

Solving a Sudoku: Possible Numbers

Penciling in possible solutions for empty squares becomes crucial as sudoku puzzles get harder. But you're not guessing when you pencil in. You're simply listing the possible solutions. You shouldn't guess at sudoku -- it'll probably end up messing up the entire puzzle so that you have to start all over, because everything is interconnected.

By penciling in all of the possible numbers for each square in a given row, column or box, we can use certain strategies to solve the section. Let's look at row 7, which has four empty squares and needs a 4, a 5, a 6 and a 9.

We're going to pencil in all of the numbers that could possibly solve each empty square, respectively. So, of the numbers 4, 5, 6 and 9, which could possibly solve the square at 7,2? The 4 can't go there, because column 2 already has a 4. The 5 is a possibility, because neither row 2 nor box 7 has a 5 yet. The 6 is out because box 7 has a 6 already. The 9 could go there, because row 2 and box 7 are both missing a 9. So we're going to pencil in "5 9" for the square:

Using the same process for the square at 7,5, we can eliminate the 4 and the 9 (box 8 already has one of each) and pencil in a 5 and a 6. For the square at 7,6, we can pencil in a 5 and a 6. And for the square at 7,8, any of the numbers will work:

Looking at the numbers you've penciled in, you'll notice two things: First, two of the squares have the same pair of numbers (and only those two numbers), and second, the 4 only appears once. Let's start with the 4 that only appears in square 7,8. Using what we'll call the "single occurrence" strategy, we know that if the only place a 4 can go is in 7,8, we've solved that square, because row 7 needs a 4. So now, row 7 looks like this:

Now, let's look at the repeating pair: Both 5 and 6 -- and only 5 and 6 -- can go in squares 7,5 and 7,6. What we've got here is a set of matching pairs. The 5 must go in one of those two squares, and the 6 must go in one of those two squares. Using the matching pairs strategy, we can now eliminate the 5 from the square at 7,2, because we know it doesn't go there. We've solved another square:

By the way, the "matching pairs" elimination strategy also works as "matching triplets," where you have three squares with the same trio of numbers, and only that trio of numbers, in each square.

From what we've penciled in so far, we still don't know which square gets the 5 and which gets the 6, so we'll pencil in some more numbers. Let's see what we can do with box 8, which has four empty squares and needs its 1, 2, 5 and 6.

Two of those squares are already penciled in with a matching pair of 5 and 6, so we know we can eliminate 5 and 6 as possible solutions for the other boxes. That leaves us with 1 and 2. Either one of those numbers could solve the square at 8,5 -- neither row 8 nor column 5 has a 1 or a 2. But row 9 has a 2, so we can't pencil in a 2 for the 9,5 square. Here's what we've got:

Notice anything? There's only one number in the 9,5 square. Using what Mepham dubs the lone number strategy -- probably the simplest strategy in sudoku -- we know that 1 is the solution at 9,5. And since the 1 for box 8 is at 9,5, we can eliminate the penciled-in 1 from the square at 8,5, leaving only a 2 -- and another solved square.

But we still don't know the correct position for the 5 and the 6. Solving column 6 will tell us which number solves the square at 7,6. We have three empty squares in column 6, one of which is already penciled in with all of its possible solutions:

Column 6 needs a 1, a 5 and a 6. For the square at 3,6, 1 and 5 are possibilities (row 3 already has its 6). For the square at 5,6, the only possible solution is a 6, because box 5 already has a 1 and a 5.

We now know that the solution at 7,6 has to be the 5, the solution at 3,6 has to be the 1, and the solution at 7,5 has to be the 6.

Because the interaction between rows, columns and boxes is the whole point in sudoku, solving a single square can instantly show you five other solutions. Up to now, we've used simple logic and we've looked for possible numbers for a given square. In the next section, we'll use another approach: looking for possible squares for a given number.