# Mutually orthogonal Latin squares

In combinatorics, two Latin squares of the same size (order) are said to be orthogonal if when superimposed the ordered paired entries in the positions are all distinct. A set of Latin squares, all of the same order, all pairs of which are orthogonal is called a set of mutually orthogonal Latin squares. This concept of orthogonality in combinatorics is strongly related to the concept of blocking in statistics, which ensures that independent variables are truly independent with no hidden confounding correlations. "Orthogonal" is thus synonymous with "independent" in that knowing one variable's value gives no further information about another variable's likely value.

A pair of orthogonal Latin squares has traditionally been called a Graeco-Latin square, although that term is now somewhat dated.

## Graeco-Latin squares

A Graeco-Latin square or Euler square or pair of orthogonal Latin squares of order n over two sets S and T (which may be the same), each consisting of n symbols, is an n × n arrangement of cells, each cell containing an ordered pair (s, t), where s is in S and t is in T, such that every row and every column contains each element of S and each element of T exactly once, and that no two cells contain the same ordered pair.

The arrangement of the s-coordinates by themselves (which may be thought of as Latin characters) and of the t-coordinates (the Greek characters) each forms a Latin square. A Graeco-Latin square can therefore be decomposed into two orthogonal Latin squares. Orthogonality here means that every pair (st) from the Cartesian product S × T occurs exactly once.

Orthogonal Latin squares were studied in detail by Leonhard Euler, who took the two sets to be S = {ABC, ...}, the first n upper-case letters from the Latin alphabet, and T = {α , β, γ, ...}, the first n lower-case letters from the Greek alphabet—hence the name Graeco-Latin square.

### Existence

When a Graeco-Latin square is viewed as a pair of orthogonal Latin squares, each of the Latin squares is said to have an orthogonal mate. In an arbitrary Latin square, a selection of positions, one in each row and one in each column whose entries are all distinct is called a transversal of that square.[1] Consider one symbol in a Graeco-Latin square. The positions containing this symbol must all be in different rows and columns, and furthermore the other symbol in these positions must all be distinct. Hence, when viewed as a pair of Latin squares, the positions containing one symbol in the first square correspond to a transversal in the second square (and vice versa).

A given Latin square of order n possesses an orthogonal mate if and only if it has n disjoint transversals.[2]

The Cayley table (without borders) of any group of odd order forms a Latin square which possesses an orthogonal mate.[2]

Thus Graeco-Latin squares exist for all odd orders as there are groups that exist of these orders. Such Graeco-Latin squares are said to be group based.

Euler was able to construct Graeco-Latin squares of orders that are multiples of four,[2] and seemed to be aware of the following result.

No group based Graeco-Latin squares can exist if the order is an odd multiple of two (that is, equal to 4k + 2 for some positive integer k).[3]

### History

Although recognized for his original mathematical treatment of the subject, orthogonal Latin squares predate Euler. In the form of an old puzzle involving playing cards,[4] the construction of a 4 x 4 set was published by Jacques Ozanam in 1725.[5] The problem was to take all aces, kings, queens and jacks from a standard deck of cards, and arrange them in a 4 x 4 grid such that each row and each column contained all four suits as well as one of each face value. This problem has several solutions.

A common variant of this problem was to arrange the 16 cards so that, in addition to the row and column constraints, each diagonal contains all four face values and all four suits as well.

According to Martin Gardner, who featured this problem in his November 1959 Mathematical Games column,[6] the number of distinct solutions was incorrectly stated to be 72 by Rouse Ball. This mistake persisted for many years until the correct value of 144 was found by Kathleen Ollerenshaw. Each of the 144 solutions has eight reflections and rotations, giving 1152 solutions in total. The 144×8 solutions can be categorized into the following two equivalence classes:

Solution Normal form
Solution #1 A♠ K♥ Q♦ J♣
Q♣ J♦ A♥ K♠
J♥ Q♠ K♣ A♦
K♦ A♣ J♠ Q♥
Solution #2 A♠ K♥ Q♦ J♣
J♦ Q♣ K♠ A♥
K♣ A♦ J♥ Q♠
Q♥ J♠ A♣ K♦

