From The Sunday Times, 26th April 1970 [link]
Near my house is an impressive block of flats. It stands 16 storeys high, and each story is a lofty 15 feet from floor to floor. My old friends Bob and Horace operate the two lifts, and both start their shift each morning leaving the ground floor at 8 a.m. precisely.
The two lifts make automatic compulsory stops at the ground level (there is no basement), the 12th and top floors. But below the 12th, Bob serves only the odd-numbered floors, and Horace the even numbers; these stops are also compulsory (up and down). All stops take just 10 seconds, except at ground level where both lifts wait for 20 seconds.
Above the 12th both Bob and Horace stop as desired, going up and coming down. Both lifts travel between floors at identical speeds.
Every morning the two attendants make a rendezvous to exchange newspapers and collect their coffee when their arrivals at a certain floor coincide exactly at two minutes after 11 a.m.
In feet per second what the speed of each lift between stops?
Note: In the UK the floors in buildings are: ground floor, first floor, second floor, etc.
Also, as stated this puzzle does not appear to have a unique solution.
An answer was published (with Teaser 467) stating:
“This clever trap, with its nice reasoning, outweighed the slight mathematical bias and kept down the entry to a mixed handful.”
But later, with Teaser 471 the following statement was made:
“[465: Regretfully a wrong transposition led to a false calculation of time.]”
In the comments I give a variation on the puzzle that does have a unique answer.
This puzzle was originally published with no title.
[teaser465]
Jim Randell 9:42 am on 16 October 2019 Permalink |
As originally stated there are multiple solutions to this puzzle.
I made the following additional suppositions in order to allow a unique solution to be arrived at.
The following Python program then finds the unique solution in 281ms.
Run: [ @repl.it ]
from enigma import irange, isqrt, filter2, is_duplicate, arg, printf # Y = year the puzzle is set (which apparently should be 2018) Y = arg(2018, 0, int) # m = minimum allowable square (the root of the square is used) m = arg(2, 1, int) printf("[Y = {Y}, m={m}]") # squares (as strings, without repeated digits) (_, squares) = filter2(is_duplicate, (str(i * i) for i in irange(m, isqrt(Y)))) # for Wunce find a pan-digital subset (without repeated digits) # ss = squares to consider # s = squares used so far # ds = digits used so far def solve1(ss, s=[], ds=set()): # are we done? if len(ds) == 10: yield list(int(x) for x in s) else: # chose the next element for (i, x) in enumerate(ss): if ds.intersection(x): continue yield from solve1(ss[i + 1:], s + [x], ds.union(x)) # for Repete find a pan-digital set of squares (allowing repeated digits) # below a given total # n = largest square to consider # t = sum of squares must be less than this # s = squares used so far # ds = digits used so far def solve2(n, t, s=[], ds=set()): # are we done? if len(ds) == 10: yield s # choose the next element for i in irange(n, m, step=-1): i2 = i * i if i2 < t: yield from solve2(i - 1, t - i2, s + [i2], ds.union(str(i2))) # find sequences for Wunce for s1 in solve1(squares): t1 = sum(s1) printf("Wunce: total = {t1}, squares = {s1}") # calculate the age age = Y - t1 age2 = age * age printf("age = {age}, age^2 = {age2}") # find sequences for Repete for s2 in solve2(age - 1, age2): t2 = sum(s2) printf("Repete: total = {t2}, squares = {s2}")Solution: The sum of Wunce’s squares is 1989. The sum of Repete’s squares is 831.
Wunce’s list of squares is (324, 576, 1089) = (18², 24², 33²).
The sum of which is 1989. So in 2018 the twins would be 29.
Repete’s list of squares is (4, 9, 25, 36, 81, 100, 576) = (2², 3², 5², 6², 9², 10², 24²).
The sum of which is 831. Which is less than 841 = 29².
If we allow 1 in the list of squares then the sum of Repete’s list could be 832. And there are further possibilities if squares in the list are allowed to be repeated.
The published solution is as follows:
LikeLike
Frits 1:43 pm on 20 October 2020 Permalink |
Same three assumptions.
from enigma import nsplit, flatten from itertools import combinations as comb # contains all digits 0-9 alldigits = lambda li: all(i in flatten([nsplit(x) for x in li]) for i in range(0, 10)) sq = [i*i for i in range(2, 45)] # check squares for Wunce for j in range(3, 6): # digit 7 only occurs first at sq[22] (576) # so pick some squares < 576 and at least one >= 576 for j1 in range(1, j): for p1 in comb(sq[:22], j1): for p2 in comb(sq[22:], j - j1): p = p1 + p2 if sum(p) not in range(1900, 2020): continue if sum(len(str(x)) for x in p) != 10: continue if not alldigits(p): continue age = 2018 - sum(p) limit = age * age space = limit - 576 if space < 0: continue # we may only pick one or two squares from group 576, 625, .... fromHighest = 1 if space < 625 else 2 # highest index with square smaller than limit and 2 smallest squares h2 = max([i for i, x in enumerate(sq) if x <= limit - 4 - 9]) # check squares for Repete for k in range(3, 10): for j3 in range(1, fromHighest + 1): for q2 in comb(sq[22:h2+1], j3): picked = sum(q2) # highest index with square smaller than limit minus q2 entries h1 = max([i for i, x in enumerate(sq) if x <= limit - picked]) for q1 in comb(sq[:h1+1], k - j3): q = q1 + q2 if not alldigits(q): continue if sum(q) >= age*age: continue print("sum Wunce's", sum(p), p) print("sum Repete's", sum(q), q) print("Age", age)LikeLike