Thursday, March 29, 2007

MS4. MAGIC SQUARES

How Many Solutions.

3x3 Squares.
There is a unique solution for a 3x3 square. Let us examine why?
Let us write all combinations of 3 numbers from 1 to 9 that add up to 15 They are 1,5,9: 1,6,8: 2,4,9: 2,5,8: 2,6,7: 3,4,8: 3,5,7: and 4,5,6. Now the central number of the square can only be that number which occurs in at least 4 combinations. The only number that satisfies this condition is 5. So only 5 can occupy the center space. Next examine 1, it combines with only 9 and 8 and as such cannot occupy corner space, so must come in the middle of a row or column. So we can place 1 and 9, and 8 immediately. Rest all the numbers then automatically fall in place.

4x4 Squares.
There are only 880 solutions for a 4x4 square, first given by Bernard Frenicle de Bassy in 1693.

5x5 Squares.
There are a staggering number of solutions for a 5x5 square----68,826,306 not counting reflections and rotations. This counting was arrived at by Richard Schroeppel, a mathematician and computer programmer at Information International, who used a standard backtracking procedure consisting of about 3500 lines and took 100 hours on a PDP-10. A final report was written by Michael Beeper and was issued in October 1975. For interested readers there is one classification by central numbers 1 through 13 (same numbers for 25 to 13) given below:-
1 - 1,091,448. 2 - 1,366,179. 3 - 1,914,984. 4 - 1,958,837.
5 - 2,431,806. 6 - 2,600,879. 7 - 3,016,881. 8 - 3,112,161.
9 - 3,472,540. 10 - 3,344,034. 11 - 3,933,818. 12 - 3,784,618. 13 - 4,769,936

Higher Order Squares.
While no firm estimate is available for a 6x6 square, suffice it to say that, the number would run into billions. To imagine the number of solutions, simply increase all numbers in the 4x4 square by 10 to give a new 4x4 square consisting of numbers 11 to 26 with total of 34 + 40 = 74, this 4x4 square forms the inner core of the 6x6 square. Now we have to use numbers from 1 to 10 and 27 to 36 to form its boundary. Arrange these in pairs to total 37. Let us only consider one such combination of numbers arranged to give the required total of 111, see figure below formed with the Jaina square for the core 4x4 square:-
01 34 05 07 35 29
33 17 22 11 24 04
31 12 23 18 21 06
28 26 13 20 15 09
10 19 16 25 14 27
08 03 32 30 02 36
Now any pair of numbers in the first and last row or the extreme left and extreme right column, excluding the corner numbers since they total 37, can be interchanged. This interchange can create 4!x4! = 576 new squares. Since there are 880 squares of order 4 which can be used for the inner core, and, further these squares can be rotated, we have, for one set of border 576x4x880 = 2,027,520 solutions. Further, in this arrangement of border numbers, if we interchange 34 & 7 from top row and corresponding pair numbers 3 & 30 from the bottom row with 31 & 10 from the left column and the corresponding pair numbers 6 & 27 from the right column, we get another set of 2,027,520 squares. But this is not all. Besides the fact that other border squares can be formed, there are other methods of construction. For example, if we reduce all odd numbers by 1 and increase all even numbers by 1 in the core 4x4 square, we get a new square which has numbers from 10 to 27, excluding 11 and 26, still with a total of 74. (This can be done for 712 squares of order 4, as this process cannot be adopted for those squares which have only odd and even numbers in their diagonals). Thus for any border combination for these squares we shall have 576x4x712 = 1,640,448 solutions.
This method of generating squares from lower order squares, described later in detail, can be applied to generate squares of any order, and, as such, the number of squares that can be constructed can only be imagined. Besides this method, there are other methods, which, again, can result in a large number of solutions.

No comments: