Interview Question
Software Engineer / DevelopersIdea is simple (remember probabilities theory).
All area where they can meet is 1hx1h.
They can meet on condition |Ta-Tb|<=10.
This gives us 2 equations: Tb=Ta-10 and Tb=Ta+10.
Now draw it on the plot Tb vs. Ta (will get 2 lines) and limit with 1hx1h area. Area between those two lines divided by all 1hx1h area is probability.
Result: 1-2*(5/6*5/6/2)=11/36.
0.1666
- chennavarri October 19, 2010The first question is how many times will they try to meet / go to the common point?
second, what is the travel time?
Anyways here's a hypothesis, assume travel time = 0 and number of times they travel = 1
Consider a different perspective of the problem,
given two bulbs A and B, in a 1 hr window how many times are both bulbs on? Given if a bulb goes on then it stays on for 10 minutes.
If A goes ON at t=1, both are ON if B goes ON anytime between t=1:10 and since we assumed bulb goes ON only once, for all t=11:60 it the condition fails.
So probability = 10/60 = 0.166
Any ideas? maybe conditional probability is used??