In combinatorial mathematics, 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.

An outdated term for pair of orthogonal Latin squares is Graeco-Latin square, found in older literature.

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

The arrangement of the -coordinates by themselves (which may be thought of as Latin characters) and of the -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  from the Cartesian product  occurs exactly once.

Orthogonal Latin squares were studied in detail by Leonhard Euler, who took the two sets to be }, the first  upper-case letters from the Latin alphabet, and },
the first  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. 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.

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

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, 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 4 + 2 for some positive integer ).

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, the construction of a 4 x 4 set was published by Jacques Ozanam in 1725. 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 variant of the problem in his November 1959 Mathematical Games column, 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:

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 different.

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. This problem is known as the thirty-six officers problem, and Euler introduced it as follows:

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  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  The non-existence of order six squares was confirmed in 1901 by Gaston Tarry through a proof by exhaustion.  However, Euler's conjecture resisted solution until the late 1950s, but the problem has led to important work in combinatorics.

In 1959, R.C. Bose and S. S. Shrikhande constructed some counterexamples (dubbed the Euler spoilers) of order 22 using mathematical insights.  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  Thus, Graeco-Latin squares exist for all orders  except  In the November 1959 edition of Scientific American, Martin Gardner published this result. The front cover is the 10 × 10 refutation of Euler's conjecture.

Thirty-six entangled officers problem

Extensions of mutually orthogonal Latin squares to the quantum domain have been studied since 2017.
In these designs, instead of the uniqueness of symbols, the elements of an array are quantum states that must be orthogonal to each other in rows and columns. 
In 2021, a Indian-Polish team of physicists (Rather, Burchardt, Bruzda, Rajchel-Mieldzioć, Lakshminarayan, and Życzkowski) found an array of quantum states that provides an example of mutually orthogonal quantum Latin squares of size 6; or, equivalently, an arrangement of 36 officers that are entangled 

.
This setup solves a generalization of the 36 Euler's officers problem, as well as provides a new quantum error detection code, allowing to encode a 6-level system into a three 6-level system that certifies occurrence of one error.

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:

And a set of MOLS(5):

While it is possible to represent MOLS in a "compound" matrix form similar to the Graeco-Latin squares, for instance,
{| class="wikitable"
|-
| 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).

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,

is a representation of the compounded MOLS(5) example above where the four MOLS have the following alphabets, respectively:
 the background color: black, maroon, teal, navy, and silver
 the foreground color: white, red, lime, blue, and yellow
 the text: fjords, jawbox, phlegm, qiviut, and zincky
 the typeface family: serif, sans-serif, slab-serif, cursive, and monospaced.

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. 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() 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  squares can exist. A set of  − 1 MOLS() is called a complete set of MOLS. Complete sets are known to exist when  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  is not known for general , and is an area of research in combinatorics.

Projective planes

 
A set of  − 1 MOLS() is equivalent to a finite affine plane of order  (see Nets below). 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.

As mentioned above, complete sets of MOLS() exist if  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.

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  exists and  or  ≡ 2 (mod 4), then  must be the sum of two (integer) squares. This rules out projective planes of orders 6 and 14 for instance, but does not guarantee the existence of a plane when  satisfies the condition. In particular,  = 10 satisfies the conditions, but no projective plane of order 10 exists, as was shown by a very long computer search, which in turn implies that there do not exist nine MOLS of order 10.

No other existence results are known.  the smallest order for which the existence of a complete set of MOLS is undetermined is 12.

McNeish's theorem
The minimum number of MOLS() is known to be 2 for all  except for  = 2 or 6, where it is 1. However, more can be said, namely,

MacNeish's Theorem: If  is the factorization of the integer  into powers of distinct primes  then 

MacNeish's theorem does not give a very good lower bound, for instance if  ≡ 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  > 6. On the other hand, it does give the correct value when  is a power of a prime.

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

The smallest case for which the exact number of MOLS() is not known is  = 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.

For large enough , the number of MOLS is greater than , thus for every , there are only a finite number of  such that the number of MOLS is . Moreover, the minimum is 6 for all  > 90.

Finite field construction
A complete set of MOLS() exists whenever  is a prime or prime power. This follows from a construction that is based on a finite field GF(), which only exist if  is a prime or prime power. The multiplicative group of GF() 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  elements of GF() as follows: 
α0 = 0, α1 = 1, α2 = λ, α3 = λ2, ..., α-1 = λ-2.

Now, λ-1 = 1 and the product rule in terms of the α's is αα = α, where  =  +  -1 (mod  -1). The Latin squares are constructed as follows, the ()th entry in Latin square L (with  ≠ 0) is L() = α + αα, where all the operations occur in GF(). In the case that the field is a prime field ( =  a prime), where the field elements are represented in the usual way, as the integers modulo , the naming convention above can be dropped and the construction rule can be simplified to L() =  + , where  ≠ 0 and ,  and  are elements of GF() and all operations are in GF(). 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.

