Lecture Notes 3: Latin Squares

A Latin square is an n × n square matrix whose entries consist of n symbols such that each symbol appears exactly once in each row and each column. It is typical to use as the symbols the integers from 1 ... n.

Some examples:

12
21
123
231
312
1234
2341
3412
4123
1234
2143
3412
4321

The first three examples all follow the same scheme; each row is determined by cyclically rotating the previous row to the right. It is not hard to see that this procedure will work for any size n to produce a Latin square, so the existence question is easily answered - there exists a Latin square of any order n. The last two examples show that you can have more than one Latin square of a given order. There is a natural question to ask at this point - How many Latin squares of a given order are there? - but before we examine this question, let's conduct a little experiment.

[To be done in class - approx. 3 min] Construct a Latin square of order 5 which is not the cyclic square.

Given the variety of answers, one wonders if they are all really different or is there some sense in which we can say that different looking squares are equivalent?

There are three operations that we can perform on a Latin square which will preserve the "Latinness" of the square. They are:

  1. Permute the rows
  2. Permute the columns
  3. Permute the symbols (i.e., rename the symbols without changing their relative positions).
If we can change one square into another by means of any or all of these operations, we say that the two squares are isotopic. Isotopy is an equivalence relation on the set of Latin squares of a given order (prove this - reflexive, symmetric and transitive - for homework). Thus it makes sense to call only nonisotopic squares different. Note that the two examples of order 4 squares are nonisotopic.

Given a square we can permute the columns so that the first row consists of 1 2 3 4 .... n in their natural order. After doing this we could permute the rows so that the first column is also 1 ... n in the natural order. The resulting square is of course isotopic to the original square and is a convenient representative of the isotopy class of this square. Such a square is said to be in standard form or reduced. (There will in general be more than one reduced square in an isotopy class. Find two reduced squares of order 4 in the same isotopy class - homework)

Now lets look at this list of order 5 squares. How many different (i.e., nonisotopic ) squares are there?

Let's back up a little. There is only one isotopy class of order 2 squares, and only one for order 3 squares. There are two classes for order four squares (although there are four reduced squares of this order). There are 2 classes of order 5 (with 56 reduced squares) and 22 classes of order 6. Other known results are:

Order # Isotopy Classes # Reduced Squares
6 22 9,408
7 563 16,942,080
8 1,676,257 535,281,401,856
9 ? 377,597,570,964,258,816

The question of enumerating and classifying Latin squares is not an easy one. Give some thought to how you might attempt to do this.

Latin squares have a long history. The concept probably originated with problems concerning the movement and disposition of pieces on a chess board. However, the earliest written reference concerned the problem of placing the 16 face cards of an ordinary playing deck in the form of a square so that no row, column or diagonal should contain more than one card of each suit and each rank. An enumeration by type of the solutions to this problem was published in 1723. A similar problem involving the arrangement of 36 officers of 6 different ranks and regiments in a square phalanx was proposed by Euler in 1779, but not until the beginning of the 20th century was it shown that no solution was possible. The Latin square concept certainly goes back further than these written documents. In his famous etching Melencholia I, the 16th Century artist Albrecht Dürer portrays an order 4 magic square, a relative of Latin squares, in the background. Magic squares can also be found in the ancient Chinese literature.

The systematic development of Latin squares started with Euler (1779) and was carried on by Cayley (1877-1890) who showed that the multiplication table of a group is an appropriately bordered special Latin square. In the 1930's the concept arose once again in the guise of multiplication tables when the theory of quasi-groups and loops began to be developed as a generalization of the group concept. Latin squares played an important role in the foundations of finite geometries, a subject which was also in development at this time. Also in the 1930's, a large application area for Latin squares was opened by R.A.Fisher who used them and other combinatorial structures in the design of statistical experiments.

Let us look at an example of the use of Latin squares in the design of a statistical experiment.

