how to solve sudoku mathematically

Upload: harsh-goel

Post on 11-Feb-2018

247 views

Category:

Documents


11 download

TRANSCRIPT

  • 7/23/2019 How to Solve Sudoku Mathematically

    1/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Sudoku New Mathematical model of Sudoku and solution Technique

    Harsh V. [email protected]

    Sudoku New Mathematical model of Sudoku and solution Technique ........................................ .. 1Mathematical model ........................................................................................................................ 1

    Introduction................................................................................................................................. 1FAQ ................................................................................................................................................ 2

    Definitions .................................................................................................................................. 3Mathematical Model ................................................................................................................... 8Solution grid ............................................................................................................................... 8Application of mathematical model in solving Sudoku Puzzle ................................................... 10Solution methods ...................................................................................................................... 10

    Example 1 Simple case .............................................................................................................. 11Example-2 (Can You Crack the World's Toughest Sudoku? ) ................................................... 18http://www.foxnews.com/scitech/2010/08/19/crack-worlds-toughest-sudoku/................. 18Example 3 (Near Impossible Sudoku) ....................................................................................... 31Example 4 - An Interesting mail (solution provided) ................................................................. 43

    Appendix-B (Some of the Question answered using this Model) ................................................... 65Possible Number of classic 99 Sudokusolution grids .............................................................. 65

    Mathematical model

    Introduction

    If you love to solve the puzzles and want to explore the new methods in Sudoku, you must try thisnew Model, it will help to understand that how we can solve any Sudoku without much trouble insystematic way, also how the given logics to solve Sudoku can be translated into mathematicalmodel and human mind functionality can be translated into mathematics.

    This method reduces the three dimension (rows, columns and Boxes) constraints to twodimensions (rows and columns) only, so it expand the search criteria, at the same time it spilt thenumber into three coordinates provides more scope and flexibility for new rules.

    This method will give thought food to the exploring minds to dig further , those who has time and

    wants to get their hand dirty and satisfy the quest of mind, must try this method.

    Feel free to contact me for feedback and clarifications at [email protected]

    Every destination is a station for next destination Harsh Vardhen Goel

  • 7/23/2019 How to Solve Sudoku Mathematically

    2/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    FAQ

    1. Do I need a computer to solve this?

    No, Computer is not required only paper and pencil is required

    2. Is it possible to solve any valid Sudoku?

    It is possible, at least I think so, unless someone come and prove it to wrong.

    3. Is this method simple and Fast?

    No , it is not simple or fast, but it is alternative and systematic approach for Sudoku core lovers,the pattern used by human brain is modelled and the constrained used to solve it, are madepart of it, so by following simple logic we could find solution. But it takes some initial time tounderstand the model and method.

    4. How I could be benefited in solving Sudoku, using this method?

    It gives a new dimension to thinking, all techniques used here can be used in solving anySudoku, basically it enhance Sudoku solving skills and I would say brain functioning.

    5. Would I lose the beauty of solving Sudoku?

    As I said, for some beauty defined, is beauty lost but for some everything is a station (part ofjourney) and not destination.

    6. Where else this mathematical model could be used apart from solving Sudoku puzzles.

    This model can be used to solve any Latin number patterns, I do see a wide scope for this

    model in understanding Latin squares, and it will extend our understanding on this subject.

    7. What Next?

    I am looking for Sudoku enthusiastic to come and help to define new rules as each number issplit into 3 parts ( row, column and Box ) so we can expand our understanding in solvingcomplex problems.

  • 7/23/2019 How to Solve Sudoku Mathematically

    3/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Definitions

    Sudoku

    It is a puzzle presented as a square grid that is usually 9 9.(Some time more or less like 4x4, 6x6 or 12x12 grids are used, but currently we will consider only

    the 99 case)

    Example of a typical Sudoku is given below

    Fig 1 : Sudoku

    A Sudoku gridhas 9 rows, 9 columnsand 9 boxes( each box has 9 numbers). The full grid has81 cells.

    Following words are self-explanatory for the conventional Sudoku, below is the pictorialview

    NumberRowColumnsBoxes

  • 7/23/2019 How to Solve Sudoku Mathematically

    4/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Number, row, Column and box are illustrated below

    Fig 2: Number, rows, columns and Box in convention Sudoku representation

    Rules to solve the Sudoku

    Place the number in blank cells such that in each row , cell has unique number from 1 to 9at the same time in each column , cells has unique number from 1 to 9 at the same time in

    each box , cell has unique number from 1 to 9

    Harshs Method of solving Sudoku

    The grid has been re-plotted again having 9 rows, 9 Column and 9 boxes. (Termed as solutiongrid)

    Now each row represents here is a number, each column represents a box

    So what has been changed?

    Number of the conventional Sudoku is representing a row here (termed as number row)Box of the Conventional Sudoku is repenting columns here (termed as box column)

    To make it simple, the conventional Sudoku is now represented in a 2D table where each columnis representing the number of the conventional Sudoku and each row is repenting the boxThe cell value in the new solution grid representing the xy coordinates of the conventional Sudoku.

  • 7/23/2019 How to Solve Sudoku Mathematically

    5/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Fig 3: 2D model of the conventional Sudoku representation

    And now plot the same 2D Box wise

    Now here comes the solution Grid

  • 7/23/2019 How to Solve Sudoku Mathematically

    6/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    This can be ploted on papers or using the excel sheet

    So here vertical columnsare number and the row are the boxes of conventional Sudoku.Each coloumn have two sub cououmn x and y

    Now it is easy to plot the

    As

  • 7/23/2019 How to Solve Sudoku Mathematically

    7/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Take some time to graps the method, is is re-eplained further.

    Another example (in other words)

    Below is the another example , pictorial view of X and Y coordinates for given numbers in Sudoku,later these X and Y coordinates will be used to find the solution.

  • 7/23/2019 How to Solve Sudoku Mathematically

    8/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Few more terms:

    Givensthe numbers already provided in the SudokuCandidatesNumber(s) supposed to be right number for a cell.

    Mathematical Model

    This mathematical modelling of a Sudoku puzzle is done by defining each number (as Numbercolumn N1, N2.) into X and Y Coordinates and placed against each box (here Box row asB1, B2.). Below is pictorial view of the mathematical model.

    Terms in mathematical model

    Solution grid

  • 7/23/2019 How to Solve Sudoku Mathematically

    9/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Row B1 to B9 presents Boxes 1 to 9 of SudokuColumn N1 to N9 represents number 1 to 9 of Sudoku.

    So the given Sudoku can be re-presented in the mathematical model as given below.

    Now as it looks, it becomes pretty simple to eliminate unwanted coordinates and isolatecandidates coordinates very easily.

  • 7/23/2019 How to Solve Sudoku Mathematically

    10/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Application of mathematical model in solving Sudoku Puzzle

    Objective complete the Sudoku gridby placing the digits 1 to 9 (each digit only once) ineach cellof the small boxes(3x3 regions); at the same time you must create a rowof uniquedigits going across each rowand each columns.

    In other words Complete the gridby placing digits 1 through 9 in each cellin such a way thatonly one of each digit is present in every row, column and box.

    How to start

    1. Make a solution grid ( or use ready-made one)2. Mark the coordinate sets (XY)of each given numberin the solution gridagainst each

    number column and box row.3. Follow base activities ( see next topic)4. Follow solution methodsrecursively to eliminate numbers until you achieve the solution.

    Follow step 3 and 4 again and again till final solution reached.

    Base Activities

    1. Eliminate Coordinate Xin each number column for givenor newly find numbers Xcoordinate.

    Details -> for each number columns strike out all the same X coordinates for given numbercoordinate (X)

    2. Eliminate Coordinate Y in each number column for given or newly find numbers coordinates (Y)

    Details -> for each columns strike out the same Y coordinates for the given Number Coordinate Y.

    3. Strike-out the coordinate set from the coordinate summary column

    Important: These Base activities need to be followed every time as soon as a newcoordinates set (Number) has been identified

    Solution methods

    Naked Single

    See if any cell left with single X and Single Y (Naked Singles) coordinates; fill the number inthe Sudoku for that coordinate set. And eliminate that coordinate from entire Columns (

    base activities )

    Naked pair /Triples

    See if any cell left with two values of X and Single Y or vice versa ( naked pair Coordinate set ) ; remove those value of unwanted coordinates across the row ( Box) Andrepeat base activities, same rule can be extended to naked triples

    Squeezing method

  • 7/23/2019 How to Solve Sudoku Mathematically

    11/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Check the summary column, in case all the coordinates set in a row or column of a boxstroked off, and then eliminate all X or Y coordinates in the box row.

    Unique single coordinate

    In the number columns, check for cells having only one value left for X or Y coordinate,scan all other cells in that column and eliminate that corresponding X or Y values from allcells in that number column,

    Unique Coordinate set

    Check the box row for any unique set of coordinate, treat that as naked single and eliminateall X or Y coordinates in the number column.

    Impossible Coordinates/possible coordinates

    Across the box row, Check possible values of XY coordinates with the summary columnagainst the available coordinate set; eliminate the already used coordinate values fromthose cells

    Possible pairs/triple pairs of coordinates

    Across the box row, look-out the possible pairs or triplets of coordinate sets, eliminate thosecoordinate set from rest of the cells. ( see example-2 for details)

    Note: These are some of the solution methods and there is ample scope for mathematician andgame lovers to fill this space with more and more solution methods with time.

    Remember to apply base activities as soon as new coordinate set has been identified as unique.

    Example 1 Simple case

    Solution methods with Examples

    Take a blank Solution grid (as given below)

  • 7/23/2019 How to Solve Sudoku Mathematically

    12/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Write down all the Coordinates for the given numbers (as have eliminated all other numbers fromthose cells to make is clear)

    . Now apply base activities

    For Column N1 ( N1 means number1) Coordinates values given are 11,63.46.58,92 and 77 soremove values for X = 1,6,4,5,9 and 7 and Y = 1,3,6,8,2 and 7 from entire column N1

  • 7/23/2019 How to Solve Sudoku Mathematically

    13/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    For Column N2 (N2 means number 2) Coordinate values given are 21, 83 and 78 so removevalues for X = 2, 8 and 7 and Y = 1, 3 and 8 from entire column N2

    For Column N3 (N3 means number 3) Coordinate values given are 13, 27 and 52 so removevalues for X = 1, 2 and 5 and Y = 3, 7 and 2 from entire Column N3

    For Column N4 (N4 means number 4) Coordinate values given are 23, 62 and 97 so removevalues for X = 2, 6 and 9 and Y = 3, 2 and 7 from entire Column N4

    For Column N5 (N5 means number 5) Coordinate values given are 33, 64, 48, 96 and 87 soremove values for X = 3,6,4,9 and 8 and Y = 3,4,8,6 and 7 from entire Column N5

    For Column N6 (N6 means number 6) Coordinate values given are 26 and 45 so remove values forX = 2 and 4 and Y = 6 and 5 from entire Column N6

    For Column N7 (N7 means number 7) Coordinate values given are 32,14,65,76 and 98 so removevalues for X = 3, 1, 6,7and 9 and Y =2, 4, 5, 6 and 8 from entire Column N7

    For Column N8 (N8 means number 8) Coordinate values given are 12, 47, 84 and 99 so removevalues for X = 1, 4, 8 and 9 and for Y =2, 74 and 9 from the entire Column N8

    For Column N9 (N9 means number 9) Coordinate values given are 34, 18 and 89 so removevalues for X = 3, 1 and 8 and Y =4, 8 and 9 from entire Column N9

    Impossible Coordinates/possible coordinates

  • 7/23/2019 How to Solve Sudoku Mathematically

    14/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Consider Cell B7N7 values are 81 and 83 but only 81 is possible so B7N7 is 81 ( meansnumber 7 will be there in box 7 at x=8 and y=1 in Sudoku ) follow base activities i.e. Strikeout X=8 and Y=1 from N7 column

    Apply Squeezing method

    Check the summary column, in case all the coordinates set in a row or column of a box strokedoff, and then eliminate all X or Y coordinates in the box row.

    Case-1Applicable for B1 row, all coordinates, 11,12 and 13 occupied so strike-out x=1 from B1 row (i.e. since all other cells are either known or given only in B1N6 we can strike out X=1 ) , nowthe possible value left in B1N6 is 31 ( means value of number 6 in box 1 is Y=3 and X=1 ) ,now follow base activities , Strike-out X=3 and Y=1 from N6 column. And strike-off 31 from B1summary column

    The value left in the summary column for B1 is 22 so Value in B1N9 is 22, follow base activityi.e. strike out X=2 and Y=2 from entire column N9

    Row B1 Completed

    Case-2

    Solution method Squeezing is also applicable for B9 where all values 97, 98 and 99 occupied,so strike off X=9 from entire row B9

    Also all three i.e. 77, 87, 97 is occupied so strike-off y=7 from B9 rowNaked Single - See if any cell left with single X and Single Y (Naked Singles) coordinates; fillthe number in the Sudoku for that coordinate set. And repeat base activities

    Consider Cell B3N7-> Values are 27 and 29 but 27 is not possible as already occupied bynumber 3 in box 3, so only possible value is 29 , ( follow base activities i.e. strike out X =2 andY = 9 from N7 and strike-off 29 from summary column.

    Consider B3N5, values are 19 and 29 but only 19 is possible as 29 is already occupied inprevious step, strike off 19 from summary column

    Consider B3N1 values are 29 and 39 but 29 not possible so only 39 possible, strike off 39 fromsummary colour of B3 and strike x=3 from Column N1

    Consider B3N4 values are 18,19 , 38 and 39 but only 38 is possible as rest of them stroke-offalso follow base activities i.e. strike-off x=3 and Y=8 from the entire row N4

  • 7/23/2019 How to Solve Sudoku Mathematically

    15/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now in row B3 all three i.e. 19, 29 and 39 stroke off so strike off Y=9 from row B3 ( for the left

    over cells) so value.

    Value left in B2N5 is 25

    Now Consider B4N2 values are 42, 52 and 62 but only 42 is available strike of X=4 and Y=2from column N2 , Similarly for B4N5 value are 51 and 52 but 51 is only free, so strike off Y=1from column N5, In B7N5 value left is 71.

    Consider B7 row, in B7N4 values are 71 and 81 but only 71 is free, strike off X=7 from N4column

    Now in B7N3 only value left is 91 (out of 71, 81 and 91) strike-off X=7 from N3 column, sovalue left in B9N3 is 88In B9N6 is 79 (last value in the row B9)In B7N8 value left is 73 (as 71 is occupied by B7N4 )

  • 7/23/2019 How to Solve Sudoku Mathematically

    16/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now in B7N9 possible available value is 93 ( strike-off Y=3 from column N9 ) and value left inB7N6 is only and only 82 ( strike-off X=8 from B8N6 )

    Here we see some symmetrical numbers; that symmetry can be used for error correction (ofcourse human errors)

    So for more clarity here is the picture- repainted again

    now value left in B8N1 is 85 only hence in B2N1 will be 24 only ( after eliminating y=5 fromcolumn N1) , value left in B8N6 is 94 and in B8N2 is 95 only keep on doing base activities as

    this will help in elimination if unwanted numbers

    So value left in B8N9 is 75

    Now in B6N7 only 57 is possible so strike out x=5 from B4N7 hence only 43 is possible.

    Now in B6N9 67 is only possible so strike out X=6 from N9 column and 56 is only possible soleft-out in B4N9 is 41

    In B6N6 only 68 is possible so in B4N6 53 is left and in B3N6 17 is leftIn B4N7 only 53 is left

    A clean picture after considering all base-activities

  • 7/23/2019 How to Solve Sudoku Mathematically

    17/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now in B3N2 only value left is 37 so in B2N2 X=3 got eliminated remaining value in B2N2 is 16In B2N4 is 15 and in B5N2 is 54 and value left in B6N2 is 69.Looks like chain reaction happened, and we are getting large numbers of naked singlescoordinates and values here.

    Now Value left in B6N4 is 56 so in B5N8 is 55, so strike out Y=5 from B2N8 left is 36, so inB2N3 is 35, so strike Y=5 from B5N3

    Here is the solution

  • 7/23/2019 How to Solve Sudoku Mathematically

    18/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    I feel it would give a lot of scope for seekers mind to explorer further much easier way to solveSudoku, as well as computer programmer to re-write logic.

    Hope you enjoyed the alternative method to solve the Sudoku, Believe me it is good for brainexercise.

    Example-2 (Can You Crack the World's Toughest Sudoku? )

    http://www.foxnews.com/scitech/2010/08/19/crack-worlds-toughest-sudoku/

    Yes, we can using this new Model.

    Take a blank Solution grid (as given below)

  • 7/23/2019 How to Solve Sudoku Mathematically

    19/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Write down all the Coordinates for the given numbers (as have eliminated all other numbers fromthose cells to make is clear) - make a note of the colour single coordinate set in a cell indicatesthat number position has been identified

    Eliminate duplicates X and Y coordinates from each column

  • 7/23/2019 How to Solve Sudoku Mathematically

    20/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Method used: base activities

    1. Eliminate Coordinate Xin each number column for givenor newly find numbers Xcoordinate.

    2. Eliminate Coordinate Y in each number column for given or newly find numbers coordinates (Y)

    3. Strike-out the coordinate set from the coordinate summary column

    Consider B1N4 Y=2 is unique, and X=3 not possible as 32 is not possibleConsider B2N5 value 25 is unique so it is naked single here; strike off 25 from summary column. InB3N3 Y=9 is unique , In B5N3 y=5 not possible as 55 is already occupied, only value left is 56 ,now strike off 56 from summary column and eliminate X=5 and Y=6 from N3 column. So in B8N3

    Y=5 not possible and Y=6 become unique

    In B7N9 X=8 is unique also 83 is not possible so eliminate Y=3 from B7N9.

    Also Since 46 and 56 is not possible so strike out y=6 from B5N8

  • 7/23/2019 How to Solve Sudoku Mathematically

    21/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now consider method: Possible pairs/triple pairs of coordinates

    Across the box row, look-out the possible pairs or triplets of coordinate sets, eliminate thosecoordinate set from rest of the cells.

    B4N6 and B4N7, possible values (Coordinate set) are 43 and 61.

    Similarly Consider B5N1 and B5N6 , the values set are 44 and 66 ( I have marked them inseparate colour ) now value Y=6 not possible in B5N6, Now since 46,56 and 66 are identified soeliminate, Now value left in B5N4 is 54 ( eliminate X=5 and Y=4 from Column N4) since 54already occupied so value left in B5N8 is 45 ( eliminate X=4 and Y=5 from N8)

    In B2N4 25 and 35 not possible so eliminate Y=5, here 6 become unique candidate, and in B8N4Y=5 become unique.

  • 7/23/2019 How to Solve Sudoku Mathematically

    22/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Consider the solution sheet afresh for clarity

    Consider B4N8 value left is 53 (eliminate X=5 and Y=3 from N9) also eliminate Y=3 from Box rowB4 (from cells B4N2, and B4N9 only) as rest two could have value 43.

    Now consider the Cell B5N9 the only value left is 65 (eliminate X=6 and Y=5 from the N9)

  • 7/23/2019 How to Solve Sudoku Mathematically

    23/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Consider B4N5 value left is 62 (eliminate X=6 and Y=2 from N5) so value left in B6N5 is 58(eliminate Y=8 from N5)

    Now consider the cell b6n1, B6N2,B6N6 and B6N7 the possible values are 48,49, 67 and 68 sothe cell left is B6N9 with value 59 ( Eliminate X=5 and Y=7 from N9)

    Now the value left in B4N9 is 42 (eliminate Y=2 from N9) value left in B7N9 is 81 (eliminate Y=1from N9)

    Now value left in B4N2 is 52 (eliminate X=5 and Y= 2 from N2)

  • 7/23/2019 How to Solve Sudoku Mathematically

    24/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In B7N9 value left is 81 so eliminate Y=1 from N9, since 13 is not possible so eliminate X=1, Nowin B3N9 X=1 become unique so value is 18,

    Coordinate Values in red not possible

  • 7/23/2019 How to Solve Sudoku Mathematically

    25/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    So the value left in B6N2 is 49 and in B6N7 is 48, value in B9N5 is 89

    Clearing the unwanted coordinates , Value left in B5N6 is 66 as x=4 eliminated due to B4N6 (valueis 43) as B4N7 is 61,

    The value left in B7N5 is 91 , since B5N6 is 66 so B5N1 is 44 and value left in B7N7 is 73 as Y=1eliminates due to value of 61 in B4N7.

    Examine the column N1 B9N! Has Y=8 as unique, so eliminate X=8 and Y=7 and 9,

    In Cell B3N6, 18 and 28 not possible so eliminate y=8

  • 7/23/2019 How to Solve Sudoku Mathematically

    26/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now chain reaction begin, follow the same sequence otherwise difficult to understand

    X=8 become unique in B8N1 so value is 86, now the value left in B8N7 is 84 ( eliminate X=8 andY=4 from N7) now since all 84,85 and 86 occupied so eliminate X=8 from B8.Value left in B8N2 is 76 (eliminate X=7 and Y=6 from N2)

    Now chain reaction continue, value left in B9N6 is 98 as other value not possible (eliminate X=9and Y= 8 from n6, so value left in B9N1 is 78 (eliminate X=7 from N1)

    Value left in B7N1 is 93 as 91 is not possible, (eliminate Y=3 from N1) so value left in B1N1 is 11as the only value possible in B1N6 are 11 and 31 but 11 is occupied so only possible is 31. (Letstake a break!!!)

    Since all the value 87, 88 and 89 occupied so remove X=8 from B9.

    I did cross check again and check the solution sheet with base activities, fast approaching towardsolution; this is really difficult Sudoku,

  • 7/23/2019 How to Solve Sudoku Mathematically

    27/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Value left in B7N2 is 92 ( eliminate Y=2 from N2 ) value left in B7N3 is 71 ( eliminate X=7 and Y=1from N3 ) , and last value in the box row B7 for B7N8 is 82 ,. Hurry.. O my gosh. This wecould find earlier as unique coordinates... Anyway

    Rapid fire round : in B1N2 ( y=2 is out due to B7N2 =92) so value left is 33 ( eliminate X=3 fromB2N2 so value left is 15 ) , in B1N3 Y=1 is out due to B7N3 value is 71 ) so value left is 22 (eliminate X=2 from N3 ) now since 22 is already occupied value left in B1N4 is 12 ( eliminate X=1from N4 ) value left in B1N9 is 23 ( eliminate X=2 from B2N9) so value left is 34.

    Since X=7 eliminated from B8N3 so value left in B8N3 is 95 and in B8N4 is 75.

  • 7/23/2019 How to Solve Sudoku Mathematically

    28/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Fresh screen shot

    Now value left in B3N2 is 39, in B2N6 is 24 and in B3N6 it is 17,

  • 7/23/2019 How to Solve Sudoku Mathematically

    29/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    So X=7 is eliminated in B9N4 so value left is 99, and last value in B9N8 is 77,

    Since y=9 eliminated in B6N4 so value left is 67 and in b6n1 is 69 , so in B3N1 it is 27.

    Now value left in B8N8 is 94 (sorry in previous screen shot I marked it as done, but itwas not), the value left in N3N8 is 19 and so on.

  • 7/23/2019 How to Solve Sudoku Mathematically

    30/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Here is the solution

    Feel free to contact me for feedback, further clarifications at [email protected]

  • 7/23/2019 How to Solve Sudoku Mathematically

    31/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Example 3 (Near Impossible Sudoku)

    With thanks

    Place the numbers in the Sudoku solution grid.

    Identify the x and y coordination (elimination round 1)

  • 7/23/2019 How to Solve Sudoku Mathematically

    32/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Move forward and find singles example - In B5N7 out of 44 and 46 only 44 is possible as 46 is

    already occupied, marking 4 in y as red as all the 4s ( 44 , 54 and 64 is occupied and no more 4 is

    possible) also B2N7 Y is 4 not possible.

    In B5N2 66 is the only option left

    Now B5N2 solution is 66, so mark all Y=6 in B5 as red , as 46,56 and 66 is occupied.

    In B4N2 mark X=6 as red.

  • 7/23/2019 How to Solve Sudoku Mathematically

    33/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In N3, N4 and N8 mark Y=5 as red except B5 row.

    A clean view

    Now consider B4N8 , 51 is the only option, so in B5N8 solution left is 65 leading B5N3 as 45 and

    B5N4 is 55.

    Eliminate X=5 for N4 except B5N4 , X=4 from B6N3, and Y=1 from B1N8

  • 7/23/2019 How to Solve Sudoku Mathematically

    34/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now target B4N2 , only option is now 53, Y=3 from B1N2 and B4N6 causes number left in B4N6

    42.

    Now since all 42, 52 and 62 occupied so Y=2 not possible in B4N5 and B1N6

    Consider B6N3 only option is 68 so Y=8 from rest of the B6 and B9N3

  • 7/23/2019 How to Solve Sudoku Mathematically

    35/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now consider the cell B1N2 , only option is 11 ( identified long ago but somehow overlooked )

    this lead to B1N3 as 31 thereafter X=3 from B2N3 is eliminated.

    Some sanity check, in B3N4 Y=7 not possible, and in B7N4 X=8 not possible

  • 7/23/2019 How to Solve Sudoku Mathematically

    36/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Considering the cell B2N1 ( should have taken earlier), only option is 15 therefore B1N1 is 21,

    B7N1 is 82 and B9N1 is 99 leading to B9N7 as 79 so B7N7 has to be 92

    A cleaner view

  • 7/23/2019 How to Solve Sudoku Mathematically

    37/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    So in B7N5 and B1N7 Y=2 not valid

    Below, doing some sanity check in B9N9 Y=9 not possible, in B1N5 Y=1 and Y=3 not possible.

  • 7/23/2019 How to Solve Sudoku Mathematically

    38/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Grouping the numbers

    Now applying advance logic

    19 is not possible in B3N9 as B3N5 has 19 of same group ( Blue)

  • 7/23/2019 How to Solve Sudoku Mathematically

    39/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    So eliminating 19 from B3N4

    Considering the grouping in N4

    41->69->73->

    But alternatively

  • 7/23/2019 How to Solve Sudoku Mathematically

    40/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    63->47->91-> neither Y=7 possible nor other option so this chain is discarded

    Marking all Blue as green ( valid) and all yellow as red ( not valid)

    Below is the clear view

  • 7/23/2019 How to Solve Sudoku Mathematically

    41/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Cleaning up the B2N8 cell as Y=4 become invalid so valid value for B2N8 is 36 hence X=3 in

    B2N7 become invalid so the value for B2N7 is 26

    Further cleaning up the cells, as X=2 become invalid for B1N7 the number in B1N7 is 33 causing

    X=3 invalid for the B1 row ( except B1N7)

  • 7/23/2019 How to Solve Sudoku Mathematically

    42/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    On similar lines , X=2 become invalid for B2N6 , X=1 and Y=9 for B3N6 and B3N9.

    Regroup them again ( based on the validity into two colours ) the wipe out the impossible group.

    Here I leave it to you to proceed further.

    Solution for this Sudoku is as below

  • 7/23/2019 How to Solve Sudoku Mathematically

    43/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Example 4 - An Interesting mail (solution provided)From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaTo: harshgoel2k Subject: Re: Mathematical model for solving Sudoku

    Hi Harsh,

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa I still haven't been able to solve this puzzle using any methods,including those from the Sudoku Professor! I really would like to know if your mathematical approach can"crack" this puzzle. Let me explain my notation system below for setting up the givens in the puzzle.

    I'll explain where to place the first f ive givens:

    1/4:9 ---> put a 9 in the cell at row 1 and column 41/9:8 ---> put an 8 in the cell at row 1 and column 82/4:8 ---> put an 8 in the cell at row 2 and column 42/7:6 ---> put a 6 in the cell at row 2 and column 72/8:3 ---> put a 3 in the cell at row 2 and column 8etc.

    Please document your solution step by step, so I can follow along with your logic. Please "walk methru your solution".

    I hope to hear from you soon.

  • 7/23/2019 How to Solve Sudoku Mathematically

    44/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Best Regards,

    -----Original Message-----From: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaTo: harshgoel2k Subject: Re: Mathematical model for solving Sudoku

    Hi Harsh,

    I have been working out examples using your method and feeling more confident about it. I tried it onone Sudoku that could not be solved using the thirteen techniques faaaaaaaaawhich were my maintechniques for solving puzzles of All levels of difficulty! aaaaaaaaaaaaaaaaaaaaaaaaaad confirmed thatthere is ONE UNIQUE SOLUTION! Please see if you can solve this one using your method; Iaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

    1/4:9 1/9:82/4:8 2/7:6 2/8:33/6:3 3/7:2 3/8:4 3/9:94/2:7 4/3:9 4/4:5 4/9:25/3:6 5/4:3 5/6:9 5/7:76/1:5 6/6:7 6/7:9 6/8:1

    7/1:2 7/2:1 7/3:4 7/4:78/2:5 8/3:8 8/6:29/1:6 9/6:8

    Good luck; I really hope your method will solve this one. Please document fully so I can follow yoursolution.

    Best Regards,

    Here is the solution -

    Solution:

    Fill the numbers in the solution sheet.

  • 7/23/2019 How to Solve Sudoku Mathematically

    45/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Eliminate the un-wanted co-ordinates

  • 7/23/2019 How to Solve Sudoku Mathematically

    46/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Here in B9N2 co-ordinate is identified as 98, mark this as green. Cleaning further

  • 7/23/2019 How to Solve Sudoku Mathematically

    47/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Let me discuss few examples here

    B2N2 and B2N4 , Y=4 not possible as 14 and 24 both are not possible

    In B3N1, B3N5, B3N7 X=3 not possible as 37, 38 and 39 already used.

    In B4N1 Y=3 not possible as 43 and 53 both used.

    In B5N2 Y=5 not possible as in B2N2 Y=4 is not possible, only Y=5 possible so in B5N2 Y=5 not

    possible.

    B6N8 X=6 not possible as 67 and 68 both used.

    In B7N3 and B7N9 X=7 not possible as 71,72 and 73 are used.

    In B8N1 and B8N4 Y=6 not possible as 86 and 96 both used up.

    In B9N9 X=9 not possible as 98 is already used.

    Now moving to next step. Marking all the identified singles

  • 7/23/2019 How to Solve Sudoku Mathematically

    48/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In B1N1 Y=1 not possible as Y=1 already identified as unique single in B1N1.

    And in B6N5 y=7 not possible as 57 is already used.

    Moving forward

  • 7/23/2019 How to Solve Sudoku Mathematically

    49/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In B5N2, X=5 not possible as 54 is already used in B5N3 so only option left is 64,

    That eliminates X=6 from B4N2 causes only option for B4N2 as 52 because 53 is already used in

    B4N6

    Also Y=4 eliminated from Row B5 as 44, 54 and 64 all used up now.

    Moving inch further

  • 7/23/2019 How to Solve Sudoku Mathematically

    50/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Since we have all the 3 in row B1 has been identified, so mark all Y=3 as red ( eliminate)

    i.e. in B1N3 , B1N7 and B1N8 ( Y=3 not possible)

    this causes further chain reaction , in B7N7 Y= 3 become unique ( only possible )

    Here is the catch, now B7N7 out of 83 and 93 only 93 is possible.

  • 7/23/2019 How to Solve Sudoku Mathematically

    51/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In B9N7 X=9 not possible as X=9 already taken in N7 column.

    Applying more logic, in B4N3 Y=3 is unique number. So as Y=3 not there in the B4 Row and

    otherwise as well, from the row N3 Considerations. So only possible number in B4N3 is 63.

    This causes some reaction. In row B6N3 X=6 Not possible so only number left is 47 as 49 is

    already used in B6N2.

  • 7/23/2019 How to Solve Sudoku Mathematically

    52/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now consider B6N3 Since X=6 is out and value 49 is not possible as it is already taken so the only

    option left is 47, so for B6N3 value is 47

    Now 47, 57 and 57 all used, no more Y=7 in the B6 so B6N4 X=4 and Y= 7 not possible aldo Y=7

    not possible in B6N8 cause Y=8 as unique in B6N8 which further eliminate Y=8 from the B9N8 so

    the only value left in B9N8 is 77

    Now have a clean

  • 7/23/2019 How to Solve Sudoku Mathematically

    53/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now Applying a new rule

  • 7/23/2019 How to Solve Sudoku Mathematically

    54/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Since In B7 Y=1 is possible in B7N3 and B7N9 So In B1N7 and B1N9 only one Y=1 will be used,

    But we need three Y=1 in B1 so B1 N4 Y=1 become unique. And hence in B4N4 Y=2 become

    unique so the value in B4N4 is 62

  • 7/23/2019 How to Solve Sudoku Mathematically

    55/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In Above Figure, B4N4 is marked green with value 62 eliminate X=6 from B5N4 and B5N4 so the

    value in B6N4 is 59 , Further in B6N5 value 59 is eliminated so the value for B6N5 is 58 ( causes

    Y=8 eliminated from B9N5) further the leftout value in B6N8 is now 48 which eliminate X=4

    from the B5N8 and B4N8 .\

    Next

  • 7/23/2019 How to Solve Sudoku Mathematically

    56/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In above figure

    In row B6 all the cells has been occupied except B6N6 the left out value is 69, which causes a big

    chain reaction. X=6 eliminated from B5N6 so in B5N4 and B5N6 is only 45 and 46 so the value in

    B5N1 is 55 ( left unique because other two values 45 and 46 not possible, now the value in B5N8 is

    65 only as 55 is already taken by B5N1,

  • 7/23/2019 How to Solve Sudoku Mathematically

    57/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In Above figure, in B4N8 the value left out is 51 as 52 is already taken, eliminating X=2 from the

    B1N8

    Also in Row B4 the value left out for B4N1 is 41.

    The value in B1N8 become 32 , causes elimination of X=3 from B1N6 , now value in B1N6 is 12,now X=3 become unique in B2N6 so it has value 34. Causes elimination of Y=4 from B8N6.

  • 7/23/2019 How to Solve Sudoku Mathematically

    58/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Now this become pretty simple , I will walk over few steps more , In the above figure, since B1N6

    become 12 so value left in B1N3 is 11 and then B1N4 is 21 , X=1 not possible for B1N7 so B3N7

    become 18,

    Taking case of B7N3 , value is 92 because X=1 not possible as x = 1 in B1N3 already. This leadsto B7N9 as 81. Now X=9 not possible for B8N3 and B9N3, and X = 8 for B8N9 and B9N9, so the

    value left in B9N8 is 78. And in B9N6 is 88

  • 7/23/2019 How to Solve Sudoku Mathematically

    59/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Moving further in D8N9 x=7 eliminated so value is 95, in B1N7 , 21 is already used so left value is

    31 . in B2N7 value left is 25 so value in B2N2 is 15. So value in B1N2 is 23.

  • 7/23/2019 How to Solve Sudoku Mathematically

    60/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    X=2 eliminated from B1 row.

    In B2N4 only value possible is 16 caused B5N4 as 45 consequently B5N6 as 46. Causes B8N6 as

    75 which further causes B8N3 as 85 which leads to B9N3 as 79.

    Taking a clean picture

  • 7/23/2019 How to Solve Sudoku Mathematically

    61/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

  • 7/23/2019 How to Solve Sudoku Mathematically

    62/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In the above figure, life is now become very easy now. I need not to explain it.

  • 7/23/2019 How to Solve Sudoku Mathematically

    63/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    And the final answer is, here we go. Without fail

  • 7/23/2019 How to Solve Sudoku Mathematically

    64/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Keep me posted on [email protected]

    Happy Sudoku solving

  • 7/23/2019 How to Solve Sudoku Mathematically

    65/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    Appendix-B (Some of the Question answered using this Model)

    Possible Number of classic 99 Sudokusolution grids

    Extract from Wiki with thanks. (http://en.wikipedia.org/wiki/Sudoku)

    The first known calculation of the number of classic 99 Sudokusolution grids was posted on the

    USENETnewsgroup rec.puzzlesin September 2003[12]

    and is 6,670,903,752,021,072,936,960

    (sequence A107739in OEIS), or approximately 6.67 x 1021

    . This is roughly 1.2106

    times the

    number of 99 Latin squares. A detailed calculation of this figure was provided by Bertram

    Felgenhauer and Frazer Jarvis in 2005.[13]

    As per my calculation based on mathematical model the number of classic 9X9 Sudoku solution grids is

    1,908,360,529,573,850,000,000,000,000 or approximately ~ 1.908x1027 .

    , here is the calculation (need

    some one to cross verify this)

    For first box row (B1)Any number can be placed in first cell (9) but in second only 8 numbers are possible, in 3

    rdonly 7and so .

    So maximum possible value is N! = 362880.

    In second Box row (B2),

    Any two numbers can be placed with 6 coordinate-set, another 2 at 5 places, another 2 at 4 places, and 1 at3 places, one at two places and remaining last at 1 place. So values comes out to be

    =6x5x4X6X5X4X3X2X1 = 86400

  • 7/23/2019 How to Solve Sudoku Mathematically

    66/67

    How to solve Sudoku Mathematical Method by Harsh Goel [email protected]

    In third row (B3)

    Any three numbers at 3 places another two at three places and remaining numbers at 1 place each

    So value comes out = 3x2x1x3x2x1x3x2x1= 216

    For B4 it is 34560For B5 it is 9216For B6 it is 64For B7 it is 216For B8 it is 64

    Above two diagram gives the no. of maximum possibilities of a number in a particular box row

    (numbers are interchangeable, but no. of coordinate sets (values) will be unchanged for Sudoku as

    whole.

    So the final value comes out to be 1,908,360,529,573,850,000,000,000,000 or approximately ~

    1.908x1027

    To understand this better, I would suggest first get a good understanding of the model first (transformation ofrow-columns-boxes of Sudoku into box-row and number columns of Harsh Method )

    I am waiting for the feedback from Sudoku experts on this calculation. And need your suggestion as well onit to improve it further.

  • 7/23/2019 How to Solve Sudoku Mathematically

    67/67

    Version information

    Version 0.90 Draft Version

    .

    .

    .

    Version 6.0 Solution details for a near impossible Sudoku (Example 3 on Page 25 ) added - Dated 5 Jan 2014Version 7.0 One more Sudoku added with detail solution steps ( Example 4 Page 38 ) Dated 1 March 2014

    * Thanks for appreciation mails, further I am working on indexing the content of this document and

    will uploaded the document with index as soon as I get some spare time.- Thanks

    Feel free to contact for any clarification or feedback, at [email protected]