On Nov 26, Jeff 'japhy' Pinyan said: >>Mr.Foo: What's the age of your children Mr. Bar? >>Mr.Bar: I have 3 children, the multiplication of their ages is 36. >>Mr.Foo: This doesn't help very much. >>Mr.Bar: Well if you add their 3 ages, you get the number fo windows in >>my house. >>Mr.Foo: I know how many windows there are in your house, but that >>doesn't tell me the age of your children. >>Mr.Bar: The oldest have blue eyes. >>Mr.Bar: Ahhhh, now I know > >Sets of three numbers that multiply to 36: > 1 * 1 * 36 > 1 * 2 * 18 > 1 * 3 * 12 > 1 * 4 * 9 > 1 * 6 * 6 > 2 * 2 * 9 > 2 * 3 * 6 > 3 * 3 * 4
I'm sorry, I left out the sums. Mr. Foo says he knows how many windows there are, but it's not enough to figure out the answer. That means it must be a triplet whose sum is not unique. KID 1 KID 2 KID 3 SUM 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 Of the two sets (1,6,6) and (2,2,9), we then use the logic below: >"The oldest have blue eyes." That statement, assuming there's no messed >up grammar, indicates that the oldest are TWO OR MORE persons. If it said >"the oldest has blue eyes", then there could only be one person with the >highest age; but since it says "the oldest have blue eyes", that means >that more than one person has the highest age. The combination is >(1,6,6). -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]