Monday, June 18, 2007

MS11. MAGIC SQUARES

ORDER 4 MAGIC SQUARES - ALL 880 SQUARES.
Coming back to order 4 squares, we examine them is detail as there are only 880 solutions.
When can we not have them?
First point to be noted is that the sum of all odd numbers between 1 & 16 is 64 and all even numbers is 72. Since the magic sum figure is 34 (an even number), each row or column or diagonal will have either 2 or 4 odd numbers. But if we have odd numbers only in one row (or column), the other row (or column) will necessarily have only all odd numbers and we will fail to get the magic sum. However, one diagonal can only have odd numbers provided the other diagonal has only even numbers.
Similarly we cannot have a square if sum of the corner numbers does not add up to 34. The sum of the corner numbers has to be 34 only, not more nor less.
We also cannot have only odd (or even) numbers in corners, since if we have odd (or even) numbers in the corners, all middle numbers will have to be even (or odd) numbers, and including diagonal numbers it makes for 12 numbers, while we have only 8 even and 8 odd numbers. And if we take only odd numbers in both diagonals again we cannot get the magic sum.

RULES FOR FORMATION
Now let us examine the Rules that will enable us to generate more squares from already generated square (may be by trial and error or by the auxiliary square method). Let us for this purpose, represent the magic square as seen below:
a b c d
e f g h
i j k l
m n o p
Rule 1. For all types of squares we get a new square by simultaneously changing
b&c, h&l, n&o, e&i f&k, g&j.
Rule 2. Change inner numbers f,g,j,k to corner numbers a,d,m,p and corners numbers to places occupied by f,g,j,k, but otherwise retaining the numbers of the rows and columns.
Rule 3. Change all even numbers to odd numbers by decreasing by 1, and odd numbers to even by increasing them by 1.
Rule 4. Subtract all numbers from n^2+1 = 17.
Rule 5. If f+k = g+j = 17, we can inter-change the middle rows or columns, both can be inter-changed but not necessary in view of Rule 1.
Rule 6. If b+c = either f+g or j+k and n+o = the remaining of f+g or j+k and f+k = b+o or b+n we can inter-change b,c & n,o with f,g &j,k. Same holds good for e,i & h,l.
Rule7. If e+h = 17 and i+l =17, we can inter-change e,h& i,l. Same is true for b,n & c,o. Or if e+i = h+l = 17, we can replace h,l by e,i, and vice-versa. Same holds good for b,n & c,o.
(It will be seen that some of these rules will not be valid for some of the squares. In particular Rule 3 will not be valid for a square, which has only odd numbers and even numbers in its diagonals. Rule 4 may not produce a new square if corner numbers are complementary, i.e. add up to 17 in pairs).
Rule 8. Applicable to only Regular Squares which number 528 in all. Change diagonal a,f,k,p to first row and m,j,g,d to 4th row and rewrite the numbers between a to m & d to p. Similarly change diagonals to columns and vice-versa to get a new square.

Now let us see how these rules work for a particular square. We start with the Main square shown below:
01 12 14 07
06 15 09 04
11 02 08 13
16 05 03 10
Rule 7 will give 3 more squares as shown below:
01 12 14 07 - - 01 14 12 07 - - 01 14 12 07
04 15 09 06 - - 06 15 09 04 - - 04 15 09 06
13 02 08 11 - - 11 02 08 13 - - 13 02 08 11
16 05 03 10 - - 16 03 05 10 - - 16 03 05 10
If we now apply Rule 1 to all these squares we get 4 more squares:
01 14 12 07 - - 01 14 12 07 - - 01 12 14 07 - - 01 12 14 07
11 08 02 13 - - 13 08 02 11 - - 11 08 02 13 - - 13 08 02 11
06 09 15 04 - - 04 09 15 06 - - 06 09 15 04 - - 04 09 15 06
16 03 05 10 - - 16 03 05 10 - - 16 05 03 10 - - 16 05 03 10
Now we apply Rule 8 to the main square to generate 2 more squares.
01 15 08 10 - - 01 12 14 07
06 12 03 13 - - 15 06 04 09
11 05 14 04 - - 08 13 11 02
16 02 09 07 - - 10 03 05 16
Rule 7 applied to the left-hand side square along with Rule 1, will give 8 new squares. Rule 5 applied to the right-hand square along with Rule 1 will give 4 new squares. In all, as such, we get in all 20 squares.
Now applying Rule 3 to the main square we get:
02 11 13 08
05 16 10 03
12 01 07 14
15 06 04 09
When we apply Rules 1, 5, 7 & 8 we get additional 19 squares or in all 20 squares.
Also let us apply Rule 2 to the left-hand side square and then Rule3 to the newly generated square and see what happens. We get the following 2 squares:
06 15 09 04 - - 05 16 10 03
12 01 07 14 - - 11 02 08 13
03 10 16 05 - - 04 09 15 06
13 08 02 11 - - 14 07 01 12
These 2 will also generate 19 additional squares, giving us in all 40 squares.
So from 1 main square and applying the various Rules we have been successful in getting 79 additional squares!!!!!!

REGULAR SQUARES
For Rule 8 we talked of Regular Squares - so what is a Regular square? If we reduce all numbers from 1 to 16 by 1, we get numbers from 1 to 15, and it will be noticed that all these numbers are a combination of 1, 2, 4 & 8. Let us now place the numbers from 0 to 15 in a 4x4 square to give a total of 30 for all its rows, columns and 2 main diagonals. Now if we split the numbers of this modified square into its components of 12, 2, 4 & 8 and place them in separate 4x4 squares, and the squares get so formed that none of the numbers 1, 2, 4 & 8, occur more than twice in any row, column or diagonal in their respective squares, we get what is called a Regular Square. Let us try this for the main square discussed earlier. Reducing all numbers by 1 we get the square:
00 11 13 06
05 14 08 03
10 01 07 12
15 04 02 09
And the split numbers get arranged in the squares as under:
X 1 1 x - - x 2 x 2 - - x x 4 4 - - x 8 8 x
1 x x 1 - - x 2 x 2 - - 4 4 x x - - x 8 8 x
x 1 1 x - - 2 x 2 x - - x x 4 4 - - 8 x x 8
1 x x 1 - - 2 x 2 x - - 4 4 x x - - 8 x x 8
(x has been placed to fill up blank spaces.)
It will be noticed that the numbers fall in the pattern required for a Regular Square.
If we, however, examine the square reproduced below it will be found that it is not a Regular Square:
01 10 15 08
05 14 11 04
16 03 06 09
12 07 02 13

No comments: