Given nonempty finite sets , and , a Latin rectangle is a system of elements for and such that
For each , all the elements in the row are distinct. In more detail, if and with , then we must have .
For each , all the elements in the column are distinct. In more detail, if and with , then we must have .
We will usually write and and . Often (but not always) we will have or and similarly for and .
In each column we have entries from which must all be different, and in each column we have entries from which must all be different. This can only work if . Thus, if we fix with , then the maximum possible size of a Latin rectangle is .
Note that in a Latin square each row contains different entries taken from , but , so each row must contain each element of precisely once. Similarly, each column must contain each element of precisely once.
The matrix
gives a Latin rectangle with and and so and and .
The matrix
gives a Latin square with and .
Let be any finite group, with . Take and . I claim that this is a Latin square. Indeed, if then and we can multiply on the left by to see that . By the contrapositive, if then . By a similar argument, if then , as required.
As a special case of the above, we can consider the group , with addition mod as the group operation. This gives a Latin square with and . For example, when we get
This example shows that for any , there is at least one Latin square.
Let be a Latin rectangle with (so has the maximum possible width, but not the maximum possible height). Then can be extended by adding extra rows to make an Latin square.
To prove this theorem and the next theorem, we will apply Hall’s Theorem and related results to a certain matching problem. This can be interpreted as a job allocation problem, in the following way. Suppose that is a set of students on a work experience scheme, and that is a set of jobs, and that . Each student is supposed to do each of the jobs for one day. On day , job is done by student . No student can do more than one job at the same time, so for fixed , the entries must all be different. No student does the same job more than once, so for fixed , the entries must all be different. Thus, the matrix must be a Latin square.
In the context of Theorem 14.8, we have constructed the rota for days to , and our task is to complete the rota for days to .
The proof of Theorems 14.8 and 14.22 will also depend on some extra definitions which we now explain.
Let be a Latin rectangle with parameters . For we let denote the number of occurrences of in , and we call this the multiplicity of . We also put and call this the excess of .
For we have so and
The occurrences of in must appear in different rows, so can also be described as the number of rows that contain . Similarly, the occurrences of in must appear in different columns, so can also be described as the number of columns that contain .
Suppose that , so that has the maximum possible width. Then we have and for all . Similarly, if (so that has the maximum possible height) then and for all .
Suppose that . Then each row has different elements but so each element must occur precisely once in each of the rows. From this we see that and so . As this simplifies to . The case where is essentially the same. ∎
Let be a Latin rectangle. It will be enough to show that we can add one more row to get a Latin rectangle, because we can then repeat the process if necessary. We will interpret the problem as in Remark 14.9.
For , let be the set of students who are allowed to do job on day . These are just the students who have not already done job on any of days , or in other words
We are assuming that is a Latin rectangle, so we have followed the rules on days to , so students must all be different, so . To make the new row, we just need to solve the usual job allocation problem with candidate sets . For each put
which is the set of jobs for which student is qualified (in the sense that they have not already done that job). We will use Proposition 12.4: if there is a constant such that for all and for all , then the allocation problem is solvable. We will take ; we have already seen that for all . On the other hand, is just the set of columns where we are allowed to put in the new row, or in other words, the set of columns that do not already contain . The number of columns that contain is , which is as we explained in Lemma 14.13. Thus, the number of columns that do not contain is as required. Thus, Proposition 12.4 is applicable, so we can solve the allocation problem, and the solution gives us an extra row. ∎
Consider the following Latin rectangle, with and :
Recall that is the set of possibilities for position in the next row. For example, in column we already have a and a , so these are not allowed, so . We can display all the sets as follows:
(We have used abbreviated notation, e.g. for .) To make the new row, we must choose one element from the possibilities in each column, making sure that we never choose the same element twice. Corollary 55 tells us that this is possible, but does not tell us exactly how to do it. However, in this case it is not difficult: in each column we can just take the first choice that has not already been used. This gives as the new row. We can write in this new row and display the possibilities for row as follows:
Again, in each column we can take the first choice that has not already been used. This gives row and leaves only one possibility for row . We end up with the following Latin square:
Let be a Latin rectangle with (so has the maximum possible height, but not the maximum possible width). Then can be extended by adding extra columns to make an Latin square.
Note that the transpose is a Latin square of maximum possible width, so we can use Theorem 14.8 to extend it to a Latin square, then take the transpose again at the end. This just amounts to doing the same steps as before, but with the roles of rows and columns exchanged. ∎
Now consider a Latin rectangle where both and are strictly less than , so neither Theorem 14.8 nor Corollary 14.15 is applicable. Can we still extend it to give an Latin square? It is not hard to find examples where this is not possible.
Take and and . We could try to extend this to a Latin square as follows:
To avoid a clash in row , we must take . To avoid a clash in row , we must also take . However, this creates an unavoidable clash in column . Thus, it is impossible to extend .
Take and and
It turns out that it is not possible to extend this to a Latin square. It is a good exercise to prove this directly. However, we will deduce it from a general theorem instead. We can list the multiplicity and excess of the elements of as follows:
It turns out that the key point is that some excesses are negative.
Let be a Latin rectangle. We say that an element is plausible if . More precisely, we say that is barely plausible if , and very plausible if .
If can be extended to an Latin square, then every element is plausible for .
Choose a Latin square extending . This will have the form
where , and have shape , and . Let be the top part, consisting of and . This is a Latin rectangle, so Lemma 14.13 tells us that
so . On the other hand, has columns, and there is at most one occurrence of per column, so , so . Putting this together, we get and so . ∎
In Example 14.17, we see that and have negative excess so they are not plausible, so there cannot be any extension to a Latin square. We now discuss another example.
Consider the following Latin rectangle with and and :
The multiplicities and excesses are as follows:
We have so all elements are plausible, so we might guess that can be extended to a Latin square. However, Proposition 14.19 does not give us any guarantees about this. If we had found that for some , then Proposition 14.19 would tell us that is definitely no extension. However, when for all we can only say (for the moment) that the question remains open. To go beyond this we need another lemma and another theorem.
Let be a Latin rectangle, where and , and suppose that every is plausible for . Then we can add an extra row to obtain a Latin rectangle such that every is still plausible for .
We will again interpret this in terms of Remark 14.9. Here we have chosen students to do jobs to on days to , but we have not yet decided anything about jobs to (perhaps the relevant managers are still on holiday). Our immediate task is to allocate students to jobs to on day .
We again put . We again have a job for each , with candidates , so . We again put , which corresponds to the set of columns not containing , or the set of jobs that student can still do. Remark 14.12 tells us that the number of columns that do contain is , so the number of columns that do not contain is . The plausibility condition says that , which translates to , so we see that . In fact, we have iff iff is barely plausible. The students with will be called “talented” (although in this model, the fact that they can still do many jobs is not really related to talent). By Corollary 12.5, we can solve the job allocation problem in such a way that every talented student gets assigned a job for day . By adding this as a new row, we get a new Latin rectangle of size . Now note that
so
so in particular in all cases. Thus, if then . On the other hand, if then is barely plausible for , so student is “talented”, so appears in the new row by construction, so . Thus, in all cases we have . ∎
Let be a Latin rectangle, and suppose that every is plausible for . Then can be extended to an Latin square.
We can apply the lemma repeatedly until we get a Latin rectangle, then we can apply Corollary 14.15 to get an Latin rectangle. ∎
We now show how to extend the the rectangle from Example 14.20. The process is controlled by the following two tables.
In the left hand table, the top left block is the original matrix . In the right hand table, the second row shows the excesses of in ; in particular, the numbers , and have so they are barely plausible. We want to add a new row, making sure that we include the barely plausible numbers , and . The possibilities for columns are , , , and , as shown in row on the left. From these sets we choose , , , and , as indicated by the bold entries in row . This gives a Latin rectangle which we call . For the next step, we need to know the excesses for , which we denote by . As we saw in the proof of Lemma 14.21, we have if appears in the new row, and if does not appear in the new row. The resulting values are shown in row of the right hand table. In particular, and are barely plausible for . To get the potential entries for row , we simply take the sets of potential entries from row and remove the bold ones, leaving , , , and . We must choose five distinct numbers, one from each of these sets, in such a way that the barely plausible numbers and are included. We choose , as indicated by the bold entries in row . This gives a Latin rectangle which we call . The excesses for are again shown in the right hand table. However, we do not really need them, because there is now only one possible way to fill in row , namely . This gives a Latin rectangle. As this has the maximum possible height, we are back in the context of Corollary 14.15, and we do not need to keep track of excesses any more. To the right of the vertical bar, we have written the possible entries for column . As our first step (indicated by the superscript ) we decide to try choosing for the entry in row . For the second step (indicated by the superscript ) we consider row . The possible choices there are and , but we already used for row , so we must use for row . For the third step, we consider row . The possible choices there are and , but we already used for row , so we must use for row . Continuing in the same way, we must use in row , then in row , then in row , then in row . This gives as column , and leaves as the only possibility for column . We end up with the following Latin square:
We now discuss some facts about the number of possible Latin squares.
We let denote the set of all Latin squares with . We will find for . We say that a Latin square is reduced if the first row is and the first column is also . We write for the set of reduced Latin squares.
For the degenerate case the only possible Latin square is , so and .
For we have . The first of these lies in but the second does not. We therefore have and .
For there are Latin squares, as follows:
Of these only the first lies in . Thus, we have and .
For any we have .
We can permute the columns of a Latin square and it will still be a Latin square.
We can also permute the rows of a Latin square and it will still be a Latin square.
There is a unique way to permute the columns so that the first row becomes .
After we have done this, the top left entry will be , and the first entries in columns will therefore be in some order. Thus, there is a unique way to permute rows so that the first column becomes . We now have a Latin square in .
By thinking about these steps in the reverse order, we obtain the following fact. We can obtain any Latin square in by starting with a square in , permuting rows in any of possible ways, then permuting the columns in any of possible ways. The claim is clear from this. ∎
We have and so .
We claim that consists of the following squares. The superscripts are just there to help us follow the proof.
The numbers in the superscripts indicate the order in which we should think about the entries; the stars indicate places where we have a choice about what to do.
The first row and column have to be . Thus, the first place where we have any choice is the position, which we have marked with the superscript . We already have a in the corresponding row (and also in the corresponding column), so we cannot put a in this position; we must have a , a or a . For square we choose to put a in the position. It turns out that we then have no more choices. To see this, consider the superscript , which appears in position in . There we have already placed a and a in the same row and a in the same column, so we have to put a in that slot. Now consider the superscript , which appears in position in . We have already placed , and in the same row, so we are forced to put in this slot. Now continue with the positions with superscripts ; we again see that there is never any choice, and we have to fill in the entries as in . Thus, is the only possible Latin square in that has a in position . Similarly, is the only Latin square in that has a in position . The only other possibility is to put a in position , as in . Just as in the case of and , we find that there is no choice about what to put in the positions with superscripts . However, when we get to the superscript in position , we find that we do have a choice: we can either put in a or a . If we put in a then we are forced to fill in the remaining slots as in , but if we put in a then we are forced to fill in the remaining slots as in . We thus have as claimed.
∎
The numbers grow very quickly as increases:
We will not prove any of this.
We now start to discuss the theory of orthogonal Latin squares. We will give an example before the definition.
Consider the following matrices:
Both and are Latin squares. The matrix is formed by merging and in an obvious way: in symbols, the entry is the ordered pair . There are possible pairs with , as follows:
It is not hard to check that each of these pair occurs precisely once in .
Let and be two Latin squares, with the same sets , and . Let be the matrix with entries for each and . We say that and are orthogonal if each of the elements of occurs precisely once in . Equivalently, and are orthogonal if the entries in are all different.
Consider the following matrices:
We will try to find such that is a Latin square and is orthogonal to .
must contain somewhere, and this can only happen if so that appears as the middle entry.
In , entry lies in the same row as and in the same column as , so it must be different from and , so it must be equal to . By the same logic we also have .
Now is as shown on the left below. To make this a Latin square, each row must contain and , and each column must contain and . The only way to achieve this is to take and , giving the matrix shown on the right below.
We now have
Inspection shows that each of the possible pairs appears precisely once in , so we have succeeded in finding a Latin square that is orthogonal to .
We now consider a different problem. Given , can we find a long list of Latin squares such that and are orthogonal when ? Our first result gives an upper bound on the possible length of such a list.
Suppose we have a list of mutually orthogonal Latin squares of size . Then .
Look at the first two rows of :
In position (at the beginning of the second row), we have some number . Because is a Latin square, every number must appear in every row. In particular, must also appear in row . It cannot appear in position , because we would then have two ’s in the first column. So must also appear at position for some . We have now defined numbers ; we claim that they are all different. Indeed, suppose that , so the first two rows of have the form
If and were the same, then in we would have a pattern like this:
so would appear twice in . However, and are assumed to be orthogonal, so each pair occurs precisely once in , so cannot appear twice, so must be different from .
We now know that the numbers are all different and all lie in . This is clearly only possible if . ∎
We now see that the maximum possible length of a list of mutually orthogonal Latin squares is at most . Can we achieve this upper bound? We can give a key example using modular arithmetic. We first need to recall a basic fact.
Let be a prime. Then every nonzero element of the ring has a multiplicative inverse. Thus, is a field, and the set is a group under multiplication.
Any nonzero element of is represented by an integer with . Let be the gcd of and , so for some integers and (by the euclidean algorithm). Now must divide , and is prime, so or . However, must also divide , and does not divide because , so we must have . This means that , so , so is an inverse for in . A field is just a nontrivial commutative ring in which every nonzero element is invertible, so we see that is a field. Now let be another nonzero element, and let be inverse to . We then have . This would be impossible if were zero mod , so we must have . This means that the set is closed under multiplication, and it is now easy to see that it is a group. ∎
The proposition implies that if with then the element is well-defined, and that division has all the usual algebraic properties, provided that we are careful not to divide by anything that could be zero.
Let be a prime. For define . Then is a Latin square (with ). Moreover, and are orthogonal if (so we have a list of mutually orthogonal Latin squares of size ).
If we have so . Similarly, if then in . We can rearrange to get but is invertible in so we can multiply by to get and so (in ). This shows that is a Latin square.
Now consider , where with , so . We want to show that every pair appears precisely once in this table, or in other words that there is a unique pair with, or that the simultaneous equations and have a unique solution. These equations can be solved in the standard way to give and as required. ∎
Now consider a number that is a prime power, say for some prime number and some . In this case the ring is not a field, but there is a more complicated way to define a field with . We will not discuss the construction here, but it can be found in most books on field theory. Now suppose that with (so there are possible choices for ). We can again define a Latin square with by , and we again find that and are orthogonal when . Thus, we have a list of mutually orthogonal Latin squares of size .
The first number that is not a prime or prime power is . This case is already hard.
There are not even two mutually orthogonal Latin squares of size .
This was conjectured by Euler in the 18th century, and proved by Tarry in 1900. A more digestible proof was given by Stinson in 1982. We will not give any details here. ∎