For each of the two solutions, 24×24 = 576 solutions can be derived by permuting the four suits and the four face values, independently. No permutation will convert the two solutions into each other, because suits and face values are not the same.

#### Thirty-six officers problem

A problem similar to the card problem above was circulating in St. Petersburg in the late 1700s and, according to folklore, Catherine the Great asked Euler to solve it, since he was residing at her court at the time.[7] This problem is known as the thirty-six officers problem,[8] and Euler introduced it as follows:[9][10]

A very curious question, which has exercised for some time the ingenuity of many people, has involved me in the following studies, which seem to open a new field of analysis, in particular the study of combinations. The question revolves around arranging 36 officers to be drawn from 6 different regiments so that they are ranged in a square so that in each line (both horizontal and vertical) there are 6 officers of different ranks and different regiments.

— Leonhard Euler

#### Euler's conjecture and disproof

Euler was unable to solve the problem, but in this work he demonstrated methods for constructing Graeco-Latin squares where n is odd or a multiple of 4. Observing that no order two square exists and being unable to construct an order six square, he conjectured that none exist for any oddly even number n ≡ 2 (mod 4). The non-existence of order six squares was confirmed in 1901 by Gaston Tarry through a proof by exhaustion.[11][12] However, Euler's conjecture resisted solution until the late 1950s, but the problem has led to important work in combinatorics.[13]

In 1959, R.C. Bose and S. S. Shrikhande constructed some counterexamples (dubbed the Euler spoilers) of order 22 using mathematical insights.[14] Then E. T. Parker found a counterexample of order 10 using a one-hour computer search on a UNIVAC 1206 Military Computer while working at the UNIVAC division of Remington Rand (this was one of the earliest combinatorics problems solved on a digital computer).

In April 1959, Parker, Bose, and Shrikhande presented their paper showing Euler's conjecture to be false for all n ≥ 10.[15] Thus, Graeco-Latin squares exist for all orders n > 1 except n = 2, 6. In the November 1959 edition of Scientific American, Martin Gardner published this result.[6] The front cover is the 10 × 10 refutation of Euler's conjecture.

## Examples of mutually orthogonal Latin squares (MOLS)

A set of Latin squares of the same order such that every pair of squares are orthogonal (that is, form a Graeco-Latin square) is called a set of mutually orthogonal Latin squares (or pairwise orthogonal Latin squares) and usually abbreviated as MOLS or MOLS(n) when the order is made explicit.

For example, a set of MOLS(4) is given by:[16]

${\displaystyle {\begin{matrix}1&2&3&4\\2&1&4&3\\3&4&1&2\\4&3&2&1\end{matrix}}\qquad \qquad {\begin{matrix}1&2&3&4\\4&3&2&1\\2&1&4&3\\3&4&1&2\end{matrix}}\qquad \qquad {\begin{matrix}1&2&3&4\\3&4&1&2\\4&3&2&1\\2&1&4&3\end{matrix}}.}$

And a set of MOLS(5):[17]

${\displaystyle {\begin{matrix}1&2&3&4&5\\2&3&4&5&1\\3&4&5&1&2\\4&5&1&2&3\\5&1&2&3&4\end{matrix}}\qquad {\begin{matrix}1&2&3&4&5\\3&4&5&1&2\\5&1&2&3&4\\2&3&4&5&1\\4&5&1&2&3\end{matrix}}\qquad {\begin{matrix}1&2&3&4&5\\5&1&2&3&4\\4&5&1&2&3\\3&4&5&1&2\\2&3&4&5&1\end{matrix}}\qquad {\begin{matrix}1&2&3&4&5\\4&5&1&2&3\\2&3&4&5&1\\5&1&2&3&4\\3&4&5&1&2\end{matrix}}.}$

While it is possible to represent MOLS in a "compound" matrix form similar to the Graeco-Latin squares, for instance,

 1,1,1,1 2,2,2,2 3,3,3,3 4,4,4,4 5,5,5,5 2,3,5,4 3,4,1,5 4,5,2,1 5,1,3,2 1,2,4,3 3,5,4,2 4,1,5,3 5,2,1,4 1,3,2,5 2,4,3,1 4,2,3,5 5,3,4,1 1,4,5,2 2,5,1,3 3,1,2,4 5,4,2,3 1,5,3,4 2,1,4,5 3,2,5,1 4,3,1,2

