Reverse engineering a math magic trick involving matrices.

2.5k Views Asked by At

This problem was brought up by my mother from a corporate party along with a question on how that worked.

There was a showman who asked to tell him a number from $10$ to $99$ (If i'm not mistaken). The number $83$ was named after which he took a piece of paper and quickly put down a matrix (note he did that fast):

$$ \begin{bmatrix} 8 & 11 & 63 & 1\\ 62 & 2 & 7 & 12\\ 3 & 65 & 9 & 6 \\ 10 & 5 & 4 & 64 \end{bmatrix} $$

If you take a closer look every row, column and diagonal has the sum of $83$. Moreover consider the corners of the matrix also have the sum of $83$. For example: $$ \begin{bmatrix} \color\red{8} & \color\red{11} & 63 & 1\\ \color\red{62} & \color\red{2} & 7 & 12\\ 3 & 65 & 9 & 6 \\ 10 & 5 & 4 & 64 \end{bmatrix} $$

Also the central square is $83$ in sum as well: $$ \begin{bmatrix} 8 & 11 & 63 & 1\\ 62 & \color\red{2} & \color\red{7} & 12\\ 3 & \color\red{65} & \color\red{9} & 6 \\ 10 & 5 & 4 & 64 \end{bmatrix} $$

Clearly numbers $1,2,3,4,5,6,7,8,9,10,11,12$ are filled in in a circular manner. And then consequent $62, 63, 64, 65$ are as well. I'm not very familial with linear algebra so my question is:

What was that rule he used to build it? Can we construct a matrix with the same properties given a random number in some range? Is it possible to build a similar one but for $5\times 5$, $6\times 6$ or $N\times N$ matrix?

3

There are 3 best solutions below

4
On BEST ANSWER

This is all based on the amazing matrix $$\pmatrix{8&11&14&1\\13&2&7&12\\3&16&9&6\\10&5&4&15}$$ Note that this works for $34$. For $34+n$ you just replace $13,14,15,16$ with $13+n,14+n,15+n,16+n$. I do not know what the showman's backup plan for numbers below $34$ is.

EDIT: There is a Numberphile video on YouTube on this exact trick.

2
On

He did not write down 'a matrix'. He wrote down a magic square.

There are various algorithms for constructing them, the easiest to do mentally is to start with a generic starter matrix you memoize:

 A  1 12  7
11  8  B  2
 5 10  3  C
 4  D  6  9

And solve for A, B, C, D for your target number. With some practice you can do this super fast.

0
On

Observe that the numbers in the sixties lie on different rows, different columns and different quadrants. If you increase them simultaneously, all the twelve sums increase by the same amount.

In the pure magic square (numbers $1$ to $16$), the sum is $34$, hence if suffices to add $83-34=49$ to these four elements.

It would be more logical to request a sum in the range $[34,83]$ so that all elements are at most two-digit naturals.

For stronger mystification, you can split the required increment in two or more and adjust on the other possible groups.