(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 28968, 753]*) (*NotebookOutlinePosition[ 29621, 776]*) (* CellTagsIndexPosition[ 29577, 772]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Sudoku Solver", "Section"], Cell[CellGroupData[{ Cell[" inits", "Subsection"], Cell["<", "Input"], Cell["\<\ blokje[m_,r_,c_]:=Take[m,{1+3*Floor[r/3-1/3],3+3*Floor[r/3-1/3]},{1+3*Floor[c/\ 3-1/3],3+3*Floor[c/3-1/3]}]\ \>", "Input"], Cell[BoxData[ \(inx[r_, c_] := Table[{x, y}, {x, 1 + 3*Floor[r/3 - 1/3], 3 + 3*Floor[r/3 - 1/3]}, {y, 1 + 3*Floor[c/3 - 1/3], 3 + 3*Floor[c/3 - 1/3]}]\)], "Input"], Cell[BoxData[ \(putblok[mat_, new_, {r_, c_}] := \(kandi = ReplacePart[mat, new\ , Flatten[inx[r, c], 1], Flatten[inx[1, 1], 1]\ \ ]\)\)], "Input"], Cell[BoxData[ \(putrow[mat_, new_, r_] := \(kandi = ReplacePart[mat, new\ , Table[{r, c}, {c, 9}], Table[{c}, {c, 9}]\ \ \ ]\)\)], "Input"], Cell[BoxData[ \(putcol[mat_, new_, c_] := \(kandi = ReplacePart[mat, new\ , Table[{r, c}, {r, 9}], Table[{r}, {r, 9}]\ \ \ ]\)\)], "Input"], Cell[BoxData[ \(elimblok[{x_, y_}, q_] := \(kandi = putblok[kandi, blokje[kandi, x, y] /. \ q \[Rule] Sequence[], {x, y}]\)\)], "Input"], Cell[BoxData[ \(elimrow[r_, q_] := \(kandi = putrow[kandi, Part[kandi, r, All] /. \ q\ \[Rule] Sequence[], r]\)\)], "Input"], Cell[BoxData[ \(elimcol[c_, q_] := \(kandi = putcol[kandi, Part[kandi, All, c]\ /. \ q \[Rule] Sequence[], c]\)\)], "Input"], Cell["kandi=Table[Range[9],{9},{9}];", "Input"] }, Open ]], Cell[CellGroupData[{ Cell["input", "Subsection"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "9", "8", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "7", "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "5", "0", "0", "0"}, {"1", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "2", "0", "0", "0", "0", "9"}, {"0", "0", "0", "9", "0", "6", "0", "8", "2"}, {"0", "0", "0", "0", "0", "0", "0", "3", "0"}, {"5", "0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "4", "0", "0", "0", "2", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "0", "0", "0", "0", "0", "0", "1", "0"}, {"4", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "2", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "5", "0", "4", "0", "7"}, {"0", "0", "8", "0", "0", "0", "3", "0", "0"}, {"0", "0", "1", "0", "9", "0", "0", "0", "0"}, {"3", "0", "0", "4", "0", "0", "2", "0", "0"}, {"0", "5", "0", "1", "0", "0", "0", "0", "0"}, {"0", "0", "0", "8", "0", "6", "0", "0", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "2", "0", "0", "4", "0", "0", "7", "0"}, {"9", "0", "0", "5", "0", "8", "0", "0", "4"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"4", "0", "0", "0", "3", "0", "0", "0", "8"}, {"0", "7", "0", "0", "9", "0", "0", "2", "0"}, {"6", "0", "0", "0", "1", "0", "0", "0", "5"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"5", "0", "0", "6", "0", "4", "0", "0", "1"}, {"0", "3", "0", "0", "0", "0", "0", "9", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], " ", RowBox[{"(*", " ", RowBox[{ RowBox[{ "still", " ", "not", " ", \(solving\ !\), " ", \(it'\), "s", " ", RowBox[{"(", "\[NoBreak]", GridBox[{ {"8", "2", "6", "1", "4", "3", "5", "7", "9"}, {"9", "1", "7", "5", "2", "8", "3", "6", "4"}, {"3", "4", "5", "9", "6", "7", "1", "8", "2"}, {"4", "5", "2", "7", "3", "6", "9", "1", "8"}, {"1", "7", "8", "4", "9", "5", "6", "2", "3"}, {"6", "9", "3", "8", "1", "2", "7", "4", "5"}, {"2", "6", "1", "3", "8", "9", "4", "5", "7"}, {"5", "8", "9", "6", "7", "4", "2", "3", "1"}, {"7", "3", "4", "2", "5", "1", "8", "9", "6"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], " ", "*)"}]}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", "\[NoBreak]", GridBox[{ {"0", "2", "0", "0", "0", "0", "0", "7", "0"}, {"0", "0", "0", "5", "0", "8", "0", "0", "4"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"4", "0", "0", "0", "3", "0", "0", "0", "8"}, {"0", "7", "0", "0", "9", "0", "0", "2", "0"}, {"6", "0", "0", "0", "1", "0", "0", "0", "5"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"5", "0", "0", "6", "0", "4", "0", "0", "1"}, {"0", "3", "0", "0", "0", "0", "0", "9", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", "\[NoBreak]", GridBox[{ {"5", "0", "0", "1", "2", "0", "0", "0", "0"}, {"0", "3", "0", "0", "0", "0", "0", "0", "0"}, {"4", "0", "0", "0", "6", "0", "1", "9", "0"}, {"0", "4", "0", "0", "0", "0", "0", "5", "0"}, {"0", "0", "2", "7", "0", "0", "6", "0", "0"}, {"7", "0", "0", "0", "0", "8", "0", "4", "0"}, {"0", "0", "8", "0", "0", "0", "0", "6", "0"}, {"0", "2", "9", "3", "0", "0", "0", "0", "8"}, {"0", "0", "0", "0", "9", "0", "7", "0", "0"} }, ColumnAlignments->{Decimal}], "\[NoBreak]", ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", GridBox[{ {"0", "4", "0", "0", "9", "0", "0", "0", "0"}, {"0", "0", "2", "8", "0", "0", "3", "4", "0"}, {"0", "0", "0", "1", "0", "5", "0", "8", "0"}, {"3", "0", "5", "0", "8", "1", "6", "0", "0"}, {"8", "0", "0", "7", "0", "6", "0", "0", "9"}, {"0", "0", "9", "0", "0", "0", "0", "3", "0"}, {"2", "5", "0", "0", "0", "4", "0", "0", "6"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "7", "0", "0", "0", "0", "0", "1"} }], ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", GridBox[{ {"0", "8", "0", "9", "0", "0", "0", "0", "0"}, {"0", "0", "6", "0", "8", "0", "0", "0", "1"}, {"0", "0", "0", "0", "0", "1", "0", "6", "3"}, {"0", "0", "0", "6", "0", "0", "3", "0", "2"}, {"0", "5", "0", "4", "0", "9", "6", "0", "0"}, {"4", "0", "0", "1", "0", "0", "0", "0", "0"}, {"2", "0", "5", "0", "0", "0", "0", "7", "4"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"9", "7", "0", "0", "3", "0", "0", "0", "0"} }], ")"}]}], ";"}], TraditionalForm]], "Input"], Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"mat", "=", RowBox[{"(", GridBox[{ {"0", "4", "0", "7", "0", "0", "0", "0", "0"}, {"0", "7", "1", "0", "0", "2", "0", "3", "8"}, {"0", "5", "2", "0", "0", "0", "0", "0", "0"}, {"0", "0", "3", "0", "0", "5", "0", "1", "0"}, {"0", "0", "0", "1", "8", "4", "0", "0", "0"}, {"0", "1", "0", "6", "0", "0", "2", "0", "0"}, {"0", "0", "0", "0", "0", "0", "1", "8", "0"}, {"1", "2", "0", "3", "0", "0", "6", "7", "0"}, {"0", "0", "0", "0", "0", "9", "0", "4", "0"} }], ")"}]}], ";", " ", RowBox[{"(*", " ", RowBox[{\(it'\), "s", " ", TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"3", "4", "8", "7", "6", "1", "9", "2", "5"}, {"6", "7", "1", "5", "9", "2", "4", "3", "8"}, {"9", "5", "2", "8", "4", "3", "7", "6", "1"}, {"4", "6", "3", "9", "2", "5", "8", "1", "7"}, {"2", "9", "7", "1", "8", "4", "3", "5", "6"}, {"8", "1", "5", "6", "3", "7", "2", "9", "4"}, {"5", "3", "9", "4", "7", "6", "1", "8", "2"}, {"1", "2", "4", "3", "5", "8", "6", "7", "9"}, {"7", "8", "6", "2", "1", "9", "5", "4", "3"} }], "\[NoBreak]", ")"}], (MatrixForm[ #]&)]}], " ", "*)"}]}], TraditionalForm]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["loop to solve step-by-step", "Subsection"], Cell[TextData[{ "Map[(#/. {_Integer,_Integer..}->0)&, (kandi=MapAt[0&,Table[Complement[", "Flatten[{", StyleBox["Part[kandi,r,c]", FontColor->RGBColor[1, 0, 0]], "}]", ",Flatten[blokje[mat,r,c]],Part[mat,All,c],Part[mat,r,All]],{r,9},{c,9}],\ Position[mat,_?Positive,{2}]]+mat ),{2}]//MatrixForm" }], "Input"], Cell["Position[kandi,{_Integer}]", "Input", Background->RGBColor[1, 1, 0]], Cell["Flatten[Extract[kandi,%]]", "Input", Background->RGBColor[1, 1, 0]], Cell["\<\ (mat[[Sequence@@#1]]=#2)&@@@Transpose[{%%,%}]; mat//MatrixForm\ \>", "Input"], Cell[TextData[{ "Map[(#/. {_Integer,_Integer..}->0)&, \ (kandi=MapAt[0&,Table[Complement[Flatten[{", StyleBox["Part[kandi,r,c]", FontColor->RGBColor[1, 0, 0]], "}],Flatten[blokje[mat,r,c]],Part[mat,All,c],Part[mat,r,All]],{r,9},{c,9}],\ Position[mat,_?Positive,{2}]]+mat ),{2}]//MatrixForm" }], "Input"], Cell[TextData[{ "Map[(#/. {}->0)&, (obligado=MapAt[0&,Table[", StyleBox["Intersection@@(Complement[Flatten[{Part[kandi,r,c]}],#]&/@{\ Flatten[blokje[MapAt[{}&,kandi,{r,c}],r,c]],Part[MapAt[{}&,kandi,{r,c}],All,c]\ ,Part[MapAt[{}&,kandi,{r,c}],r,All]})", FontColor->RGBColor[1, 0, 0]], ",{r,9},{c,9}],Position[mat,_?Positive,{2}]]+mat ),{2}]//MatrixForm" }], "Input"], Cell["Position[obligado,{_Integer}]", "Input", Background->RGBColor[1, 1, 0]], Cell["Flatten[Extract[obligado,%]]", "Input", Background->RGBColor[1, 1, 0]], Cell["\<\ (mat[[Sequence@@#1]]=#2)&@@@Transpose[{%%,%}]; mat//MatrixForm\ \>", "Input"], Cell[TextData[{ "Map[(#/. {_Integer,_Integer..}->0)&, (kandi=MapAt[0&,Table[", StyleBox["Intersection@@(", FontColor->RGBColor[1, 0, 0]], "Complement[", StyleBox["Flatten[{Part[kandi,r,c]}]", FontColor->RGBColor[1, 0, 0]], ",reserved[#]]", StyleBox["&/@{Flatten[blokje[MapAt[0&,kandi,{r,c}],r,c]", FontColor->RGBColor[1, 0, 0]], StyleBox[",1", FontColor->RGBColor[0, 0, 1]], StyleBox["],Part[MapAt[0&,kandi,{r,c}],All,c],Part[MapAt[0&,kandi,{r,c}],r,\ All]})", FontColor->RGBColor[1, 0, 0]], ",{r,9},{c,9}],Position[mat,_?Positive,{2}]]+mat ),{2}]//MatrixForm" }], "Input"], Cell["Position[kandi,{_Integer}]", "Input", Background->RGBColor[1, 1, 0]], Cell["Flatten[Extract[kandi,%]]", "Input", Background->RGBColor[1, 1, 0]], Cell["\<\ (mat[[Sequence@@#1]]=#2)&@@@Transpose[{%%,%}]; mat//MatrixForm\ \>", "Input"], Cell[BoxData[ \(Do[mem = blokje[kandi, r, c]; it = \(Take[Position[mem, #, {\(-1\)}], All, 2] &\) /@ Range[9]; Cases[it, f : {{a_, _}, {a_, _} .. } \[RuleDelayed] elimrow[a + r - 1, \(Position[it, f]\)[\([1, 1]\)]]]; Cases[it, f : {{_, a_}, {_, a_} .. } \[RuleDelayed] elimcol[a + c - 1, \(Position[it, f]\)[\([1, 1]\)]]]; \[IndentingNewLine]putblok[kandi, \ mem, {r, c}]\[IndentingNewLine], {r, 1, 9, 3}, {c, 1, 9, 3}]\)], "Input"], Cell[BoxData[ \(Do[mem = Part[kandi, r, All]; it = \(Take[Position[Partition[mem, 3], #, {\(-1\)}], All, 2] &\) /@ Range[9]; Cases[it, f : {{a_, _}, {a_, _} .. } :> elimblok[{r, 3 a}, \(Position[it, f]\)[\([1, 1]\)]]]; \[IndentingNewLine]putrow[kandi, \ mem, r]\[IndentingNewLine], {r, 9}]\)], "Input"], Cell[BoxData[ \(Do[mem = Part[kandi, All, c]; it = \(Take[Position[Partition[mem, 3], #, {\(-1\)}], All, 2] &\) /@ Range[9]; Cases[it, f : {{a_, _}, {a_, _} .. } :> elimblok[{3 a, c}, \(Position[it, f]\)[\([1, 1]\)]]]; \[IndentingNewLine]putcol[kandi, mem, c]\[IndentingNewLine], {c, 9}]\)], "Input"], Cell["Position[kandi,{_Integer}]", "Input", Background->RGBColor[1, 1, 0]], Cell["Flatten[Extract[kandi,%]]", "Input", Background->RGBColor[1, 1, 0]], Cell["\<\ (mat[[Sequence@@#1]]=#2)&@@@Transpose[{%%,%}]; mat//MatrixForm\ \>", "Input"], Cell["\<\ Union@Flatten[{Map[PermutationQ,{mat,Transpose[mat]},{2}],Map[PermutationQ,\ Table[Flatten@blokje[mat,3r,3c],{r,3},{c,3}],{2}]}]==={True}\ \>", "Input"], Cell["\<\ kandi===oldkandi oldkandi=kandi;\ \>", "Input"] }, Open ]], Cell[CellGroupData[{ Cell["post mortem, to-do:", "Subsection"], Cell[BoxData[ \(kandi\)], "Input"], Cell["\<\ http://www.sudokusolver.co.uk/index.html below: the reds do not contain a 1, so it must be in the blue, and the \ magenta can be eliminated.\ \>", "Text"], Cell["to do:", "Text"], Cell[BoxData[ FormBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\({1, 3, 8}\), "2", \({1, 3, 5, 6, 8}\), \({1, 3, 9}\), "4", \({1, 3, 9}\), \({1, 3, 5, 6, 8}\), "7", \({3, 6, 9}\)}, {"9", \({1, 6}\), \({1, 3, 6, 7}\), "5", \({2, 6, 7}\), "8", \({1, 2, 3, 6}\), \({1, 3, 6}\), "4"}, {\({1, 3, 7, 8}\), \({1, 4, 5, 6}\), \({1, 3, 4, 5, 6, 7, 8}\), \({1, 2, 3, 7, 9}\), \({2, 6, 7}\), \({1, 2, 3, 7, 9}\), \({1, 2, 3, 5, 6, 8}\), \({1, 3, 5, 6, 8}\), \({2, 3, 6, 9}\)}, {"4", \({1, 5}\), \({2, 9}\), \({2, 7}\), "3", \({5, 6}\), \({7, 9}\), \({1, 6}\), "8"}, {\({1, 3, 8}\), "7", \({1, 3, 5, 8}\), \({4, 8}\), "9", \({5, 6}\), \({1, 3, 4, 6}\), "2", \({3, 6}\)}, {"6", \({8, 9}\), \({2, 3, 8, 9}\), \({4, 8}\), "1", \({2, 7}\), \({7, 9}\), \({3, 4}\), "5"}, { StyleBox[\({1, 2, 7, 8}\), FontColor->RGBColor[0, 0, 1]], StyleBox[\({1, 4, 6}\), FontColor->RGBColor[0, 0, 1]], StyleBox[\({1, 2, 4, 6, 7, 8}\), FontColor->RGBColor[0, 0, 1]], StyleBox[\({3, 9}\), FontColor->RGBColor[1, 0, 0]], StyleBox[\({2, 5, 7, 8}\), FontColor->RGBColor[1, 0, 0]], StyleBox[\({3, 9}\), FontColor->RGBColor[1, 0, 0]], StyleBox[\({2, 4, 5, 6, 8}\), FontColor->RGBColor[1, 0, 0]], StyleBox[\({4, 5, 6, 8}\), FontColor->RGBColor[1, 0, 0]], StyleBox[\({2, 6, 7}\), FontColor->RGBColor[1, 0, 0]]}, {"5", \({8, 9}\), \({2, 7, 8, 9}\), "6", \({2, 7, 8}\), "4", \({2, 3, 8}\), \({3, 8}\), "1"}, { RowBox[{"{", RowBox[{ StyleBox["1", FontColor->RGBColor[1, 0, 1]], ",", "2", ",", "7", ",", "8"}], "}"}], "3", RowBox[{"{", RowBox[{ StyleBox["1", FontColor->RGBColor[1, 0, 1]], ",", "2", ",", "4", ",", "6", ",", "7", ",", "8"}], "}"}], \({1, 2, 7}\), \({2, 5, 7, 8}\), \({1, 2, 7}\), \({2, 4, 5, 6, 8}\), "9", \({2, 6, 7}\)} }], "\[NoBreak]", ")"}], TraditionalForm]], "Input", FontWeight->"Plain"], Cell["\<\ other example: the blue column must contain a 5, all alternatives lie inside \ the bold block, so that can't have any other 5's, the magenta's have to go.\ \>", "Text"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\({3, 6, 8, 9}\), "4", \({6, 8, 9}\), "7", \({3, 5, 6, 9}\), \({1, 3, 6}\), \({5, 9}\), StyleBox["2", FontColor->RGBColor[0, 0, 1]], \({1, 5, 6, 9}\)}, {\({6, 9}\), "7", "1", \({4, 5}\), \({4, 5, 6, 9}\), "2", \({4, 5, 9}\), StyleBox["3", FontColor->RGBColor[0, 0, 1]], "8"}, {\({3, 6, 9}\), "5", "2", "8", \({3, 4, 6, 9}\), \({1, 3, 6}\), \({4, 7, 9}\), StyleBox[\({6, 9}\), FontColor->RGBColor[0, 0, 1]], \({1, 4, 6, 7, 9}\)}, {\({4, 7}\), "6", "3", "9", "2", "5", StyleBox["8", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox["1", FontSize->14, FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], StyleBox[\({4, 7}\), FontSize->14, FontWeight->"Bold", FontSlant->"Italic"]}, {"2", "9", \({5, 7}\), "1", "8", "4", StyleBox[ RowBox[{ StyleBox["{", FontWeight->"Bold", FontSlant->"Italic"], RowBox[{ StyleBox["3", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["5", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["7", FontWeight->"Bold", FontSlant->"Italic"]}], StyleBox["}", FontWeight->"Bold", FontSlant->"Italic"]}], FontSize->14, FontSlant->"Italic"], StyleBox[ RowBox[{ StyleBox["{", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["5", FontColor->RGBColor[1, 0, 0]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["6", FontColor->RGBColor[0, 0, 1]]}], StyleBox["}", FontColor->RGBColor[0, 0, 1]]}], FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ RowBox[{ StyleBox["{", FontWeight->"Bold", FontSlant->"Italic"], RowBox[{ StyleBox["3", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["5", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["6", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["7", FontWeight->"Bold", FontSlant->"Italic"]}], StyleBox["}", FontWeight->"Bold", FontSlant->"Italic"]}], FontSize->14, FontSlant->"Italic"]}, {\({4, 5, 8}\), "1", \({4, 5, 8}\), "6", \({3, 7}\), \({3, 7}\), StyleBox["2", FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ RowBox[{ StyleBox["{", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["5", FontColor->RGBColor[1, 0, 0]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["9", FontColor->RGBColor[0, 0, 1]]}], StyleBox["}", FontColor->RGBColor[0, 0, 1]]}], FontSize->14, FontWeight->"Bold", FontSlant->"Italic"], StyleBox[ RowBox[{ StyleBox["{", FontWeight->"Bold", FontSlant->"Italic"], RowBox[{ StyleBox["4", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["5", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0, 1]], StyleBox[",", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["9", FontWeight->"Bold", FontSlant->"Italic"]}], StyleBox["}", FontWeight->"Bold", FontSlant->"Italic"]}], FontSize->14, FontSlant->"Italic"]}, {\({4, 5, 9}\), "3", \({4, 5, 9}\), \({2, 4, 5}\), \({6, 7}\), \({6, 7}\), "1", StyleBox["8", FontColor->RGBColor[0, 0, 1]], \({2, 5, 9}\)}, {"1", "2", \({4, 5, 9}\), "3", \({4, 5}\), "8", "6", StyleBox["7", FontColor->RGBColor[0, 0, 1]], \({5, 9}\)}, {\({6, 7}\), "8", \({6, 7}\), \({2, 5}\), "1", "9", \({3, 5}\), StyleBox["4", FontColor->RGBColor[0, 0, 1]], \({2, 3, 5}\)} }], "\[NoBreak]", ")"}], (MatrixForm[ #]&)]], "Input", FontWeight->"Plain"], Cell["\<\ and more: the blue block must contaoin a 9, all alternatives lie in the last \ column, so that can't have any other 9's, the magenta's have to go.\ \>", "Text"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {\({3, 6, 8, 9}\), "4", \({6, 8, 9}\), "7", \({3, 5, 6, 9}\), \({1, 3, 6}\), \({5, 9}\), "2", RowBox[{"{", RowBox[{"1", ",", "5", ",", "6", ",", StyleBox["9", FontColor->RGBColor[1, 0, 1]]}], "}"}]}, {\({6, 9}\), "7", "1", \({4, 5}\), \({4, 5, 6, 9}\), "2", \({4, 5, 9}\), "3", "8"}, {\({3, 6, 9}\), "5", "2", "8", \({3, 4, 6, 9}\), \({1, 3, 6}\), \({4, 7, 9}\), \({6, 9}\), RowBox[{"{", RowBox[{"1", ",", "4", ",", "6", ",", "7", ",", StyleBox["9", FontColor->RGBColor[1, 0, 1]]}], "}"}]}, {\({4, 7}\), "6", "3", "9", "2", "5", "8", "1", \({4, 7}\)}, {"2", "9", \({5, 7}\), "1", "8", "4", \({3, 7}\), \({5, 6}\), \({3, 6, 7}\)}, {\({4, 5, 8}\), "1", \({4, 5, 8}\), "6", \({3, 7}\), \({3, 7}\), "2", \({5, 9}\), RowBox[{"{", RowBox[{"4", ",", StyleBox["9", FontColor->RGBColor[1, 0, 1]]}], "}"}]}, {\({4, 5, 9}\), "3", \({4, 5, 9}\), \({2, 4, 5}\), \({6, 7}\), \({6, 7}\), StyleBox["1", FontColor->RGBColor[0, 0, 1]], StyleBox["8", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["{", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["2", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["5", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["9", FontColor->RGBColor[1, 0, 0]]}], StyleBox["}", FontColor->RGBColor[0, 0, 1]]}]}, {"1", "2", \({4, 5, 9}\), "3", \({4, 5}\), "8", StyleBox["6", FontColor->RGBColor[0, 0, 1]], StyleBox["7", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["{", FontColor->RGBColor[0, 0, 1]], RowBox[{ StyleBox["5", FontColor->RGBColor[0, 0, 1]], StyleBox[",", FontColor->RGBColor[0, 0, 1]], StyleBox["9", FontColor->RGBColor[1, 0, 0]]}], StyleBox["}", FontColor->RGBColor[0, 0, 1]]}]}, {\({6, 7}\), "8", \({6, 7}\), \({2, 5}\), "1", "9", StyleBox[\({3, 5}\), FontColor->RGBColor[0, 0, 1]], StyleBox["4", FontColor->RGBColor[0, 0, 1]], StyleBox[\({2, 3, 5}\), FontColor->RGBColor[0, 0, 1]]} }], "\[NoBreak]", ")"}], (MatrixForm[ #]&)]], "Input", FontWeight->"Plain"] }, Open ]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowSize->{884, 600}, WindowMargins->{{6, Automatic}, {Automatic, 1}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 32, 0, 53, "Section"], Cell[CellGroupData[{ Cell[1796, 55, 28, 0, 47, "Subsection"], Cell[1827, 57, 46, 0, 30, "Input"], Cell[1876, 59, 204, 4, 66, "Input"], Cell[2083, 65, 132, 3, 30, "Input"], Cell[2218, 70, 185, 3, 50, "Input"], Cell[2406, 75, 171, 3, 30, "Input"], Cell[2580, 80, 163, 3, 30, "Input"], Cell[2746, 85, 163, 3, 30, "Input"], Cell[2912, 90, 160, 3, 30, "Input"], Cell[3075, 95, 149, 3, 30, "Input"], Cell[3227, 100, 149, 3, 30, "Input"], Cell[3379, 105, 47, 0, 30, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3463, 110, 27, 0, 47, "Subsection"], Cell[3493, 112, 811, 16, 171, "Input"], Cell[4307, 130, 811, 16, 171, "Input"], Cell[5121, 148, 1808, 35, 171, "Input"], Cell[6932, 185, 811, 16, 171, "Input"], Cell[7746, 203, 811, 16, 171, "Input"], Cell[8560, 221, 733, 14, 171, "Input"], Cell[9296, 237, 733, 14, 171, "Input"], Cell[10032, 253, 1574, 29, 171, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11643, 287, 48, 0, 31, "Subsection"], Cell[11694, 289, 323, 8, 66, "Input"], Cell[12020, 299, 76, 1, 46, "Input"], Cell[12099, 302, 75, 1, 46, "Input"], Cell[12177, 305, 87, 3, 48, "Input"], Cell[12267, 310, 313, 7, 66, "Input"], Cell[12583, 319, 376, 7, 84, "Input"], Cell[12962, 328, 79, 1, 46, "Input"], Cell[13044, 331, 78, 1, 46, "Input"], Cell[13125, 334, 87, 3, 48, "Input"], Cell[13215, 339, 611, 16, 84, "Input"], Cell[13829, 357, 76, 1, 46, "Input"], Cell[13908, 360, 75, 1, 46, "Input"], Cell[13986, 363, 87, 3, 48, "Input"], Cell[14076, 368, 547, 12, 110, "Input"], Cell[14626, 382, 393, 9, 90, "Input"], Cell[15022, 393, 391, 9, 90, "Input"], Cell[15416, 404, 76, 1, 46, "Input"], Cell[15495, 407, 75, 1, 46, "Input"], Cell[15573, 410, 87, 3, 48, "Input"], Cell[15663, 415, 162, 3, 48, "Input"], Cell[15828, 420, 57, 3, 48, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[15922, 428, 41, 0, 47, "Subsection"], Cell[15966, 430, 38, 1, 30, "Input"], Cell[16007, 433, 165, 4, 52, "Text"], Cell[16175, 439, 22, 0, 33, "Text"], Cell[16200, 441, 2523, 52, 171, "Input"], Cell[18726, 495, 178, 3, 33, "Text"], Cell[18907, 500, 6647, 167, 159, "Input"], Cell[25557, 669, 170, 3, 33, "Text"], Cell[25730, 674, 3210, 75, 153, "Input"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)