Cox [The Planning of Experiments, 1958] discusses an experiment in prosthodontics which compares seven treatments, which are commercial dentures of different materials and set at different angles. It is desirable to eliminate as much as possible of the variation due to differences between patients. Hence, each patient wears dentures of one type for a month, then dentures of another type for another month, and so on. After seven months, each patient has worn each type of denture.

In this experiment, it seems likely that the results in later months will be different from those in earlier months, and hence it is sensible to arrange that each treatment be used equally often in each time position. Thus, there are two types of variation, namely between-patient and between-time variation. The desire to balance out both types suggests the use of Latin squares.

We could design this experiment in the following way. Form a 7 x 7 square whose columns are labeled with the months and whose rows are labeled with the patients.

  Jan Feb Mar Apr May Jun Jul
Pat. A        
B       
C       
D       
E       
F       
G       

Now associate a digit from 1 - 7 with each of the treatments and fill in the cells of the square with (any) order 7 Latin square. The square is then the experimental design, specifying which treatment is given to which patient for each month. Since the design is a Latin square, each patient will get each treatment and each treatment will be used each month, thus balancing out the variations.

ORTHOGONAL LATIN SQUARES

Much of the interest and many of the applications in the theory of Latin squares involves a relationship between squares of the same order called orthogonality.

The first written reference to Latin squares concerned a problem of arranging the face cards of an ordinary pack of playing cards into a square so that no row or column contained more than one card of each suit and one card of each rank. Consider the following array, which is one of the solutions to this problem.

A K Q J
J Q K A
K A J Q
Q J A K
If we separate the suits and ranks, we get two order 4 Latin squares.
A K Q J
J Q K A
K A J Q
Q J A K
Moreover, in the combined square, each symbol from the first square is matched with each of the symbols in the second square and since there are four of each type of symbol this means that each pair of symbols, one from the first square and the other from the second square appears exactly once in the combined square (alternatively, there are no duplicates in the combined square). This relationship between the two squares is what we will call orthogonality. More formally,

Two Latin squares L1 = | aij| and L2 = | bij| on n symbols 1,2,...,n are said to be orthogonal if every ordered pair of symbols occurs exactly once among the n2 pairs (aij ,bij), i = 1,2,...,n; j = 1,2,...,n.

Another example, a pair of orthogonal order 3 Latin squares and the 9 distinct ordered pairs that they form.

2 3 1
1 2 3
3 1 2
2 1 3
1 3 2
3 2 1
2,2 3,1 1,3
1,1 2,3 3,2
3,3 1,2 2,1
We often refer to one of a pair of orthogonal squares as being an orthogonal mate of the other. Euler was originally interested in such pairs and in his writings he would always use Latin letters for the first square and Greek letters for the second. Thus, when he referred to only one of the squares he called it the Latin square. When referring to both of the orthogonal squares he used the term Graeco-Latin squares, which is the way orthogonal squares are referred to in all the earlier literature.

Orthogonal Mates

Given a pair of orthogonal Latin squares, consider the cells in the first square which contain one particular symbol. Of course, by Latiness, there is only one of these cells in each row and column. Now consider the cells in the orthogonal mate which correspond to these cells in the first square. By orthogonality, the entries in these cells must all be different and so these cells form a transversal in the orthogonal mate. This observation applies to the cells corresponding to any symbol of the first square, so we have:

Theorem I.2.1.1 - A given Latin square possesses an orthogonal mate if and only if it has n disjoint transversals.

If the Latin square in question is the multiplication table of a group, then it can be shown that the existence of a single transversal suffices to conclude that the square has an orthogonal mate. Furthermore,

Theorem I.2.1.2 - The multiplication table of any group of odd order forms a Latin square which possesses an orthogonal mate.

Corollary I.2.1.3 - There exist pairs of orthogonal Latin squares of every odd order.

