OU blog

Personal Blogs

Richard Walker

A classic puzzle from Martin Gardner

Visible to anyone in the world
Edited by Richard Walker, Sunday, 2 Mar 2025, 22:44

This puzzle can be found in many places in the internet but was first published by Martin Gardner in his 'Mathematical Recreations' column in Scientific American. It goes like this (this wording is mine, not the original which I don't have to hand.)

Two mathematicians are sitting outside a café, and one say to the other, “I have three children, and the product of their ages is 36. Can you work out their ages?”

“No”, say the second mathematician, “I don’t have enough information”.

“Then what if I tell you the sum of their ages is equal to the number of that house directly opposite?” the first mathematician replies.

“Still not enough information”, answers the second.

“Well what if I tell you the oldest is called Bill?”, say the first.

“Aha, now I know the ages!” says the second mathematician.

1. Can YOU work out what the ages are? (Solution appears further down.)

2. Can you find a number different for 36 but which would still let the second mathematician deduce the ages if they knew the sum of the ages and the fact that the oldest child is called Bill?



PS The second triple is wrong see comments.

Permalink
Share post

Comments

Steven McDonald

New comment

Still working on part 2 of your question, but I think there is a mistake in your solution to part 1. multirelation sum with 3 summands one plus four plus nine equals 14 not equals 13 , so the answer should instead be 2, 2, 9.
Steven McDonald

New comment

To find another number, we can look at what makes the prime factorisation of 36 special. 36 factorises into primes as 36 equals two squared multiplication three squared , and the two factorisations with identical sums are left parenthesis two comma two comma three squared right parenthesis and left parenthesis one comma two multiplication three comma two multiplication three right parenthesis . So we can look for another number with prime factorisation p squared times q squared , for primes p and q that satisfy two times p plus q squared equals one plus two times p times q .

This is where I got lazy, and created a numpy array in Python to find such pairs of prime numbers. I have included the relevant part of my Python session below, but the result is that other than two squared multiplication three squared equals 36 , candidate numbers are three squared multiplication five squared equals 225 and seven squared multiplication 13 squared equals 8281 .

Going through the possible ages of children for these numbers verifies that they each have a single pair of solutions with the same sum, only one having a unique highest age. In the case of 225 we have (1, 15, 15) and (3, 3, 25), both with sum 31, and for 8281 we have (1, 91, 91), (7, 7, 169), both with sum 183. (We may have to assume at this point that the conversation is taking place in the world of Genesis.)

So we have both 225 and 8281 as answers to your second question.

>>> import numpy as np
>>> def test(p,q):
...     return(1+2*p*q==2*p+q**2)
... 
>>> p = np.array([2,3,5,7,11,13,17,19,23])
>>> q = np.array([2,3,5,7,11,13,17,19,23])
>>> test(p[:,np.newaxis], q[np.newaxis,:])
array([[False,  True, False, False, False, False, False, False, False],
       [False, False,  True, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False,  True, False, False, False],
       [False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False],
       [False, False, False, False, False, False, False, False, False]])
>>> test(2,3)
True
>>> test(3,5)
True
>>> test(7,13)
True
Richard Walker

New comment

D'oh! It should indeed be 2,2,9 not 1,4,9.

Not sure where 1,4,9 came from!

Richard Walker

New comment

I think the next number that could replace 36 in the puzzle ie 72. The ways of breaking 72 into three factors are

  1. (1,1,72): 1+1+72=74

  2. (1,2,36): 1+2+36=39

  3. (1,3,24): 1+3+24=28

  4. (1,4,18): 1+4+18=23

  5. (1,6,12): 1+6+12=19

  6. (1,8,9): 1+8+9=18

  7. (2,2,18): 2+2+18=22

  8. (2,3,12): 2+3+12=17

  9. (2,4,9): 2+4+9=15

  10. (2,6,6): 2+6+6=14

  11. (3,3,8): 3+3+8=14

  12. (3,4,6): 3+4+6=13

(Feeling lazy, I had DeepSeek work this our for me!)

The only sum that appears twice is 14, so that can be the house number, and only 3,3,8 gives an oldest child, so 3,3,8 would be the solution.