for the MOLS(5) example above, it is more typical to compactly represent the MOLS as an orthogonal array (see below).[18]

In the examples of MOLS given so far, the same alphabet (symbol set) has been used for each square, but this is not necessary as the Graeco-Latin squares show. In fact, totally different symbol sets can be used for each square of the set of MOLS. For example,

 fjords jawbox phlegm qiviut zincky zincky fjords jawbox phlegm qiviut qiviut zincky fjords jawbox phlegm phlegm qiviut zincky fjords jawbox jawbox phlegm qiviut zincky fjords

is a representation of the compounded MOLS(5) example above where the four MOLS have the following alphabets, respectively:

### The number of mutually orthogonal latin squares

The mutual orthogonality property of a set of MOLS is unaffected by

• Permuting the rows of all the squares simultaneously,
• Permuting the columns of all the squares simultaneously, and
• Permuting the entries in any square, independently.

Using these operations, any set of MOLS can be put into standard form, meaning that the first row of every square is identical and normally put in some natural order, and one square has its first column also in this order.[19] The MOLS(4) and MOLS(5) examples at the start of this section have been put in standard form.

By putting a set of MOLS(n) in standard form and examining the entries in the second row and first column of each square, it can be seen that no more than n − 1 squares can exist.[20] A set of n − 1 MOLS(n) is called a complete set of MOLS. Complete sets are known to exist when n is a prime number or power of a prime (see Finite field construction below). However, the number of MOLS that may exist for a given order n is not known for general n, and is an area of research in combinatorics.

#### Projective planes

A set of n − 1 MOLS(n) is equivalent to a finite affine plane of order n (see Nets below).[10] As every finite affine plane is uniquely extendable to a finite projective plane of the same order, this equivalence can also be expressed in terms of the existence of these projective planes.[21]

As mentioned above, complete sets of MOLS(n) exist if n is a prime or prime power, so projective planes of such orders exist. Finite projective planes with an order different from these, and thus complete sets of MOLS of such orders, are not known to exist.[10]

The only general result on the non-existence of finite projective planes is the Bruck–Ryser theorem, which says that if a projective plane of order n exists and n ≡ 1 (mod 4) or n ≡ 2 (mod 4), then n must be the sum of two (integer) squares.[22] This rules out projective planes of orders 6 and 14 for instance, but does not guarantee the existence of a plane when n satisfies the condition. In particular, n = 10 satisfies the conditions, but no projective plane of order 10 exists, as was shown by a very long computer search,[23] which in turn implies that there do not exist nine MOLS of order 10.

No other existence results are known. As of 2020, the smallest order for which the existence of a complete set of MOLS is undetermined is thus 12.[10]

#### McNeish's theorem

The minimum number of MOLS(n) is known to be 2 for all n except for n = 2 or 6, where it is 1. However, more can be said, namely,[24]

MacNeish's Theorem: If ${\displaystyle n=p_{1}^{\alpha _{1}}p_{2}^{\alpha _{2}}\cdots p_{r}^{\alpha _{r}}}$ is the factorization of the integer n into powers of distinct primes ${\displaystyle p_{1},p_{2},\cdots ,p_{r}}$ then

the minimum number of MOLS(n) ${\displaystyle \geq {\underset {i}{\operatorname {min} }}\{p_{i}^{\alpha _{i}}-1\}.}$

MacNeish's theorem does not give a very good lower bound, for instance if n ≡ 2 (mod 4), that is, there is a single 2 in the prime factorization, the theorem gives a lower bound of 1, which is beaten if n > 6. On the other hand, it does give the correct value when n is a power of a prime.

For general composite numbers, the number of MOLS is not known. The first few values starting with n = 2, 3, 4... are 1, 2, 3, 4, 1, 6, 7, 8, ... (sequence A001438 in the OEIS).