The existence question for pairs of orthogonal Latin squares of even order is much more difficult to settle and has a long and famous history. To start with, there are only two Latin squares of order 2 and they are not orthogonal (prove this !). We have illustrated an example of a pair of orthogonal squares of order 4 in the introduction to this section. The next case, that of order 6, is the problem that originally interested Euler in the subject. Called the Problem of the 36 Officers, Euler stated it as follows in 1779, "Arrange 36 officers, 6 from each of 6 regiments, of 6 different ranks, into a 6x6 square, so that each row and each file contains one officer of each rank and one officer of each regiment." Clearly, the problem can be solved, as with the card problem in the introduction, by finding a pair of orthogonal latin squares of order 6. As brilliant a mathematician as Euler was, he was unable to find such a pair of squares and unable to prove that they did not exist. Based on his experience with the problem and some other pieces of evidence (such as Cor I.1.2.5, which he was aware of), Euler made a conjecture which included and went beyond this problem:

Euler's Conjecture: There does not exist an orthogonal mate for any Latin square whose order has the form n = 4k + 2 (oddly even integers as he put it).

120 years after Euler first stated the problem, Tarry in 1900 settled the problem of the 36 officers in the negative. His method was straight-forward, he listed out all of the 812,851,200 Latin squares of order 6 and examined each pair for orthogonality and found none [ actually, by working with reduced squares he simplified the problem to checking only 9408 pairs - but of course this was all done by hand]. ( A short, non-computer proof of Tarry's result was given in 1984 by Stinson, see the references).

It was beginning to look like the old master had pulled off a coupe, but in 1960 Bose, Shrikhande and Parker shocked the mathematical community by proving that if n > 6 Euler's conjecture is false. Their original method is long, complicated and involved looking at a number of special cases (see the references). We shall, after some preliminaries, present a short and elegant proof of the result published by the Chinese mathematician Zhu Lie.

As we shall see in the next section, the remaining case (of squares with orders divisible by 4) is easily settled in the affirmative, so the existence question for orthogonal Latin squares is completely settled.

Theorem I.2.1.4 - For any order n 2 or 6, there exists a pair of orthogonal Latin squares of order n.

Sets of Mutually Orthogonal Latin Squares [MOLS]

A set of Latin squares of the same order, each of which is an orthogonal mate of each of the others is called a set of mutually orthogonal Latin squares. This mouthful is often shortened to its acronym MOLS. For example, a set of 3 MOLS of order 4 is given by:
1 0 3 2
2 3 0 1
3 2 1 0
0 1 2 3
2 3 0 1
3 2 1 0
1 0 3 2
0 1 2 3
3 2 1 0
1 0 3 2
2 3 0 1
0 1 2 3
(Verify that each is an orthogonal mate of the other two squares !).

A question both interesting and important for applications we will see later is how big can a set of MOLS of a given order be? We already know that if the order is not 2 or 6, there are at least two MOLS of that order, but what more can be said?

The questions posed concern themselves only with the number of squares in a set of MOLS, not with what the squares actually are, so we may give ourselves license to alter the squares to suit our purposes as long as we don't change the number or mutual orthogonality of the squares. We know that we can change one square into an "equivalent" (i.e.,isotopic) square by permuting the rows, and/or columns and by renaming the elements. What effect do these transformations have on orthogonality? Consider a pair of orthogonal squares. It is not hard to see that we can easily destroy orthogonality by permuting rows and/or columns, unless we carry out the permutations simultaneously on both squares. Doing row and/or column permutations simultaneously on the two squares is the same thing as doing these permutations on the superimposed square, which will move the ordered pairs around but clearly will not change any of them, so the resulting squares remain orthogonal. Now consider the renaming operation, and suppose we rename the elements of the second square only. For the original pair, each element of the first square was matched in an ordered pair with all of elements of the second square. After the renaming, all these ordered pairs are still present, they just appear in different places, so the new squares are still orthogonal. These observations lead us to the following definition. Two sets of MOLS with the same number of squares are said to be equivalent sets of MOLS if one can be obtained from the other by any combination of simultaneously permuting the rows of all the squares, simultaneously permuting the columns of all the squares and renaming the elements of any square. (Homework: Show that this is in fact an equivalence relation)

Lemma I.2.2.1 - Any set of MOLS is equivalent to a set where each square has the first row in natural order and one of the squares (usually the first) is reduced (i.e., it also has its first column in natural order).

Proof: Given a set of MOLS, we can convert it to an equivalent set by renaming the elements in any or all squares. If we do this to each square, we can make the first rows be anything we like, in particular, we can put them all in natural order. Now take any square and simultaneously permute the rows of all the squares so that the first column of this square is in natural order (this will not affect the first row since it is in natural order and so starts with the smallest element). The result is an equivalent set with the required properties.

A set of MOLS in the form described by this lemma is said to be in standard form, and the lemma merely says that any set of MOLS is equivalent to a set of MOLS in standard form.

(Homework: Put the set of MOLS given in the example above in standard form. There is an easy way and a hard way to do this, do it both ways.)

We may now easily answer one of the above questions.

Theorem I.2.2.2 - No more than n-1 MOLS of order n can exist.

Proof: Any set of MOLS of order n is equivalent to a set in standard form, which of course has the same number of squares in it. Consider the entries in first column and second row of all of the squares in standard form. No two squares can have the same entry in this cell. Suppose two squares had an r, say, in this cell, then in the superimposed square the ordered pair (r,r) would appear in this cell and also in the r-th cell of the first row because both squares have the same first row, and so, the two squares can not be orthogonal contradiction. Now, we can not have a 1 in this cell, since it appears in the first column of the first row. Thus, there are only n-1 possible entries for this cell and so there can be at most n-1 squares.

A set of MOLS of order n containing n-1 squares is called a complete set. We now have an existence question, for which orders do complete sets of MOLS exist? We know by examples that complete sets exist for orders 2 (only one square is needed), 3 and 4 and also that no complete set exists for order 6. We shall see how to construct complete sets of MOLS for any order which is a prime or power of a prime. However, it is an open research question of long standing whether or not a complete set of MOLS exists for any composite order. Instant fame will go to any mathematician who can settle this question.

Leaving aside the question of the existence of complete sets, it is certainly clear that for any order there is a maximum number of MOLS. Let N(n) be the maximum number of MOLS of order n. The only exact values that are known for this function are N(6) = 1 and N(p*) = p*-1 ,where p* is a prime or power of a prime. We also know that N(n) 2 if n2,6. Much work has gone into finding other values of this function, mostly computer searches, but the task is immense and will not be completed by the methods currently being used. Failing to find exact values, we can at least try to get good lower bounds for this function (the upper bound is of course n-1). One good attempt at this was carried out by MacNeish in the 1920's, based on the following construction.

Theorem I.2.2.3 - (MacNeish [1922]) Suppose that there exist r MOLS of order n and r MOLS of order m, then there exist r MOLS of order mn.

Proof: This proof is a notational nightmare, but the idea behind it is actually very simple.

Let A(1), A(2), ... , A(r) be the set of MOLS of order m and B(1), B(2), ... , B(r) be the set of MOLS of order n. For e = 1,2,...,r, let (aij(e), B(e)) represent the n x n matrix whose h,k entry is the ordered pair (aij(e),bhk(e)). Let C(e) be the mn × mn matrix that can be represented schematically by:

(a11(e) , B(e) ) (a12(e), B(e) )..... (a1m(e), B(e) )
(a21(e), B(e) ) (a22(e), B(e) )..... (a2m(e), B(e) )
.........................
(am1(e), B(e) ) (am2(e), B(e) ) ..... (amm(e) , B(e) )

We will show that C(1),C(2),...,C(r) is a set of MOLS of order mn.

To see that C(e) is a Latin square, note first that in a given row, two entries in different columns are given by (aij(e) ,buv(e)) and (aik(e),buw(e)), and so are distinct since A(e) and B(e) are Latin squares. In a given column two entries in different rows are distinct by the same reasoning.

To see that C(e) and C(f) are orthogonal, suppose that

((aij(e) ,buv(e) ) , (aij(f) ,buv(f) )) = ((apq(e) ,bst(e) ) , (apq(f) ,bst(f) ))
Then it follows that,
(aij(e) ,aij(f) ) = (apq(e) ,apq(f) )
so, by orthogonality of A(e) and A(f) , i = p and j = q. Similarly, orthogonality of B(e) and B(f) implies that u = s and v = t.

MacNeish used this construction to prove:

Theorem I.2.2.4 - Suppose that n = p1a p2b p3c ...pst is the prime power decomposition of n, n > 1, and r is the smallest of the quantities

(p1a - 1), (p2b - 1), ... , (pst -1).
Then N(n) r.

Proof: For each prime power p* in the decomposition we know that there are p* - 1 MOLS of that order. Thus there are r MOLS for each p*, since r is the smallest of these values. Repeated use of Thm I.2.2.3 yields r MOLS of order n.

We may now tidy up a result of the last section, where we left open the existence of orthogonal pairs for orders divisible by 4. This is taken care of by:

Corollary I.2.2.5 - If n is not of the form 4k + 2, then N(n) 2.

Proof: For n of this type, either 2 is not a divisor or its power is greater than 1. In either case, the smallest possible value of p* - 1 is 2.

MacNeish believed that his theorem actually gave the upper bound for N(n) as well (this is true for prime powers). This conjecture was put to rest in 1959 when E.T.Parker showed that N(21) 4 by constructing a set of 4 MOLS of order 21.

Work on the lower bounds of N(n) has shown that

It is also known that N(n) as n .

REFERENCES

Denes,J. & Keedwell,A.D., Latin Squares and Their Applications, 1974, Academic Press, New York. [Out of Print - but a second edition has come out]

This book is the only compilation of the vast literature on Latin squares. The style is a bit erratic since many research papers were simply rewritten to put this book together; however, it is invaluable as a resource book and we will refer to it often.

Other books with good sections on orthogonal Latin squares are

M. Hall, Combinatorial Theory, Blaisdell, 1967 , Chapter 13.

H. Ryser, Combinatorial Mathematics, Carus Mathematical Monographs #14, Mathematical Association of America, 1963, Chapter 7.

C. Liu, Introduction to Combinatorial Mathematics, McGraw - Hill, 1968.

The original work of enumeration the Latin squares of order six, by Tarry is in French.

G. Tarry, "Le problème des 36 officiers", C.R. Assoc. France Av. Sci., 29(1900) part 2, pp. 170 - 203.

A theoretical approach for order 6 is contained in the paper,

D.R. Stinson, "A Short Proof of the Nonexistence of a Pair of Orthogonal Latin Squares of Order Six", Journal of Combinatorial Theory, Series A, 36(1984), pp. 373-376.

The original proof of the falsity of Euler's Conjecture is given in a series of papers.

Bose,R.C. & Shrikhande,S.S., "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 Science, 45(1959), pp. 734-737.

Bose,R.C.,& Shrikhande,S.S.," On the Construction of Sets of Mutually Orthogonal Latin Squares and Falsity of a Conjecture of Euler", Transactions of the American Mathematical Society, 95(1960), pp.191-209.

Bose,R.C.,Shrikhande,S.S. & Parker, E.T., "Further Results on the Construction of Mutually Orthogonal Latin Squares and the Falsity of Euler's Conjecture", Canadian Journal of Mathematics, 12(1960), pp. 189-203.

A short proof of the result can be found in,

Z. Lie, "A Short Disproof of Euler's Conjecture Concerning Orthogonal Latin Squares", Ars Combinatoria, 14(1982), pp. 47-55.

MacNeish's theorem and conjecture can be found in,

H.F. MacNeish, "Euler Squares", Annals of Mathematics, 23(1922) pp. 221-227.

Parker's disproof of MacNeish's conjecture is contained in,

E.T. Parker, "Construction of some sets of mutually orthogonal Latin squares", Proceedings of the American Mathematical Society, 10(1959), pp. 946-949.

Some constructions of orthogonal squares are contained in:

H.B.Mann, "On Orthogonal Latin Squares", Bulletin of the American Mathematical Society, 50(1944), pp. 249 - 257.