Brain-Teaser 670: A shared legacy
From The Sunday Times, 12th May 1974 [link]
When my neighbour Giles found he could no longer look after his prize herds of cattle and sheep, he planned to divide the lot among his four sons in equal shares.
But when he started by counting up the cattle he soon found that their total was not exactly divisible by four, so he decided he would juggle with the numbers of beasts and achieve the four shares of equal value by making to the respective recipients quite arbitrary allocations of both cattle and sheep, taking into account that the value per head of the former was four times that of the latter.
The outcome was that:
(i) one son received 80% more beasts than another;
(ii) two sons each received a total of beasts which equalled the aggregate total of two of the other three sons;
(iii) one son received twice as many of one type of beast as of the other;
(iv) only one son received over 100 beasts in all.How many cattle were included in this last total of over 100 beasts?
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). The puzzle text above is taken from the book.
[teaser670]








Jim Randell 9:37 am on 15 November 2022 Permalink |
If the total number of animals received by each brother is: A, B, C, D (in descending order), then (from (iv)) A is the only one to receive more than 100.
And from (ii) two of the brothers totals are equal to the sum of the totals of two of the remaining three brothers. These two must be A and B, and so B = C + D, and A = C + 2D or 2C + D.
This Python program starts by finding possible A, B, C, D values, and then tries to split these totals into numbers of cattle and sheep such that the remaining conditions hold.
It runs in 62ms. (Internal runtime is 11.2ms).
Run: [ @replit ]
from enigma import (irange, subsets, ediv, as_int, printf) # split total <t> into (<cattle>, <sheep>) with value <v> def split(t, v): c = ediv(v - t, 3) return (as_int(c, "0+"), as_int(t - c, "0+")) # solve puzzle for given totals: A, B, C, D def solve(A, B, C, D): # consider number of cattle for A for Ac in irange(0, A): As = A - Ac # total value for A (cattle = 4, sheep = 1) v = 4 * Ac + As # find splits for B, C, D try: (Bc, Bs) = split(B, v) (Cc, Cs) = split(C, v) (Dc, Ds) = split(D, v) except ValueError: continue # total number of cattle is not divisible by 4 if (Ac + Bc + Cc + Dc) % 4 == 0: continue # someone has twice as many of one type of animal as the other if all(2 * x != y and x != 2 * y for (x, y) in [(Ac, As), (Bc, Bs), (Cc, Cs), (Dc, Ds)]): continue # output scenario printf("[v={v}] A: {Ac}c+{As}s = {A}; B: {Bc}c+{Bs}s = {B}; C: {Cc}c+{Cs}s = {C}; D: {Dc}c+{Ds}s = {D}") # total number of animals for C (not more than 100) for C in irange(1, 100): # total number of animals for D (not more than C) for D in irange(0, C): # B = C + D (not more than 100) B = C + D if B > 100: break # A = C + 2D or 2C + D (more than 100) for A in (B + D, B + C): if not (A > 100): continue # one of these values must be 1.8x a lower value if not any(5 * x == 9 * y for (x, y) in subsets((A, B, C, D), size=2)): continue # solve the puzzle solve(A, B, C, D)Solution: The son receiving over 100 animals received 6 cattle.
The full solution is:
Assigning values of cattle = 4, sheep = 1, each brother receives animals to a value of 135.
In total there are 279 animals = 87 cattle (not a multiple of 4) + 192 sheep.
LikeLike