The smallest case for which the exact number of MOLS(n) is not known is n = 10. From the Graeco-Latin square construction, there must be at least two and from the non-existence of a projective plane of order 10, there are fewer than nine. However, no set of three MOLS(10) has ever been found even though many researchers have attempted to discover such a set.[25]

For large enough n, the number of MOLS is greater than ${\displaystyle {\sqrt[{14.8}]{n}}}$, thus for every k, there are only a finite number of n such that the number of MOLS is k.[26] Moreover, the minimum is 6 for all n > 90.

#### Finite field construction

A complete set of MOLS(q) exists whenever q is a prime or prime power. This follows from a construction that is based on a finite field GF(q), which only exist if q is a prime or prime power.[27] The multiplicative group of GF(q) is a cyclic group, and so, has a generator, λ, meaning that all the non-zero elements of the field can be expressed as distinct powers of λ. Name the q elements of GF(q) as follows:

α0 = 0, α1 = 1, α2 = λ, α3 = λ2, ..., αq-1 = λq-2.

Now, λq-1 = 1 and the product rule in terms of the α's is αiαj = αt, where t = i + j -1 (mod q -1). The Latin squares are constructed as follows, the (i, j)th entry in Latin square Lr (with r ≠ 0) is Lr(i,j) = αi + αrαj, where all the operations occur in GF(q). In the case that the field is a prime field (q = p a prime), where the field elements are represented in the usual way, as the integers modulo p, the naming convention above can be dropped and the construction rule can be simplified to Lr(i,j) = i + rj, where r ≠ 0 and i, j and r are elements of GF(p) and all operations are in GF(p). The MOLS(4) and MOLS(5) examples above arose from this construction, although with a change of alphabet.

Not all complete sets of MOLS arise from this construction. The projective plane that is associated with the complete set of MOLS obtained from this field construction is a special type, a Desarguesian projective plane. There exist non-Desarguesian projective planes and their corresponding complete sets of MOLS can not be obtained from finite fields.[28]

### Orthogonal array

An orthogonal array, OA(k,n), of strength two and index one is an n2 × k array A (k ≥ 2 and n ≥ 1, integers) with entries from a set of size n such that within any two columns of A (strength), every ordered pair of symbols appears in exactly one row of A (index).[29]

An OA(s + 2, n) is equivalent to s MOLS(n).[29] For example, the MOLS(4) example given above and repeated here,

${\displaystyle {\begin{matrix}1&2&3&4\\2&1&4&3\\3&4&1&2\\4&3&2&1\\&L_{1}&&\end{matrix}}\qquad \qquad {\begin{matrix}1&2&3&4\\4&3&2&1\\2&1&4&3\\3&4&1&2\\&L_{2}&&\end{matrix}}\qquad \qquad {\begin{matrix}1&2&3&4\\3&4&1&2\\4&3&2&1\\2&1&4&3\\&L_{3}&&\end{matrix}}}$

can be used to form an OA(5,4):

r c L1 L2 L3
1 1 1 1 1
1 2 2 2 2
1 3 3 3 3
1 4 4 4 4
2 1 2 4 3
2 2 1 3 4
2 3 4 2 1
2 4 3 1 2
3 1 3 2 4
3 2 4 1 3
3 3 1 4 2
3 4 2 3 1
4 1 4 3 2
4 2 3 4 1
4 3 2 1 4
4 4 1 2 3

where the entries in the columns labeled r and c denote the row and column of a position in a square and the rest of the row for fixed r and c values is filled with the entry in that position in each of the Latin squares. This process is reversible; given an OA(s,n) with s ≥ 3, choose any two columns to play the r and c roles and then fill out the Latin squares with the entries in the remaining columns.

More general orthogonal arrays represent generalizations of the concept of MOLS, such as mutually orthogonal Latin cubes.

### Nets

A (geometric) (k,n)-net is a set of n2 elements called points and a set of kn subsets called lines or blocks each of size n with the property that two distinct lines intersect in at most one point. Moreover, the lines can be partitioned into k parallel classes (no two of its lines meet) each containing n lines.[30]

An (n + 1, n)-net is an affine plane of order n.

A set of k MOLS(n) is equivalent to a (k + 2, n)-net.[10]

