# How old are Charlie's pets?

Last year at a picnic, Charlie told Julie's daughter the sum and the product of the ages of his dog and two cats, but she guessed the ages incorrectly. This year, he gave Steve's daughter the same information, but she guessed the ages incorrectly as well. If the sum is between 20 and 30, what are the ages of Charlie's pets?

• is only the sum of the current year between 20 and 30 or also the sum of the last year? is it possible for the animals to be younger than 1 year (in the last year)? is the solution without these extra conditions also unique? – Bernd Wilke πφ May 22 '18 at 7:28
• Being pedantic, trivially, no matter what ages they are, she could have guessed the ages incorrectly by swapping the dog's age with one of the cats. But I presume you mean work out the ages, but not assigned to a particular animal. (Also, was Julie's daughter banned from this year's picnic for getting the answer wrong last year? Seems harsh!) – Mohirl May 24 '18 at 9:53
• Has a correct answer been given? If so, please don't forget to $\color{green}{\checkmark \small\text{Accept}}$ it :) – Rubio May 25 '18 at 7:26

## 2 Answers

Their ages are

$5$, $7$, and $16$.

Explanation:

Last year they were $4$, $6$, and $15$. Their sum was $25$ and their product was $360$, but Julie's daughter incorrectly guessed their ages as $3$, $10$, and $12$. This year, their sum is $28$ and their product is $560$, but Steve's daughter incorrectly guessed their ages as $4$, $10$, and $14$.

• I can identify multiple conditions, but I can't resolve one condition (except a very long list): the sum and product must have mutiple solutions in each year. how can I identify all(!) this combinations and is there only one combination, that resolves the additional condition about the one year older relation? – Bernd Wilke πφ May 22 '18 at 7:23
• @BerndWilkeπφ Sorry, I don't quite understand what you mean. If you have the list of triples that share a sum and product with another triple, then you just have to find the pair of these triples that differ by exactly one in each coordinate. – noedne May 22 '18 at 7:42
• @noedne Not everything adds up in your answer. On the second year, the girl has 4 informations : the sum of their age on both year, and the product of their age on both year. Let's say you are correct. So she knows the product of their age was 360 on the first year. If she thinks they are 4, 10 and 14 on the second year, they would have been 3, 9 and 13 on the first year, wich gives a product of 351, not 360. So she wouldn't make that guess. – Dorian Fusco May 24 '18 at 10:16
• @DorianFusco There are two girls. – noedne May 24 '18 at 10:21
• Oh, my bad, I thought it was the same girl. Here, take my upvote ^^' – Dorian Fusco May 24 '18 at 10:27

There are 371 age combos that sums up to between 20 and 30 in the first year, and again the next year. Most are unique combo, meaning that as soon as you tell the kid the (sum, product) pair, the kid can guess it right because there is just one combo. For example, if the pair is (20, 18), you immediately know the ages are (1, 1, 18).

Out of the 371 combos, just 26 of those are non-unique pairs. They (age1, age2, age3, sum_year1, product_year1, sum_year2, product_year_2) are:

[(4, 8, 15, 27, 480, 30, 720),
(5, 6, 16, 27, 480, 30, 714),
(1, 9, 10, 20, 90, 23, 220),
(2, 3, 15, 20, 90, 23, 192),
(2, 9, 15, 26, 270, 29, 480),
(3, 5, 18, 26, 270, 29, 456),
(1, 8, 12, 21, 96, 24, 234),
(2, 3, 16, 21, 96, 24, 204),
(2, 12, 12, 26, 288, 29, 507),
(4, 4, 18, 26, 288, 29, 475),
(2, 10, 12, 24, 240, 27, 429),
(3, 5, 16, 24, 240, 27, 408),
(4, 9, 10, 23, 360, 26, 550),
(5, 6, 12, 23, 360, 26, 546),
(2, 7, 12, 21, 168, 24, 312),
(3, 4, 14, 21, 168, 24, 300),
(1, 7, 18, 26, 126, 29, 304),
(2, 3, 21, 26, 126, 29, 264),
(5, 8, 9, 22, 360, 25, 540),
(6, 6, 10, 22, 360, 25, 539),
(3, 8, 10, 21, 240, 24, 396),
(4, 5, 12, 21, 240, 24, 390),
(1, 12, 14, 27, 168, 30, 390),
(2, 4, 21, 27, 168, 30, 330),
(3, 10, 12, 25, 360, 28, 572),
(4, 6, 15, 25, 360, 28, 560)]


In the second year, there are 34 non-unique ones:

[(3, 7, 14, 24, 294, 27, 480),
(4, 5, 15, 24, 300, 27, 480),
(1, 8, 14, 23, 112, 26, 270),
(2, 4, 17, 23, 136, 26, 270),
(1, 11, 14, 26, 154, 29, 360),
(2, 5, 19, 26, 190, 29, 360),
(2, 8, 15, 25, 240, 28, 432),
(3, 5, 17, 25, 255, 28, 432),
(3, 9, 13, 25, 351, 28, 560),
(4, 6, 15, 25, 360, 28, 560),
(1, 11, 11, 23, 121, 26, 288),
(3, 3, 17, 23, 153, 26, 288),
(1, 9, 11, 21, 99, 24, 240),
(2, 4, 15, 21, 120, 24, 240),
(3, 8, 9, 20, 216, 23, 360),
(4, 5, 11, 20, 220, 23, 360),
(4, 8, 13, 25, 416, 28, 630),
(5, 6, 14, 25, 420, 28, 630),
(5, 9, 13, 27, 585, 30, 840),
(6, 7, 14, 27, 588, 30, 840),
(2, 9, 14, 25, 252, 28, 450),
(4, 4, 17, 25, 272, 28, 450),
(2, 11, 13, 26, 286, 29, 504),
(3, 6, 17, 26, 306, 29, 504),
(1, 9, 15, 25, 135, 28, 320),
(3, 3, 19, 25, 171, 28, 320),
(2, 6, 19, 27, 228, 30, 420),
(3, 4, 20, 27, 240, 30, 420),
(2, 9, 11, 22, 198, 25, 360),
(3, 5, 14, 22, 210, 25, 360),
(3, 11, 11, 25, 363, 28, 576),
(5, 5, 15, 25, 375, 28, 576),
(4, 11, 11, 26, 484, 29, 720),
(5, 7, 14, 26, 490, 29, 720)]


By comparing the two lists, you can see that only one age combo, which is in the first list, and again appear in the second list. It's (4, 6, 15, 25, 360, 28, 560).

• This assumes that no pet is aged 0 in the first year, if you include pets aged 0 there are actually 4 answers – lPlant Jun 7 '18 at 16:31