October’s Puzzle: Two Mathematicians
Two mathematicians (let’s call them M and N)—once good friends—meet after a long time to have a drink together. M asks, “Are you married? Any kids? Do you still live in that old apartment building?” N replies, “Yes, I'm married with three kids, and we live in a private house now.” M asks, “How old are your kids?” N replies, “Let me answer with a riddle: The product of the ages of my kids is 36. Now, see that bus over there? The sum of my kids' ages is equal to that bus number.” M thinks for a moment, then says, “I don’t have sufficient information to solve the puzzle.” N replies, “Oh, yes, you’re right, I forgot to mention that one of my kids was born before we bought the house.” Soon after N provides this last bit of information, M solved the puzzle and told N the correct ages of the kids. Can you figure out the solution? Also, how would the solution change if N’s additional piece of information was that one of his kids was born after he bought the house?
A good way to start solving this puzzle is to first list all variations of three integers whose product is 36, then calculate their sums:
1 + 1 + 36 = 38
1 + 2 + 18 = 21
1 + 3 + 12 = 16
1 + 4 + 9 = 14
1 + 6 + 6 = 13
2 + 2 + 9 = 13
2 + 3 + 6 = 11
3 + 3 + 4 = 10
M knows the sum of the kids' ages (equal to the number of the bus N pointed to). Notice that all sums are unique except one, which is the sum of two different variations of three integers. Had the bus number been other than 13, M would have immediately known the answer. Because M said that he doesn’t have sufficient information to solve the puzzle, the bus number must have been 13. Now, the question remains, which of the two age variations is the correct one? Notice that in both cases (1, 6, 6 and 2, 2, 9), there are twins. The additional piece of information N provided was, “One of my kids was born before we bought the house.” The implication is that one of the kids is older than the other two, so of the two variations, the correct one is 2, 2, 9. Now, how would the solution change if N’s additional piece of information had been that one of his kids was born after he bought the house? In this case, one of the kids is younger than the other two, so the correct answer would be 1, 6, 6. Interestingly, you can solve this puzzle with a T-SQL query, as Listing A shows. (Download .Zip File)
November’s Puzzle: Crazy Sequence
This month's puzzle (acquired from Marcello Poletti) requires that you determine the next number in the following sequence.