To construct a (k + 2, n)-net from k MOLS(n), represent the MOLS as an orthogonal array, OA(k + 2, n) (see above). The ordered pairs of entries in each row of the orthogonal array in the columns labeled r and c, will be considered to be the coordinates of the n2 points of the net. Each other column (that is, Latin square) will be used to define the lines in a parallel class. The n lines determined by the column labeled Li will be denoted by lij. The points on lij will be those with coordinates corresponding to the rows where the entry in the Li column is j. There are two additional parallel classes, corresponding to the r and c columns. The lines rj and cj consist of the points whose first coordinates are j, or second coordinates are j respectively. This construction is reversible.[31]

For example, the OA(5,4) in the above section can be used to construct a (5,4)-net (an affine plane of order 4). The points on each line are given by (each row below is a parallel class of lines):

 l11: (1,1) (2,2) (3,3) (4,4) l12: (1,2) (2,1) (3,4) (4,3) l13: (1,3) (2,4) (3,1) (4,2) l14: (1,4) (2,3) (3,2) (4,1) l21: (1,1) (2,4) (3,2) (4,3) l22: (1,2) (2,3) (3,1) (4,4) l23: (1,3) (2,2) (3,4) (4,1) l24: (1,4) (2,1) (3,3) (4,2) l31: (1,1) (2,3) (3,4) (4,2) l32: (1,2) (2,4) (3,3) (4,1) l33: (1,3) (2,1) (3,2) (4,4) l34: (1,4) (2,2) (3,1) (4,3) r1: (1,1) (1,2) (1,3) (1,4) r2: (2,1) (2,2) (2,3) (2,4) r3: (3,1) (3,2) (3,3) (3,4) r4: (4,1) (4,2) (4,3) (4,4) c1: (1,1) (2,1) (3,1) (4,1) c2: (1,2) (2,2) (3,2) (4,2) c3: (1,3) (2,3) (3,3) (4,3) c4: (1,4) (2,4) (3,4) (4,4)

### Transversal designs

A transversal design with k groups of size n and index λ, denoted T[k, λ; n], is a triple (X, G, B) where:[32]

• X is a set of kn varieties;
• G = {G1, G2, ..., Gk} is a family of k n-sets (called groups, but not in the algebraic sense) which form a partition of X;
• B is a family of k-sets (called blocks) of varieties such that each k-set in B intersects each group Gi in precisely one variety, and any pair of varieties which belong to different groups occur together in precisely λ blocks in B.

The existence of a T[k,1;n] design is equivalent to the existence of k-2 MOLS(n).[33]

A transversal design T[k,1;n] is the dual incidence structure of an (k,n)-net. That is, it has nk points and n2 blocks. Each point is in n blocks; each block contains k points. The points fall into k equivalence classes (groups) of size n so that two points in the same group are not contained in a block while two points in different groups belong to exactly one block.[34]

For example, using the (5,4)-net of the previous section we can construct a T[5,1;4] transversal design. The block associated with the point (i, j) of the net will be denoted bij. The points of the design will be obtained from the following scheme: rii, cj ↔ 5j, and lij ↔ 5i + j. The points of the design are thus denoted by the integers 1, ..., 20. The blocks of the design are:

 b11: 6 11 16 1 5 b22: 6 13 19 2 10 b33: 6 14 17 3 15 b44: 6 12 18 4 20 b12: 7 12 17 1 10 b21: 7 14 18 2 5 b34: 7 13 16 3 20 b43: 7 11 19 4 15 b13: 8 13 18 1 15 b24: 8 11 17 2 20 b31: 8 12 19 3 5 b42: 8 14 16 4 10 b14: 9 14 19 1 20 b23: 9 12 16 2 15 b32: 9 11 18 3 10 b41: 9 13 17 4 5

The five "groups" are:

 6 7 8 9 11 12 13 14 16 17 18 19 1 2 3 4 5 10 15 20

### Graph theory

A set of k MOLS(n) is equivalent to an edge-partition of the complete (k + 2)-partite graph Kn,...,n into complete subgraphs of order k + 2.[10]

## Applications

