Technical Interview

Tips, questions, answers and puzzles at
www.technical-interview.com

Thursday, February 8, 2007

Two MIT math graduates bump into each other. They hadn’t seen each

Two MIT math graduates bump into each other. They hadn’t seen each other in over 20 years.
The first grad says to the second: “how have you been?”
Second: “Great! I got married and I have three daughters now”
First: “Really? how old are they?”
Second: “Well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
First: “Right, ok.. oh wait.. I still don’t know”
second: “Oh sorry, the oldest one just started to play the piano”
First: “Wonderful! my oldest is the same age!” Problem: How old are the daughters?

9 comments:

  1. The possible solutions are (12,3,2), (9,4,2), (6,4,3), (9,8,1)
    - The oldest can not be more than 20 years old since the have not seen each other for 20 years.
    - What matters is their product only.
    - The second condition about their sum is not needed.
    - The third one is need, so depending on at what age can a kid play piano, we determine the solutions accordingly. For me I think at age 6, which leaves me with (6,4,3)

    ReplyDelete
  2. The previous solution is wrong. The sum does matter. The mate does not know the correct answer, since there are two possibilities for the given factorization of 72 with the same sum. These factorizations are: 6*6*2 and 8*3*3. Since there is an "oldest" among the 3 girls, the second possibility is the true.

    ReplyDelete
  3. 72 = 1*2*2*2*3*3, which can be grouped into 3 collections in a number of ways. There's no way to tell which is best without the sum. Consider:

    (3,4,6)
    (2,4,9)
    (2,2,18)
    (1,8,9)
    ...

    ReplyDelete
  4. Factor 72 with with all numbers from 1 to 20. 2*36=72 6*12=72 .... to get pairs like (2,36) (6,12) (9,8). now factor each number in the pair till they cannot be factored anymore. like (9,8) to (9,4,2) (3,3,8)(9,8,1). pick an age when one can start playing a piano and select the pair where this number is the ONLY greatest number in the pair.

    ReplyDelete
  5. This is definitely a tricky one. The correct answer is 3,3,8. The reason for this is that by being MIT graduates they represent the cleverest of society and so not only is the one telling the other of his daughters' age a super genius but the one listening it too. So when the second guy hears that the product is 72 and the sum is equal to his house number, he was still unsure about the ages BECAUSE THERE ARE TWO GROUPS OF MULTIPLES EQUAL TO EACH OTHER.
    That would be the 3,3,8 and the 6,6,2. Since there is an eldest, therefore the only suitable solution is 3,3,8. Pretty kool, huh?

    ReplyDelete
  6. The solution is 3,3,8. This is because the second MIT graduate was unsure of the answer even after the clue. Assuming the second guy is a super genius he found out that there were two possible solutions. In other words he was unsure because he found that 3,3,8 and 6,6,2 were two possible solutions that add up to the same number. Since he was unsure he told the first that this was not enough information. Then the first guy gave him another clue that the ELDEST plays piano, indicating that there was an eldest daughter. Therefore the solution is 3,3,8

    ReplyDelete
  7. age can be (4,18,1) (2,2,18) (2,12,3) etc. So consider them too.

    ReplyDelete
  8. Boy, an ancient chestnut. A young Danish women staying at my (then) girlfriend's parent's (later my in-law's) house produced the same problem, except part of the solution depended on the age range of a mother's menstruation.

    ReplyDelete
  9. Step 1: the divisors of 72 is 2, 2, 2, 3, 3, 1(repeatable).

    Step 2: enumerate all possibilities of separating the above divisors into three subsets, while the sum of divisors in any subset is smaller than 20. The answers are:
    {1, 8, 9}, SUM = 18
    {1, 4, 18}, SUM = 23
    {2, 2, 18}, SUM = 22
    {2, 3, 12}, SUM = 17
    {2, 4, 9}, SUM = 15
    {2, 6, 6}, SUM = 14
    {3, 3, 8}, SUM = 14
    {3, 4, 6}, SUM = 13

    Since the second tip doesn't yield the answer, it must be that the building number is 14. Otherwise the friend would have known the ages according to the unique sum.

    Step 3: this reduces the options to
    {2, 6, 6}
    {3, 3, 8}
    You can pick 3, 3, 8 because there is a single largest age. I would just tell the interviewer both options since the "single oldest" is just a tricky wording to me.

    ReplyDelete