# Linear Algebra - Magic Squares

Let $V$ be the vector space of $3 \times 3$ magic squares. We have the following endomorphisms:

• $r: V \to V$ that rotates the square of 90 degrees.
• $c: V \to V$ sends a square $M$ to the constant square in which all entries are equal to the middle square of $M$.

Show that we have $\text{id}_V + r^2 = 2c$.

I don't really have a clue how to tackle this problem, so I tried to do it geometrically. Let the $A$ be a $3 \times 3$ magic square:

$$A = \begin{pmatrix} a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3 \end{pmatrix}$$

Then we have $id_A = A$. For $r^2$ I have some trouble, because I don't know what $r^2$ is. The endomorphism $r$ would change $A$ to $$= \begin{pmatrix} c_1 & b_1 & a_1 \\ c_2 & b_2 & a_2 \\ c_3 & b_3 & a_3 \end{pmatrix}$$

So I'd guess that $r^2$ would mean applying this again, so we'd have

$$= \begin{pmatrix} c_3 & c_2 & c_1 \\ b_3 & b_2 & b_1 \\ a_3 & a_2 & a_1 \end{pmatrix}$$

If we apply the endomorphism $c$ to $A$, you'd get

$$= \begin{pmatrix} b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \end{pmatrix}$$

so I'd guess applying that $2c$ would give simply

$$= 2 \begin{pmatrix} b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \end{pmatrix}$$

However, $$= \begin{pmatrix} c_3 & c_2 & c_1 \\ b_3 & b_2 & b_1 \\ a_3 & a_2 & a_1 \end{pmatrix} \neq 2 \begin{pmatrix} b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \end{pmatrix}$$

So I must have gotten something terribly wrong. Can anyone help?

edit: In accordance to Quang's comment, I guess it should be

$$= \begin{pmatrix} c_3 + a_1 & c_2 + a_2 & c_1 + a_3 \\ b_3 + b_1 & b_2 + b_2 & b_1 + b_3 \\ a_3 + c_1 & a_2 + c_2 & a_1 + c_3 \end{pmatrix} \neq 2 \begin{pmatrix} b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \\ b_2 & b_2 & b_2 \end{pmatrix}$$

• You forgot $\mathrm{id}_V$: it is $\mathrm{id}_V+r^2=2c$, not $r^2=2c$. – Quang Hoang Oct 2 '15 at 1:58
• True, but even then I still don't see how the sides equal each other. – linalgglanil Oct 2 '15 at 1:59
• Remember that you are working on the magic squares. Try to show that for such a square, sum of elements on any rows is $3b_2$. – Quang Hoang Oct 2 '15 at 2:00
• @QuangHoang Thanks, this comment helped me a lot, working with all the squares made me lose track of the algebra – linalgglanil Oct 2 '15 at 2:13

Let me try. We have $$(id_V + r^2 )(A) = \begin{pmatrix} a_1 + c_3 & a_2 + c_2 &a_3+c_1\\ b_1+ b_3 & 2b_2 & b_1 + b_3 \\ a_3 + c_1 & a_2 + c_2& a_1 + c_3 \end{pmatrix}.$$
Note that $A$ is a magic square. So, we have relations $$\begin{cases} a_1 + a_2 + a_3 = b_1 + b_2 + b_3 = c_1 + c_2 + c_3 = k\\ a_1 + b_1 + c_1 = a_2 + b_2 + c_2 = a_3 + b_3 + c_3 = k\\ a_1 + b_2 + c_3 = a_3 + b_2 + c_1 = k\end{cases}$$
So, you have $$a_1 + c_3 = a_3 + c_1 = b_1 + b_3 = a_2 + c_2 = 2b_2.$$ You get the conclusion.