MathLabs

Problem 5

Larry and Rob are two robots travelling in one car from Argovia to Zillis. Both robots have control over the steering and steer according to this algorithm: Larry makes a 90° left turn after every ℓ\ell kilometer driving from the start; Rob makes a 90° right turn after every rr kilometer driving from the start, where ℓ\ell and rr are relatively prime positive integers. If both turns occur simultaneously, the car keeps going without changing direction. Assume the ground is flat and the car can move in any direction. The car starts from Argovia facing towards Zillis. For which pairs (ℓ,r)(\ell,r) is the car guaranteed to reach Zillis, regardless of how far it is from Argovia?
Step 1 of 6: Divide the journey into sections
one section=ℓr km,Δθ≡ℓ−r(mod4)\text{one section}=\ell r\text{ km},\quad \Delta\theta\equiv\ell-r\pmod4
Detailed analysis

Consider successive sections of ℓr\ell r kilometers. In one section there are r−1r-1 left turns and ℓ−1\ell-1 right turns; simultaneous turns at the endpoint cancel. Thus the net rotation is determined by ℓ−r\ell-r modulo 44, and the behavior repeats with a changed initial direction.