Source

I got this problem from Rustan Leino, who got it from the book *In code: a
mathematical journey *by Sarah Flannery and David Flannery.

I solved it and wrote up my solution.

Problem

A (presumed smart) insurance agent knocks on a door and a (presumed smart) woman opens. He introduces himself and asks if she has any children. She answers: 3. When he then asks their ages (which for this problem we abstract to integers), she hesitates. Then she decides to give him some information about their ages, saying "the product of their ages is 36". He asks for more information and she gives in, saying "the sum of their ages is equal to our neighbors' house number". The man jumps over the fence, inspects the house number, and then returns. "You need to give me another hint", he begs. "Alright", she says, "my oldest child plays the piano". What are the ages of the children?

Solution
Reveal

The ages of the children are 2, 2, and 9.

The reason is as follows. When the insurance agent learns that the product of the ages is 36, he can reason that their ages must be $\{1, 1, 36\},$ $\{1, 2, 18\},$ $\{1, 3, 12\},$ $\{1, 4, 9\},$ $\{1, 6, 6\},$ $\{2, 2, 9\},$ $\{2, 3, 6\},$ or $\{3, 3, 4\}.$ The corresponding age sums are 38, 21, 16, 14, 13, 13, 11, and 10. Since the agent can't figure out the ages, the sum must not uniquely determine the ages, so the sum must be 13. Once the agent hears that the oldest child plays the piano, he realizes that there must be a unique oldest child, so the ages can't be $\{1, 6, 6\}.$ Thus, the only possibility that remains is $\{2, 2, 9\}.$