Is sudoku more than just a puzzle? asks Marcus Du Sautoy



You might think it's simply a puzzle for whiling away the time, but the mathematics of sudoku is at the heart of modern communication

'Being a mathematician often feels like being a detective solving a mystery,' said Marcus du Sautoy

Last month Finnish mathematician Arto Inkala challenged the world with what he'd calculated was the hardest sudoku ever. Most sudokus come with a health warning indicating how difficult they are to crack, from easy through to fiendish. But Inkala's sudoku was off the scale.



The difficulty ratings relate to how many logical steps will be needed at certain points in the puzzle before you can put in the next number. If a row contains one empty square it takes one logical step to deduce the missing number. But sometimes it requires a whole combination of observations and deductions to make the next move.

With only 23 of its 81 squares filled, Inkala's puzzle requires as many as eight or nine simultaneous logical steps for you to progress.



'Some people might make three or four lucky guesses and so be able to solve it in 15 minutes or half an hour, and will wonder why it's said to be so difficult,' he said. 'But it will normally take days to solve by logic.'

It's extraordinary how ubiquitous sudokus have now become. Pick up a newspaper anywhere in the world and you're likely to find one (or three) somewhere in its pages. It's an interesting reflection on the universal nature of numbers that even if the rest of the paper is in Hindi or Mandarin you'll still be able to have a go at the sudoku it contains. But it wasn't so long ago that there were no sudokus, and it was just the verbal part of your brain that got a workout on the morning crossword.

The puzzle in its modern form seems to have been first developed by an American called Howard Garns, and appeared in Dell puzzle magazines in 1979 as 'Number Place'. It wasn't until the mid-Eighties that a Japanese publication started regularly printing sudokus. The familiar name was derived from the Japanese su, meaning 'a number', and doku, roughly meaning ' single', indicating that each square can contain only one of the nine numbers.



The craze in the West was ignited by a retired Hong Kong judge called Wayne Gould, who saw the puzzles in Tokyo in the late Nineties and eventually persuaded a UK newspaper to publish its first puzzle on November 12, 2004. Soon practically every newspaper in Europe and the U.S. would feature sudoku as the puzzle's popularity spread.

Nervous of people's reaction to a puzzle involving numbers, publishers were quick to reassure their readers that no mathematics was needed to solve it. What they meant was that no arithmetic is necessary. You don't have to do any adding or subtracting to get the answer. But at its heart, the satisfaction of doing a sudoku is all about mathematics. The buzz of suddenly realising that a three must go in the lower left-hand corner is precisely the buzz you get from doing mathematics.



Contrary to the general perception, mathematics isn't about doing long division to lots of decimal places. It's about pattern-searching, piecing together a logical argument. Being a mathematician often feels like being a detective solving a mystery with certain clues which, pieced together in the right way, enable you to determine 'who dunnit'. It's the same satisfaction that's at the heart of solving a sudoku.



Finnish mathematician Arto Inkala challenged the world with what he'd calculated was the hardest sudoku ever

Although the sudoku epidemic caught hold in 2005, this type of number puzzle has a long and ancient heritage. Magic squares share much in common with sudokus. In a magic square, numbers are arranged in a grid so that if you add up the numbers in any row or column you get the same answer. The most famous magic square is an arrangement of the numbers one to nine in a 3x3 grid so that each row, column and diagonal adds up to 15.



Legend has it this magic square first appeared in around 2000 BC inscribed on the back of a turtle that emerged from the Lo river in China. The river had badly flooded, and the people offered sacrifices in an attempt to appease the river god. Each time they did so a turtle emerged from the river and walked around the sacrifice. Then a child spotted the magic square, and they realised the correct number of sacrifices to make: 15.

Once this arrangement of numbers had been discovered, Chinese mathematicians started trying to construct even bigger squares, and their most impressive achievement was a 9x9 magic square. The squares were believed to have great magical properties.



In India they were used to specify recipes for making perfumes and as a means of facilitating childbirth. Magic squares have continued to fascinate people through to the modern day. A 4x4 magic square is carved into one of the facades of Spanish architect Antoni Gaudí's famous church, the Sagrada Família in Barcelona.

The sudoku was born out of a variation of these magic squares called Graeco-Latin squares. To build one of these special squares, take the court cards and aces from a standard pack of cards and try to arrange them in a 4x4 grid so that no row or column has two cards of the same suit or rank. The problem was first posed in 1694 by the French mathematician Jacques Ozanam, who some regard as the man who invented sudoku.

