Brain-Teaser 461: [Grovelball]
From The Sunday Times, 29th March 1970 [link]
The finals of the Ruritanian grovelball championships have just taken place between the four leading teams, each team playing the other three.
The Archers won the championships, scoring fourteen grovels to one against, while the Bakers scored eight and conceded five.
The Cobblers, who scored four grovels, conceded the same number as the Donkey-drivers, who failed to score in any of their three games.
In no game were fewer than three grovels scored, and there were only two games which resulted in the same score.
What were the scores in the Archers v. Bakers and Archers v. Cobblers games?
This puzzle was originally published with no title.
[teaser461]
Jim Randell 7:22 am on 7 March 2019 Permalink |
We first note that C and D conceded the same number of goals, say x. And the sum of all the goals scored must be the same as the sum of all the goals conceded:
From there we can use the [[
Football()]] helper class from the enigma.py library to consider this as a “substituted table” problem. We get a fairly short program, but not especially quick, but it finds the solution in 886ms.Run: [ @repl.it ]
from enigma import Football, digit_map, ordered # scoring system (all games are played) football = Football(games="wdl") # digits stand for themselves, A=10, E=14 d = digit_map(0, 14) # the table (mostly empty) (table, gf, ga) = (dict(played="3333", w="???0"), "E840", "15AA") # consider match outcomes for (ms, _) in football.substituted_table(table, d=d): # find possible scorelines from the goals for/against columns for ss in football.substituted_table_goals(gf, ga, ms, d=d): # additional restrictions: # "in no game were fewer than 3 goals scored" if any(sum(s) < 3 for s in ss.values()): continue # "only two games had the same score" # so there are 5 different scores involved if len(set(ordered(*s) for s in ss.values())) != 5: continue # output the matches football.output_matches(ms, ss, teams="ABCD")Solution: A vs B = 4-1; A vs C = 7-0.
There is only one possible set of scorelines:
So A has 3w, B has 2w+1d, C has 1w, D has 0w.
LikeLike