16.1: Latin Squares and Sudokus
- Page ID
- 60155
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)You can think of a Latin square as a Sudoku puzzle that can be of any (square) size, and does not have the requirement that every value appear in each of the outlined smaller subsquares.
Definition: Latin Square
A Latin square of order \(n\) is an \(n \times n\) array whose entries are elements of a set \(N\) of cardinality \(n\), with the property that every element of \(N\) appears exactly once in each row and each column.
Example \(\PageIndex{1}\)
Here is a Latin square of order \(4\):
\[ 1 \; \; 2 \; \; 3\; \; 4 \\ 4 \;\; 1 \; \; 2 \; \; 3 \\ 3 \; \; 4 \; \; 1\; \; 2 \\ 2 \; \; 3\; \; 4 \; \; 1 \]
Solution
Notice that in the above example, we placed the numbers \(1\), \(2\), \(3\), and \(4\) in the first row, in that order. For each subsequent row, we shifted the numbers one place to the right (wrapping around). This same technique (placing the numbers from \(1\) through \(n\) across the first row) will work to construct a Latin square of order \(n\).
So you might think (with reason) that Latin squares aren’t very interesting. However, even knowing that there is a Latin square of every possible order and they are easy to construct, there remain some interesting related questions.
Some of these questions are related to Sudokus. If we fill in some entries of a Latin square, are there conditions on these entries that guarantee that this can be completed to a full Latin square? Are there conditions under which we can be sure that a partial Latin square has a unique completion to a full Latin square?
Some of these questions have easy answers that are not what we are really looking for. For example, if we give you all but one entry of a Latin square (or Sudoku), then if it can be completed at all, the completion will be unique. However, some interesting mathematical work has been done on these problems, both for Latin squares and for Sudokus.
There are no known examples in which a Sudoku puzzle with \(16\) or fewer squares pre-filled, can be completed uniquely. However, there are tens of thousands of (non-isomorphic) ways of pre-filling \(17\) entries of a Sudoku puzzle, that have a unique completion.
Looking only at “non-isomorphic” examples is important, because there are many ways of creating Latin squares (or Sudoku puzzles) that are essentially the same. The following operations take a Latin square to another Latin square that is structurally essentially the same:
- Permuting of the symbols used in the set \(N\). For example, changing every \(1\) to a \(2\) and every \(2\) to a \(1\).
- Interchanging any two rows.
- Interchanging any two columns.
- Making all of the rows into columns, and all of the columns into rows.
Exercise \(\PageIndex{1}\)
1) Prove that interchanging two rows of a Latin square, yields a Latin square.
2) Complete the following Latin square. Is the completion unique?
\( 1 \; \; \_ \; \; 4\; \; \_\; \\ \_ \; \; 1 \; \; \_\; \; \_\; \\ \_ \; \; \_ \; \; \_\; \; 3\; \\ \_ \; \; \_ \; \;\_\; \; \_\; \\ \)
3) Use the method described at the start of this chapter to create a Latin square of order \(5\). What \(3\) of the operations listed above that change a Latin square to an isomorphic Latin square, are required to arrive at the following result?
\( 5 \; \; 1 \; \; 4\; \; 2\; \; 3 \\ 1 \; \; 3 \; \; 5\; \; 4\; \; 2\\ 4 \; \; 5 \; \; 2\; \; 3\; \; 1\\ 2 \; \; 4 \; \; 3\; \; 1\; \; 5 \\ 3 \; \; 2 \; \; 1\; \; 5\; \; 4 \)
4) Show there are exactly two different Latin squares of order \(3\) whose first row is \(1\), \(2\), \(3\).
5) Show there are exactly twelve different Latin squares of order \(3\) whose entries are the numbers \(1\), \(2\), \(3\).
[Hint: Use Problem \(4\).]
6) There are four different Latin squares of order \(4\) whose first row is \(1\), \(2\), \(3\), \(4\) and whose first column is also \(1\), \(2\), \(3\), \(4\). That is, there are only four ways to complete the following Latin square:
\( 1 \; \; 2 \; \; 3\; \; 4\; \\ 2 \; \; \_ \; \; \_\; \; \_\; \\ 3 \; \; \_ \; \; \_\; \; \_\; \\ 4 \; \; \_ \; \;\_\; \; \_\; \\ \)
Find all four.
[Hint: Each of the possibilities for the second entry of the second row can be completed in only one or two ways.]