4-by-4 Sudoku¶
Logic and puzzles · level 2, lesson 3 of 6
A question to start¶
This puzzle has 16 squares, and only 4 of them have numbers in them.
The rules: every row (across), every column (down) and every box (the four 2 by 2 squares with thick edges) must have the numbers 1, 2, 3 and 4, each exactly once.
With 12 empty squares and only 4 clues, you might think there are lots of ways to fill it in. But there is exactly one way, and you can find it without guessing even once. Here is something even more surprising: people have checked every possible 4 by 4 Sudoku, and no puzzle with only 3 clues has just one answer. Four is the fewest clues that can work.
By the end of this lesson you will solve this puzzle (it is question 7), and you will know why 2 clues can never be enough.
The idea¶
The rules, carefully¶
A 4 by 4 Sudoku has:
- 4 rows, going across. We number them 1 to 4 from the top.
- 4 columns, going down. We number them 1 to 4 from the left.
- 4 boxes, each a 2 by 2 square: top left, top right, bottom left, bottom right.
Every row, every column and every box must contain 1, 2, 3 and 4, each once. That means no number can appear twice in a row, twice in a column, or twice in a box.
Each square belongs to exactly one row, one column and one box. Those are the three "neighbourhoods" of the square. A number in any of its neighbourhoods is a number that square cannot be.
Move 1: the only number for this square¶
Pick one empty square. Look at its row, its column and its box. Every number you see there is ruled out for this square. If only one number is left, it must go there.
This is just like the clue riddles in level 1: cross out what cannot be, and see what is left.
Move 2: the only square for this number¶
Now turn it around. Pick one row (or column, or box) and one number that is missing from it, say 1. Look at each empty square in that row and ask: "could 1 go here, or is there already a 1 in this square's column or box?" If only one square can take the 1, it goes there.
Move 1 asks "which number fits this square?" Move 2 asks "which square fits this number?" Between them, they solve every puzzle in this lesson.
Why one number unlocks the next¶
Each number you write in is a new clue. It rules things out in its row, its column and its box. So a puzzle that looked stuck often opens up after one more square is filled. Good solvers keep going round: fill one, then look again at the squares near it.
Never guess¶
You may be tempted to guess: "maybe this is a 3?" Do not. A guess that is wrong makes a mess that you only find much later. Every number you write should have a reason: "it is 3 because row 2 already has 1, 2 and 4." If you cannot say the reason, keep looking somewhere else.
Why a good puzzle has only one answer¶
A good Sudoku has exactly one answer. That is what lets you solve it by reasons alone: if there were two different answers, no reason could tell you which one to choose.
Here is a clever way to see that some puzzles must have more than one answer. Suppose a puzzle's clues use only the numbers 1 and 2. No 3 or 4 is given anywhere. Solve it any way at all. Now swap every 3 for a 4, and every 4 for a 3. Is it still correct?
- Each row still has one 3 and one 4 (they just swapped places), so it still has 1, 2, 3, 4 once. Same for columns and boxes.
- The clues are only 1s and 2s, and we did not touch those. So the clues still match.
So the swapped grid is another answer, and it really is different, because every row has a 3 and a 4 that have changed places. So a puzzle with clues using only two different numbers never has just one answer. A good puzzle must use at least three different numbers in its clues. (That is part of why 2 clues are never enough.)
Worked examples¶
Example 1. One missing. Row 1 reads 3, 1, empty, 4. What goes in the empty square?
The row needs 1, 2, 3, 4. It has 3, 1 and 4. The only one missing is 2. When a row, column or box has three numbers, the last one is always easy.
Example 2. The only number for this square.
Which number goes in the orange square (row 2, column 2)?
- Its row (row 2) has a 1. So it is not 1.
- Its column (column 2) has a 2. So it is not 2.
- Its box (top left) has a 3. So it is not 3.
- Only 4 is left. It must be 4.
Notice that no single clue was enough. The answer came from three neighbourhoods working together.
Example 3. The only square for this number.
The top left box has no 1 yet. Which of its four squares can take the 1?
- Row 1 already has a 1 (in column 3). So neither square in row 1 of the box can be 1.
- Column 1 already has a 1 (in row 3). So the square in row 2, column 1 cannot be 1.
- Only one square is left: row 2, column 2. The 1 goes there.
We do not know yet what the other three squares of the box are. But we know exactly where the 1 is.
Example 4. A whole puzzle.
- Row 1 has 1, 2 and 4. The empty square is 3.
- Row 2 is missing 2 and 3. Its first square is in the top left box, which already has 1, 2 and 4. So that square cannot be 2: it is 3, and the last square of row 2 is 2.
- Row 3 is missing 2 and 3. Its first square is in column 1, which now has 1, 3 and 4. So it is 2, and the last square of row 3 is 3.
- Row 4 is missing 2 and 3. Its second square is in column 2, which has 2, 4 and 1. So it is 3, and the other empty square is 2.
Check every row, column and box: each has 1, 2, 3 and 4 once. Checking at the end is part of solving.
Try it¶
Puzzles for questions 3, 4 and 5:
- Row 3 reads 4, empty, 1, 2. What is the empty square?
- An empty square's row has 2 and 4. Its column has 1. Its box has 2 and 1. What number goes in it?
- Solve puzzle A below.
- Solve puzzle B below.
- Solve puzzle C below (only 4 clues!).
- Nia made a puzzle whose only clues are a 1 in the top left corner and a 2 in the bottom right corner. Explain why her puzzle cannot have just one answer.
- Solve the puzzle from the start of the lesson.
Answers
- The row has 4, 1, 2. The missing number is 3.
- Ruled out: 2 and 4 (row), 1 (column). Only 3 is left.
- Finished grid, row by row: 3 1 4 2, 4 2 3 1, 1 4 2 3, 2 3 1 4. One way: row 1 has 3 and 1, and its third square is in column 3, which has 3 and 2, so it is 4, and the last square is 2. Row 2 has 4, 2, 3, so its last square is 1. Row 3's empty square is 4 (row has 1, 2, 3). Row 4: column 1 has 3, 4, 1, so 2; column 2 has 1, 2, 4, so 3; column 3 has 4, 3, 2, so 1; column 4 has 2, 1, 3, so 4.
- Finished grid: 2 3 4 1, 4 1 2 3, 1 2 3 4, 3 4 1 2. One way: row 1 is missing only 4. Row 2's last square: row has 2, column 4 has 1, box top right has 4 and 1 and 2, so it is 3. Row 3's third square: column 3 has 4, 2, 1, so it is 3; its last square: column 4 has 1, 3, so 2 or 4, and row 3 now has 2 and 3, so 4; then row 3's first square is 1. Then row 2: first square, column 1 has 2, 1, box has 2, 3, so 4; second square is 1. Row 4: column 1 has 2, 4, 1, so 3; column 2 has 3, 1, 2, so 4; column 4 has 1, 3, 4, so 2.
- Finished grid: 3 2 1 4, 4 1 2 3, 1 4 3 2, 2 3 4 1. Start with row 1, column 3: its row has 2, its column has 4, its box has 3, so it is 1. Then row 1, column 4: row has 2 and 1, column has 3, so 4. Row 1's first square is then 3. Keep going with Move 1, square by square, and check at the end.
- Her clues use only two different numbers, 1 and 2. Take any answer and swap every 3 with every 4: you get another correct grid, and the 1 and the 2 have not moved. So there are at least two answers. (In fact there are many more.)
- Finished grid: 1 2 3 4, 3 4 1 2, 2 1 4 3, 4 3 2 1. Steps: row 1, column 2: row has 1, 4, column has 3, so 2; then row 1, column 3 is 3. Row 2, column 2: column has 2, 3, box has 1, 2, so it is not 1, 2 or 3: 4. Row 2, column 1: box has 1, 2, 4, so 3. Row 2, column 3: row has 3, 4, column has 3, 2, so 1; row 2, column 4 is 2. Row 3, column 2: column has 2, 4, 3, so 1. Row 3, column 3: column has 3, 1, 2, so 4. Row 3, column 1: row has 1, 4, column has 1, 3, so 2; row 3, column 4 is 3. Row 4: column 1 has 1, 3, 2, so 4; the last square is 1.
Common mistake¶
Checking only the row. A square has three neighbourhoods: its row, its column and its box. If you only look at the row, you might write a number that is already in the column. Always check all three.
Guessing and hoping. If you write a number without a reason and it is wrong, you may not find out until much later, and then many squares are wrong. Write only what you can explain.
Where it leads¶
- Previous lesson: Sorting circles. Next lesson: Coding with steps.
- This level: Level 2: Rules and puzzles. The whole topic: Logic and puzzles.
- Crossing out what cannot be: Clue riddles in level 1.
- In level 3 you will move up to the full 9 by 9 Sudoku: Level 3.
- How many 4 by 4 Sudoku grids are there? Exactly 288. Counting things like this is part of Counting.