Latin square


In combinatorics and in experimental design, a Latin square is an n × n array filled with n different symbols, each occurring exactly once in each row and exactly once in each column. An example of a 3×3 Latin square is
ABC
CAB
BCA

The name "Latin square" was inspired by mathematical papers by Leonhard Euler, who used Latin characters as symbols, but any set of symbols can be used: in the above example, the alphabetic sequence A, B, C can be replaced by the integer sequence 1, 2, 3. Euler began the general theory of Latin squares.

History

The Korean mathematician Choi Seok-jeong was the first to publish an example of Latin squares of order nine, in order to construct a magic square in 1700, predating Leonhard Euler by 67 years.

Reduced form

A Latin square is said to be reduced if both its first row and its first column are in their natural order. For example, the Latin square above is not reduced because its first column is A, C, B rather than A, B, C.
Any Latin square can be reduced by permuting the rows and columns. Here switching the above matrix's second and third rows yields the following square:
ABC
BCA
CAB

This Latin square is reduced; both its first row and its first column are alphabetically ordered A, B, C.

Properties

Orthogonal array representation

If each entry of an n × n Latin square is written as a triple, where r is the row, c is the column, and s is the symbol, we obtain a set of n2 triples called the orthogonal array representation of the square. For example, the orthogonal array representation of the Latin square
123
231
312

is
where for example the triple means that in row 2 and column 3 there is the symbol 1. Orthogonal arrays are usually written in array form where the triples are the rows, such as:
rcs
111
122
133
212
223
231
313
321
332

The definition of a Latin square can be written in terms of orthogonal arrays:
This means that the n2 ordered pairs are all the pairs with 1 ≤ i, jn, once each. The same is true of the ordered pairs and the ordered pairs.
The orthogonal array representation shows that rows, columns and symbols play rather similar roles, as will be made clear below.

Equivalence classes of Latin squares

Many operations on a Latin square produce another Latin square.
If we permute the rows, permute the columns, and permute the names of the symbols of a Latin square, we obtain a new Latin square said to be isotopic to the first. Isotopism is an equivalence relation, so the set of all Latin squares is divided into subsets, called isotopy classes, such that two squares in the same class are isotopic and two squares in different classes are not isotopic.
Another type of operation is easiest to explain using the orthogonal array representation of the Latin square. If we systematically and consistently reorder the three items in each triple, another orthogonal array is obtained. For example, we can replace each triple by which corresponds to transposing the square, or we could replace each triple by, which is a more complicated operation. Altogether there are 6 possibilities including "do nothing", giving us 6 Latin squares called the conjugates of the original square.
Finally, we can combine these two equivalence operations: two Latin squares are said to be paratopic, also main class isotopic, if one of them is isotopic to a conjugate of the other. This is again an equivalence relation, with the equivalence classes called main classes, species, or paratopy classes. Each main class contains up to six isotopy classes.

Number

There is no known easily computable formula for the number of Latin squares with symbols. The most accurate upper and lower bounds known for large are far apart. One classic result is that
A simple and explicit formula for the number of Latin squares was published in 1992, but it is still not easily computable due to the exponential increase in the number of terms. This formula for the number of Latin squares is
where is the set of all matrices, is the number of zero entries in matrix, and is the permanent of matrix.
The table below contains all known exact values. It can be seen that the numbers grow exceedingly quickly. For each, the number of Latin squares altogether is times the number of reduced Latin squares.
reduced Latin squares of size all Latin squares of size
111
212
3112
44576
556161,280
69,408812,851,200
716,942,08061,479,419,904,000
8535,281,401,856108,776,032,459,082,956,800
9377,597,570,964,258,8165,524,751,496,156,892,842,531,225,600
107,580,721,483,160,132,811,489,2809,982,437,658,213,039,871,725,064,756,920,320,000
115,363,937,773,277,371,298,119,673,540,771,840776,966,836,171,770,144,107,444,346,734,230,682,311,065,600,000
121.62 × 1044?
132.51 × 1056?
142.33 × 1070?
151.50 × 1086?

