### 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

22 February 2012

Posted by on **From New Scientist #2722, 22nd August 2009** [link]

In a tournament in which each team played each of the other teams four times, with 2 points awarded for each win and 1 point to each team for a draw, the teams finished in the order Albion, Borough, City, Rangers, United, each team having a different number of points.

If 3 points had been awarded for each win and 1 point to each team for a draw, once again each team would have had a different number of points; but City would have won the tournament and none of the teams would have finished in the same position as with 2 points for a win.

11 matches were drawn, including the first match of the tournament. If I told you which teams played in that match you could deduce with certainty how many matches each team won, drew and lost. How many matches did each team win?

**Enigma 1380** is also called “Points for a win”.

[enigma1559]

Advertisements

%d bloggers like this:

The following Python program runs in 1.8s.

Originally I wrote code with more nested loops to find the answer. It runs faster, but is even longer and messier than this. I’ve tried to come up with a cleaner version (that also goes all the way to analysing the possibilities and finding the answer), and this is the best I’ve managed so far.

Solution:Albion won 6 matches. Borough won 6 matches. City won 9 matches. Rangers won 3 matches. United won 5 matches.In fact it turns out that you only need to know that United played in one of the drawn matches.