Orthogonal array

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

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

can be used to form an OA(5,4):
{| class="wikitable"
|-
! 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(,) with  ≥ 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) ()-net is a set of 2 elements called points and a set of  subsets called lines or blocks each of size  with the property that two distinct lines intersect in at most one point. Moreover, the lines can be partitioned into  parallel classes (no two of its lines meet) each containing  lines.

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

A set of  MOLS() is equivalent to a ( + 2, )-net.

To construct a ( + 2, )-net from  MOLS(), represent the MOLS as an orthogonal array, OA( + 2, ) (see above). The ordered pairs of entries in each row of the orthogonal array in the columns labeled  and , will be considered to be the coordinates of the 2 points of the net. Each other column (that is, Latin square) will be used to define the lines in a parallel class. The  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 . There are two additional parallel classes, corresponding to the  and  columns. The lines j and j consist of the points whose first coordinates are , or second coordinates are  respectively. This construction is reversible.

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):
{| class="wikitable"
|-
|11:
|(1,1) (2,2) (3,3) (4,4)
|12:
|(1,2) (2,1) (3,4) (4,3)
|13:
|(1,3) (2,4) (3,1) (4,2)
|14:
|(1,4) (2,3) (3,2) (4,1)
|-
|21:
|(1,1) (2,4) (3,2) (4,3)
|22:
|(1,2) (2,3) (3,1) (4,4)
|23:
|(1,3) (2,2) (3,4) (4,1)
|24:
|(1,4) (2,1) (3,3) (4,2)
|-
|31:
|(1,1) (2,3) (3,4) (4,2)
|32:
|(1,2) (2,4) (3,3) (4,1)
|33:
|(1,3) (2,1) (3,2) (4,4)
|34:
|(1,4) (2,2) (3,1) (4,3)
|-
|1:
|(1,1) (1,2) (1,3) (1,4)
|2:
|(2,1) (2,2) (2,3) (2,4)
|3:
|(3,1) (3,2) (3,3) (3,4)
|4:
|(4,1) (4,2) (4,3) (4,4)
|-
| 1:
|(1,1) (2,1) (3,1) (4,1)
| 2:
|(1,2) (2,2) (3,2) (4,2)
| 3:
|(1,3) (2,3) (3,3) (4,3)
| 4:
|(1,4) (2,4) (3,4) (4,4)
|}

Transversal designs
A transversal design with  groups of size  and index λ, denoted T[, λ; ], is a triple () where:
  is a set of  varieties;
 } is a family of -sets (called groups, but not in the algebraic sense) which form a partition of ;
  is a family of -sets (called blocks) of varieties such that each -set in  intersects each group  in precisely one variety, and any pair of varieties which belong to different groups occur together in precisely λ blocks in .

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

A transversal design T[,1;] is the dual incidence structure of an ()-net. That is, it has  points and 2 blocks. Each point is in  blocks; each block contains  points. The points fall into  equivalence classes (groups) of size  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.

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 () of the net will be denoted ij. The points of the design will be obtained from the following scheme: i ↔ , j ↔ 5, and ij ↔ 5 + . The points of the design are thus denoted by the integers 1, ..., 20. The blocks of the design are:
{| class="wikitable"
|-
|11:
|6 11 16 1 5
|22:
|6 13 19 2 10
|33:
|6 14 17 3 15
|44:
|6 12 18 4 20
|-
|12:
|7 12 17 1 10
|21:
|7 14 18 2 5
|34:
|7 13 16 3 20
|43:
|7 11 19 4 15
|-
|13:
|8 13 18 1 15
|24:
|8 11 17 2 20
|31:
|8 12 19 3 5
|42:
|8 14 16 4 10
|-
|14:
|9 14 19 1 20
|23:
|9 12 16 2 15
|32:
|9 11 18 3 10
|41:
|9 13 17 4 5
|}
The five "groups" are:
{| class="wikitable"
|-
|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  MOLS() is equivalent to an edge-partition of the complete ( + 2)-partite graph Kn,...,n into complete subgraphs of order  + 2.

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.

See also

36 cube
Block design
Blocking (statistics)
Combinatorial design

Notes

References 
 
 
 
 |doi-broken-date=2020-10-03| zbl=1112.05018 | citeseerx=10.1.1.151.3043}}

External links
Leonhard Euler's Puzzle of the 36 Officiers AMS featured column archive (Latin Squares in Practice and Theory II)

Euler's work on Latin Squares and Euler Squares at Convergence
 Java Tool which assists in constructing Graeco-Latin squares (it does not construct them by itself) at cut-the-knot
 Anything but square: from magic squares to Sudoku
 Historical facts and correlation with Magic Squares, Javascript Application to solve Graeco-Latin Squares from size 1x1 to 10x10 and related source code (Javascript in Firefox browser and HTML5 mobile devices)

Latin squares
Design of experiments