Mutually orthogonal Latin squares have a great variety of applications. They are used as a starting point for constructions in the statistical design of experiments, tournament scheduling, and error correcting and detecting codes. Euler's interest in Graeco-Latin squares arose from his desire to construct magic squares. The French writer Georges Perec structured his 1978 novel Life: A User's Manual around a 10×10 Graeco-Latin square.

## Notes

1. ^ This has gone under several names in the literature, formule directrix (Euler), directrix, 1-permutation, and diagonal amongst others. (Denes & Keedwell 1974, p. 29)
2. ^ a b c Denes & Keedwell 1974, p. 155
3. ^ Denes & Keedwell 1974, p. 156
4. ^ Knuth, Donald (2011), The Art of Computer Programming, 4A: Combinatorial Algorithms Part 1, Addison-Wesley, pp. xv+883pp, ISBN 978-0-201-03804-0. Errata: [1]
5. ^ Ozanam, Jacques (1725), Recreation mathematiques et physiques, IV, p. 434, the solution is in Fig. 35
6. ^ a b Gardner 1966, pp. 162-172
7. ^ van Lint & Wilson 1993, p.251
8. ^ P. A. MacMahon (1902). "Magic Squares and Other Problems on a Chess Board". Proceedings of the Royal Institution of Great Britain. XVII: 50–63.
9. ^
10. Colbourn & Dinitz 2007, p. 162
11. ^ Tarry, Gaston (1900). "Le Probléme de 36 Officiers". Compte Rendu de l'Association Française pour l'Avancement des Sciences. Secrétariat de l'Association. 1: 122–123.
12. ^ Tarry, Gaston (1901). "Le Probléme de 36 Officiers". Compte Rendu de l'Association Française pour l'Avancement des Sciences. Secrétariat de l'Association. 2: 170–203.
13. ^ van Lint & Wilson 1993, p.267
14. ^ Bose, R. C.; Shrikhande, S. S. (1959), "On the falsity of Euler's conjecture about the non-existence of two orthogonal Latin squares of order 4t + 2", Proceedings of the National Academy of Sciences USA, 45 (5): 734–737, doi:10.1073/pnas.45.5.734, PMC 222625, PMID 16590435
15. ^ Bose, R. C.; Shrikhande, S. S.; Parker, E. T. (1960), "Further results on the construction of mutually orthogonal Latin squares and the falsity of Euler's conjecture", Canadian Journal of Mathematics, 12: 189–203, doi:10.4153/CJM-1960-016-5, MR 0122729
16. ^ Colburn & Dinitz 2007, p. 160
17. ^ Colburn & Dinitz 2007, p. 163
18. ^
19. ^ Denes & Keedwell 1974, p. 159
20. ^ Denes & Keedwell 1974, p. 158
21. ^ The term "order" used here for MOLSs, affine planes and projective planes is defined differently in each setting, but these definitions are coordinated so that the numerical value is the same.
22. ^ Bruck, R.H.; Ryser, H.J. (1949), "The nonexistence of certain finite projective planes", Canadian Journal of Mathematics, 1: 88–93, doi:10.4153/cjm-1949-009-2
23. ^ Lam, C. W. H. (1991), "The Search for a Finite Projective Plane of Order 10", American Mathematical Monthly, 98 (4): 305–318, doi:10.2307/2323798, JSTOR 2323798
24. ^ Denes & Keedwell 1974, p. 390
25. ^ McKay, Meynert & Myrvold 2007, p. 102
26. ^ Lenz, H.; Jungnickel, D.; Beth, Thomas (November 1999). Design Theory by Thomas Beth. Cambridge Core. doi:10.1017/cbo9781139507660. ISBN 9780521772310. Retrieved 2019-07-06.
27. ^ Denes & Keedwell 1974, p. 167
28. ^ Denes & Keedwell 1974, p. 169
29. ^ a b Stinson 2004, p. 140
30. ^ Colbourn & Dinitz 2007, p. 161
31. ^ Denes & Keedwell 1974, p. 270
32. ^ Street & Street 1987, p. 133
33. ^ Street & Street 1987, p. 135
34. ^ van Lint & Wilson 1993, p.257