One man who certainly caught the bug was the great Swiss mathematician Leonhard Euler. In 1779, not long before he died, Euler recast the problem for a 6x6 grid. Suppose you have six regiments with six soldiers in each. You can think of each regiment as having a different-coloured uniform: red, blue, yellow, green, orange and purple. Meanwhile, the soldiers in each regiment all have different ranks: colonel, major, captain, lieutenant, corporal and private. How can you arrange the soldiers in a 6x6 grid so that no column or row contains two soldiers of the same rank or the same regiment?

A sudoku is rather like a message that should have 81 characters but has lost many of them

Euler posed the problem for a 6x6 grid because he believed it was impossible to arrange the 36 soldiers satisfactorily. It wasn't until 1901 that the French amateur mathematician Gaston Tarry proved him correct.

Euler also believed the puzzle was impossible to solve for a 10x10 grid, 14x14 grid, 18x18 grid and so on, adding four each time. But this time there was a shock in store. In 1960 three mathematicians showed that it was in fact possible to arrange ten regiments in a 10x10 grid. They went on to disprove Euler's hunch entirely, showing that the only impossible grid sizes for Graeco-Latin squares are 2x2 and 6x6.

Sudokus have a slightly different set of rules, but essentially also involve arranging things to avoid duplication - you must place the numbers one to nine so that no row, column or 3x3 box features a number twice.

The sudokus we tackle are generated by computers, and there are a variety of different ways of doing it. One method is to start with a grid filled with numbers that satisfy the rules of sudoku. Then start randomly removing entries. After you remove each number the computer checks to see if there's still only one way to complete the puzzle. As soon as there are two you go back one step, putting back the number you just removed, and there is your puzzle. It's quite difficult to set the difficulty level in advance, so this is generally determined after the puzzle has been generated.

But how many distinct ways are there of arranging the numbers in the 9x9 grid which satisfy the sudoku rules?



We consider two arrangements the same if one can be changed into the other through reflection, rotation, swapping rows or columns around or relabelling the numbers. The answer was calculated in 2005 by Ed Russell and Frazer Jarvis as 5,472,730,538, enough to keep the newspapers going for a while yet.

Another mathematical problem that arises from sudoku, which hasn't been completely resolved, is determining the minimum number of entries required in a puzzle for there to be one unique way to fill in the other squares. Clearly if you have too few (for example, three numbers in the grid) then there are many ways to complete the sudoku, since there isn't enough information to impose a unique solution. It's believed you need at least 17 numbers to ensure there's just one way to complete a sudoku.

You might think that sudoku is simply a recreational puzzle with little use beyond whiling away the time. But in fact the mathematics of sudoku is at the heart of some very powerful codes that are used to communicate information effectively. Whether we're talking about an email, a picture or a conversation on a mobile phone, mathematics is used to convert the message into a string of numbers. But when the message is sent across the wires or bounced between satellites, noise can interfere with it and you can lose information.



A sudoku is rather like a message that should have 81 characters but has lost many of them. The internal logic of the sudoku means that it's possible to recover the complete message from the remaining numbers. The mathematics used to encode messages in our digital age works in a similar way. The internal logic of the message allows information to be recovered even when some of it is lost during transmission.

Despite its incredibly mathematical character, I must admit that when sudoku swept the globe in 2005 I was sceptical about its staying power. Surely once you'd worked out a strategy to crack these puzzles their fascination would wear off. It isn't like a crossword, where you've got different word games being played in each new puzzle.



The logical process for solving a sudoku is quite similar from one puzzle to the next. Hence, I reasoned, either you can do them and they get boring, or you can't do them and they're even more boring. But this doesn't seem to be the case. People who do sudokus day in, day out consider the activity to be a bit like jogging round the park. It might be the same park every day, but your body gets a workout. In the case of a sudoku it's the brain that's getting exercised.

Given my scepticism about sudokus, when someone asked me in the summer of 2005 to write a 'How to solve sudoku' manual I decided to pass. I remember telling a colleague that I thought they were a passing fad, and I bet him there wouldn't be any sudokus in the newspapers in five years' time. The colleague thought otherwise and ended up writing the book instead. I realised I might have made a mistake when a few years later I was waiting for a plane in Delhi airport. There among the Dan Browns and the Ken Folletts was my colleague's book on how to solve sudokus. This summer I had to swallow my words and pay up on our bet. I may be able to do a sudoku, but predicting the future isn't always possible using mathematics.





'The Number Mysteries' is published by Fourth Estate, priced at £16.99





