Bloomberg LP Interview Question
Financial Software Developersproblem 1: the only chance of no collision is that all ants walk in clockwise or counter-clockwise way, therefore, the probability of no collision is (1/2)^3*2 = 1/4.
problem 2: step 1, divide them into 3 groups each with 3 balls. Weigh any two of them. If equal, then the 9th is in the 3rd group; otherwise weigh one of the two and the 3rd group to decide which group the 3rd is in. At the same time, we can know whether the 9th ball is lighter or heavier. The total number of weighing is 2 in this step; Step 2, divide the group in which the 9th is in into 3. Pick any two of them to weigh. If equal, the third one is the 9th ball. Otherwise, pick up the lighter/heavier one as the 9th ball. (The information of being lighter or heavier has been got in the first step.) Therefore, we need totally 3 weighings.
Problem3: Cut the cube apart and put them in a 2-dim surface. Draw a line connecting the two vertex. That line is the shortest.
Ans: 3/2
Let ants be at vertices A, B and C
Sample space = { ABA, ABC, ACA, ACB, BAB, BAC, BCA, BCB, CAB, CAC, CBA, CBC } where each event has probability 1/4
Events of interest where ants collide = {ABA, ACA, BAB, BCB, CAC, CBC }
Hence probability of ants colliding = 6*(1/4) = 3/2
Does one agree with this ?
Event ABA implies as ant A moves towards B and B move towards A, which results in collision
Every Ant can move in 2 possible directions , backward and forward ( B or F ) , so the whole sample space consists of 8 choices, out of which 2 , namely BBB and FFF are no collision choices. so probability of not colliding is 2 /8 = 1/4.
- seeker7 June 29, 2010F F B
F F F
F B B
F B F
B F B
B F F
B B B
B B F