26
More Computational More Computational Curiosities of Curiosities of Sudoku Sudoku ( ( 数数 数数 ) ) Bryson R. Payne, Ph.D. Bryson R. Payne, Ph.D. North Georgia College & North Georgia College & State University State University

More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Embed Size (px)

Citation preview

Page 1: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

More Computational More Computational Curiosities of Sudoku Curiosities of Sudoku

(( 数独数独 ))

Bryson R. Payne, Ph.D.Bryson R. Payne, Ph.D.

North Georgia College & State North Georgia College & State UniversityUniversity

Page 2: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

What is Sudoku?What is Sudoku?

Usually 9x9 grid with Usually 9x9 grid with 9 3x3 subgrids9 3x3 subgrids

Usually 17 to 32 Usually 17 to 32 “givens”“givens”

Must fill in the grid so Must fill in the grid so that each digit 1-9 that each digit 1-9 appears only once in appears only once in each column, row, each column, row, and 3x3 subgridand 3x3 subgrid

Page 3: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

What’s in a name?What’s in a name?

Japanese name (Japanese name ( 数字は独身に限る数字は独身に限る ))= = ""Sūji wa dokushin ni kagiruSūji wa dokushin ni kagiru" " = = the digits must occur only oncethe digits must occur only once

数独 数独 = “su doku” = number single = = “su doku” = number single = Chinese “shu du”Chinese “shu du”

In each row, column, and area (usually In each row, column, and area (usually 3x3 box), each digit must occur only once3x3 box), each digit must occur only once

Page 4: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Computational CuriositiesComputational Curiosities

Sudokus are special cases of magic Sudokus are special cases of magic squares (in which all rows and columns squares (in which all rows and columns add up to 45)add up to 45)

Sudokus are also special cases of Latin Sudokus are also special cases of Latin Squares (in which digits appear only once Squares (in which digits appear only once in each row & column) with the added in each row & column) with the added requirement that digits appear only once in requirement that digits appear only once in each 3x3 grideach 3x3 grid

Page 5: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

More Computational CuriositiesMore Computational Curiosities

There are approximately 6x10There are approximately 6x10 21 21 validvalid sudoku gridssudoku grids

Taking into account rotation & reflection, Taking into account rotation & reflection, there are only around 4 trillion relatively there are only around 4 trillion relatively unique sudoku gridsunique sudoku grids

Considering relabeling leaves only around Considering relabeling leaves only around 5 billion unique sudoku puzzle grids5 billion unique sudoku puzzle grids

Page 6: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

History of SudokuHistory of Sudoku

Magic squares were printed in China at least Magic squares were printed in China at least back to the 1back to the 1stst & 2 & 2ndnd centuries A.D. centuries A.D.

First believed to be introduced to the West in the First believed to be introduced to the West in the 99thth century in century in Thabit ibn QurrahThabit ibn Qurrah

Europe’s famous appearance of a magic square Europe’s famous appearance of a magic square is in Albrecht Dürer's 'Melancholia' in 1514 is in Albrecht Dürer's 'Melancholia' in 1514 where a 4x4 magic square is shown with an where a 4x4 magic square is shown with an arrangement of the numbers 1-16 and a sum of arrangement of the numbers 1-16 and a sum of 34 in each row, column and diagonal34 in each row, column and diagonal

Page 7: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

History continuedHistory continued

The Swiss mathematician Leonhard Euler The Swiss mathematician Leonhard Euler (of (of ii and and ππ fame) developed the closest fame) developed the closest historical relative to the modern sudoku, historical relative to the modern sudoku, which he called Latin Squares, while which he called Latin Squares, while teaching at the St. Petersburg Academy in teaching at the St. Petersburg Academy in RussiaRussia

Believed to have presented the puzzle on Believed to have presented the puzzle on October 17, 1776 – published 6 years laterOctober 17, 1776 – published 6 years later

Page 8: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Into the 20Into the 20thth Century Century

