Difference between malloc, calloc, free and realloc functions
October 18, 2012
comma operator
October 19, 2012

Ages of three children

A lady has 3 daughters, A man visited their house and asked the ages of her three daughters. The lady started giving him clues:

Lady: Product of their ages (ages of her 3 daughters) is 72.
Man did some calculations and says: The clue is insufficient to determine the ages.
Lady: Ok, let me give you secong clue, Sum of their ages is equal to our house number.
Man saw the house number on the number plat, did some calculations and says: Even this clue is insufficient to determine the ages.
Lady: My eldest daughter is hungry and I have to cook for her.

Hearing this, the man was able to find the correct ages of her three daughters. What are the ages, and what is the house number of the lady ?

Solution:

Let us consider the situation after each clue.

After 1’st clue

Since the product of ages is 72 possible ages are of three kids are (along with the sum):

   Ages          Sum
-----------     -----
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

Obviously, the man was not able to answer the ages, because he cannon choose one option over another.

After 2’nd clue

Then the lady gave the 2nd clue, “Sum of their ages is equal to my house number” .

The man knows the house number (he saw it). but man was not able to answer the ages. It means, the house number was not giving him a unique combination of ages.

Which means the house number is 14, because in all other cases the house number is unique, For example, If the house number is, say 74, man can answer directly that ages are 1, 6 & 12.

Hence, Options with man are

   Ages          Sum
-----------     -----
2   6   6        14
3   3   8        14

And he is still not able to get the correct ages. Hence he said, even this clue is insufficient.

3’rd Clue

Third clue is not explicit. The lady said, “my ELDEST daughter is hungry.

If the ages are 2, 6 and 6 then there is no ‘ELDEST’ (elder daughters are twins, and not one). The answer has to be 3, 3, and 8.

Hence the ages are 3, 3, & 8 and house number is 14.

Leave a Reply

Your email address will not be published. Required fields are marked *