14

In $\mathbb{R}^2$, a wolf is trying to catch two sheep. At time $0$ the wolf's at $(0,0)$ and the sheep are at $(1,0)$. The animals are moving continuously and react instantaneously according to each other's positions. Wolf speed is $1$ and sheep speed is $1/2$. The wolf catches a sheep if their distance is $0$.

The wolf wants to catch the pair of sheep in minimum time. The sheep want to maximize that time.

Question: How does everyone move?


Technical note

To those who find the descriptions above somewhat ambiguous and subject to possible misinterpretations, we can reframe some terms in a more rigorous manner:

  • Continuous movement: we use $w(t)$, $s_1(t)$ and $s_2(t)$ to denote the animals' positions at time $t$. Call the functions $w, s_1, s_2$ the wolf path or the sheep path. They satisfy $$\vert w(t)-w(s)\vert \leq \vert t-s\vert, \vert s_i(t)-s_i(s)\vert \leq \frac{1}{2}\vert t-s\vert, i=1,2, \forall t,s\geq0,$$ with initial conditions: $w(0)=(0,0)$, $s_1(0)=s_2(0)=(1,0)$

  • Instantaneous reaction: intuitively we want each animal's choice of path (strategy) be as free as possible influenced only by the other players paths up to this moment. Let $W$ be the set of all wolf paths and $S_i$ the set of all sheep $i$ paths. Then

    • The wolf's strategy is a function $f_w$ from $S_1\times S_2$ to $W$ such that if $s,s'\in S_1\times S_2$ agree on $[0,t]$, then $f_w(s)$ and $f_w(s')$ also agree on $[0,t]$, $\forall t$.
    • The sheep's strategy is a function $f_{s}$ from $W$ to $S_1\times S_2$ such that if $w, w'\in W$ agree on $[0,t]$, then $f_{s}(w)$ and $f_{s}(w')$ also agree on $[0,t]$, $\forall t$.
Eric
  • 1,909
  • Does the wolf catches the sheep in a whole number of steps? – WindSoul May 09 '23 at 15:02
  • If the animals adjust continuously then the sheep will be both caught at the same time while moving on the same path away from the wolf. The motion has to be discrete or somehow incremental in order to make sense for the sheep to change direction. The only reason the prey changes direction is because it forces the hunter to slow down in order to make a correction course at a speed where it won’t veer off due to centrifugal force. The sheep have to find a way to slow the wolf down, this won’t happen in a uniform motion. – WindSoul May 09 '23 at 15:05
  • 5
    The sheep will choose different paths because their aim is to delay the second sheep's death. I think Sheep 2 will stay the same distance from the wolf as Sheep 1, plus a tiny bit, until it can flee directly away from Sheep 1. Sheep 1 will somehow balance moving away from the wolf and away from Sheep 2. – Empy2 May 09 '23 at 15:24
  • One option that is easy to calculate: Sheep 1 travels in a straight line above the axis, and Sheep 2 travels in a mirror-symmetric line below the axis. The wolf sees that and, instead of going towards Sheep 1, calculates an intercept point and goes straight there. Then Sheep 2 goes directly away from the wolf. The Sine Rule is useful here, plot the total distance as a function of the slope of Sheep 1's path. – Empy2 May 09 '23 at 16:03
  • 3
    A quick upper bound is 8 minutes, since the wolf can catch sheep 1 in two minutes, and at that point the second second sheep is a distance of at most 3 away and so can be caught in six more minutes. – Tyler Seacrest May 09 '23 at 18:24
  • 5
    @Tyler Seacrest. That's a useful comment. However, isn't Sheep 2 at most 2 away at that point? This gives an upper bound of 6 units of time in total. – user1172706 May 09 '23 at 18:55
  • @user1172706: You're right, thanks! – Tyler Seacrest May 09 '23 at 19:17
  • Some obvious things that it might be helpful to say: the sheep/wolf are trying to maximize/minimize $T+2|s_2(T)-w(T)|$, where $T = T(w, s_1, s_2)$ is the time of intercept from the wolf to the first sheep. A question that might be good to think about is whether it's optimal for the wolf to always pursue the closer sheep. I think it's true, but I'm not sure if it is. If it is, then since the movements are all continuous, we can say that $|w(t)-s_1(t)|\le |w(t)-s_2(t)|\forall t\ge 0$ (i.e. one sheep is decided at the beginning to be the sacrifice sheep), although I don't know if that's useful. – Varun Vejalla May 13 '23 at 18:37
  • 2
    On second thought, always going toward the closer sheep is probably not the right move. In some cases, it might be better for the wolf to try and corral the sheep toward each other so it can minimize the time needed to catch both sheep. – Varun Vejalla May 15 '23 at 04:16
  • @VarunVejalla That's assuming the sheep are not aware of the wolf's strategy, and they don't try to stay away from each other. I think in general this question is too open ended unless we place some restrictions on the movement strategies and intelligence of each animal. – V.S.e.H. May 16 '23 at 14:31
  • @V.S.e.H. The animals act optimally. A super rigorous formulation might include how the wolf acts at every instant to minimize the time needed to catch both sheep given all animals’ current positions, while the sheep try to maximize it. – Varun Vejalla May 17 '23 at 15:58
  • I don't know how useful this'll be, but if we write a function $T:\mathbb{R}^2\times\mathbb{R}^2\to\mathbb{R}_{\ge 0}$ for the time to capture given the positions of the sheep (and with the wolf at the origin), then I think $T(rs_1, rs_2)=r\cdot T(s_1,s_2)$. And since we can continuously rotate the problem so that $s_1$ travels along the $x$-axis, we can assume $|s_1|^2+|s_2|^2=1$ in order to reduce the problem to two variables, $s_1\in[0,1]$ and $\theta\in[0,\pi]$, where the position of the second sheep would be $(1-s^2_1)(\cos\theta,\sin\theta)$. But this might only make it harder. – Varun Vejalla May 22 '23 at 06:38
  • (ran out of space in my previous comment) This might make a numerical solution easier to come up with. – Varun Vejalla May 22 '23 at 06:44

2 Answers2

3

(Too long for a comment.) As it is discussed in comments, the upper bound is $6$. The wolf being faster than the sheep by $1/2$ will catch this sheep within $2$ time units. Each sheep goes no more than $1$ during this time, therefore distance to the other sheep is at most $2$, and the wolf will catch it in $4$ time units.

My observation is that this upper bound doesn't depend on metrics. Also for Manhattan $L_1$ metrics this bound is reachable. If two sheep go in two different constant directions other than directly to the wolf (e. g., along the line $x = 1$ in the opposite directions), then the wolf will catch one of them exactly after $2$ time units (at the point $(1, \pm 1)$). The second one will be at distance $2$ at that moment and will not need to change anything to be alive for $4$ more time units (will be caught at the point $(1, \mp 3)$). Also both sheep may change direction with a simple restriction: not getting closer to the wolf and to each other.

For Chebyshov $L_{\infty}$ metrics situation is rather similar, however the strategy is a bit different. Now both sheep should move away from the wolf and at the same time away from each other. This is possible only when moving along lines $y = x - 1$ and $y = 1 - x$ with increasing $x$. Then the wolf will catch one of them at the point $(2, \pm 1)$. The second sheep may vary its $x$-speed keeping the same $y$-speed to be caught at $(x_2, \mp 3)$ for some $x_2 \in [0, 4]$. Also the second sheep could start changing $x$-speed before the wolf catches the first sheep. However it changes only the range of $x_2$ to $[-1, 4]$, not the total time.

If we have $3$ sheep instead of $2$ then situation will be rather similar for Manhattan $L_1$ metrics. Simple upper bound is $18$ and it is easily reachable. However $3$ sheep for Chebyshov $L_{\infty}$ metrics and $4$ sheep for Manhattan $L_1$ metrics are not so easy cases.

In $k$-dimensional space $s \le 2k-1$ sheep have a strategy to reach simple upper bound of $2 \cdot 3^{s - 1}$ time units for Manhattan $L_1$ metrics and $s \le 2^{k - 1}$ sheep have such strategy for Chebyshov $L_{\infty}$ metrics.

Smylic
  • 6,715
2

Inspired by @10010100102ohno from a puzzling stack exchange thread, I tried to code it up (though I'm not nearly as good a programmer; note I started with some GPT4 code). Here is what I came up with:

https://jsfiddle.net/pbzn1Lva/

The wolf strategy is simply to follow the closest sheep. The sheep strategy is to initially head in opposite directions, and then the sheep closer to the wolf slowly turns in a direction heading directly away from the wolf, and the farther sheep slowly turns in a direction away from the other sheep. This leads to a time of about 4.6. Niether the sheep nor wolf movement is optimal, but it was the best I could do and should be in the ball park.

  • 1
    Actually the code is not bad at all! I leave you my considerations here: 1) There is some numerical instability (epsilon, directional vector integration,L2 norm). This generates the wolf to change sheep target in the start two or three times, slowing it a bit. Maybe is a good idea to lock the target and keep it locked until the distance is "big enough". 2) Try to work in the integer domain as long as you can or use javascript "BigInt" type. If you feel brave enough you can try BigRational.js to work in Q. However I do not think that this point will really change something in the observation... – 10010100102ohno May 09 '23 at 23:12
  • 1
    ...a part finer values at the end of the round. 3) Wolf d vector changes values immediately (dx and dy are assigned every round), but sheeps integrate over their d vector (dx and dy increase by some values proportional to distance to wolf/other sheep). The sheep d vectors normalized are then used to compute the next position. This calculation generates a kind of weighted average of direction to take based on all the distances calculated up to the actual round. At the start you can observe a sheep moving towards the wolf for a bit, maybe it is related! Anyway, great job Tyler! – 10010100102ohno May 09 '23 at 23:25
  • 1
    I've come to think a discrete version, with simultaneous movement on the grid, would be an interesting puzzle. I'm thinking about the right step size: too long, then the problem becomes too easy; too short then the search tree becomes too long. If the step size is infinitely short, then the problem becomes continuous and identical to this one. – Eric May 10 '23 at 12:05
  • @Eric The problem with grid is that on the plane you can move in any direction. And on the grid you have a finite number of options. "Proof" that $\pi = 4$ is based on the same principle – Smylic May 15 '23 at 15:57
  • 1
    @Smylis You are correct. Grid probably won't work as we desire. Discrete approximation actually requires two parameters: a stepwise radius r and a radian theta. – Eric Jul 10 '23 at 01:20