Brain Teaser: Tea table talk
From The Sunday Times, 26th December 1954 [link]
The Sales Manager of the Kupper Tea Company came into the Chief Accountant’s office. “I’ve got to report to the Chairman on the results of our new policy of selling pound packets only in four qualities only”, he said, “Which is the most popular brand — the 3s. 11d., 4s. 11d., 5s. 11d., or 6s. 11d.?”.
“When reduced to pounds, shillings and pence”, replied the man of figures, the sales of each brand for last month differ from each other only in the pence column, and there only to the extent that the figures are 1d., 2d., 3d., and 4d., though not respectively”.
“Very Interesting,” said the Sales Manager, but the Chairman will want a plain “yes” or “no” to whether we have reached our sales target. What is the answer to that?”.
“The answer to that, my boy”, replied the Chief Accountant, “is all the further information you need to calculate the complete figures for yourself”.
What are the figures?
[Note: £1 = 20s, and 1s = 12d]
This is one of the occasional Holiday Brain Teasers published in The Sunday Times prior to the start of numbered Teasers in 1961. Prizes of £3, £2 and £1 were offered for the first 3 correct solutions.
[teaser-1954-12-26] [teaser-unnumbered]
Jim Randell 10:35 am on 12 December 2021 Permalink |
The following program steps through multiples of the largest price, and looks for multiples of the other prices which come in close to the same price, but with differing “pence” values.
We find that there are many sets of 4 sales figures that differ only in the pence column, with values of (1, 2, 3, 4).
If the sales target had been met (or exceeded) we would not know which of these to choose (if we find one set of figures that works, any larger set of figures would also work).
However, if the sales target had not been met, and that is enough information to work out what the figures are, then we must be interested in the lowest set of possible sales figures, and the target must be higher than this, but less than the second lowest possible set of figures.
The program runs in 166ms, so is fast enough, but this isn’t a suitable approach for a manual solution.
Run: [ @replit ]
from enigma import irange, inf, div, singleton, unpack, printf # pence -> (pounds, shillings, pence) def d2psd(n): (n, d) = divmod(n, 12) (p, s) = divmod(n, 20) return (p, s, d) # (pounds, shillings, pence) -> pence def psd2d(p, s, d): return 240 * p + 12 * s + d # solve for the specified prices, (A, B, C, D) def solve(A, B, C, D): # look for multiples of the largest price for n in irange(0, inf, step=D): (p, s, d) = d2psd(n) if 0 < d < 5: # so the other amounts were are interested in are... r = dict() for d_ in (1, 2, 3, 4): if d_ == d: continue k = singleton(x for x in (A, B, C) if div(psd2d(p, s, d_), x)) if k: r[k] = (p, s, d_) else: break # have we found a value for each d? if len(r.keys()) == 3: r[D] = (p, s, d) yield r # prices (in ascending order) prices = list(psd2d(0, s, 11) for s in (3, 4, 5, 6)) # look for the smallest solution for r in solve(*prices): for (k, (p, s, d)) in sorted(r.items(), key=unpack(lambda k, v: v)): n = div(psd2d(p, s, d), k) (_, ks, kd) = d2psd(k) printf("({p}, {s}s, {d}d) = {n} pkts @ ({ks}s, {kd}d) each") printf() breakSolution: The sales figures are:
And the target must be above this.
The next set of figures starts at £77098, 0s, 1d, so the target must be below this (otherwise there would be a choice of two sets of figures).
LikeLike
Hugh+Casement 2:10 pm on 12 December 2021 Permalink |
I wouldn’t like to have had to work that out in 1954, with no computer to hand.
It would have been easier if the sales had been all the same: £68088 14s. 1d. is the LCM of the four packet prices, each a prime number of pence.
In the days before the ubiquitous teabags, tea was normally sold in quarter-pound packets.
I seem to remember a price of about 1s. 6d., but probably less in the ’50s.
LikeLike
GeoffR 9:00 am on 14 December 2021 Permalink |
I worked in old decimal pence (240p = £1), looking for 1d differences in total sales values between 12,000,000 and 14,400,000 sales totals, in old pence. This search range is £50,000 to £60,000 in current money terms and was used to reduce search time. The Chuffed solver was used.
Using Python’ divmod function for converting old money totals to current monetary values:
T1 = 12930734 in old pence is:
divmod(12930734,240) = (53878, 14) = £53878 1s 2d
T2 = divmod(12930735,240)
= (53878, 15) = £53878 1s 3d
T3 = divmod(12930733,240)
= (53878, 13) = £53878 1s 1d
T4 = divmod(12930736,240)
= (53878, 16) = £53878 1s 4d
There were several solutions, including the published solution.
LikeLike