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) homeowner opens. The agent introduces themselves and asks the homeowner if they have any children. The homeowner answers that they have three. When the agent then asks their ages (which for this problem we abstract to integers), the homeowner hesitates. They decide to give the agent some information about their ages, saying "the product of their ages is 36". The agent asks for more information and the homeowner gives in, saying "the sum of their ages is equal to our neighbors' house number". The agent jumps over the fence, inspects the house number, and then returns. "You need to give me another hint", they beg. "Alright", they say, "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, they 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, they realize 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\}.$