75Games

The logic of sudoku

A sudoku has one rule and no arithmetic. See which digits can go in a cell, find a digit with only one home and count how many solutions a puzzle has.

Puzzle page

A puzzle with one rule and no arithmetic

In a sudoku the digits are only symbols. You could use letters or colours and the puzzle would be the same. The rule is short. Every row, every column and every box must hold each digit once. Nothing is added up. A good puzzle also has exactly one solution, so every move can be reasoned out and nobody has to guess.

Four boxed puzzles to try. Play the rule on a small grid. See which digits can go in a cell. Find the place where a digit has only one home. And count how many solutions a puzzle has as you take clues away. The page works all of this out for you in the browser. Without a script each puzzle shows one grid or table.

First puzzle

The one rule

Start small. This grid has 4 rows, 4 columns and four boxes of 2 by 2, and the digits are 1 to 4. Each row, column and box needs all four digits, once. The grey digits are given. Fill in the rest.

Click a cell and type a digit from 1 to 4, or press the space bar or delete to clear it. A digit that repeats in its row, column or box turns red. When the grid is full and no digit repeats, it is solved.

A 4 by 4 sudoku with six digits given
13
4
24
1

Fill each row, column and box with 1 to 4, once. Six digits are given.

Second puzzle

What can go here

In a 9 by 9 sudoku, a cell can take a digit only if that digit is not already in its row, its column or its box. The digits left are the candidates. When only one candidate is left, that is the answer. It is called a naked single.

Click a cell to see its row, column and box, and the digits that can go there. Turn on the pencil marks to see the candidates of every cell. Press the button to find a cell with only one candidate.

A 9 by 9 sudoku with 34 digits given
61853
846
61489
35468
865921
7
983
58
4289

Click a cell to see which digits can go in it.

Third puzzle

Where can this digit go

You can also look at it from the other side. Take a digit and a row, a column or a box. If that digit can go in only one cell of it, it must go there, even if that cell has other candidates too. This is a hidden single.

Pick a digit. Cells that hold it are marked. Cells that it cannot go in, because of a copy in the same row, column or box, are shaded. If a box, row or column has only one free cell left for the digit, the page marks it.

The same 9 by 9 sudoku
61853
846
61489
35468
865921
7
983
58
4289

Pick a digit to see where it can still go.

Fourth puzzle

How many solutions

A finished small grid is a set of clues you can take away. Click a digit to remove it and the page counts every way to finish the grid. While the count is 1, the puzzle has one solution. Take away too much, and there are many.

The page can also count all the 4 by 4 grids by trying every digit, and finds 288. For the usual 9 by 9 there are 6,670,903,752,021,072,936,960 grids by the count in the sources. Checking one a second would take about 211 trillion years.

A finished 4 by 4 grid. Click a digit to take it away.
1234
3412
2143
4321
How many grids there are
SizeDifferent finished grids
4 by 4288
9 by 96,670,903,752,021,072,936,960

All sixteen digits are given, so there is one way to finish the grid. Click a digit to take it away.

Key takeaways

  1. The rule of sudoku is that every row, column and box holds each digit once. The digits are only symbols.
  2. The candidates of a cell are the digits not yet in its row, column or box. With one candidate left, that digit is the answer.
  3. A digit that has only one cell it can go in, in a row, column or box, goes there. That is a hidden single.
  4. A good puzzle has exactly one solution. Taking clues away can make it have many.
  5. There are more than 6 sextillion valid 9 by 9 grids, and 288 of the 4 by 4 kind.

Sources

Some of these sites could not be opened while this page was written, so some facts were checked through search results that quote them. The rule of every row, column and box holding each digit once, naked singles and hidden singles as the first techniques, the count of 6,670,903,752,021,072,936,960 grids by Felgenhauer and Jarvis, Howard Garns and Number Place in a Dell magazine in 1979, Maki Kaji bringing it to Japan in 1984 and The Times beginning to print it in November 2004 each appeared in at least two places. Sources differ on the month of the count and on some dates in the history, and the page gives the years most agree on. One source says a puzzle with a single solution needs at least 17 clues, without naming who proved it, and the page says so and does not name a person. The count of 288 grids of 4 by 4, the candidates, the singles, the solution counts and the 211 trillion years (the 9 by 9 count in seconds, divided by the seconds in a year) are computed on the page. The 9 by 9 puzzle was made for this page and checked to have one solution.