For each, each isotopy class contains up to Latin squares, while each main class contains either 1, 2, 3 or 6 isotopy classes.
main classesisotopy classes
111
211
311
422
522
61222
7147564
8283,6571,676,267
919,270,853,541115,618,721,533
1034,817,397,894,749,939208,904,371,354,363,006
112,036,029,552,582,883,134,196,09912,216,177,315,369,229,261,482,540

The number of structurally distinct Latin squares for = 1 up to 7 is 1, 1, 1, 12, 192, 145164, 1524901344 respectively .

Examples

We give one example of a Latin square from each main class up to order five.



They present, respectively, the multiplication tables of the following groups:
A transversal in a Latin square is a choice of n cells, where each row contains one cell, each column contains one cell, and there is one cell containing each symbol.
One can consider a Latin square as a complete bipartite graph in which the rows are vertices of one part, the columns are vertices of the other part, each cell is an edge, and the symbols are colors. The rules of the Latin squares imply that this is a proper edge coloring. With this definition, a Latin transversal is a matching in which each edge has a different color; such a matching is called a rainbow matching.
Therefore, many results on Latin squares/rectangles are contained in papers with the term "rainbow matching" in their title, and vice versa.
Some Latin squares have no transversal. For example, when n is even, an n-by-n Latin square in which the value of cell i,j is mod n has no transversal. Here are two examples:
In 1967, H. J. Ryser has conjectured that, when n is odd, every n-by-n Latin square has a transversal.
In 1975, S. K. Stein and Brualdi has conjectured that, when n is even, every n-by-n Latin square has a partial transversal of size n-1.
A more general conjecture of Stein is that a transversal of size n-1 exists not only in Latin squares but also in any n-by-n array of n symbols, as long as each symbol appears exactly n times.
Some weaker versions of these conjectures have been proved:
For small squares it is possible to generate permutations and test whether the Latin square property is met. For larger squares, Jacobson and Matthews' algorithm allows sampling from a uniform distribution over the space of n × n Latin squares.

Applications

Statistics and mathematics

Sets of Latin squares that are orthogonal to each other have found an application as error correcting codes in situations where communication is disturbed by more types of noise than simple white noise, such as when attempting to transmit broadband Internet over powerlines.
Firstly, the message is sent by using several frequencies, or channels, a common method that makes the signal less vulnerable to noise at any one specific frequency. A letter in the message to be sent is encoded by sending a series of signals at different frequencies at successive time intervals. In the example below, the letters A to L are encoded by sending signals at four different frequencies, in four time slots. The letter C, for instance, is encoded by first sending at frequency 3, then 4, 1 and 2.

The encoding of the twelve letters are formed from three Latin squares that are orthogonal to each other. Now imagine that there's added noise in channels 1 and 2 during the whole transmission. The letter A would then be picked up as:
In other words, in the first slot we receive signals from both frequency 1 and frequency 2; while the third slot has signals from frequencies 1, 2 and 3. Because of the noise, we can no longer tell if the first two slots were 1,1 or 1,2 or 2,1 or 2,2. But the 1,2 case is the only one that yields a sequence matching a letter in the above table, the letter A.
Similarly, we may imagine a burst of static over all frequencies in the third slot:
Again, we are able to infer from the table of encodings that it must have been the letter A being transmitted. The number of errors this code can spot is one less than the number of time slots. It has also been proven that if the number of frequencies is a prime or a power of a prime, the orthogonal Latin squares produce error detecting codes that are as efficient as possible.

Mathematical puzzles

The problem of determining if a partially filled square can be completed to form a Latin square is NP-complete.
The popular Sudoku puzzles are a special case of Latin squares; any solution to a Sudoku puzzle is a Latin square. Sudoku imposes the additional restriction that nine particular 3×3 adjacent subsquares must also contain the digits 1–9. See also Mathematics of Sudoku.
The more recent KenKen puzzles are also examples of Latin squares.

Board games

Latin squares have been used as the basis for several board games, notably the popular abstract strategy game Kamisado.

Agronomic research

Latin squares are used in the design of agronomic research experiments to minimise experimental errors.

Heraldry

The Latin square also figures in the arms of the Statistical Society of Canada, being specifically mentioned in its blazon. Also, it appears in the logo of the International Biometric Society.

Generalizations