Magic and Supremely Nonmagic Squares

In connection with Story #85, an MCMC take on Magic Squares, I've uploaded com5d to the site. Use it, play with it, constuct magic squares of sizes 4 x 4, 5 x 5, 6 x 6, perhaps higher. This is achieved via the MCMC for f(x) = \exp[-\lambda Q(x)] / constant, with positive \lambda. You may also play with *negative \lambda*, to encourage outcomes as far as possible from magic-ness: sums of rows, columns, diagonals, far away from the magic number (34 for 4 x 4, 111 for 6 x 6, etc.). The exercise is then to find the Bayesian MAP, maximising Q(x) as score: the worst ever squares. 

I think it's pretty hard to do this by pure math -- so run chains and see what happens. My current guesses, for 4 x 4 and 6 x 6 (after tne minutes of playnig) are 114 and 540. If you can beat these numbers, tell me, and I'll give you tyve kroner (les Rudolf Nilsen).

Published Sep. 4, 2025 11:16 AM - Last modified Sep. 4, 2025 11:16 AM