Saturday, October 13, 2007


I thought that I should explain the purpose of me posting Mathematica solutions to the New Scientist Enigma problems.

The main purpose is to show how one can quickly get a solution to each problem (usually by brute force attack) using the unique processing abilities of Mathematica. Each posting shows the first line of reasoning that led me to the solution, so my reasoning is usually not elegant and is not intended to be elegant; the goal is to find the correct solution and to do it quickly. Sometimes this means that I deliberately use an unusual sequence of manipulations in order to illustrate a particular style of programming. Occasionally this means that I use a peculiar Mathematica idiom that I just happen to know.

Actually, I do worry about the elegance of solutions, but optimising the elegance of a solution is completely different from simply finding the correct solution to a problem. In the case of the New Scientist Enigma problems I strongly suspect that most of them are constructed in a brute force way (i.e. start with a large set of potential solutions, then impose various perverse constraints, until there is only one member of the set remaining), so there is no guarantee that there are slick and elegant solutions to them.


Anonymous said...

Do you think there are any numerical puzzles that could not be sorted out in fairly short order using Mathematica?

Stephen Luttrell said...

I have wondering about precisely that question myself. I was going to keep solving Enigma problems until one came up that wasn't amenable to the brute force solution approach that I have been using. Then I would see how I needed to expand my approach, presumably by "engaging my brain" somewhat more than I have been doing thus far.

An Enigma problem could be constructed to be hostile to brute force attack by making the initial size of the set of solutions so large that it defeated the capabilities of current computer technology. Alternatively, an Enigma problem could be constructed in such a way that it required the use of some clever number theory (or whatever) to isolate the solution, which would defeat all but the very small proportion of people who happened to know the relevant number theory (or whatever), but this sort of Enigma problem would be unfair to publish in a general magazine like New Scientist.

In the past I have noticed several Enigma problems that came close to defeating the use of brute force attack, but presumably the author of the Enigma problem was using a computer to generate the problem in the first place, so the initial size of the set of solutions was naturally constrained to be amenable to brute force attack.