Sunday, December 20, 2009

solve it as fast as you can.........

in a group of 200 people, everybody has a non burning candle. One person has a matchstick so that he can light his candle. With this candle he walks to somebody else and lights a new candle. Then everybody with a burning candle will look for somebody without a burning candle, and if found they will light it. This will continue until all candles are lit. Suppose that from the moment a candle is lit it takes exactly 30 seconds to find a person with a non burning candle and light that candle. From the moment the first candle is lit, how long does it take before all candles are lit?

4 comments:

  1. Well, at the second step, I mean like at t = 30 seconds, we have 2 burning candles, then can we say that at t = 60 seconds, we ll have 4 burning candles (I mean will the two people be able to find two distinct people with non-burning candles in 30 seconds) ?

    If this is the case, then clearly the number of burning candles keeps doubling at every 30 seconds, so the answer is ceil(log(200)/log(2))*30

    ReplyDelete
  2. well.. @ Jatin, your answer cannot be right as the number of seconds cannot be fractional. Cause they find people at end of 30 seconds. I am assuming that lighting a candle takes no time as it is not mentioned in the question.

    So, after
    1 round v hv 2 = 2^1 people,time elapsed- 30*1
    2 round v hv 4 = 2^2 people,time elapsed - 30*2

    ......
    7 rounds v hv 128 =2^7 people, time=30*7
    8th round would involve only 72 people working but each takes 30 sec... making it 30*7+30=240 sec.

    So my answer would be 240 seconds.

    ReplyDelete
  3. crazytime seems to be more accurate and practical

    ReplyDelete