From The Sunday Times, 16th May 1976 [link]
I went to the Post Office to buy three 5½p stamps (those were the days!) for my entries for the Brain-teaser, Crossword and Mephisto; but finding a long queue there I bought a 10p book of stamps from a machine, which contained two stamps at each of the following denominations: 2p, 1½p, 1p, ½p. Since I already had four stamps of total value 6½p left over from a similar 10p book I now had just enough stamps for the three entries.
I stuck four of the stamps totalling 5½p on my Brain-teaser entry, but then found that there was room for only three stamps on the Crossword entry (because entrants have to write “Crossword” on the top left-hand corner of the envelope) and the stamps I had left could not be arranged to give me three stamps totalling 5½p for the Crossword entry and five for the Mephisto entry.
What were the denominations of stamps on the Brain-teaser entry?
Current stamp prices in the UK are 85p (1st class) or 66p (2nd class).
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 1 (1980). The puzzle text above is taken from the book.
[teaser774]
Jim Randell 11:24 am on 11 July 2021 Permalink |
I think there is some ambiguity in this puzzle.
I supposed that there was only time per day that there was a train for each service leaving simultaneously, and that time was in the morning (i.e. between 00:00 and 11:59).
And also that the interval between trains on the same service must be at least 10 minutes (in order to make trains departing 1 minute apart an occurrence of note). Originally I assumed at least 5 minutes, but this gave me multiple solutions.
There are 24 × 60 = 1440 minutes in a day so the frequencies of the services must divide this.
This Python program runs in 59ms.
Run: [ @replit ]
from enigma import (irange, divisors, intersect, subsets, peek, printf) # times for a service, given a reference time <t> and frequency <d> times = lambda t, d: set(x % 1440 for x in irange(t, t + 1439, step=d)) # consider possible frequencies for the two services ds = (d for d in divisors(1440) if 9 < d < 1440) for (dA, dB) in subsets(ds, size=2, select="M"): # look for simultaneous times in both services ts = intersect([times(737, dA), times(738, dB)]) # there should be only 1 if len(ts) == 1: # and it should be in the morning (h, m) = divmod(peek(ts), 60) if h < 12: printf("A: {dA}; B: {dB} -> {ts} {h:02d}:{m:02d}")Solution: The two services leave simultaneously at 08:33.
The timetable of the trains are as follows:
My alternatives (with frequencies less than 10m) are:
LikeLike
Frits 12:38 pm on 11 July 2021 Permalink |
@Jim, have you considered processing only the first 2 characters of the subsets select parameter? Then you can use select=”Product” instead of select=”M”.
I first thought was a tuple but it turns out to be a generator.
Using
you can still print the content of without emptying it.
—————
I think 04:02 also is a solution, intersection of (dA=45, dB=16) contains 242 and 962 which is valid as 962 >= 720.
LikeLike
Hugh Casement 3:14 pm on 11 July 2021 Permalink |
The use of the definite article in “the two afternoon trains” rather implies that there are no others until evening, though we’re not told when afternoon ends and evening begins. Better, I feel, would have been “the first two trains after noon”, when we would know that the interval is more than 16 minutes, thus excluding a lot of potential solutions.
Possibly that’s what the setter wrote, but it was altered by an editor without consultation — there’s been a history of that over the years.
LikeLike