Sudoku
Sudoku
Merciadri Luca
[email protected]
Abstract. The Sudoku game has gained much interest for a dozen years. It is now put in various
magazines and mathematical research is more and more interested in it. This document aims at pro-
viding some newer information about the mathematical properties of the Sudoku, but not according to
graphs’ theory. We do not speak about the “minimum number of clues,” but about Sudokus’ matrix in-
terpretation: general properties of its determinant, in relation to eigenvalues; transpose; non-Hermitian
character; neither symmetric nor antisymmetric character; non-normal character; non-orthogonal char-
acter when the matrix has a determinant of 0, conjecture when the determinant is not equal to 0; order;
condition number.
1 Introduction
The Sudoku game has gained much interest for a dozen years. It is now put in various magazines and
mathematical research is more and more interested in it. This document aims at providing some newer
information about the mathematical properties of the Sudoku, but not according to graphs’ theory. We
do not speak about the “minimum number of clues,” but about Sudokus’ matrix interpretation: general
properties of its determinant, in relation to eigenvalues; transpose; non-Hermitian character; neither sym-
metric nor antisymmetric character; non-normal character; non-orthogonal character when the matrix has
a determinant of 0, conjecture when the determinant is not equal to 0; order; condition number.
2 Conventions
Through this paper, we use the following conventions:
– S denotes the set of all the (solved) Sudokus. We have |S| ≈ 6.771 · 1021 , according to [3],
– Si,j denotes the element at the ith row and the jth column of the general S Sudoku square matrix. We
shall use 1 ≤ i ≤ n, 1 ≤ j ≤ n, where n denotes the number of rows (or columns, as it is always a square
matrix) of the Sudoku (we always consider n ≥ 4). S has thus the following form:
S1,1 S1,2 · · · S1,n
S2,1 S2,2 · · · S2,n
S= . .. . . .. ,
.. . . .
Sn,1 Sn,2 · · · Sn,n
Pn
– j=1 Si,j = n(n+1)
2 , 1 ≤ i ≤ n (i being free in this interval) denotes the sum of all the elements on one
line i of S. Evidently,
X n n
n(n + 1) X n(n + 1)
Si,j = = Si,j = ,
j=1
2 i=1
2
Evidently, we assume the reader is familiar with the notions of Sudoku, Latin Square, and related concepts.
3 Determinants
As S is a square matrix, one can wonder about the value of det(S), for a given n. Based on many experiments,
det S has the following properties:
– It is in Z∗ or in Z,
– The assertion
(det(S) (mod 2) = 0) ∨ (det(S) (mod 2) 6= 0) (1)
is always true, but det S is sometimes even, and sometimes odd.
Theorem 1 (Determinant of S sometimes equals 0). The determinant of the S matrix, det S, formed
by the elements of a complete Sudoku, can equal 0. ⊓
⊔
– Let’s take
9 4 7 2 5 8 1 3 6
1 2 3 4 6 7 9 8 5
6 5 8 1 9 3 7 2 4
8 9 5 6 4 2 3 7 1
det(B) = 7 6 4 9 3 1 2 5 8 6= 0,
3 1 2 8 7 5 4 6 9
4 8 9 7 2 6 5 1 3
2 3 6 5 1 9 8 4 7
5 7 1 3 8 4 6 9 2
– It is shown in [2] that
a b c d a b d c
c d a b c d b a
= 4 4 4 4 2 2 2 2 2 2 2 2 2 2 2 2
d c b a b a c d = a + b + c + d − 2a b − 2a c − 2b c − 2a d − 2b d − 2c d + 8abcd,
b a d c d c a b
which is logical, as there is an even number of permutations of rows (and columns) between the first
and the second matrix. In the standard case, i.e. if (a, b, c, d) are mapped bijectively to (1, 2, 3, 4), we
have
a4 + b4 + c4 + d4 − 2a2 b2 − 2a2 c2 − 2b2 c2 − 2a2 d2 − 2b2 d2 − 2c2 d2 + 8abcd = 0.
Note that
6 7 3 5 1 4 9 8 2
9 2 1 3 6 8 7 5 4
5 8 4 7 9 2 1 3 6
8 9 6 2 3 7 4 1 5
2 1 5 9 4 6 3 7 8 = 0.
3 4 7 1 8 5 2 6 9
4 5 2 8 7 1 6 9 3
1 6 9 4 5 3 8 2 7
7 3 8 6 2 9 5 4 1
Remark 1 (Possible configurations). Given a matrix S, [at least] two rows in S will never be formed by the
same elements in the same order than another row. If this happens, S is not a valid Sudoku anymore, as it
leads to a part of S (the example is for the rows of S, but it is as trivial for the columns of S) like
··· ··· ··· ··· ···
1 2 3 ··· n
1 2 3 ··· n ,
··· ··· ··· ··· ···
where 1, 2, · · · , n can be in a different order. This would also be shown by the determinant of a submatrix
of
k k + 1 k + 2 ··· n
,
k k + 1 k + 2 ··· n
which always equals 0 (thus leading to a rank ρ less than 2),
Beginning by the end, i.e. using the following configuration:
··· ··· ··· ··· ···
1 2 3 ··· n
n n − 1 n − 2 ··· 1
··· ··· ··· ··· ···
can only lead to linearly independent rows. The rank ρ of a matrix A being defined as the biggest dimension
of the square submatrices of 6= 0 det extracted from A, we know that
··· ··· ··· ··· ···
1 2 3 ··· n
ρ
n n − 1 n − 2 · · · 1 = 2,
··· ··· ··· ··· ···
under some given conditions which will be determined now. For k ∈ {1, · · · , n − 1}, we have
k k + 1
2 2
n n − k = k(n − k) − n(k + 1) = kn − k − kn − n = −k − n;
k=(n−1)
−2 − k 2 = −2 − (n − 1)2 = −n2 + 2n + 3,
we must ask (
n ≥ −n2 + 2n + 3
,
n ≥ −3
which is equivalent to
( i √ iSh √ h
n ∈ − ∞, 1−2 5 1+ 5
2 , +∞
,
n ≥ −3
thus giving
( i √ iSh √ h
n ∈ − ∞, 1−2 5 1+ 5
2 , +∞
,
n ≥ −3
and
h 1 + √5 h
n∈ , +∞ ,
2
which is always the case, as
√
1+ 5
≃ 1.618,
2
and the dimension of a Sudoku is always the square of a number. Thus, the first interesting Sudoku’s
dimension would be 4 = 22 (thus greater than the golden ratio). ⊓
⊔
4 Erroneous Sudokus
Theorem 2 (Finding if a Sudoku matrix is erroneous or not). There is no way to be sure about the
correctness of a Sudoku matrix by only computing its determinant. ⊓
⊔
Proof. An erroneous Sudoku can have a determinant of zero, but it is not always the case. Furthermore,
having a determinant of zero cannot even be a sufficient condition to be an erroneous Sudoku matrix, as
there are correct Sudoku matrices which have a determinant of 0.
Let’s take two erroneous Sudokus:
assuming the · · · can be filled correctly to make no other mistake. At least a given Sudoku can thus
have a non-zero determinant,
2. The second is “more” erroneous:
· · · · · · · · · · · · · · · · · · · · · · · · · · ·
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 = 0,
· · · · · · · · · · · · · · · · · · · · · · · · · · ·
which equals 0 iff (a, b, c, d) are mapped bijectively to (1, 2, 3, 4), leading however to a correct Sudoku. ⊓
⊔
5 Sudoku Eigenvalues
5.1 General Case
Let’s take the eigenvalues of S; that is, let’s compute det(S −λI). Depending on the dimension of S, denoted
by n, det(S − λI) will be a polynom of a different order: this order will always be of n. That is,
n
X
det(S − λI) = αλn + βλn−1 + · · · + ζλ0 = αi λi (2)
i=0
Theorem 3 (Perron). If all of the entries of a matrix are positive, then the matrix has a dominant
eigenvalue that is real and has multiplicity 1. ⊓
⊔
Theorem 4 (Max eigenvalue of a square and positive matrix). The dominant eigenvalue of any
square and positive matrix where each row and column have the same sum, will equal that sum. ⊓
⊔
for exactly one λi . This is thus the dominant eigenvalue of the matrix S. This eigenvalue has multiplicity
1. ⊓
⊔
Corollary 2. A Sudoku square matrix S, of dimension n, and of determinant det(S), always verifies
det(S) mod
1 ≤max λi = 0,
i ≤ n,
λi ∈ R
6 Transpose
for i = j. Let 1 ≤ i ≤ n, 1 ≤ j ≤ n. Is the same equality possible with these conventions? We shall now try
to construct such a matrix. Let’s reason first with a 4 × 4 matrix. We define
B1,1 B1,2 B1,3 B1,4 C1,1 C1,2 C1,3 C1,4
B2,1 B2,2 B2,3 B2,4
B := and Be := C := C2,1 C2,2 C2,3 C2,4 .
B3,1 B3,2 B3,3 B3,4 C3,1 C3,2 C3,3 C3,4
B4,1 B4,2 B4,3 B4,4 C4,1 C4,2 C4,3 C4,4
g
It is clear that Bi,j = Bi,j for all 1 ≤ i ≤ n and 1 ≤ j ≤ n iff Bi,j = Ci,j for all i and j. The C matrix has
thus to be exactly B. It is the case iff Bi,j = Bj,i , with 1 ≤ i ≤ n and 1 ≤ j ≤ n, thus iff B is symmetric.
Let’s try to construct a symmetric B. Such a B would be symmetric:
B1,1 B2,1 B3,1 B4,1
B2,1 B2,2 B3,2 B4,2
B3,1 B3,2 B3,3 B4,3 ,
B4,1 B4,2 B4,3 B4,4
1 1
but it does not respect the rules of Sudoku, as there is at least one subsquare of dimension 4 2 × 4 2 ≡ 2 × 2
where two elements are the same (here, there is only one: B4,3 ). Here is the generalization of this fact. If we
take
B1,1 B1,2 · · · B1,n
B2,1 B2,2 · · · B2,n
B= . .. . . .. ,
. . . . .
Bn,1 Bn,2 · · · Bn,n
B should verify
B1,1 B2,1 · · · Bn,1
B2,1 B2,2 · · · Bn,2
B= . .. .. ..
.. . . .
Bn,1 Bn,2 · · · Bn,n
to be symmetric. It is symmetric, but does not respect the rules of Sudoku anmyore, as, at the place of the
..
. and the · · · , zooming at the end would lead to the submatrix
..
. · · · · · · S n,2
.. . . .. ..
. . . .
.
.
.. · · · . . . Sn,n−1
Sn,2 · · · Sn,n−1 Sn,n
⊓
⊔
6.1 Determinant
Theorem 6 (Determinant of the transpose of a square matrix). For every square matrix C,
e
det(C) = det(C). ⊓
⊔
This theorem is not proved here, even if it is evident.
Corollary 3 (Determinant of the transpose of a Sudoku matrix). If S is the matrix of a given
e
Sudoku, det(S) = det(S). ⊓
⊔
Corollary 4. If S is the matrix of a given Sudoku, Se its transpose, and n their dimension (which is the
same),
n(n + 1) e mod n(n + 1) = 0.
det(S) mod = det(S)
2 2
⊓
⊔
e
Proof. Trivial, as det(S) = det(S). ⊓
⊔
6.2 Trace
e
Theorem 7 (Trace of a transpose). Whatever the matrix E, Tr(E) = Tr(E). ⊓
⊔
This theorem is not proved here, even if it is evident.
Corollary 5 (Trace of the transpose of a Sudoku matrix). If S is the matrix of a given Sudoku,
e
Tr(S) = Tr(S). ⊓
⊔
7 Non-Hermitianity
A matrix C is Hermitian if and only if
C = C ∗.
As, for any Sudoku matrix S, S = S, as · is the complex conjugate of ·, and the Si,j , 1 ≤ i ≤ n, 1 ≤ j ≤ n,
e However, this is not
asking if any Sudoku matrix is Hermitian or not is equivalent to ask if, for S, S = S.
true, as we have
e
S 6= S,
thanks to Theorem 5.
Corollary 6 (Every Sudoku matrix is not Hermitian). There is no Hermitian Sudoku matrix. ⊓
⊔
Proof. Direct using Theorem 5, as Si,j = Si,j for 1 ≤ i ≤ n, 1 ≤ j ≤ n, as Si,j ∈ R. ⊓
⊔
Corollary 7 (Every Sudoku matrix is not antisymmetric). S is not antisymmetric, for clear reasons:
Si,j 6= −Sj,i . ⊓
⊔
Proof. The Si,j are in Z∗ . If we take −Si,j for 1 ≤ i ≤ n and 1 ≤ j ≤ n, all the Si,j will lie in Z∗− , or no
Sudoku matrix can have negative elements. ⊓
⊔
8 Non-Normality
A matrix C is normal if and only if
CC ∗ = C ∗ C.
It is equivalent to ask, for now clear reasons,
e = CC,
CC e
if C is a Sudoku matrix.
Theorem 8 (Every Sudoku matrix is not normal). There is no normal Sudoku matrix. ⊓
⊔
Proof. Let’s try to build such a matrix. If we have
S1,1 S1,2 · · · S1,n S1,1 S2,1 · · · Sn,1
S2,1 S2,2 · · · S2,n S1,2 S2,2 · · · Sn,2
S= . .. . . .. and S ′ := Se = . .. .. .. ,
.. . . . .. . . .
Sn,1 Sn,2 · · · Sn,n S1,n S2,n · · · Sn,n
we have S Se = SS
e iff
S1,1 S1,2 · · · S1,n S1,1 S2,1 · · · Sn,1 S1,1 S2,1 · · · Sn,1 S1,1 S1,2 · · · S1,n
S2,1 S2,2 · · · S2,n S1,2 S2,2 · · · Sn,2 S1,2 S2,2 · · · Sn,2 S2,1 S2,2 · · · S2,n
S= . .. .. .. .. .. .. .. = .. .. .. .. .. .. .. .. ,
.. . . . . . . . . . . . . . . .
Sn,1 Sn,2 · · · Sn,n S1,n S2,n · · · Sn,n S1,n S2,n · · · Sn,n Sn,1 Sn,2 · · · Sn,n
thus asking an equality between
0 2
S1,1 2
+ S1,2 2
+ · · · + S1,n S1,1 S2,1 + S1,2 S2,2 + · · · + S1,n S2,n · · · S1,1 Sn,1 + S1,2 Sn,2 + · · · + S1,n Sn,n
1
B
BS 2 2 2 C
B 2,1 S1,1 + S2,2 S1,2 + · · · + S2,n S1,n S2,1 + S2,2 + · · · + S2,n · · · S2,1 Sn,1 + S2,2 Sn,2 + · · · + S2,n Sn,n C
C
B ··· ··· ··· ··· C
@ A
Sn,1 S1,1 + Sn,2 S1,2 + · · · + Sn,n S1,n Sn,1 S2,1 + Sn,2 S2,2 + · · · + Sn,n S2,n ··· 2
Sn,1 2
+ Sn,2 2
+ · · · + Sn,n
and 0 2 2 2 1
S1,1 + S2,1 + · · · + Sn,1 S1,1 S1,2 + S2,1 S2,2 + · · · + Sn,1 Sn,2 · · · S1,1 S1,n + S2,1 S2,n + · · · + Sn,1 Sn,n
S1,2 2 + S2,2
2 + · · · + Sn,2 2
B C
BS S + S S + + Sn,2 Sn,1 · · · S1,2 S1,n + S2,2 S2,n + · · · + Sn,2 Sn,n C
B 1,2 1,1 2,2 2,1 · · · C,
B ··· ··· ··· ··· C
@ A
S1,n S1,1 + S2,n S2,1 + · · · + Sn,n Sn,1 S1,n S1,2 + S2,n S2,2 + · · · + Sn,n Sn,2 ··· 2
Sn,1 2
+ S2,n 2 + · · · + Sn,n
Proof. We have
det(Se · S) = det(S)
e det(S),
If det(S) 6= 0, Se has to coincide with S −1 to make S orthogonal. Using Theorem 5, Se 6= S. But one might
ask the question “Can Se equal S −1 ?” The answer to this question is not known yet.
Suggestion 1 The only way to make S orthogonal is to have Se = S −1 . Or this equality should be impossible:
as
^ · (det(S))−1 ,
S −1 = cofact(S)
it would be equivalent to ask
^ · (det(S))−1 ,
Se = cofact(S)
which should never be true for a S Sudoku matrix. ⊓
⊔
10 Order
Theorem 10 (Every invertible matrix has a finite order). Every invertible matrix has a finite order.
⊓
⊔
This theorem is proved in many books, and its proof does not enter in the scope of this paper.
Corollary 8. Iff det(S) 6= 0, S has a finite order. ⊓
⊔
However, there is no special remark to do about this and Sudokus: there seems to be no link between the
order of a Sudoku matrix S and other concepts related to Sudoku’s matrices.
11 Condition Number
Theorem 11 (No well-conditioning for S can arise). The system Sx = b can be else than well-
conditioned (assuming b 6= 0n ). ⊓
⊔
It verifies
κ=1
λ=2
µ=3
ν=4
ξ=5
χ=6
ρ=7
σ=8
τ = 9.
Using numerical analysis, we can now solve
673514982 α 1
9 2 1 3 6 8 7 5 4 β 2
5 8 4 7 9 2 1 3 6 γ 3
8 9 6 2 3 7 4 1 5 δ 4
2 1 5 9 4 6 3 7 8 ǫ = 5 .
3 4 7 1 8 5 2 6 9 ζ 6
4 5 2 8 7 1 6 9 3 η 7
1 6 9 4 5 3 8 2 7 θ 8
738629541 ι 9
12 Trace
Theorem 12 (The trace of a Sudoku matrix is not constant). The trace of a Sudoku matrix is not
constant. ⊓
⊔
Proof. Consider
673514982 947258136
9 2 1 3 6 8 7 5 4 1 2 3 4 6 7 9 8 5
5 8 4 7 9 2 1 3 6 6 5 8 1 9 3 7 2 4
8 9 6 2 3 7 4 1 5 8 9 5 6 4 2 3 7 1
P =
2 1 5 9 4 6 3 7 8 and B =
7 6 4 9 3 1 2 5 8 ,
3 4 7 1 8 5 2 6 9 3 1 2 8 7 5 4 6 9
4 5 2 8 7 1 6 9 3 4 8 9 7 2 6 5 1 3
1 6 9 4 5 3 8 2 7 2 3 6 5 1 9 8 4 7
738629541 571384692
whose traces are 32 and 44, respectively. ⊓
⊔
References
1. Davis, Tom, The Mathematics of Sudoku, (2008). http://www.geometer.org/mathcircles/sudoku.pdf.
2. Frank, Richard, Mathematics in Sudoku, (2005). http://people.brandeis.edu/~kleinboc/47a/sudoku.pdf.
3. LeBoeuf, Robert, Properties of Sudoku and Sudoku Matrices, (2009). http://compmath.files.wordpress.
com/2009/02/rlfreport.pdf.
4. , Sudoku Matrices, (2009). http://compmath.files.wordpress.com/2009/02/rlposter.pdf.