Brain-Teaser 101: Midsummer birthday madness
From The Sunday Times, 3rd March 1963 [link]
Midsummer Day, 1962 (June 24) was my youngest grandson John’s first birthday, and I was then able to claim that my nine grandchildren were aged 0, 1, 2, 3, 4, 5, 6, 7, and 8 years old (neglecting, of course, the odd days). They were all born in June, and if they are arranged in birthday order through the month the following facts are true:
John is the middle grandchild;
The sum of the dates of the last four is an exact multiple of the sum of the dates of the first four;
The sum of the ages of the last four is two-thirds of the sum of the ages of the first four;
The sum of the years of birth of the first three is equal to the sum of the years of birth of the last three;
The intervals between birthdays are 0, 1, 2, 3, 4, 5, 6, and 7 days, but not in that order;
Also:
My eldest son’s two daughters are exactly two years apart;
The twins were born four hours apart;
Two children are as old as their dates of birth.
What was the date of birth of the grandchild born in 1954?
This puzzle is included in the book Sunday Times Brain Teasers (1974).
There are now 700 Teaser puzzles available on the site.
[teaser101]
Jim Randell 11:56 am on 26 June 2022 Permalink |
The ages are all different, so the twins must be born either side of midnight on the 24th, so John is one of the twins, and the other must have a birthday of the 25th. John is the youngest grandson, so his (younger) twin must be a girl.
This Python program starts with the 24th in the middle of the order, and then chooses an ordering for the intervals to give the remaining dates. It then assigns the ages, and checks all the required conditions apply.
It runs in 161ms.
Run: [ @replit ]
from enigma import (subsets, div, printf) # the middle birthday is on the 24th, and the separation between # birthdays is (0, 1, 2, 3, 4, 5, 6, 7), in some order for ss in subsets((0, 1, 2, 3, 4, 5, 6, 7), size=len, select="P"): # construct the dates d5 = 24 (d4, d6) = (d5 - ss[3], d5 + ss[4]) (d3, d7) = (d4 - ss[2], d6 + ss[5]) (d2, d8) = (d3 - ss[1], d7 + ss[6]) (d1, d9) = (d2 - ss[0], d8 + ss[7]) if d1 < 1 or d9 > 30: continue ds = [ d1, d2, d3, d4, d5, d6, d7, d8, d9] # John's twin must be born on the 25th if 25 not in ds: continue # sum of the dates of the last 4 is an exact multiple of the sum of # the dates of the first four x = div(sum(ds[-4:]), sum(ds[:4])) if x is None or x < 2: continue # choose values for the ages (John is 1) for ns in subsets((0, 2, 3, 4, 5, 6, 7, 8), size=len, select="P", fn=list): # insert 1 ns.insert(4, 1) # John's twin (age 0) was born on the 25th if ds[ns.index(0)] != 25: continue # the sum of the ages of the last four is 2/3 the sum of the ages # of the first four if 3 * sum(ns[-4:]) != 2 * sum(ns[:4]): continue # [exactly] 2 ages are the same as the date if sum(x == y for (x, y) in zip(ds, ns)) != 2: continue # the sum of the years of birth of the first three is the same as # the sum of the years of birth of the last three ys = list(1962 - x for x in ns[:5]) + list(1961 - x for x in ns[5:]) if sum(ys[:3]) != sum(ys[-3:]): continue # find the 2 grandchildren that share a birthday i = ss.index(0) # neither can be John if i == 3 or i == 4: continue # the ages must differ by 2 if abs(ns[i] - ns[i + 1]) != 2: continue # output solution for (d, n, y) in zip(ds, ns, ys): printf("{d:02d} June {y} -> age = {n}{s}", s=(' [*** SOLUTION ***]' if y == 1954 else '')) printf()Solution: The birthday of the grandchild born in 1954 is 11th June.
The dates of birth and ages are:
The program prints two solutions because the granddaughters born on 28th June could appear in either order.
LikeLike
Frits 3:09 pm on 29 June 2022 Permalink |
LikeLike