Euler’s puzzle remained largely unused for Euler’s puzzle remained largely unused for over 200 years, until Howard Garnes over 200 years, until Howard Garnes published the first known 9x9 Sudoku published the first known 9x9 Sudoku puzzle in Dell Puzzle Magazines in 1979puzzle in Dell Puzzle Magazines in 1979

Title of the puzzle was “Number Place”Title of the puzzle was “Number Place”

Garnes added the rule that each 3x3 block Garnes added the rule that each 3x3 block had to satisfy the same requirements as had to satisfy the same requirements as each row and columneach row and column

Page 9: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Into JapanInto Japan

Garnes’ puzzle quickly caught on in JapanGarnes’ puzzle quickly caught on in JapanOne possible explanation for Sudoku’s One possible explanation for Sudoku’s popularity in Japan is a property of the popularity in Japan is a property of the Japanese language:Japanese language: Japanese characters are more symbolic than Japanese characters are more symbolic than

phonetic, and do not lend themselves easily phonetic, and do not lend themselves easily to crosswordsto crosswords

Sudoku was first printed in the Sudoku was first printed in the Monthly Monthly NikolistNikolist magazine in April 1984 magazine in April 1984

Page 10: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Back to the USA… almostBack to the USA… almost

In 1989, Loadstar/Softdisk introduced DigitHunt In 1989, Loadstar/Softdisk introduced DigitHunt for the Commodore 64, the first known for the Commodore 64, the first known computerized version of Sudokucomputerized version of Sudoku

In 1997, a retired judge from New Zealand saw a In 1997, a retired judge from New Zealand saw a partially solved Japanese sudoku puzzle and partially solved Japanese sudoku puzzle and spent years developing & promoting a program spent years developing & promoting a program to quickly produce the puzzlesto quickly produce the puzzles

In November 2004, the London In November 2004, the London TimesTimes launched launched the puzzle, which quickly became a craze in the puzzle, which quickly became a craze in Great BritainGreat Britain

Page 11: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Back to the USABack to the USA

In the spring of 2005, sudokus finally In the spring of 2005, sudokus finally returned to the US in strong formreturned to the US in strong form

Page 12: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Hints & HeuristicsHints & Heuristics

Hints and Heuristics from Hints and Heuristics from American ScientistAmerican Scientist::The most elementary strategy for solving the The most elementary strategy for solving the puzzle is to examine each cell and list all its puzzle is to examine each cell and list all its possible occupants—that is, all the numbers not possible occupants—that is, all the numbers not ruled out by a conflict with another cell. If you ruled out by a conflict with another cell. If you find a cell that has only one allowed value, then find a cell that has only one allowed value, then obviously you can write that value in. obviously you can write that value in. The complementary approach is to note all the The complementary approach is to note all the cells within a row, a column or a block where cells within a row, a column or a block where some particular number can appear; again, if some particular number can appear; again, if there is a number that can be put in only one there is a number that can be put in only one position, then you should put it there. position, then you should put it there.

Page 13: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

More Hints & HeuristicsMore Hints & Heuristics

These are known as Level 1 rules: They restrict These are known as Level 1 rules: They restrict a cell to a single value or restrict a value to a a cell to a single value or restrict a value to a single cell. single cell. At level 2 are rules that apply to pairs of cells At level 2 are rules that apply to pairs of cells within a row, column or block; when two such within a row, column or block; when two such cells have only two possible values, those cells have only two possible values, those values are excluded elsewhere in the values are excluded elsewhere in the neighborhood. neighborhood. Level-3 rules work with triples of cells and values Level-3 rules work with triples of cells and values in the same way. in the same way. In principle, the tower of rules might rise all the In principle, the tower of rules might rise all the way to level 9.way to level 9.

Page 14: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

It’s Just Not That EasyIt’s Just Not That Easy

