### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,149)
- misc (2)
- project euler (2)
- puzzle (38)
- site news (44)
- tantalizer (40)
- teaser (3)

### Site Stats

- 175,242 hits

Advertisements

Programming Enigma Puzzles

17 July 2014

Posted by on **From New Scientist #1353, 14th April 1983** [link]

Hook, Line and Sinker were the judges for the Cooker Book prize this year as usual. They assembled a short list of six and then, as usual, could not agree on the order of merit. In the end each did his own ranking, giving 6 points for first place, 5 for second and so on (no ties). Then they totalled the points, which produced a final order (also without ties). Hook gave 5 points to the book which in fact came out second and 1 point to the book which finished third. He ranked

“Stuff”above“Nonsense”and gave“Umph”the number of points which Line gave to“Impenetrables”. Line ranked“Gawp”above“Elements”and placed“Impenetrables”below“Umph”. Sinker ranked“Nonsense”third and“Stuff”fifth. No book totalled 13 or 10 or received the same number of points from any two judges. One of the books totalled 8.Can you spell out the final order?

[enigma207]

Advertisements

%d bloggers like this:

This Python program isn’t particularly elegant, or particularly quick, but it does find the answer. It runs in 535ms.

Solution:The final order is:,Gawp,Elements,Nonsense,Impenetrables,Umph.StuffThe actual scores given are shown below:

Note that the initial letters of the book titles read GENIUS.

I’m still not inspired to read any of them, though.

Here is the problem expressed as a set of MiniZinc constraints, which can be executed directly to give the solution.

I used the

minizinc.pywrapper library that I wrote forEnigma 361to let me bring the solution(s) back into Python for easier formatting.This program runs in 144ms.