A mild arithmetic Le Monde mathematical puzzle:
Find the optimal permutation of {1,2,..,15} towards minimising the maximum of sum of all three consecutive numbers, including the sums of the 14th, 15th, and first numbers, as well as the 15th, 1st and 2nd numbers.
If once again opted for a lazy solution, not even considering simulated annealing!,
[sourcecode language=”r” gutter=”false”]
parme=sample(15)
max(apply(matrix(c(parme,parme[-1],
parme[1],parme[-(1:2)],parme[1:2]),3),2,sum))
[/sourcecode]
and got the minimal value of 26 for the permutation
14 9 2 15 7 1 11 10 4 12 8 5 13 6 3
Le Monde gave a solution with value 25, though, which is
11 9 7 5 13 8 2 10 14 6 1 12 15 4 3
but there is a genuine mistake in the solution!! This anyway shows that brute force may sometimes fail. (Which sounds like a positive conclusion to failing to find the proper solution! But trying with a simple simulated annealing version did not produce any 25 either…)
