Brain-Teaser 190: Towns and families
From The Sunday Times, 13th December 1964 [link]
Cardiff and London share a line of latitude; Cardiff and Edinburgh share a line of longitude.
The Archers, the Brewers, the Carters and the Drews are four married couples born and married in London, Cardiff, Edinburgh and Belfast. One of each sex was born in each city; one marriage took place in each city. No one was married in the city of his or her birth. Mrs Archer was the only woman married east of where she was born; Mr Archer was the only man married south of where he was born; Mr Brewer was the only man to marry a woman born north of him. Mr Carter and Mrs Drew were twins.
Where were the Carters married?
This puzzle is included in the book Sunday Times Brain Teasers (1974).
[teaser190]





Jim Randell 8:18 am on 9 October 2022 Permalink |
This Python program tries all possible arrangements.
It runs in 55ms. (Internal runtime is 790µs).
Run: [ @replit ]
from enigma import (subsets, printf) # Belfast, Cardiff, Edinburgh, London cities = "BCEL" # assign North and East values (approximate latitude and longitude) N = dict(C=51.5, L=51.5, B=54.6, E=56.0) E = dict(B=-5.9, C=-3.2, E=-3.2, L=-0.1) # choose cities of birth for the men for (mA, mB, mC, mD) in subsets(cities, size=len, select="P"): # choose cities of birth for the women for (fA, fB, fC, fD) in subsets(cities, size=len, select="P"): # "Mr C and Mrs D were twins" (presumably born in the same place) if not (mC == fD): continue # "Mr B was the only man to marry a woman born N of him" if not (N[fB] > N[mB]): continue if any(N[f] > N[m] for (m, f) in zip((mA, mC, mD), (fA, fC, fD))): continue # choose cities for marriages for (wA, wB, wC, wD) in subsets(cities, size=len, select="P"): # no-one was married in the city of their birth if any(w == m or w == f for (m, f, w) in zip((mA, mB, mC, mD), (fA, fB, fC, fD), (wA, wB, wC, wD))): continue # "Mrs A is the only woman married east of her birth" if not (E[wA] > E[fA]): continue if any(E[w] > E[f] for (f, w) in zip((fB, fC, fD), (wB, wC, wD))): continue # "Mr A is the only man married south of his birth" if not (N[mA] > N[wA]): continue if any(N[m] > N[w] for (m, w) in zip((mB, mC, mD), (wB, wC, wD))): continue printf(" A B C D") printf("husband = {mA} {mB} {mC} {mD}") printf("wife = {fA} {fB} {fC} {fD}") printf("wedding = {wA} {wB} {wC} {wD}") printf()Solution: The Carters were married in Belfast.
The full solution is:
LikeLike