Two MIT math grads bump into each other at Fairway on the upper west side. They haven’t seen each other in over 20 years.
the first grad says to the second: “how have you been?”
second: “great! i got married and i have three daughters now”
first: “really? how old are they?”
second: “well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
first: “right, ok.. oh wait.. hmm, i still don’t know”
second: “oh sorry, the oldest one just started to play the piano”
first: “wonderful! my oldest is the same age!”
problem: how old are the daughters?
Solution
solution: start with what you know. you know there are 3 daughters whose ages multiply to 72. let’s look at the possibilities…
Ages: Sum of ages:
1 1 72 74
1 2 36 39
1 3 24 28
1 4 18 23
1 6 12 19
1 8 9 18
2 2 18 22
2 3 12 17
2 4 9 15
2 6 6 14
3 3 8 14
3 4 6 13
after looking at the building number the man still can’t figure out what their ages are (we’re assuming since he’s an MIT math grad, he can factor 72 and add up the sums), so the building number must be 14, since that is the only sum that has more than one possibility.
finally the man discovers that there is an oldest daughter. that rules out the “2 6 6” possibility since the two oldest would be twins. therefore, the daughters ages must be “3 3 8”.
(caveat: an astute reader pointed out that it is possible for two siblings to have the same age but not be twins, for instance one is born in january, and the next is conceived right away and delivered in october. next october both siblings will be one year old. if a candidate points this out, extra credit points to him/her.)
this question is pretty neat, although there is certainly a bit of an aha factor to it. the clues are given in such a way that you think you are missing information (the building number), but whats important isn’t the building number, but the fact that the first man thought that it was enough information, but actually wasn’t.
even if the candidate doesn’t know the solution, they could come up with some interesting thoughts. if they just stare at you and shrug “i dunno” then thank them for their time and don’t give them a fogcreek pen.
credit to david for reminding me of this one
2026 Update: Mathematical Reasoning and Constraint Narrowing
The Daughters’ Ages puzzle is a classic mathematical brain teaser: a census taker learns that a man has three daughters, whose ages multiply to 36, sum to the house number (which the taker can see), and the oldest likes chocolate. The census taker is stumped by the sum alone but the “oldest daughter” clue resolves it — meaning the sum must correspond to multiple factorizations of 36, and the tiebreaker is that there’s a unique oldest (no twins at the top).
Solving it systematically:
from itertools import product
def daughters_ages_puzzle(product_val=36):
"""Find all age triples and identify ambiguous sums."""
from collections import defaultdict
# Find all triples (a, b, c) with a<=b= b:
triples.append((a, b, c))
# Group by sum
by_sum = defaultdict(list)
for triple in triples:
by_sum[sum(triple)].append(triple)
# The sum is ambiguous (census taker can't determine from sum alone)
ambiguous = {s: ts for s, ts in by_sum.items() if len(ts) > 1}
print("Ambiguous sums:", ambiguous)
# Tiebreaker: "oldest daughter" means unique maximum age (no tie at top)
for s, ts in ambiguous.items():
resolved = [t for t in ts if t.count(t[-1]) == 1] # Unique oldest
if len(resolved) == 1:
print(f"Answer: {resolved[0]} (sum={s})")
daughters_ages_puzzle(36)
Output: The ambiguous sum is 13, with triples (1,6,6) and (2,2,9). The “oldest likes chocolate” (unique oldest child) rules out (1,6,6) — leaving ages 2, 2, 9.
Why this pattern appears in software engineering: Constraint propagation — eliminating possibilities one clue at a time — is the core of Sudoku solvers, SAT solvers, and constraint satisfaction in compiler register allocation. The puzzle is a tiny CSP instance.