The problem of Tom and Jerry

Tom, the angry cat, is again searching for Jerry, the prankster mouse. The story goes as follows. Consider the real line R \mathbb{R} , extending from -\infty to + +\infty . 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 J J 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 α J \alpha J units, for some constant α 0 \alpha \geq 0 . Find the minimum value of α \alpha .

9 7 1 2 12 10

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.

1 solution

Abhishek Sinha
Nov 3, 2016

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 \alpha=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 2\times 2^{n-1} units at round n , n 1 n, n \geq 1 alternatingly on each side of the origin. Suppose Jerry is hiding at a distance J J from the origin. Then, there must exist two consecutive powers of 2 2 such that 2 k < J 2 k + 1 2^{k} < J \leq 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 T= 2\sum_{n=1}^{k+2}2^{n-1} + J \leq 8\times 2^{k}+J Hence, T J 8 2 k J + 1 9. \frac{T}{J} \leq 8\frac{2^k}{J} +1 \leq 9. \hspace{10pt} \blacksquare

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 7 J . Do you see why?

(3) What if instead of the x x -axis only, Jerry could also hide somewhere on the y y -axis too. What would be the minimum α \alpha in that case?

(4) What if Jerry could hide anywhere on a d d -dimensional integer lattice ?

Btw, any particular reason why choose 2 as base of the exponential? Why it's not 3,etc. Nice problem, btw.

Muhammad Reza - 4 years, 5 months ago

From where can i learn about algorithms ?Thanks.

Harsh Shrivastava - 4 years, 7 months ago

Log in to reply

Hi Harsh, you may check out MIT OCW materials : Introductory algorithms , Advanced algorithms .

Abhishek Sinha - 4 years, 7 months ago

Why can't we make Tom run J along the positive part, and make him turn back to the origin and along the negative part to -J, making the distance 3J?

Loppukilpailija - 4 years, 7 months ago

Log in to reply

We don't know J J beforehand. That's precisely the point of the problem.

Abhishek Sinha - 4 years, 7 months ago

Log in to reply

Yes same here reading the problem feels like we know J you should state it clearly.

Sahil Goyat - 5 months, 3 weeks ago

I think you need to tell it. I agree with @Loppukilpailija

Muhammad Reza - 4 years, 5 months ago

If Jerry hides behind the point -0.01, this strategy won't work. since α \alpha is then more than 100.

Abdelhamid Saadi - 4 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...