Wednesday, April 11, 2007

MS5. MAGIC SQUARES

Methods Of Construction.
We will now discuss, in greater detail, methods of construction of squares of different orders.

Border Square Method.

There is no universal method of construction of magic squares ab-initio. However, once a 3x3 square (which has only one solution) and a 4x4 square, have been constructed, the border square method, illustrated earlier for the 6x6 square, can be considered as universally applicable. In general, an order "n" square can be constructed from an order "n-2" square by the following method:-
To every number in the order n-2 square add 2n-2; the numbers that have not yet been used will be 1,2,3,....2n-2, and n^2, n^2-1, n^2-2,.....n^2-2n+3,
( these numbers are complementary numbers , in the sense that pairs of them total n^2+1). These numbers are to be placed in the 4(n-1) border cells such that the complementary numbers occur at the end of the 2 diagonals, columns and the rows of the inner square; however, the choice of the numbers for the top row and one of the columns is to be so made that the total comes to n(n^2+1)/2, the other row and column will automatically give the required total. This selection of numbers is best done by trial and error method. So long as precaution is taken not to use complementary numbers in the top row and the selected column this should not pose any problem. This method is attributed to Frenicle.
Let us try this for the 5x5 square from the 3x3 square. The order 3 square is :-
4 3 8
9 5 1
2 7 6
In this square we have to increase the numbers in each cell by
2n-2 i.e. 2(5-1) = 8.we thus get:-
The border square is to be formed with numbers from 1 to 18 and 18 to 25. This is easily done, one solution being:
12 11 16
17 13 09
10 15 14
Take 18 20 21 4 2 for the top row and 18 1 3 19 24 for the left-hand column.
So the final square is:-
18 20 21 04 02
01 12 11 16 25
03 17 13 09 23
19 10 15 14 07
24 06 05 22 08
We have already seen construction of 6x6 square by this method earlier.
Incidentally for this square we have:-
18^2 + 1^2 + 3^2 + 19^2 + 24^2 = 2^2 + 25^2 + 23^2 + 7^2 + 8^2 and
18^2 + 20^2 + 21^2 + 4^2 + 2^2 = 24^2 + 6^2 + 5^2 + 22^2 + 8^2.

The Hindu Rule.

For odd order squares we have a special rule, called the HINDU RULE. The Hindu rule may be enunciated as follows:-
To start with write the first number 1 in the center of the topmost row, next write 2 in the lowest space of the vertical column next adjacent to the right, and then so inscribe the remaining numbers in their natural order in the squares diagonally upwards towards the right that, on reaching the right-hand margin, the inscription shall be continued from the left-hand margin in the row just above, and again, on reaching the upper margin, shall be continued from the lower margin in the column next adjacent to the right, noting that whenever we are arrested in our progress by a square already occupied we are to fill out the square next beneath the one we have filled. In this manner, for example, the 7x7 square given below has been formed:-
30 39 48 01 10 19 28
38 47 07 09 18 27 29
46 06 08 17 26 35 37
05 14 16 25 34 36 45
13 15 24 33 42 44 04
21 23 32 41 43 03 12
22 31 40 49 02 11 20
This method is neat and quick. De La Loubere, Envoy of Louis X1V to Siam learnt of this method here.
This square may also be represented as under to give multiple solutions:
Cf Be Ad Gc Fb Ea Dg
Bd Ac Gb Fa Eg Df Ce
Ab Ga Fg Ef De Cd Bc
Gg Ff Ee Dd Cc Bb Aa
Fe Ed Dc Cb Ba Ag Gf
Ec Db Ca Bg Af Ge Fd
Da Cg Bf Ae Gd Fc Eb
Giving D value 21 and rest of the A's one of the values-0,7,14,28,35,42, and a's one of the values-1,2,3,4,5,6,7 we are able to cover all numbers from 1 to 49 and get the magic sum of 175. It gives 7!x6!/4 clear solutions. Alternately we can give D value 4 and rest of the A's one of the values 1,2,3,5,6,7, and A's values from 0,7,14,21,28,35,42.
And now let us have a look at the 5x5 square by the Hindu Rule.:-
09 03 22 16 15
02 21 20 14 08
25 19 13 07 01
18 12 06 05 24
11 10 04 23 17
and note that:-
9^2 + 2^2 + 25^2 + 18^2 + 11^2 = 15^2 + 8^2 + 1^2 + 24^2 + 17^2 = 1155
3^2 + 21^2 + 19^2 + 12^2 + 10^2 = 16^2 + 14^2 + 7^2 + 5^2 + 23^2 =
9^2 + 3^2 + 22^2 + 16^2 +15^2 = 11^2 + 10^2 + 4^2 + 23^2 + 17^2 = 1055 And
2^2 + 21^2 + 20^2 + 14^2 + 8^2 = 18^2 + 12^2 + 6^2 + 5^2 + 24^2 =
22^2 + 20^2 + 13^2 + 6^2 + 4^2 =1105.

No comments: