Two trains enter at the opposite sides of a tunnel of length L with speeds 'V'. A particle enters the tunnel at the same time with a speed 'v' and it vibrates in the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the position of the particle by the time the 2 trains meet?
Donno :D :D
if x is the distance from its entering point and d the distance the particle travelled until the trains meet given by \[d=v*L/(2V)\] then the formula \[x=(d) \mod (2L) - ( ( (d) \mod (2L) - (d) \mod (L) ) / L * ( 2* (d) \mod (2L) - 2L)\] should work. Explanation: \[d=v*L/(2V)\] should be quite obvius as L/(2V) is the time until both trains meet (as they meet in the middle of the tunnel and so need to cross half of the tunnel length and the particle "flies" this time at constant speed v. Now it gets interesting, as we dont want the distance it travelled but its position in the tunnel. We arent interested in the cases were it completly passed the tunnel from entrance to end and back, so we just look at the distance it travelled in the current "round". For this we use the modulo operator:\[(d) \mod (2L)\] gives us this distance. Now we have a value between 0 and 2L. if its between 0 and L we're happy, the particle is on the way from entrance to end and we have the solution. But what if the particle is on its way back? In this case we would have to subtract its distance >L (the distance it travelled backwards) from L to get its position. So, when do we have that case? Again, the modulo operator helps: \[((d) \mod (2L) - (d) \mod(L)) / L\] If d mod 2L is <= L then d mod 2L equals d dmod L so we get a 0 out of this equation and nothing happens. If it is > L then d mod 2L - d mod 2L equals L so we get a 1 out of the equation. Now we have the possibility to do something just when the particle is on its way back to the entrance. Nice, isnt it? (I hope theres a more beautiful solution, but this one works ;-) ) Now the final part of our equation \[-2* (d) \mod (2L) + 2L\] deals with the case of the particle being on the way back. it takes the overall distance of one "round" (2L) and subtracts the distance travelled in this round (d mod 2L). It subtracts it 2 times just to eliminate the first part of the equation where we added it one times ;-) Well, not exactly beautiful, but it works ;-)
ya Thanks Ente. for a good and brief explanation. get the medal......
Join our real-time social learning platform and learn together with your friends!