### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,126 hits

Programming Enigma Puzzles

16 August 2017

Posted by on **From New Scientist #1026, 11th November 1976** [link]

Here is what is left of the league table pinned in our local church door at the end of the season. It shows the number of goals scored in each match rather than the mere result. Each side played each [other side] once and there were no ties in the “points” list.

You would think that the Anvils, having scored more than half the goals scored in the entire competition, must have done pretty well. But in fact, as you see, they came bottom. The Bears beat the Eagles and drew with the Furies. At least one team drew more games than the Casuals. The Dynamos — but that’s enough information.

Can you fill in the table?

[tantalizer475]

%d bloggers like this:

Instead of writing a program to solve the problem I expressed it as a set of MiniZinc constraints:

The [[

`mzn-chuffed`

]] solver executes this model in 287ms.And here is a Python program that uses the

minizinc.pywrapper to format the output from MiniZinc into the appropriate table.Solution:The full table is given below:Assuming 2 points for a win and 1 to each side for a draw. (The published solution gives 1 point for a win and a half point to each side for a draw).

If, however, we were to assume 3 points for a win and 1 for a draw then there would be multiple solutions, so really the puzzle should explicitly state the scoring system.

The scores in the matches are:

As we see, A scored 22 goals, and all the other teams scored 21 goals between them. C drew two matches (BvC, CvD), and B and F drew 3 matches (BvC, BvD, BvF and BvF, DvF, EvF) and D drew four matches (BvD, CvD, DvE, DvF).