# ..MindWrite..

• 27,094
• ## Author over at this website on Interesting read about Interne… Gmail Inbox Tabs and… on Malkovich Bias guptaradhesh on Yahoo acquires Tumblr! Great…

# Posts Tagged ‘puzzle’

## For a 3 sets tennis game, would you bet on it finishing in 2 sets or 3 sets?

Posted by guptaradhesh on September 19, 2012

This question was asked to a friend of mine as a part of interview process for DE Shaw & Co. I liked the question. Pretty basic probability question to test ones thinking process.

My two cents:

If the two players have equal probability of winning, the chance that the game will finish in 2 sets or 3 sets is same.

If one of the players is better then other, the chances of game finishing in 2 sets is more then chances of game finishing in 3 sets.

Say, p is probability of Player A winning a set ; q is the probability of Player B winning a set

and lets assume p > q

If game ends in 2 sets => Player A wins first two games or player B wins first two games;  P1 = p*p + q*q

If game ends in 3 sets => Player A and B win first or the second game; P2 = p*q + q*p

And we know that,   p^2 + q^2 >= 2 p*q  [with minima when p=q]

## Travelling bird puzzle

Posted by guptaradhesh on October 24, 2010

Two trains start 20 miles apart and head toward each other, each going at a steady speed of 10 m.p.h. At the same time, a bird that travels at a steady 15 m.p.h. starts from the front of the first train and flies to the front of the second one, and then turns around and flies to the front of the first train again, and continues in this manner till the trains meet.

(a)  How much distance will the bird cover before the trains meet?
(b) How many trips will the bird make?
Solution:
This is similar to Microsoft’s famous interview puzzle – One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have traveled?
Part (a)

The relative speed between the two trains is 20 mph. So they meet after 20/20 i.e. 1 hour. The bird would have travelled 15*1=15 miles.

Part (b)

Consider that the trains are ‘x’ miles apart.

The bird takes x(15+10) hours to make a trip. The distance between the trains reduces to x-(10*x/25)*2 = x/5 miles. This means that one trip of the bird reduces the distance between the trains to one-fifth. Given that the trains start 20 miles apart, we can say the distance between the trains after  trips of the bird would be 20/(5^t). Thus we get the total number of trips of the bird as :
The answer, though mathematically logical and valid, is pretty little hard to digest. The problem here assumes that bird takes almost NO time to switch its journey between the trains. Even a small ‘delta’ time consideration of switching would have given finite number of trips.

Posted in puzzles/ algorithms | Tagged: , , | 1 Comment »