Tom, the angry cat, is again searching for Jerry, the prankster mouse. The story goes as follows. Consider the real line , extending from to . A few hours ago, Jerry started out from the origin and after wandering on the line for some time, chose a suitable point for hiding (which may be on the positive or negative axis) and fell asleep there.
Right now, Tom is standing at the origin. He can catch Jerry if and only if he passes through the point where Jerry is hiding. Since Tom does not know where Jerry is hiding, he asks for your help.
Suppose, Jerry has run a total distance of units before he hid. You design an excellent deterministic strategy for Tom, such that he is guaranteed to catch Jerry after running a total distance of at most units, for some constant . Find the minimum value of .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Note that, had we known which half of the real axis (positive or negative) Jerry is hiding, the problem would be trivial; Tom just needs to run along that direction until he catches Jerry. This would give us α = 1 . The difficulty here is that we do not know this information, thus we have to search on both sides of the line.
Call each consecutive visits of Tom to origin a round . Similar to the Binary Search , it can be shown that an optimal strategy is to run exponentially increasing lengths alternatingly on each side at each round, i.e., Tom runs a distance of 2 × 2 n − 1 units at round n , n ≥ 1 alternatingly on each side of the origin. Suppose Jerry is hiding at a distance J from the origin. Then, there must exist two consecutive powers of 2 such that 2 k < J ≤ 2 k + 1 Hence, at the worst case, the total distance run by Tom before he catches Jerry is given by T = 2 n = 1 ∑ k + 2 2 n − 1 + J ≤ 8 × 2 k + J Hence, J T ≤ 8 J 2 k + 1 ≤ 9 . ■
Note
(1) The above algorithm is an example of Online algorithm and the method of analysis is known as Competitive Analysis .
(2) If we had allowed randomized strategy too, the expected distance Tom must run could be reduced to 7 J . Do you see why?
(3) What if instead of the x -axis only, Jerry could also hide somewhere on the y -axis too. What would be the minimum α in that case?
(4) What if Jerry could hide anywhere on a d -dimensional integer lattice ?