Part of the fun lies in the fact that not all Part of the fun lies in the fact that not all Sudokus can be solved by these rules Sudokus can be solved by these rules alone; some of the puzzles seem to alone; some of the puzzles seem to demand analytic methods that don't have demand analytic methods that don't have a clear place in the hierarchy. A few of a clear place in the hierarchy. A few of these tactics have even acquired names, these tactics have even acquired names, such as "swordfish" and "x-wing." The such as "swordfish" and "x-wing." The subtlest of them are nonlocal rules that subtlest of them are nonlocal rules that bring together information from across a bring together information from across a wide swath of the matrix.wide swath of the matrix.

Page 15: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Variations on SudokuVariations on Sudoku

Page 16: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Samurai SudokuSamurai Sudoku

Page 17: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Killer SudokuKiller Sudoku

Page 18: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

http://www.Killer-Samurai.comhttp://www.Killer-Samurai.com

Page 19: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Killer Samurai SolutionKiller Samurai Solution

Page 20: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Great ResourcesGreat Resources

Free, online Sudoku sites:Free, online Sudoku sites: http://www.sudoku.com/http://www.sudoku.com/ http://www.samurai-sudoku.com/http://www.samurai-sudoku.com/ http://sudoku.binaryworlds.com/http://sudoku.binaryworlds.com/

http://http://www.pedagonet.com/sudokuEwww.pedagonet.com/sudokuE// http://websudoku.com/ (my favorite http://websudoku.com/ (my favorite ))

http://http://www.sudokudaily.netwww.sudokudaily.net/puzzle//puzzle/ http://absolutist.com/online/sudoku/ (hints, solves)http://absolutist.com/online/sudoku/ (hints, solves) http://www.daily-sudoku.com/sudoku_online.phphttp://www.daily-sudoku.com/sudoku_online.php

Page 21: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Sudokus to print out:Sudokus to print out: http://www.sudoku.4thewww.comhttp://www.sudoku.4thewww.com http://www.killer-samurai.com/http://www.killer-samurai.com/ http://www.mathrec.org/sudoku/ - cube & http://www.mathrec.org/sudoku/ - cube &

code-doku code-doku

Pay-per-view Sudokus:Pay-per-view Sudokus:http://www.top-notch.co.ukhttp://www.top-notch.co.uk

Page 22: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Sudoku History:Sudoku History: http://www.sudokudragon.com/sudokupuzzle.htmhttp://www.sudokudragon.com/sudokupuzzle.htm http://www.spiritustemporis.com/sudoku/history.htmlhttp://www.spiritustemporis.com/sudoku/history.html http://www.conceptispuzzles.com/articles/sudoku/http://www.conceptispuzzles.com/articles/sudoku/ http://www.americanscientist.org/template/http://www.americanscientist.org/template/

AssetDetail/assetid/48550gAssetDetail/assetid/48550g http://en.wikipedia.org/wiki/Sudoku http://en.wikipedia.org/wiki/Sudoku

Page 23: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

The Holy Grail: A Sudoku SolverThe Holy Grail: A Sudoku Solver

http://sudoku.sourceforge.net/ http://sudoku.sourceforge.net/

Page 24: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Another Great SiteAnother Great Site

My web site:My web site: http://www.professorpayne.comhttp://www.professorpayne.com Has this presentation, as well as the Has this presentation, as well as the

“Computational Curiosities of Sudoku” “Computational Curiosities of Sudoku” handouthandout

Page 25: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

ConclusionConclusion

Finally – numbers are part of a positive, Finally – numbers are part of a positive, fun “craze” in the US!fun “craze” in the US!

Sudokus have a rich, multicultural historySudokus have a rich, multicultural history

Solving sudokus is primarily non-Solving sudokus is primarily non-mathematical, but might help reduce mathematical, but might help reduce “number anxiety” prevalent in our society“number anxiety” prevalent in our society

There’s a sudoku level and variation for There’s a sudoku level and variation for every taste – catch the fever today!every taste – catch the fever today!

Page 26: More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University

Thank You!Thank You!