Thursday, December 29, 2016

Primitive Operations Leave the Sums Unchanged


  We need to show that the primitive operations of transpose, vertical and horizontal reflection and the double shifts, acting on a magic square, leave the sums unchanged. To do this we perform the actions on a magic square and compare sums.


The sums for the rows, columns and the quarters after one of the primitive operations can all be found in the original magic square in rows, columns or quarters. For a transpose and a flip (multiplication by F) the sum for a diagonal is a sum for a diagonal in the original magic square and the same is true for the center and corners. For the double shifts (multiplication by G) sums for the diagonals, center and corners are evaluated above and remain unchanged. So all these primitive operations leave the sums for the magic square unchanged.

Supplemental (Dec 30): Had a little problem typing in the lower case i. It changed to what looked like an l. Retyping the i corrected the problem.


Turns out the lower case i was autocorrected to capital I. Decided to remove it from the autocorrection options.

Replacing Rotations With More Primitive Operations


  Since the rotations of the magic square can be defined in terms of the reflections they are all we need in order to find new arrangements. The group can be reduced to just the three primitive operations of multiplying a magic square M and its transpose MT by the arrays F and G either on the left or right side. So each magic square belongs to a set or class of 32.


Even though we can exchange the order in which we multiply by F and G the order above needs to be fixed so we don't double count the number of magic squares. Using reflections and rotations in our group of operators risks double counting magic squares.

  Why can we exchange the order of F and G and the order of the transpose? F and G only exchange rows with rows and columns with columns. Transpose exchanges rows and columns. There appears to be something fundamentally different about doing this. Rotations exchange rows and columns too.

Summary of Magic Square Operators


  It might help for review purposes to keep the formulas needed in one place. F, G and H do the various flips and shifts. XM and MX with X ∈ {F, G, H} need to be added to the formulas below for completion.


F, G and H can be exchanged with each other but not necessarily with M, R and the diagonal flips.

Wednesday, December 28, 2016

Repeated Rotations


  We can repeatedly use or "nest" the expressions for counterclockwise and clockwise rotations but the expressions that result can be simplified and we are left with just four unique expressions.


Simple Rotations


  We can't treat the cells of an array as points and use matrices to rotate the array but it can be done with flips and transpositions. Here the superscript T indicates that M is transposed.


So it looks like we can examine these operations in Excel to see if they leave the sums for the magic squares unchanged.

Using Formulas To Create Arrays In Excel


  In Excel 2016 one can use a constant such as {1,2,3,4;5,...} to define an array but functions provide an easier method. Below the numbers 1-16 are placed in order in the array M. Also, the two operators F and G are used to produce two more operators, H and E, by multiplication. The multiplication table for the set of four operators shows that it forms an Abelian group and so the order of the multiplication among themselves doesn't matter.


Left and right multiplication of F, G and H with M produces a set of 16 distinct rearrangements including the original. In FM all the columns are inverted and MF has its rows reversed. GM does a double shift upwards with replacement. In MG there's a double shift to the left. One can see the right multiplication produces different results left multiplication does.


To show how this works we can look at the action of an array with just one nonzero value which allows shift a row or column depending on the filled cell's location.


These are some of the operators kinds of operators which leave the sums in the magic square unchanged. The situation is a little more complicated than that of the dihedral group of a square with has only reflections and rotations.

Saturday, December 24, 2016

Using Matrix Operators For Flips in Excel 2016


 I've been using my free 30 day evaluation for Office 2016 to see what Excel 2016 is capable of doing. It was a little cumbersome at first but I'm starting to get the hang of it. Working with magic squares has proven to be a good motivator. I was able to get it to use matrix operators to some of the basic flips.


The basic tools are the matrices which I labeled Flip and HalfFlip. To show what these matrices do we start with the source matrix, S, and first multiply it on the left side by Flip with MMULT. The result is a matrix that is flipped along the columns. Multiplying S on the right flips the source along the rows. When HalfFlip multiplies S on the left the top and bottom halves are flipped along the columns. When it multiplies S on the right the left and right haves are flipped along the rows. The transpose function flips S leaving the 1-16 diagonal unchanged. The result is represented by ST. The flip leaving the 4-13 diagonal unchanged is accomplished by the series of operations, (S·Flip)T·Flip.

With Excel 2016 I find that it helps to keep track of what one is doing by labeling the matrices and displaying the formulas used with the FORMULATEXT( ) function.

P.S. Merry Christmas!