My oldest plays the piano!
Two old friends, Ernie and Bernie, bump into each other in the street. It was more than twenty years since their last meeting, so they decide to spend some time together in a nearby bar, chatting about their lives. At some point, Bernie asks the inevitable: “So, you got married?”
“Well, yes!”—claims enthusiastically Ernie. “And I have three beautiful children!”
“That’s great, Ernie! And how old are your kids?”—enquired Bernie.
“I know you are a sucker for puzzles, Bernie, so I will let you figure it out through a few clues. You should not have any trouble getting it. First clue: If you add the ages of my kids, the result is thirteen“
“Whoa! That doesn’t help me much, does it?”—complains Bernie. “Couldn’t you give me another clue?”
“Sure, a second clue: If you multiply their ages together, the result is the same as how much we payed for these beers”
Bernie scratches his head for a minute, and cannot figure it out yet… Before he complains again, Ernie realizes the mistake, apologizes, and offers Bernie the last clue: “My oldest plays the piano!”
Bernie had no trouble finding the ages of the children this time.
These are all the possible combinations of positive integers , , that add up to thirteen, together with their product:
Notice that there are only two combinations that offer the same product: and . The fact that Bernie did not know the answer to the riddle after the second clue, indicates that none of the other possibilities is right. He thus needs a third clue to decide between the two choices above.
I would not think of stealing the pleasure to solve the puzzle to my reader. What are the ages of Ernie’s children?
With the aid of WolframAlpha, one should be able to find quickly all the intermediate steps to the solution. One must be careful, nevertheless, to input the right expressions. For example, the reaction of WolframAlpha to the query “all integer solutions to a+b+c=13 && a>0 && b>0 && c>0 && a<14 && b<14 && c<14” offers only one (insufficient) possibility:
A better way to go about it is, for example, to generate the solutions in python. A possible script to obtain the solutions would look like this: