I chose to try a 4x4 magic square, as I had already worked on a 3x3 previously. Since the side length of the square was 4 and the area was 16 (or 4 squared), in order to be nerdy and consistent I made the target sum 64 (or 4 cubed). Take a look at the picture below for the solution and the variable placements that I refer to throughout this post.
Thought process for attempt #1:
Step 1: Label the boxes with variables and list out all possible equations.
Step 2: Use linear algebra to try and solve a system of equations. Actually, this can't work yet, since we have 16 variables and only 10 possible equations.
Step 2.25: Give ourselves a starting place. Fill in values for the diagonals afkp and dgjm. By using the squares along the diagonals, we ensure that every single one of our 10 equations has a value for at least one variable. Now go back to step 2. Er, I mean jump to step 3.
Step 2.5: Maybe start with placing values in all 4 corners. Each of the 4 corner squares appear in 3 different equations, horizontally, vertically, and diagonally. Now solve for one side length. Head to step 3.
Step 2.75: Perhaps place 4 values that add to 64 in the central square fgjk? A good starting point to solving the 3x3 involves solving the central square. We'll try that approach, except this time it's 4 central squares... Proceed to step 3.
Step 3: This system has no solution. Start again from scratch.
Attempt #2:
Step 1: "I wonder if there's any correlation between the magic square and fibonacci or binary values..." They have applications all over nature, and sometimes in the most random problems.
Step 2: Every number has a unique fibonacci or binary sum, and since you need 64 to appear in 10 different orientations, this won't work. Also, the length of the binary value for 64 is longer than 4 digits, so this definitely won't work!
Step 3: Start from scratch.
Attempt #3:
Step 1: Divide the 4x4 grid into 4 smaller 2x2 grids. Now each 2x2 grid is a sub-magic square for 32.
Step 2: This doesn't work because 2 diagonal squares in the 2x2 grid must have the same value. Try again.
Attempt #6?:
Step 1: "Can it be filled in with only even values?" It is possible to solve a 4x4 magic square using only digits from 1 to 16. 64 is an even number, and there are 32 even numbers that precede it- I only need 16 of those 32 values. Go to step 3.
Step 2: "What about only odd numbers?" Go to step 3.
Step 3: Start from scratch.
...
Attempt #x:
This time I collaborated with my sister, because my brain was swimming with numbers, and math is always more fun when it's worked on together :)
Step 1: Since our magic square needs to add up in 3 different directions, we'll try to think 3-dimensionally, but on a 2-D plane. Take a look at right edge dhlp, bottom edge mnop, and diagonal afkp. These all intersect at p, and it uses 10 squares to do so. In order to work our way from the bottom of the number line up, strategically place numbers 1 to 9 in dhl, afk, and mno, until they equal the same value. In other words, use trial and error until the triplets (d, h, i), (a, f, k), and (m, n, o) equal the same value (or, d + h + i = a + f + k = m + n + o). Now, you can fill in p with the difference.
Step 2: It's time for linear algebra! There are 7 equations for 6 unknowns. We simplified each of the equations in terms of 1 variable, j, and thank goodness, the equations for b, c, e, g, i, and j, in terms of j were all independent. So, this means that there were no values that would occur twice. Set a value for j, in this case we let j = 10 since we already used numbers from 1 to 9 in the other squares, and plug this in to find your other values.
Step 3: Check. Do each of the rows, columns, and diagonals add up to 64? In our case, no, it didn't :( The sum of row 1 was 66, row 2 was 82, and column 3 was 84, while everything else was 64. Luckily, the 2 rows and 1 column were both off by 20, so we adjusted it accordingly. And it worked!! (One reason that it may not have added up initially, was because we set j = 10. This might work immediately for different values of j though.)
Step 4: Admire your magic square.
Wonderful account of your process (with your sister, which is great!) and a very nice magic square that resulted. Q: If you had decided on a lower number (34?) rather than 64 as your sum, could you have used consecutive numbers rather than needing to jump to 17, 21 etc.? Very nice work.
ReplyDelete