Monday, October 19, 2020

Constructing a magic square

To make things easier, I'm going to call the rows, columns, and diagonals of the magic square "triples". 

My first intuition was that 5 had to go in the centre square. From there, I realized that for each triple that passed through the centre square, the 'outer' numbers had to add up to 10, which meant they had to come in pairs: 1 and 9, 2 and 8, 3 and 7, and 4 and 6. Each of these pairs must form a triple with 5 that passes through the centre square. Using this, I played around a little and got a working magic square on my second attempt.

I then tried to justify my assumption that 5 had to go in the centre. I thought about counting the number of triples that each square was a part of, and making some sort of algebraic argument with that, but it didn't really go anywhere. Then I realized I could combine that idea with what I had been thinking about earlier - there are four triplets that involve the central square. Since each triplet sums to 15, the four triplets have a total sum of 60. Each of the outer numbers of the square is counted once in this sum, and the number in the central square is counted four times (once for each triplet). Therefore, if n is the number in the central square, then 1+2+3+...+9+3n = 60, which we can solve to get n = 5. So 5 does have to be in the central square!

What about the other squares? We can learn some things about them using parity. Since each triple sums to 15, which is an odd number, each triple must contain either 3 odd numbers, or 1 odd number and 2 even numbers. For any triple not including the centre square, the odd numbers we can choose are 1, 3, 7, and 9, no three of which sum to 15, so every triple that doesn't include the centre square must have exactly one odd number. There are four such triples: the left and right columns and the top and bottom rows. Since each contains only one odd number, the four remaining odd numbers must be placed in the centre box of each of these rows/columns. This makes it pretty easy to complete the square. In fact, since each triple has to add to 15, there are so few choices that you can make that the solution is unique up to rotation and reflection!

1 comment:

  1. Nicely done, Zach! I like the fact that you looked for the logic even after you'd solved the puzzle. Would you be willing to share your solution in class today if we have time?

    ReplyDelete

Reflection on the class

If you had asked me a year ago about teaching math history in as part of the high school curriculum, I probably would have said it was a was...