From The Sunday Times, 10th August 1975 [link]
A farmer grows apples in an orchard divided into plots —three to the East and three to the West of a central path. The apples are of two types — for eating (Cox, Laxton, Pearmain) and for cider making (Tremlitt, Coppin, Kingston).
Adjacent plots contain apples of different basic type. The apples are of six colours (red, green, russet, golden, orange, yellow) and of six tastes (sweet, sour, acid, tart, pleasant, bitter).
They ripen at different times, either early or late in July, August and September. Those ripening in early or late September are in plots directly opposite. Those South of Pearmain do not ripen in August. Tart are directly West of the acid variety, which ripens in early August. Yellow apples and those maturing in late September are adjacent. Yellow and orange are of the same type. Orange are North of pleasant and also North of Pearmain. Kingstons are adjacent to golden. Green is South of bitter.
Cox ripen in early July, and Laxtons ripen early in a different month. Tremlitts are red, and Kingstons mature after Coppins, which are not sour.
If cider apples taste unpleasant, what are the characteristics of the apples in North East plot? (Name, colour, taste, ripens).
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981).
I think the puzzle as published in The Sunday Times and in the book is open to interpretation, and my first attempt using a reasonable interpretation gave two solutions (neither of which are the published solution). After examining the given solution in the book I think the following wording is clearer:
A farmer grows apples in an orchard divided into plots — three to the East and three to the West of a central track. Adjacent plots are separated by a shared fence. The apples are of two basic types — for eating (Cox, Laxton, Pearmain) and for cider making (Tremlitt, Coppin, Kingston).
Neighbouring plots contain apples of different basic type. The apples are of six colours (red, green, russet, golden, orange, yellow) and of six tastes (sweet, sour, acid, tart, pleasant, bitter).
They ripen at different times, either early or late in July, August and September. Those ripening in early or late September are in plots directly opposite each other. Those directly South of Pearmain do not ripen in August. Tart are directly West of the acid variety, which ripens in early August. Yellow apples and those maturing in late September are in adjacent plots. Yellow and orange are of the same basic type. Orange are directly North of Permain, which are pleasant. Kingstons and golden are in adjacent plots. Green is directly South of bitter.
Cox ripen in early July, and Laxtons ripen early in a different month. Tremlitts are red, and Kingstons mature after Coppins, which are not sour.
If cider apples are neither pleasant nor sweet, what are the characteristics of the apples in North-East plot?
[teaser734]
Jim Randell 9:16 am on 3 October 2024 Permalink |
Note that the number formed from the cards “is divisible by the digit that is one more than the number of cards”.
If there are k cards, then (k + 1) must be a single digit, i.e.:
And the example given involves removing the 6th card and closing up the gap, hence:
So the only possible values for k are 7 or 8.
This Python program runs in 228ms. (Internal runtime is 142ms).
from enigma import (irange, tuples, subsets, nconcat, delete, printf) # solve the puzzle for digits <ds> def solve(ds): k = len(ds) # divisibility by 3 or 9 does not depend on order if (k == 2 or k == 8) and sum(ds) % (k + 1) > 0: return # choose an ordering for the digits for ss in subsets(ds, size=k, select='P'): if ss[0] == 0: continue n = nconcat(ss) # the number is divisible by one more than the number of digits if n % (k + 1) > 0: continue # if the digit at position i is removed, the number formed from # the remaining digits is divisible by i if any(nconcat(delete(ss, [i - 1])) % i > 0 for i in irange(2, k)): continue # output solution printf("k={k}: {ds} -> {ss} -> {n}") digits = list(irange(0, 9)) # the puzzle implies there between 7 and 8 cards for k in irange(7, 8): # choose k consecutive digits for ds in tuples(digits, k): solve(ds)Solution: The original number was: 2435160.
If we allow the full range numbers of cards (2 to 9) there are the following solutions:
Note that beyond k=2 the numbers are even (as removing the 2nd digit must result in a number divisible by 2, and so the final digit must be even).
And beyond k=5 the numbers end in 0 (as removing the 5th digit must result in a number divisible by 5, and so the final digit must be 0). And so the only consecutive sequence of digits is 0..(k − 1).
This means that for k=8 the set of digits is 0..7, but these digits have a sum of 28, which is not divisible by 9, and so none of the arrangements of digits will be. So there is no possible collection of 8 cards.
We know then, that the number must be formed from 7 cards, using the digits 0..6.
The following run file uses these restrictions and divisibility rules on the 7-digit number, and has an internal run time of 275µs.
LikeLike