Meeting Of 2 People On a circular track

Two persons are running on a circular track either in the same direction or in the opposite direction, indefinitely.

The speed of both of them is given to you.

Speed will be positive in clockwise direction, and negative in anticlockwise direction.

Calculate the number of distinct points, at which they will meet on the circle

For example, if the speed are 1, 2 then the number of distinct points are 1 and if the speeds are 1, ?1, then number of distinct points are 2.

Assume the speeds to be x and y. I need a general solution.
1 Like

first let us assume that both x and y are positive.

let both of them start from the same point. 
they again meet after the slower one (let x be the slower one) has travelled an angle ?. the faster y has travelled ? + 2pi.

 ?/x = (? + 360)/y


solve for ?. 
now take multiples of ? and check if they are divisible by 360. The smallest k such that 
?*k % 360 == 0 will be the number of times they meet.
eg. if ? comes out to be 60. they meet 6 times.


note that there will be infinite meeting spots if x/y is irrational :-)

1 Like

See this :http://apps.topcoder.com/forums/?module=Thread&threadID=750585&start=0

1 Like