Mathematical Methods In Solving Sudoku Puzzles By: Cory Trenkamp Wright State University May 24, 2006.

Slides:



Advertisements
Similar presentations
Techniques for Solving Logic Puzzles. Logic Puzzles Logic puzzles operate using deductive logic. Logic puzzles operate using deductive logic. A well-designed.
Advertisements

Copyright © Cengage Learning. All rights reserved. 6 Sets and Counting.
Welcome to our Mathematics Evening
Understanding Microsoft Excel
13.4 Map Coloring and the Four Color Theorem. We started this chapter by coloring the regions formed by a set of circles in the plane. But when do we.
Playing Fair at Sudoku Joshua Cooper USC Department of Mathematics.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Section 1.7: Coloring Graphs
X Australian Curriculum Year 5 Solve problems involving multiplication of large numbers by one or two digit numbers using efficient mental, written strategies.
Structured Graphs and Applications
Backtracking COP Backtracking  Backtracking is a technique used to solve problems with a large search space, by systematically trying and eliminating.
The Mathematics of Sudoku
Chapter 11 Systems of Equations.
Entering Data in Excel. Entering numbers, text, a date, or a time n 1Click the cell where you want to enter data. n 2Type the data and press ENTER or.
SOLVING SUDOKU Graham Hutton University of Nottingham (with thanks to Richard Bird)
The Mathematics of Sudoku Helmer Aslaksen Department of Mathematics National University of Singapore
Perform Basic Matrix Operations Chapter 3.5. History The problem below is from a Chinese book on mathematics written over 2000 years ago: There are three.
Do Now Order the following fractions from least to greatest: ½, 1/8, 1/3, 1/9 2/3, 1/6, 3/6, 2/5, 4/7 Homework: lattice multiplication worksheet.
College Algebra Prerequisite Topics Review
Solving Sudoku Mark PTTLS Micro teach. Solving Sudoku What is a Sudoku? A Sudoku is a number puzzle based on a 9x9 grid made up from smaller 3x3 blocks.
More Computational Curiosities of Sudoku ( 数独 ) Bryson R. Payne, Ph.D. North Georgia College & State University.
CS194 Project: Sudoku Difficulty Kha Chu Advisor: Professor Sahai.
SUDOKU Via Relaxation Labeling
Sudoku Puzzles Frank Hilvers Taylor O’Brien. The History of Sudoku The history of Sudoku puzzles dates back to the 18th century.  Swiss mathematician.
Positional Number Systems
Matrix Representations of Knot and Link Groups Jess May 2006 Knot Theory Knot Theory is the study of mathematical knots. A knot is a simple closed polygonal.
Digital Logic Chapter 4 Presented by Prof Tim Johnson
Progression In Calculations at Lyndhurst First School.
Adding Whole Numbers © Math As A Second Language All Rights Reserved next #5 Taking the Fear out of Math
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 Uncertainty: Data and Chance.
Chapter An Introduction to Problem Solving 1 1 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
Sudoku Hands-on Training Masters Project Presentation Yiqi Gao March 19, 2014.
CHAPTER 13 Creating a Workbook Part 1. Learning Objectives Understand spreadsheets and Excel Enter data in cells Edit cell content Work with columns and.
Our Purpose and Agenda Important outcome for 2 nd grade Whole number addition and subtraction Two- and three-digit addition and subtraction Important outcomes.
Slide 7- 1 Copyright © 2012 Pearson Education, Inc.
Linear Equations and Inequalities. Much education today is monumentally ineffective. All too often we are giving young people cut flowers when we should.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Examining data using Microsoft Access Queries Using Criteria and Calculations SESSION 3.2 This section covers specifying an exact match condition in a.
First of all, pick the number of times a day that you would like to have chocolate (more than once but less than 10) Multiply this number by 2 (just to.
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS.
Patent Pending New Minimum Number of Clues Findings to Sudoku-derivative Games up to 5-by-5 Matrices including a Definition for Relating Isotopic Patterns.
Computing Science 1P Large Group Tutorial 20 Simon Gay Department of Computing Science University of Glasgow 2006/07.
Whiteboardmaths.com © 2008 All rights reserved
Get Into Sudoku! How to play and how to become an expert.
Sudoku Solver Comparison A comparative analysis of algorithms for solving Sudoku.
Lacey Johnson Summer 2013 Student Research Project – James Madison University Sudoku can be described as a system of polynomials which can then be solved.
Topic 3 Games and Puzzles Unit 1 Topic 1. You just used reasoning to determine what happened in the story. In this unit, we are going to do the same.
1 Project Management Example Solving Sudoku 2 What is Sudoku?  Sudoku is a game with 9 columns and 9 rows and 9 “boxes” composed of a 3 x 3 Grid  Numbers.
To create a program, written in C++, that could generate a Sudoku. Elements to take into consideration: The Sudoku created must have one unique solution.
Chapter 5 Exponents, Polynomials, and Polynomial Functions.
Overview Excel is a spreadsheet, a grid made from columns and rows. It is a software program that can make number manipulation easy and somewhat painless.
CPSC 252 Hashing Page 1 Hashing We have already seen that we can search for a key item in an array using either linear or binary search. It would be better.
How Do I Solve This Thing?. You are familiar with Sudoku puzzles. For this variation, place the integers 1 – 9 into each row or column such that the.
Yr 7.  Pupils use mathematics as an integral part of classroom activities. They represent their work with objects or pictures and discuss it. They recognise.
Combinatorial Designs and Their Applications ( 組合設計及其應用 ) 應用數學系 傅恆霖.
Understanding Microsoft Excel
Eigenfaces (for Face Recognition)
Teacher Notes Supplies Needed: Class set of sudoku puzzles.
Patrick MacKinnon & Claude-Michelle Chavy-Waddy
Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9:
Christopher Hodgson and Gregory Tyler Loftis
Systems of Linear Equations
Key Words and Introduction to Expressions
adapted from Recursive Backtracking by Mike Scott, UT Austin
Sudoku (数独 sūdoku?), also known as Number Place or Nanpure, is a logic-based placement puzzle. The objective is to fill the grid so that every column,
Announcements Assignment #4 is due tonight. Last lab program is going to be assigned this Wednesday. ◦ A backtracking problem.
Unit II Game Playing.
Presentation transcript:

Mathematical Methods In Solving Sudoku Puzzles By: Cory Trenkamp Wright State University May 24, 2006

What is a Sudoku Puzzle?  A Sudoku Puzzle is a logic-based puzzle  Most puzzles are a 9 by 9 grid or matrix  Each grid is further reduced into 9 separate 3 by 3 subgrids, which I will refer to as regions throughout this presentation.

An example

Objective of the puzzle Arrange the numbers 1 through 9 in each row, column and region so the numeral only shows up once. In every puzzle, a certain number of givens will be provided in order for you to solve the puzzle. –Givens are simply numerals provided from the beginning.

As you can clearly see: each row, column and region contain the numerals 1 through 9 only once. This must hold true for every other row, column and region as well.

The History of Sudoku Although the origin of the Sudoku name is Japanese, it was actually created in New York in the 1970s by a company called Dell puzzle magazine. They called the puzzle “Number Place”. As Dell continued to quietly churn out Number Place through the Eighties, it was spotted, imitated and embraced in puzzle- obsessed Japan. Publisher Nicola renamed it Sudoku - in Japanese Su means a number and doku translates as singular.

History continued A sudoku grid is a special case of a mathematical object called a Latin square. A Latin square consists of n sets of numbers from 1 to n arranged in a square pattern so that no row or column contains the same number twice. There are two Latin squares of order two (n = 2), 12 of order three, and 576 or order four.

OrderNumber of Latin Squares

Latin Squares were first discovered by the great mathematician Leonard Euler in He first named the squares “nouveau espece de cares magiques”, translating to “the new kind of magic squares”. Latin squares got their name due to the fact that Euler used Latin symbols to display the properties of these special matrices. So even if you did not know it, every time you solve a Sudoku puzzle you’ve created a Latin Square. Congratulations!

Lets solve these things The strategy for solving a puzzle generally comprises a combination of three processes: Scanning, Marking up, and Elimination.

Scanning SCANNING is performed at the outset and periodically throughout the solving process. It is made up of two basic techniques, which may be alternated:  The first involves counting 1–9 in rows, columns, and 3 x 3 regions to identify missing numbers. Counting based upon the last number discovered may speed up the search. It also can be the case that the value of an individual box can be determined by counting in reverse — that is, scanning its 3 x 3 region, row, and column for values it cannot be, to see which is left.  The second method, referred to as cross-hatching, involves the scanning of rows or columns to identify which line in a particular region may contain a certain number by a process of elimination. For fastest results, the numbers are scanned in order of their frequency. It is important to perform this process systematically, checking all of the digits 1–9.

Marking Up Scanning comes to a halt when no further numbers can be discovered. From this point, it is necessary to engage in some logical analysis. Many find it useful at this stage to lightly pencil in possible numbers in the blank boxes. It helps to begin in the regions that already have the most numbers filled in, as there will be fewer possibilities for the empty boxes. Once all the possibilities have been filled into the empty boxes, it is necessary to analyze the diagram and start a process of Elimination.

Elimination Progress is made by eliminating numbers from one or more boxes so that you’re left with just one choice. After a number has been discovered, it generally helps to perform another scan to see the effect this number has on the rest of the puzzle. Boxes with the same combinations of possible numbers are said to be matched if the amount of penciled-in numbers in each box is equal to the amount of boxes containing them. For instance, boxes within a particular row, column, or region are said to be matched if two of them contain the same pair of possible numbers (for example 3 and 5) and no others, or if three boxes contain the same three possibilities (say, 3, 5, and 6), and no others. When this happens, you can automatically delete these numbers (3, 5, 6) that were penciled in elsewhere in the same row, column, or region as possible choices.

More methods

Naked Single This technique is also called "sole candidate" It is often the case that a cell can only possibly take a single value, when the contents of the other cells in the same row, column and block are considered. This is when, between them, the row, column and block use eight different digits, leaving only a single digit available for the cell ? 5

Hidden Single This technique is also called "unique candidate." If a cell is the only one in a row, column or block that can take a particular value, then it must have that value. This is because all rows, columns and blocks, must contain each of the digits 1 to 9. 2 ? 8 9 2

Region and Column / Row Interactions Sometimes, when you examine a region, you can determine that a certain number must be in a specific row or column, even though you cannot determine exactly which cell in that row or column. This is enough information to remove that number from the candidate list for other cells in the same row or column, but outside the region * * * * * *

Region / Region Interactions If a number appears as candidates for only two cells in two different regions, but both cells are in the same column or row, it is possible to remove that number as a candidate for other cells in that column or row **6 8*9 1 *72 XX XX XX

Naked Subset This technique is also called "naked pair" if two candidates are involved, "naked triplet" if three, or "naked quad" if four. It is sometimes called "disjoint subset". If two cells in the same row, column or block have only the same two candidates, then those candidates can be removed from the candidates of the other cells in that row, column or block. This is because one of the cells must hold one of the candidates, and the other cell must hold the other candidate - so neither can go in any of the other cells. This technique can be applied to more than two cells at once, but in all cases, the number of cells must be the same as the number of different candidates.

For example, consider a row that has the candidates: {1, 7}, {6, 7, 9}, {1, 6, 7, 9}, {1, 7}, {1, 4, 7, 6}, {2, 3, 6, 7}, {3, 4, 6, 8, 9}, {2, 3, 4, 6, 8}, {5} (The single {5} indicates that this cell already holds the value 5.) You can see that there are two cells that have the same two candidates 1 and 7. One of these cells must hold the 1, and the other cell must hold the 7, although we don't know which is which. So 1 and 7 can be removed from the candidates for the other cells. This reduces the candidates to: {1, 7}, {6, 9}, {6, 9}, {1, 7}, {4, 6}, {2, 3, 6}, {3, 4, 6, 8, 9}, {2, 3, 4, 6, 8}, {5} So now there are two cells that have 6 and 9 as the only candidates. Repeating the process for these numbers leaves: {1, 7}, {6, 9}, {6, 9}, {1, 7}, {4}, {2, 3}, {3, 4, 8}, {2, 3, 4, 8}, {5} Now we have a cell with a single candidate - i.e. we have reduced the candidates to the extent that we have determined the only value that can possibly go into this cell.

Hidden Subset This technique is known as "hidden pair" if two candidates are involved, "hidden triplet" if three, or "hidden quad" if four. It is sometimes called "unique subset". This technique is very similar to naked subsets, but instead of affecting other cells with the same row, column or block, candidates are eliminated from the cells that hold the subset. If there are N cells, with N candidates between them that don't appear elsewhere in the same row, column or region, then any other candidates for those cells can be eliminated.

For example, consider a region that has the following candidates: {4, 5, 6, 9}, {4, 9}, {5, 6, 9}, {2, 4}, {1, 2, 3, 4, 7}, {1, 2, 3, 7}, {2, 5, 6}, {1, 2, 7}, {8} (The single {8} indicates that this cell already holds the value 8.) You can see that there are only three cells that have any of the candidates 1, 3 or 7. Three candidates with only three possible cells between them means that one of the candidates must be in each of the cells. So, these three cells cannot hold any other value, meaning we can eliminate any other candidates for these cells. In this example, we're left with: {4, 5, 6, 9}, {4, 9}, {5, 6, 9}, {2, 4}, {1, 3, 7}, {1, 3, 7}, {2, 5, 6}, {1, 7}, {8}

Other methods Ariadne's Thread is used for the extremely difficult puzzles. It entails picking one of two possible solutions for a given square and following it until you reach a solution or a dead end. If you reach a dead end, you retrace your steps to the guessing point and pick a different number. Computer scientists have written algorithms that solve these puzzles quickly and accurately but are too long to discuss for this presentation.

Cory T’s Sudoku “cheat” Since it is known that every row, column and region contains the numbers 1 through 9, you can easily set up a formula in Excel to help guide you. Simply set each row, column and region to the summation of all numbers (which is 45). Then as you fill in your grid, subtract each entry from the total. This will give you a visual check and with time allows you to pick up on patterns.

Interesting Discoveries Many scientists have testified that Sudoku is more challenging than crossword puzzles and it benefits people with a mental workout. Even a Teachers magazine which is backed by the government recommended Sudoku as brain exercise in classrooms. Some studies suggest that Sudoku solving is capable of slowing the progression of Alzheimer's.

continued Not every Sudoku puzzle has one unique answer, it all depends on the amount of “givens” and the location of the “givens”. Puzzles that have only one unique solution are called proper puzzles. An irreducible puzzle is a proper puzzle from which no givens can be removed, leaving it a proper puzzle.

continued The degree of difficulty depends directly on the amount of “givens” and the location of the “givens”. Most newspapers start the week off with a simple puzzle and with each passing day, they increase the difficulty. So by the end of the week, you are left with the most difficult puzzle.

continued Minimal Sudoku The lowest known is 17 givens in a general Sudoku. It is conjectured that these puzzles are the best possible in terms of difficulty. Gordon Royle has collected a total of 36,628 distinct Sudoku with 17 givens. He has checked each one using the following: Permutations of the 9 symbols Transposing the matrix Permuting rows within a single region Permuting columns within a single region Permuting the regions row-wise Permuting the regions column-wise *There are currently no known solvable Sudoku puzzles with less than 17 givens.

The Global Craze Today there are Sudoku clubs, chat rooms, strategy books, videos, mobile phone games, card games, competitions and even a Sudoku game show. Sudoku has also sprung up in newspapers all over the world and is commonly described in the world media as "the Rubik's cube of the 21st century" and as the "fastest growing puzzle in the world".

The End I hope my addiction has been passed onto you. Questions? Comments? Concerns?