Latin Squares
Total Page:16
File Type:pdf, Size:1020Kb
Latin squares Peter J. Cameron University of St Andrews Sutton Trust Talk 3 July 2019 Who invented Sudoku? Magic squares In an appendix to a Sunday newspaper, entitled “Ten things you didn’t know about Switzerland”, some years ago, I read: 7. Leonhard Euler invented Sudoku. A magic square is an n n array, whose entries are the × numbers from 1 to n2, in such a way that the numbers in any row, column or diagonal of the square have the same sum. Since all the numbers from 1 to n2 add up to n2(n2 + 1)/2, if each of the n rows has the same sum, this sum must be n(n2 + 1)/2. For n = 3, this magic sum is 15; for n = 4, it is 34. In former times, such squares were regarded as having very special properties. Some thought that, if worn in battle, a magic square would protect its wearer from injury! So finding magic In fact he didn’t (I will tell you later who did), but the story is squares was an important technology of the day. rather interesting, as is the reason why the things I am talking about are called Latin squares. Euler was the most prolific mathematician of all time; his collected works run to over 80 volumes. The Lo Shu D¨urer The Chinese had an example of a magic square of order 3, The artist Albrecht Durer¨ produced a famous engraving called called the Lo Shu. It was supposedly written (in Chinese Melancholy, in which a moody-looking angel contemplates numerals) on the back of a turtle in the River Lo. varies mathematical figures and tools. On the wall is a magic square, which Durer¨ has arranged so that the bottom row gives the date of the picture: 1514. The picture is a Tibetan version of the Lo Shu. Here it is in modern Western form. 4 9 2 3 5 7 8 1 6 Do you think Durer¨ thought mathematicians were sad people? Graeco-Latin squares Next we interpret that Latin letters as “tens digits” and Greek Euler invented a new method for constructing magic squares. letters as “units digits” in whole numbers written to base n. For This was his idea. example, if n = 3, then Cβ is interpreted as the number 21 in Suppose that we can find two n n squares, one with n Latin base 3, which is 2 3 + 1 = 7. The condition on the × × letters and the other with n Greek letters, so that Graeco-Latin square shows that all pairs from 00 = 0 up to (n 1)(n 1) = n2 1 occurs once. Then add 1 to each entry I each letter occurs once in each row and column of the − − − so that the numbers run from 1 up to n2. relevant square; I if the squares are superimposed, each combination of Latin 21 = 7 00 = 0 12 = 5 8 1 6 and Greek letters occurs exactly once. 02 = 2 11 = 4 20 = 6 3 5 7 10 = 3 22 = 8 01 = 1 4 9 2 C A B β α γ Cβ Aα Bγ A B C γ β α Aγ Bβ Cα Finally you might have to rearrange the rows and columns to B C A α γ β Bα Cγ Aβ get the diagonal sums right. (In this case I have done it for you.) Euler’s construction Euler’s conjecture So Euler needed to be able to construct Graeco-Latin squares of order n (this means n n) for as many n as possible. It is easy to see that there is no Graeco-Latin square of order 2. × He found that he was able to produce a construction for any You can try that for yourself. number n not of the form 4k + 2 (that is, not leaving a Euler was unable to find a Graeco-Latin square of order n = 6. remainder of 2 when divided by 4. So he posed his “problem of the 36 officers”: Here is a construction you can try for yourself. It involves Thirty-six officers, of six different ranks and from six modular arithmetic, that is doing calculations and then taking different regiments (each combination of rank and regiment the remainder on dividing by n (much as you do with the hours represented by one officer) are to be arranged on a parade on a clock, with n = 12.) ground in a 6 6 square in such a way that in each row × This construction works for all odd numbers n. We take the and each column, each rank and each regiment occurs rows, columns, and letters all to be the numbers exactly once. 0, 1, 2, . , n 1. In row i and column j of the first square, you − put i + j; in the second square, you put i + 2j. (So, for example, Indeed, Euler came to think after exhaustive trials that this was if n = 5, then in row 3 and column 4 in the first square you put impossible: 2, and in the second square you put 1.) What happened to Euler’s conjecture? To run the story forward: In 1900, Tarry proved, by exhaustive case analysis, that Euler was right about 6, and there was indeed no Graeco-Latin square of order 6. However, he may not have been the first. On 10 August 1842, Heinrich Schumacher, the astronomer in Altona, Germany, wrote a letter to Gauss, telling him that his assistant, Thomas Clausen, had proved that there is no Graeco-Latin square of order 6. However, Clausen’s calculations have never been found. Euler conjectured that, furthermore, no solution could be found for any number n of the form 4k + 2. The end of the conjecture Latin squares A Latin square is an n n array whose cells contain entries In 1959, R. C. Bose and S. S. Shrikhande constructed a × Graeco-Latin square of order 22, and E. T. Parker found others from a set of n letters so that each letter occurs once in each row of orders 10, 34, 46 and 70. and once in each column. The three authors joined forces, and in 1960 showed that Euler Thus, if we take a Graeco-Latin square and ignore the Greek was as wrong as he could be: they constructed Graeco-Latin letters, we get a Latin square: hence the name. (Of course, if we squares of all orders except n = 2 or n = 6. ignore the Latin letters and just use the Greek letters, we also Their result made the front page of the New York Times, and get a Latin square . ) they became known as the Euler spoilers. There is no difficulty in constructing Latin squares. Just write 1, . , n in the first row; then, in each successive row, move the first element to the end and everything else left one place (as in Scottish dancing): 1 2 3 4 2 3 4 1 3 4 1 2 4 1 2 3 Algebra Algebra and Graeco-Latin squares Let’s think about modular arithmetic again. We can represent modular addition and multiplication by tables: here they are for n = 5: Algebra repays its debt. Whenever we have a field of order n + 0 1 2 3 4 0 1 2 3 4 (and in particular, in modular arithmetic with n prime), we can × construct n 1 latin squares, such that every pair forms a 0 0 1 2 3 4 0 0 0 0 0 0 − Graeco-Latin square. Take squares A1,..., An 1, where the 1 1 2 3 4 0 1 0 1 2 3 4 − 2 2 3 4 0 1 2 0 2 4 1 3 entry in row i and column j of Ak is i + kj. It can be shown that n 1 is the largest number of such squares 3 3 4 0 1 2 3 0 3 1 4 2 − 4 4 0 1 2 3 4 0 4 3 2 1 possible with any two forming a Graeco-Latin square. There are important connections with geometry as well. But there is a big open problem. We only know examples when n is a power The addition table is a Latin square; in fact it is the same one of a prime number. Do such sets of Latin squares exist for any other that we just constructed. The multiplication table is not, since values of n? all the entries in row 0 are 0 (as 0 times anything is 0). But if we This problem still awaits its “Euler spoilers”. just look at the other rows and columns, we see a Latin square. This works whenever n is a prime number, and gives an algebraic structure called a field. Try it for yourself, both for primes, and for composite numbers. Statistics Latin squares in experiments Rothamsted experimental station, near Harpenden in Hertfordshire, has been conducting agricultural experiments In the above experiment, perhaps one of the treatments is not since 1843. Here is an experiment from the 20th century, on the very effective. The insects could breed up on the plots using effects of different insecticides on a crop of beans: that treatment, and spread to neighbouring plots. In order to be fair to all treatments, we could require that, given any pair of treatments, numbers i and j say, treatment j should occur once to the left of i, once to its right, once above in the same column, and once below. Such a square is called complete. Here is an example: 1 2 3 4 2 4 1 3 Agricultural land in England has been cultivated for centuries, 3 1 4 2 and there maybe systematic effects on soil fertility in the 4 3 2 1 direction of ploughing, so we don’t want to confuse these with the effects of the insecticide.