Two families lived next door to each other —the Abramowitzs and the Bernhardts. The total ages of the four members of the Abramowitz family amounted to one hundred years, and the total ages of the four members of the Bernhardt family also amounted to the same.
It was found in the case of each family that the sum obtained by adding the squares of each of the children's ages to the square of the mother's age equaled the square of the father's age. In the case of the Abramowitz family, however, Emmylou was one year older than her brother Eric, whereas Francine Bernhardt was two years older than her brother Frank.
What was the age of each of the eight individuals?
CLS
PRINT " f", " m", " c1", " c2": PRINT
FOR f = 15 TO 85
FOR m = 15 TO 100  f
t = 100  f  m
FOR c1 = 0 TO t
c2 = t  c1
IF c2 >= c1 THEN
fs = f * f
ms = m * m
c1s = c1 * c1: c2s = c2 * c2
IF c1s + c2s + ms = fs THEN
PRINT f, m, c1, c2
END IF
END IF
NEXT
NEXT
NEXT
finds
f m c1 c2
38 20 12 30
38 30 12 20
39 34 13 14
42 40 8 10
50 50 0 0
as the possible family ages (without having filtered out some physical impossibilities).
Only the third set could apply to the Abramowitzes and the fourth to the Bernhardts.
So Mr. Abramowitz was 39 and Mrs. Abramowitz 34, with Eric 13 and Emmylou 14. Mr. Bernhardt was 42 and his wife 40, with Francine and Frank being 10 and 8 respectively.

Posted by Charlie
on 20060621 09:39:34 