A magic square of size 3 by 3 looks like:
| a | b | c |
| d | e | f |
| g | h | k |
(i) The set of all three by three magic squares is a vector space:
Here is a check of the first four conditions:
1: If
| a1 | b1 | c1 |
| d1 | e1 | f1 |
| g1 | h1 | k1 |
| a2 | b2 | c2 |
| d2 | e2 | f2 |
| g2 | h2 | k2 |
| a1+a2 | b1+b2 | c1+c2 |
| d1+d2 | e1+e2 | f1+f2 |
| g1+g2 | h1+h2 | k1+k2 |
2:
If
| a | b | c |
| d | e | f |
| g | h | k |
| L |
|
3
| 0 | 0 | 0 |
| 0 | 0 | 0 |
| 0 | 0 | 0 |
4:
If
| a | b | c |
| d | e | f |
| g | h | k |
| - |
| = |
|
(ii) Write the conditions as 7 linear equations, and use an augmented matrix and row reduction to find a general solution:
There are various ways of thinking about how to get 7 conditions. One way is to take each equal sign to give an equation. You have seven equal signs, so there are seven equations:
We have to rewrite these so all the constants are on one side, and variables on the other side, and then write as an augmentend matrix, with columns corresponding to a,b,c,d,e,f,g,h,k:
| / | 1 | 1 | 1 | -1 | -1 | -1 | 0 | 0 | 0 | | | 0 | \ |
| | | 0 | 0 | 0 | 1 | 1 | 1 | -1 | -1 | -1 | | | 0 | | |
| | | -1 | 0 | 0 | -1 | 0 | 0 | 0 | 1 | 1 | | | 0 | | |
| | | 1 | -1 | 0 | 1 | -1 | 0 | 1 | -1 | 0 | | | 0 | | |
| | | 0 | 1 | -1 | 0 | 1 | -1 | 0 | 1 | -1 | | | 0 | | |
| | | -1 | 0 | 1 | 0 | -1 | 1 | 0 | 0 | 0 | | | 0 | | |
| \ | 1 | 0 | -1 | 0 | 0 | 0 | -1 | 0 | 1 | | | 0 | / |
To find what (a,b,c,d,e,f,g,h,k) have to be, you can use MatLab to reduce the matrix, or do it by hand:
| / | 1 | 0 | 0 | 0 | 0 | 0 | -2/3 | -2/3 | 1/3 | | | 0 | \ |
| | | 0 | 1 | 0 | 0 | 0 | 0 | -2/3 | 1/3 | -2/3 | | | 0 | | |
| | | 0 | 0 | 1 | 0 | 0 | 0 | 1/3 | -2/3 | -2/3 | | | 0 | | |
| | | 0 | 0 | 0 | 1 | 0 | 0 | 2/3 | -1/3 | -4/3 | | | 0 | | |
| | | 0 | 0 | 0 | 0 | 1 | 0 | -1/3 | -1/3 | -1/3 | | | 0 | | |
| | | 0 | 0 | 0 | 0 | 0 | 1 | -4/3 | -1/3 | 2/3 | | | 0 | | |
| \ | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | | 0 | / |
(iii) Write a basis for the space of 3 by three magic squares
From the reduced matrix we get the following:
| / | a | \ | / | 2/3g | 2/3h | -1/3k | \ | / | 2/3 | \ | / | 2/3 | \ | / | -1/3 | \ | ||||||
| | | b | | | | | 2/3g | -1/3h | +2/3k | | | | | 2/3 | | | | | -1/3 | | | | | 2/3 | | | ||||||
| | | c | | | | | -1/3g | +2/3h | +2/3k | | | | | -1/3 | | | | | 2/3 | | | | | 2/3 | | | ||||||
| | | d | | | | | -2/3g | +1/3h | +4/3k | | | | | -2/3 | | | | | 1/3 | | | | | 4/3 | | | ||||||
| | | e | | | = | | | 1/3g | +1/3h | +1/3k | | | =g | | | 1/3 | | | + | h | | | 1/3 | | | + | k | | | 1/3 | | |
| | | f | | | | | 4/3g | +1/3h | -2/3k | | | | | 4/3 | | | | | 1/3 | | | | | -2/3 | | | ||||||
| | | g | | | | | 1g | 0h | 0k | | | | | 1 | | | | | 0 | | | | | 0 | | | ||||||
| | | h | | | | | 0g | 1h | 0k | | | | | 0 | | | | | 1 | | | | | 0 | | | ||||||
| \ | k | / | \ | 0g | 0h | 1k | / | \ | 0 | / | \ | 0 | / | \ | 1 | / |
So these three vectors give a basis for the space of three by three magic squares. If we write them as magic squares, we have a basis;
| { |
| , |
| , |
| } |
Check, these really are magic squares, and all the rows, columns, diagaonals, have sums of 1.
Note that other basis are possible; if we'd had more time we could have talked more about change between different basis. For instance, the following is also a basis, and it might be considered nicer since it's more symmetric:
| B2 | = | { |
| , |
| , |
| } |
To check this is also a basis, check that they are magic squares, check that they are linearly independent (the third is not a combination of the first two), then since there are three of them, and the space of magic squares has dimension 3, they must span the space, and so they are a basis.
There are other possible basis. You only needed to find one for this question, and as long as it's a basis, it doens't matter which one you found.
Please send comments, questions, suggestions, corrections, ideas, to me.
Welcome Home
Origami