From The Sunday Times, 26th December 2021 [link] [link]
A Christmas Carol was published on 19/12/1843, when Bob Cratchit was in his forties, almost seven years after Jacob Marley’s death on Christmas Eve. On Marley’s last Christmas Day, a working day for them all as always, Scrooge said to Cratchit and Marley: “We three will work the same dates next year as this year, except that I’ll cover Cratchit’s birthday so he can have the day off, since Marley never works on his”. On Boxing Day, Scrooge decided to allocate extra work dates for next year to anyone whose number of work dates was going to be below the average of the three of them, bringing them up to exactly that average. Daily, up to and including New Year’s Eve, Scrooge repeated this levelling-up to the new average, never needing fractions of a day.
What was Bob Cratchit’s full date of birth?
In the book The Sunday Times Teaser Book 2 (2023), the “levelling-up” process is described as follows:
… Scrooge decided to allocate extra work dates for the next year to the one whose number of work dates was going to be below the average of the three of them, bringing him up to exactly that average. Daily, up to and including New Year’s Eve, Scrooge repeated this levelling-up for that person to the new average, never needing fractions of a day.
Which is intended to indicate that only one of the three is “levelled-up” each time the process is applied.
[teaser3092]
Jim Randell 3:55 pm on 29 July 2022 Permalink |
The title of this puzzle is presumably an allusion to Sherlock Holmes’ “three pipe problem” in The Red-Headed League.
Some judicious applications of Pythogoras’ theorem gets us the answer.
This Python program runs in 54ms. (Internal runtime is 313µs).
Run: [ @replit ]
from enigma import (irange, div, is_square, sq, printf) # suppose the pipes have diameters a, b, c, d, e, f (in cm) # we know h = 2a + c < 500; b = (2/3)a for a in irange(6, 249, step=3): b = div(2 * a, 3) # from pipes ABC c = a - b # calculate the height of the stack (in centimetres) h = 2 * a + c if not (h < 500): break # from pipes AAD: (a + d)^2 = a^2 + (a - d)^2 d = div(a, 4) if d is None: continue # from pipes ABC: (a + e)^2 = (a + c - b - e)^2 + (b + c)^2 e = div(sq(b) + sq(c) - a * (b - c), 2 * a - b + c) if e is None: continue # from pipes ADF: (d + f)^2 = (d - f)^2 + x^2; (a + f)^2 = (a - f)^2 + y^2; x + y = a r = is_square(a * d) if r is None: continue f = div(sq(a), 4 * (a + d + 2 * r)) if f is None: continue if a > b > c > d > e > f > 0: # output solution (in cm) printf("height = {h} cm [a={a} b={b} c={c} d={d} e={e} f={f}]")Solution: The height of the stack is 420 cm.
Note that the derivation of d requires a to also be divisible by 4 (as well as 3), so we could consider just multiples of 12 for a for a slight increase in speed.
Manually:
If we suppose a = 180k, then we can simplify the expressions used in the program to give the following values:
And we require all these values to be positive integers, so k takes on a positive integer value.
The total height of the stack is h = 2a + c = 420k, and we require h < 500.
So the only permissible value is k = 1, and the answer follows directly.
LikeLike
Frits 2:26 pm on 2 August 2022 Permalink |
Problem is when to stop with your analysis.
Ultimately each diameter can be expressed in terms of the smallest diameter.
from enigma import SubstitutedExpression # AGH, BIJ, CK, DL, EM and FN variables are diameters # if (x - y)^2 = z^2 then (2x - 2y)^2 = (2z)^2 # so we can also calculate with diameters in the Pythagorean formulae # the alphametic puzzle p = SubstitutedExpression( [ # type A 50 per cent wider than type B # diameter A is equal to diameter C + two times radius B # a height of less than 5 metres so 2a + c = 7c < 500 "1 < CK < 72", "3 * CK = AGH", "2 * CK = BIJ", # (a + d)^2 = a^2 + (a - d)^2 so 4ad = a^2 "div(AGH, 4) = DL", # (a + e)^2 = (a + c - b - e)^2 + (b + c)^2 using a = 3c and b = 2c # 6ce + 9c^2 = 4c^2 - 4ce + 9c^2 "div(2 * CK, 5) = EM", # (d + f)^2 = (d - f)^2 + x^2; (a + f)^2 = (a - f)^2 + (a - x)^2; # so 4df = x^2 and 4af = (a - x)^2 "4.0 * AGH * FN == (AGH - 2 * (DL * FN)**.5)**2", # A to F in decreasing size "AGH > BIJ > CK > DL > EM > FN" ], answer="2 * AGH + CK, (AGH, BIJ, CK, DL, EM, FN)", d2i=dict([(k, "CF") for k in range(8, 10)]), distinct="", verbose=0, # use 256 to see the generated code ) # print answers for (_, ans) in p.solve(): print(f"the final height of the stack in centimetres: {ans[0]}")LikeLike