All Euler problems
Project Euler

Runner and Swimmer

A student is swimming in a pool while a teacher runs around the perimeter trying to apprehend the student. The student's swimming speed is slower than the teacher's running speed by a factor of v....

Source sync Apr 19, 2026
Problem #0761
Level Level 36
Solved By 190
Languages C++, Python
Answer 5.05505046
Length 2,295 words
geometrygame_theoryanalytic_math

Problem Statement

This archive keeps the full statement, math, and original media on the page.

Two friends, a runner and a swimmer, are playing a sporting game: The swimmer is swimming within a circular pool while the runner moves along the pool edge. While the runner tries to catch the swimmer at the very moment that the swimmer leaves the pool, the swimmer tries to reach the edge before the runner arrives there. They start the game with the swimmer located in the middle of the pool, while the runner is located anywhere at the edge of the pool.

We assume that the swimmer can move with any velocity up to $1$ in any direction and the runner can move with any velocity up to $v$ in either direction around the edge of the pool. Moreover we assume that both players can react immediately to any change of movement of their opponent.

Assuming optimal strategy of both players, it can be shown that the swimmer can always win by escaping the pool at some point at the edge before the runner gets there, if $v$ is less than the critical speed $V_{Circle} \approx 4.60333885$ and can never win if $v>V_{Circle}$.

Now the two players play the game in a perfectly square pool. Again the swimmer starts in the middle of the pool, while the runner starts at the midpoint of one of the edges of the pool. It can be shown that the critical maximal speed of the runner below which the swimmer can always escape and above which the runner can always catch the swimmer when trying to leave the pool is $V_{Square} \approx 5.78859314$.

At last, both players decide to play the game in a pool in the form of regular hexagon. Giving the same conditions as above, with the swimmer starting in the middle of the pool and the runner at the midpoint of one of the edges of the pool, find the critical maximal speed $V_{Hexagon}$ of the runner, below which the swimmer can always escape and above which the runner can always catch the swimmer.

Give your answer rounded to $8$ digits after the decimal point.

Problem 761: Runner and Swimmer

Solution

Some Definitions

All angles are measured counterclockwise in the range (π,π](-\pi,\pi]. Thus if

a=(1,0),b=(0,1),o=(0,0),a=(1,0), \qquad b=(0,1), \qquad o=(0,0),

then

aob=π2,boa=π2.\angle aob = \frac{\pi}{2}, \qquad \angle boa = -\frac{\pi}{2}.

Suppose the pool occupies a closed bounded convex set PP with boundary P\partial P and interior intP\operatorname{int} P. Let its perimeter be pp, and let λ>1\lambda > 1.

Suppose QQ is a closed convex proper subset of PP. Let

πQ:XQPintQ\pi_Q : X_Q \to P \setminus \operatorname{int} Q

be the universal cover of PintQP \setminus \operatorname{int} Q, and let

σ:XQXQ\sigma : X_Q \to X_Q

be a generator of the fundamental group, so that

πQσ=πQ.\pi_Q \circ \sigma = \pi_Q.

We lift the metric on PP to a metric on XQX_Q, and identify

πQ1(P)\pi_Q^{-1}(\partial P)

with R\mathbb{R} via an isometry so that

σ(x)=x+pfor xπQ1(P).\sigma(x)=x+p \qquad \text{for } x \in \pi_Q^{-1}(\partial P).

Without loss of generality, as we traverse R\mathbb{R} in the positive direction, we traverse P\partial P counterclockwise.

For x,yXQx,y \in X_Q, let

dQ(x,y)d_Q(x,y)

be the length of the shortest path from xx to yy in XQX_Q. Since both PP and QQ are convex, such a path is either a straight line or two straight lines joined by a section of

πQ1(Q).\pi_Q^{-1}(\partial Q).

Now suppose the perimeter qq of QQ is at least p/λp/\lambda. For

xXQ,yπQ1(P),x \in X_Q, \qquad y \in \pi_Q^{-1}(\partial P),

define

aQ(x,y)=yλdQ(x,y),aQ+(x,y)=y+λdQ(x,y).a_Q^-(x,y) = y - \lambda d_Q(x,y), \qquad a_Q^+(x,y) = y + \lambda d_Q(x,y).

Then set

aQ(x)=supyπQ1(P)aQ(x,y),aQ+(x)=infyπQ1(P)aQ+(x,y).a_Q^-(x) = \sup_{y \in \pi_Q^{-1}(\partial P)} a_Q^-(x,y), \qquad a_Q^+(x) = \inf_{y \in \pi_Q^{-1}(\partial P)} a_Q^+(x,y).

If yy is sufficiently large, say y>y0y>y_0, then the shortest path from xx to yy winds all the way around QQ at least once. Removing one lap yields a shortest path from xx to ypy-p, so

dQ(x,yp)=dQ(x,y)q.d_Q(x,y-p)=d_Q(x,y)-q.

Hence

aQ(x,y)=yλdQ(x,y)(yp)λdQ(x,yp)=aQ(x,yp),a_Q^-(x,y) = y-\lambda d_Q(x,y) \le (y-p)-\lambda d_Q(x,y-p) = a_Q^-(x,y-p),

and therefore

aQ(x)=supyy0aQ(x,y).a_Q^-(x)=\sup_{y \le y_0} a_Q^-(x,y).

In particular, aQ(x)a_Q^-(x) is finite and the supremum is achieved. A symmetric argument applies to aQ+a_Q^+.

If x1,x2XQx_1,x_2 \in X_Q, then for every

yπQ1(P)y \in \pi_Q^{-1}(\partial P)

we have

dQ(x1,y)dQ(x2,y)dQ(x1,x2),|d_Q(x_1,y)-d_Q(x_2,y)| \le d_Q(x_1,x_2),

so

aQ(x1)aQ(x2)λdQ(x1,x2),|a_Q^-(x_1)-a_Q^-(x_2)| \le \lambda d_Q(x_1,x_2),

and similarly for aQ+a_Q^+. Thus both aQa_Q^- and aQ+a_Q^+ are continuous. Moreover, if p(t)p(t) is a path in XQX_Q with speed at most 11, then both

aQ(p(t))andaQ+(p(t))a_Q^-(p(t)) \qquad\text{and}\qquad a_Q^+(p(t))

have speed at most λ\lambda.

Finally define

δQ(x)=aQ+(x)aQ(x).\delta_Q(x)=a_Q^+(x)-a_Q^-(x).

By symmetry,

aQ±(σx)=aQ±(x)+p,a_Q^\pm(\sigma x)=a_Q^\pm(x)+p,

so

δQ(σx)=δQ(x).\delta_Q(\sigma x)=\delta_Q(x).

Thus δQ\delta_Q descends to a well-defined function on

PintQ.P \setminus \operatorname{int} Q.

A Criterion for Cutoff

Call xXQx \in X_Q a concave point if there exist

y±πQ1(P)y^\pm \in \pi_Q^{-1}(\partial P)

achieving aQ±(x)a_Q^\pm(x) such that

y+xy[0,π],\angle y^+xy^- \in [0,\pi],

and intQ\operatorname{int} Q is disjoint from the cone cast by that angle. In particular, the shortest paths from xx to y±y^\pm are straight lines.

Similarly, call xx a convex point if there exist

y±πQ1(P)y^\pm \in \pi_Q^{-1}(\partial P)

achieving aQ±(x)a_Q^\pm(x) such that

yxy+[0,π],\angle y^-xy^+ \in [0,\pi],

and intQ\operatorname{int} Q is contained in the cone cast by that angle.

Theorem 1

Theorem 1. Suppose QQ is as above and satisfies:

  • every point of Q\partial Q is a concave point;
  • every point of Q\partial Q satisfies δQ(x)=p\delta_Q(x)=p;
  • at least one point of Q\partial Q is a convex point.

Then:

  • for v<λv < \lambda, the student can force an escape regardless of the initial positions;
  • for v>λv > \lambda, the teacher can force a capture provided the student starts in QQ.

Before proving Theorem 1, we need several lemmas.

Suppose

xintP,y,yP.x \in \operatorname{int} P, \qquad y,y' \in \partial P.

By convexity, the angle yyx\angle y'yx increases as yyy' \to y from above, so the limit exists; similarly for the limit from below. Define

θ+=limyy+yyx,θ=limyyxyy.\theta^+ = \lim_{y' \to y^+} \angle y'yx, \qquad \theta^- = \lim_{y' \to y^-} \angle xyy'.

We say the segment xyxy makes angles (θ+,θ)(\theta^+,\theta^-) with P\partial P. Again by convexity,

θ++θπ.\theta^+ + \theta^- \le \pi.

Lemma 1

Lemma 1. Let

α=arccos ⁣(1λ).\alpha = \arccos\!\left(\frac{1}{\lambda}\right).

If the line segment xyxy achieves aQ(x)a_Q^-(x), then its angles with P\partial P are

(πα,α).(\pi-\alpha,\alpha).

If it achieves aQ+(x)a_Q^+(x), then its angles are

(α,πα).(\alpha,\pi-\alpha).

Proof. We prove the statement for aQ(x)a_Q^-(x); the statement for aQ+(x)a_Q^+(x) follows by symmetry.

We may suppose that some neighborhood of the segment xyxy is disjoint from QQ; otherwise we replace xx by a point closer to yy on the segment. Denote the angles made by xyxy with P\partial P by (θ+,θ)(\theta^+,\theta^-).

First suppose y>yy' > y. Since xyxy achieves aQ(x)a_Q^-(x),

yλdQ(x,y)yλdQ(x,y).y-\lambda d_Q(x,y) \ge y' - \lambda d_Q(x,y').

If yy' is sufficiently close to yy, then the segment xyxy' is disjoint from QQ, so

dQ(x,y)=xy,dQ(x,y)=xy,d_Q(x,y)=|xy|, \qquad d_Q(x,y')=|xy'|,

and also

yyyy.y'-y \ge |yy'|.

Thus

λxyλxyyy.\lambda |xy'| - \lambda |xy| \ge |yy'|.

Let

θ=yyx,ϕ=yxy.\theta = \angle y'yx, \qquad \phi = \angle yxy'.

By the sine rule, this inequality becomes

λsinθλsin(θ+ϕ)sinϕ.\lambda \sin\theta - \lambda \sin(\theta+\phi) \ge \sin\phi.

Rearranging,

sinθtan ⁣(ϕ2)cosθcosα.\sin\theta \tan\!\left(\frac{\phi}{2}\right) - \cos\theta \ge \cos\alpha.

As yy+y' \to y^+, we have θθ+\theta \to \theta^+ and ϕ0\phi \to 0, so

cosθ+cosα.-\cos\theta^+ \ge \cos\alpha.

Hence

θ+πα.\theta^+ \ge \pi-\alpha.

Now suppose y<yy' < y. Extend the ray xyxy' to a point yy'' such that

xyy=θ.\angle xyy'' = \theta^-.

The segments yyyy'' and yyy''y' lie outside PP, so

yyyy+yy.y-y' \le |yy''| + |y''y'|.

Again for yy' sufficiently close to yy,

λxyλxyyyyy+yy.\lambda |xy| - \lambda |xy'| \le y-y' \le |yy''| + |y''y'|.

Since λ>1\lambda>1 and

xy+yy=xy,|xy'| + |y''y'| = |xy''|,

it follows that

λxyyy+λxy.\lambda |xy| \le |yy''| + \lambda |xy''|.

Let

ϕ=yxy=yxy.\phi = \angle y'xy = \angle y''xy.

Again by the sine rule,

λsin(θ+ϕ)sinϕ+λsinθ.\lambda \sin(\theta^-+\phi) \le \sin\phi + \lambda \sin\theta^-.

Hence

cosθsinθtan ⁣(ϕ2)cosα.\cos\theta^- - \sin\theta^- \tan\!\left(\frac{\phi}{2}\right) \le \cos\alpha.

Letting yyy' \to y^- gives

cosθcosα,\cos\theta^- \le \cos\alpha,

so

θα.\theta^- \ge \alpha.

Since also θ++θπ\theta^+ + \theta^- \le \pi, we conclude

(θ+,θ)=(πα,α).(\theta^+,\theta^-) = (\pi-\alpha,\alpha).

This proves the lemma. \square

Lemma 2

Lemma 2. Suppose y1,y2Py_1,y_2 \in \partial P and x1,x2intPx_1,x_2 \in \operatorname{int} P are such that

y1x1x2+x1x2y2=π,\angle y_1x_1x_2 + \angle x_1x_2y_2 = \pi,

that is, the segments x1y1x_1y_1 and x2y2x_2y_2 are parallel. Let

θ=y1x1x2,\theta = \angle y_1x_1x_2,

and let y2y1y_2-y_1 denote the counterclockwise arclength along P\partial P from y1y_1 to y2y_2. Then:

(y2y1)+λx2y2λx1y1λx1x2cosθif x1y1 makes angles (α,πα),(y2y1)+λx2y2λx1y1λx1x2cosθif x2y2 makes angles (α,πα),(y2y1)λx2y2+λx1y1λx1x2cosθif x1y1 makes angles (πα,α),(y2y1)λx2y2+λx1y1λx1x2cosθif x2y2 makes angles (πα,α).\begin{aligned} (y_2-y_1) + \lambda|x_2y_2| - \lambda|x_1y_1| &\le -\lambda|x_1x_2|\cos\theta &&\text{if } x_1y_1 \text{ makes angles } (\alpha,\pi-\alpha), \\ (y_2-y_1) + \lambda|x_2y_2| - \lambda|x_1y_1| &\ge -\lambda|x_1x_2|\cos\theta &&\text{if } x_2y_2 \text{ makes angles } (\alpha,\pi-\alpha), \\ (y_2-y_1) - \lambda|x_2y_2| + \lambda|x_1y_1| &\ge \lambda|x_1x_2|\cos\theta &&\text{if } x_1y_1 \text{ makes angles } (\pi-\alpha,\alpha), \\ (y_2-y_1) - \lambda|x_2y_2| + \lambda|x_1y_1| &\le \lambda|x_1x_2|\cos\theta &&\text{if } x_2y_2 \text{ makes angles } (\pi-\alpha,\alpha). \end{aligned}

We omit the proof, which is analogous to the proof of Lemma 1.

Lemma 3

Lemma 3. Suppose

δQ(x)>0for all xQ.\delta_Q(x)>0 \qquad \text{for all } x \in \partial Q.

Then

δQ(x)>0for all xintPintQ.\delta_Q(x)>0 \qquad \text{for all } x \in \operatorname{int} P \setminus \operatorname{int} Q.

Proof. Consider the function

f(y1,y2)=(y2y1)λdQ(y1,y2)f(y_1,y_2)=(y_2-y_1)-\lambda d_Q(y_1,y_2)

for

y1,y2πQ1(P).y_1,y_2 \in \pi_Q^{-1}(\partial P).

If

y2y12p,y_2-y_1 \ge 2p,

then the shortest path from y1y_1 to y2y_2 traverses Q\partial Q at least once, so

f(y1,y2)f(y1,y2p).f(y_1,y_2) \le f(y_1,y_2-p).

Also

f(y1+p,y2+p)=f(y1,y2).f(y_1+p,y_2+p)=f(y_1,y_2).

Finally, if y2<y1y_2<y_1, then

f(y1,y2)<0=f(y1,y1).f(y_1,y_2) < 0 = f(y_1,y_1).

Therefore ff is bounded above by its supremum on the compact set

{(y1,y2)0y1p, y1y2y1+2p}.\{(y_1,y_2)\mid 0 \le y_1 \le p,\ y_1 \le y_2 \le y_1+2p\}.

Hence ff attains a maximum value.

Suppose ff is maximal at (y1,y2)(y_1,y_2). If y1=y2y_1=y_2, then

f(y1,y2)=0.f(y_1,y_2)=0.

So suppose y1<y2y_1<y_2.

First suppose the shortest path from y1y_1 to y2y_2 intersects Q\partial Q at a point xx. Then

aQ(x)y2λdQ(x,y2),a_Q^-(x) \ge y_2 - \lambda d_Q(x,y_2),

and

aQ+(x)y1+λdQ(x,y1).a_Q^+(x) \le y_1 + \lambda d_Q(x,y_1).

By hypothesis,

0<δQ(x)=aQ+(x)aQ(x)λ(dQ(x,y1)+dQ(x,y2))(y2y1).0 < \delta_Q(x)=a_Q^+(x)-a_Q^-(x) \le \lambda\bigl(d_Q(x,y_1)+d_Q(x,y_2)\bigr) - (y_2-y_1).

Since

dQ(x,y1)+dQ(x,y2)=dQ(y1,y2),d_Q(x,y_1)+d_Q(x,y_2)=d_Q(y_1,y_2),

we obtain

f(y1,y2)<0,f(y_1,y_2)<0,

contradicting maximality.

Now suppose the shortest path from y1y_1 to y2y_2 is disjoint from Q\partial Q. Then it is a straight line. Moreover, y2y_2 achieves aQ(y1)a_Q^-(y_1) and y1y_1 achieves aQ+(y2)a_Q^+(y_2), so by Lemma 1 the segment y1y2y_1y_2 makes angles

(α,πα)(\alpha,\pi-\alpha)

at y1y_1 and

(πα,α)(\pi-\alpha,\alpha)

at y2y_2.

Pick

y3,y4πQ1(P)y_3,y_4 \in \pi_Q^{-1}(\partial P)

so that the segment y3y4y_3y_4 touches Q\partial Q and is parallel to y1y2y_1y_2. Pick points x1x_1 on y1y2y_1y_2 and x2x_2 on y3y4y_3y_4. If

y3>y1andy4<y2,y_3>y_1 \qquad\text{and}\qquad y_4<y_2,

then Lemma 2 gives

(y3y1)+λx2y3λx1y1λx1x2cosθ,(y2y4)λx1y2+λx2y4λx1x2cosθ,\begin{aligned} (y_3-y_1) + \lambda|x_2y_3| - \lambda|x_1y_1| &\le -\lambda|x_1x_2|\cos\theta, \\ (y_2-y_4) - \lambda|x_1y_2| + \lambda|x_2y_4| &\le \lambda|x_1x_2|\cos\theta, \end{aligned}

where

θ=y1x1x2.\theta = \angle y_1x_1x_2.

If instead

y3<y1andy4>y2,y_3<y_1 \qquad\text{and}\qquad y_4>y_2,

then Lemma 2 gives

(y1y3)+λx1y1λx2y3λx1x2cosθ,(y4y2)λx2y4+λx1y2λx1x2cosθ,\begin{aligned} (y_1-y_3) + \lambda|x_1y_1| - \lambda|x_2y_3| &\ge -\lambda|x_1x_2|\cos\theta, \\ (y_4-y_2) - \lambda|x_2y_4| + \lambda|x_1y_2| &\ge \lambda|x_1x_2|\cos\theta, \end{aligned}

where

θ=y3x2x1.\theta = \angle y_3x_2x_1.

In either case, summing the two inequalities yields

(y2y1)λy1y2(y4y3)λy4y3.(y_2-y_1)-\lambda|y_1y_2| \le (y_4-y_3)-\lambda|y_4y_3|.

Thus

f(y1,y2)f(y3,y4)<0,f(y_1,y_2) \le f(y_3,y_4) < 0,

again contradicting maximality.

Therefore the maximum value of ff is 00, achieved only when y1=y2y_1=y_2.

Now let

xintPintQ,x \in \operatorname{int} P \setminus \operatorname{int} Q,

and let

y±y^\pm

achieve aQ±(x)a_Q^\pm(x). Then

δQ(x)=aQ+(x)aQ(x)=(y+y)+λ(dQ(x,y+)+dQ(x,y))f(y+,y).\delta_Q(x) = a_Q^+(x)-a_Q^-(x) = (y^+-y^-) + \lambda\bigl(d_Q(x,y^+)+d_Q(x,y^-)\bigr) \ge -f(y^+,y^-).

Hence

δQ(x)0.\delta_Q(x)\ge 0.

Equality could hold only if

y=y+y^-=y^+

and

dQ(x,y+)+dQ(x,y)=dQ(y+,y),d_Q(x,y^+) + d_Q(x,y^-)=d_Q(y^+,y^-),

which forces

x=y=y+,x=y^-=y^+,

contrary to

xintP.x \in \operatorname{int} P.

Therefore

δQ(x)>0.\delta_Q(x)>0.

This proves the lemma. \square

Lemma 4

Lemma 4. If Q\partial Q contains a line segment x1x2x_1x_2, then δQ\delta_Q is concave down on x1x2x_1x_2.

Proof. Suppose x2x_2 is counterclockwise from x1x_1 on Q\partial Q. It suffices to show that for xx on the segment x1x2x_1x_2,

x1x2δQ(x)x1xδQ(x2)+xx2δQ(x1).|x_1x_2|\,\delta_Q(x) \ge |x_1x|\,\delta_Q(x_2) + |xx_2|\,\delta_Q(x_1).

Lift the segment x1x2x_1x_2 to a segment in XQX_Q, still denoted x1x2x_1x_2, and let

yπQ1(P)y \in \pi_Q^{-1}(\partial P)

achieve aQ+(x)a_Q^+(x).

First suppose the shortest path from xx to yy is a straight line. Let the rays from x1x_1 and x2x_2 parallel to xyxy meet πQ1(P)\pi_Q^{-1}(\partial P) at y1y_1 and y2y_2 respectively. By Lemma 1, the segment xyxy makes angles (α,πα)(\alpha,\pi-\alpha) with the boundary, so Lemma 2 implies

aQ+(x2,y2)aQ+(x,y)λxx2cosθ,aQ+(x,y)aQ+(x1,y1)λx1xcosθ,\begin{aligned} a_Q^+(x_2,y_2)-a_Q^+(x,y) &\le -\lambda |xx_2|\cos\theta, \\ a_Q^+(x,y)-a_Q^+(x_1,y_1) &\ge -\lambda |x_1x|\cos\theta, \end{aligned}

where

θ=yxx2=y1x1x.\theta = \angle yxx_2 = \angle y_1x_1x.

Multiply the first inequality by x1x|x_1x| and the second by xx2|xx_2|, then add. Since aQ+(x,y)=aQ+(x)a_Q^+(x,y)=a_Q^+(x), we obtain

x1x2aQ+(x)x1xaQ+(x2,y2)+xx2aQ+(x1,y1).|x_1x_2|\,a_Q^+(x) \ge |x_1x|\,a_Q^+(x_2,y_2) + |xx_2|\,a_Q^+(x_1,y_1).

Hence

x1x2aQ+(x)x1xaQ+(x2)+xx2aQ+(x1).|x_1x_2|\,a_Q^+(x) \ge |x_1x|\,a_Q^+(x_2) + |xx_2|\,a_Q^+(x_1).

Next suppose the shortest path from xx to yy contains a section of Q\partial Q. Then it passes through either x1x_1 or x2x_2; assume without loss of generality that it passes through x1x_1. Then

dQ(x,y)=xx1+dQ(x1,y),d_Q(x,y)=|xx_1|+d_Q(x_1,y),

and

dQ(x2,y)x2x+dQ(x,y).d_Q(x_2,y)\le |x_2x|+d_Q(x,y).

Therefore

x1xaQ+(x2,y)+xx2aQ+(x1,y)x1x2aQ+(x,y),|x_1x|\,a_Q^+(x_2,y) + |xx_2|\,a_Q^+(x_1,y) \le |x_1x_2|\,a_Q^+(x,y),

which again implies

x1x2aQ+(x)x1xaQ+(x2)+xx2aQ+(x1).|x_1x_2|\,a_Q^+(x) \ge |x_1x|\,a_Q^+(x_2) + |xx_2|\,a_Q^+(x_1).

The same argument applies to aQa_Q^-, and subtracting the two inequalities yields

x1x2δQ(x)x1xδQ(x2)+xx2δQ(x1).|x_1x_2|\,\delta_Q(x) \ge |x_1x|\,\delta_Q(x_2) + |xx_2|\,\delta_Q(x_1).

Thus δQ\delta_Q is concave down on x1x2x_1x_2. \square

Proof of Theorem 1

For

yπQ1(P),y \in \pi_Q^{-1}(\partial P),

we have

aQ(y)yaQ+(y).a_Q^-(y) \ge y \ge a_Q^+(y).

On the other hand, by taking the limit of Lemma 3,

0δQ(y)=aQ+(y)aQ(y).0 \le \delta_Q(y)=a_Q^+(y)-a_Q^-(y).

Hence

aQ+(y)=aQ(y)=y.a_Q^+(y)=a_Q^-(y)=y.

First consider the runner’s strategy for v>λv>\lambda. While the swimmer is inside QQ, the runner does nothing. When the swimmer first touches Q\partial Q, lift the swimmer’s position to a point xXQx \in X_Q. By assumption,

p=δQ(x)=aQ+(x)aQ(x).p=\delta_Q(x)=a_Q^+(x)-a_Q^-(x).

Therefore the runner can choose a lifted position

yπQ1(P)y \in \pi_Q^{-1}(\partial P)

such that

aQ(x)yaQ+(x).a_Q^-(x) \le y \le a_Q^+(x).

As the swimmer moves through

intPintQ,\operatorname{int} P \setminus \operatorname{int} Q,

Lemma 3 gives

aQ(x)<aQ+(x),a_Q^-(x)<a_Q^+(x),

and both aQ(x)a_Q^-(x) and aQ+(x)a_Q^+(x) move at speed at most λ\lambda. Since v>λv>\lambda, the runner can continue moving so as to maintain the inequality

aQ(x)yaQ+(x).a_Q^-(x) \le y \le a_Q^+(x).

When the swimmer finally reaches P\partial P, the runner is at the same boundary point.

Now consider the swimmer’s strategy for v<λv<\lambda. If the perimeter of QQ were exactly p/λp/\lambda, then the swimmer could lap QQ faster than the runner can lap PP. Writing the swimmer’s and runner’s lifted positions as xx and yy, the swimmer could continue until

aQ(x)+p=y=aQ+(x).a_Q^-(x)+p = y = a_Q^+(x).

Then the swimmer could follow the path achieving aQ(x)a_Q^-(x) so as to increase aQ(x)a_Q^-(x) at speed λ\lambda, or the path achieving aQ+(x)a_Q^+(x) so as to decrease aQ+(x)a_Q^+(x) at speed λ\lambda, while keeping the runner trapped between the two barriers.

There are two complications:

  • if the perimeter of QQ is greater than p/λp/\lambda, we must replace QQ by a smaller set;
  • if the runner changes direction repeatedly, the swimmer may keep retracing a path and never reach P\partial P.

Choose ε>0\varepsilon>0 such that

v<(12ε)λ.v < (1-2\varepsilon)\lambda.

The first goal is to reach positions x,yx,y satisfying

xπQ1(Q),yaQ+(x)<pε2.x \in \pi_Q^{-1}(\partial Q), \qquad |y-a_Q^+(x)| < \frac{p\varepsilon}{2}.

Since there exists a convex point

x0πQ1(Q),x_0 \in \pi_Q^{-1}(\partial Q),

there are points

y0±πQ1(P)y_0^\pm \in \pi_Q^{-1}(\partial P)

achieving aQ±(x0)a_Q^\pm(x_0) such that

y0x0y0+[0,π]\angle y_0^-x_0y_0^+ \in [0,\pi]

and the cone CC cast by this angle contains QQ.

Pick

x1πQ1(Q)x_1 \in \pi_Q^{-1}(\partial Q)

such that

u+Cu + C

is disjoint from intQ\operatorname{int} Q, where

u=πQ(x1)πQ(x0).u=\pi_Q(x_1)-\pi_Q(x_0).

For t(0,1)t \in (0,1), let

Qt=Q(tu+C).Q_t = Q \cap (tu+C).

Identify XQsX_{Q_s} with a subset of XQX_Q whenever s<ts<t, and let XX be the union of all XQtX_{Q_t} with the induced map

π:XP.\pi:X \to P.

Let

xt=x0+tu.x_t = x_0 + tu.

Let the rays from xtx_t parallel to x0y0±x_0y_0^\pm meet πQ1(P)\pi_Q^{-1}(\partial P) at yt±y_t^\pm and πQ1(Q)\pi_Q^{-1}(\partial Q) at zt±z_t^\pm.

Set

θ+=y0+x0xt,θ=xtx0y0.\theta^+ = \angle y_0^+x_0x_t, \qquad \theta^- = \angle x_tx_0y_0^-.

By Lemma 2,

(y0+yt+)+λx0y0+λxtyt+λx0xtcosθ+,(yty0)λxtyt+λx0y0λx0xtcosθ.\begin{aligned} (y_0^+-y_t^+) + \lambda |x_0y_0^+| - \lambda |x_ty_t^+| &\ge \lambda |x_0x_t|\cos\theta^+, \\ (y_t^- - y_0^-) - \lambda |x_ty_t^-| + \lambda |x_0y_0^-| &\ge \lambda |x_0x_t|\cos\theta^-. \end{aligned}

Since θ++θπ\theta^+ + \theta^- \le \pi, these imply

λ(x0y0++x0y0)(y0y0+)λ(xtyt++xtyt)(ytyt+).\lambda\bigl(|x_0y_0^+|+|x_0y_0^-|\bigr) - (y_0^- - y_0^+) \ge \lambda\bigl(|x_ty_t^+|+|x_ty_t^-|\bigr) - (y_t^- - y_t^+).

The left-hand side is

aQ+(x0)aQ(x0)=δQ(x0)=p,a_Q^+(x_0)-a_Q^-(x_0)=\delta_Q(x_0)=p,

so

λ(xtyt++xtyt)(ytyt+)p.\lambda\bigl(|x_ty_t^+|+|x_ty_t^-|\bigr) - (y_t^- - y_t^+) \le p.

Also,

aQ(zt)ytλytzt,a_Q^-(z_t^-) \ge y_t^- - \lambda |y_t^-z_t^-|, aQ+(zt+)yt++λyt+zt+,a_Q^+(z_t^+) \le y_t^+ + \lambda |y_t^+z_t^+|,

and

aQ+(zt)aQ(zt)=δQ(zt)=p.a_Q^+(z_t^-)-a_Q^-(z_t^-)=\delta_Q(z_t^-)=p.

Finally,

xtyt++xtytdQt(yt,yt+)=ytzt+dQt(zt,zt+)+yt+zt+.|x_ty_t^+| + |x_ty_t^-| \ge d_{Q_t}(y_t^-,y_t^+) = |y_t^-z_t^-| + d_{Q_t}(z_t^-,z_t^+) + |y_t^+z_t^+|.

Combining these inequalities yields

aQ+(zt)aQ+(zt+)λdQt(zt,zt+).a_Q^+(z_t^-)-a_Q^+(z_t^+) \ge \lambda d_{Q_t}(z_t^-,z_t^+).

Define

b(x)=aQ+(x)b(x)=a_Q^+(x)

for xπQ1(Q)x \in \pi_Q^{-1}(\partial Q), and extend bb to πQ1(intQ)\pi_Q^{-1}(\operatorname{int} Q) by linear interpolation along the sets

πQ1((tu+C)intQ).\pi_Q^{-1}\bigl((tu+\partial C)\cap \operatorname{int} Q\bigr).

That is, for

xπQ1(intQ),x \in \pi_Q^{-1}(\operatorname{int} Q),

let t=t(x)t=t(x) be the unique value in (0,1)(0,1) with

π(x)tu+C,\pi(x) \in tu+\partial C,

and set

b(x)=dQt(zt,x)b(zt+)+dQt(zt+,x)b(zt)dQt(zt,zt+).b(x) = \frac{d_{Q_t}(z_t^-,x)b(z_t^+) + d_{Q_t}(z_t^+,x)b(z_t^-)}{d_{Q_t}(z_t^-,z_t^+)}.

Then bb is continuous on πQ1(Q)\pi_Q^{-1}(Q). Moreover, as xx moves along πQ1(Qt)\pi_Q^{-1}(\partial Q_t) from ztz_t^- to zt+z_t^+ at speed 11, the function b(x)b(x) increases at speed

b(zt+)b(zt)dQt(zt,zt+)λ.\frac{b(z_t^+)-b(z_t^-)}{d_{Q_t}(z_t^-,z_t^+)} \ge \lambda.

Choose T(0,1)T \in (0,1) such that the perimeter of QTQ_T is at most p/λp/\lambda. The swimmer first moves to QT\partial Q_T. Lift the swimmer’s and runner’s positions to x,yXx,y \in X such that

y>b(x).y>b(x).

If the swimmer laps QTQ_T once, then b(x)b(x) increases by pp while the runner’s lifted position moves by at most

pvλ<p.\frac{pv}{\lambda} < p.

Hence the swimmer can keep lapping until

y=b(x).y=b(x).

Now the swimmer follows the strategy below while π(x)intQ\pi(x) \in \operatorname{int} Q:

  • if yb(x)(pε,pε/4)y-b(x) \in (-p\varepsilon,-p\varepsilon/4), move along Qt(x)\partial Q_{t(x)} toward zt(x)z_{t(x)}^-;
  • if yb(x)[pε/4,pε/4]y-b(x) \in [-p\varepsilon/4,p\varepsilon/4], move in direction u-u;
  • if yb(x)(pε/4,pε/2)y-b(x) \in (p\varepsilon/4,p\varepsilon/2), move along Qt(x)\partial Q_{t(x)} toward zt(x)+z_{t(x)}^+.

This maintains

yb(x)<pε2.|y-b(x)| < \frac{p\varepsilon}{2}.

It remains to show that the swimmer eventually reaches Q\partial Q. Suppose not. Then the swimmer remains in one connected component of

πQ1(QQT).\pi_Q^{-1}(Q \setminus Q_T).

While in the second case, t(x)t(x) decreases at speed

1u,-\frac{1}{|u|},

so the total time spent there is less than TuT|u|. Going from the first case to the third case requires at least some fixed positive amount of time in the second case, so this can happen only finitely many times. Hence the swimmer eventually stops visiting one of the first or third cases; assume without loss of generality that the third case is eventually avoided.

Consider

dQt(x,zt)dQt(xt,zt)+tu,d_{Q_t}(x,z_t^-) - d_{Q_t}(x_t,z_t^-) + t|u|,

where t=t(x)t=t(x). This quantity decreases at speed 11 in both the first and second cases, yet is bounded below. Therefore the swimmer eventually reaches πQ1(Q)\pi_Q^{-1}(\partial Q).

Now the swimmer is at some

x2πQ1(Q),x_2 \in \pi_Q^{-1}(\partial Q),

and the runner is at a lifted position yy with

aQ+(x2)y<pε2.|a_Q^+(x_2)-y| < \frac{p\varepsilon}{2}.

Because x2x_2 is concave, there exist

y2±πQ1(P)y_2^\pm \in \pi_Q^{-1}(\partial P)

achieving aQ±(x2)a_Q^\pm(x_2) such that

y2+x2y2[0,π]\angle y_2^+x_2y_2^- \in [0,\pi]

and the cone C2C_2 cast by that angle is disjoint from intQ\operatorname{int} Q.

Let X2X_2 be the connected component of

πQ1(C2P)\pi_Q^{-1}(C_2 \cap P)

containing x2x_2. For xX2x \in X_2, define

b(x)=supy[y2+,y2](yλxy)+p,b^-(x) = \sup_{y \in [y_2^+,y_2^-]} \bigl(y-\lambda |xy|\bigr)+p,

and

b+(x)=infy[y2+,y2](y+λxy).b^+(x) = \inf_{y \in [y_2^+,y_2^-]} \bigl(y+\lambda |xy|\bigr).

As before, Lemma 2 implies

b+(x)b(x).b^+(x) \le b^-(x).

Now define

c±(x)=b±(x)±ε(b(x)b+(x)p2).c^\pm(x)=b^\pm(x) \pm \varepsilon\left(b^-(x)-b^+(x)-\frac{p}{2}\right).

Since 12ε>01-2\varepsilon>0,

c(x)c+(x)pε.c^-(x)-c^+(x)\ge p\varepsilon.

If xx moves toward the point achieving b(x)b^-(x) at speed 11, then b(x)b^-(x) increases at speed λ\lambda while b+(x)b^+(x) changes at speed at most λ\lambda. Hence c(x)c^-(x) increases at speed at least

λ(12ε)>v.\lambda(1-2\varepsilon)>v.

The same is true for c+(x)c^+(x).

Choose a vector ww such that

π(x2)+wintC2.\pi(x_2)+w \in \operatorname{int} C_2.

The swimmer now follows this strategy:

  • if 0<yc+(x)<pε/40<y-c^+(x)<p\varepsilon/4, move toward the point achieving b+(x)b^+(x);
  • if c+(x)+pε/4yc(x)pε/4c^+(x)+p\varepsilon/4 \le y \le c^-(x)-p\varepsilon/4, move in direction ww;
  • if pε/4<yc(x)<0-p\varepsilon/4 < y-c^-(x)<0, move toward the point achieving b(x)b^-(x).

Since δQ(x2)=p\delta_Q(x_2)=p, we have

b±(x2)=aQ±(x2),b^\pm(x_2)=a_Q^\pm(x_2),

and therefore

c±(x2)=aQ±(x2)pε2.c^\pm(x_2)=a_Q^\pm(x_2)\mp \frac{p\varepsilon}{2}.

Thus initially

c+(x)<y<c(x),c^+(x) < y < c^-(x),

and the strategy preserves this inequality.

As before, the swimmer eventually reaches some point

x[y2+,y2].x \in [y_2^+,y_2^-].

At that point,

xb(x)paQ(x)=x=aQ+(x)b+(x)x,x \le b^-(x)-p \le a_Q^-(x)=x=a_Q^+(x)\le b^+(x)\le x,

so

x+pε2=c+(x)<y<c(x)=x+ppε2.x+\frac{p\varepsilon}{2}=c^+(x)<y<c^-(x)=x+p-\frac{p\varepsilon}{2}.

In particular,

π(y)π(x).\pi(y)\ne \pi(x).

Hence the swimmer escapes. This completes the proof of Theorem 1. \square

Regular Polygon

Let

θ=πn,\theta=\frac{\pi}{n},

and let

pk=(cos(2kθ),sin(2kθ))(kZ).p_k=(\cos(2k\theta),\sin(2k\theta)) \qquad (k \in \mathbb{Z}).

Suppose PP is the convex hull of the points pkp_k. Let ρ\rho denote counterclockwise rotation about the origin by angle 2θ2\theta. Then ρ\rho is a symmetry of PP and sends pkp_k to pk+1p_{k+1}.

As kk ranges from 00 to nn, the quantity

sin(kθ)(k+n)tanθcos(kθ)\sin(k\theta) - (k+n)\tan\theta \cos(k\theta)

changes sign. Let KK be the largest integer for which it is negative. Thus

sin(Kθ)(K+n)tanθcos(Kθ)<0\sin(K\theta) - (K+n)\tan\theta \cos(K\theta) < 0

and

0sin((K+1)θ)(K+n+1)tanθcos((K+1)θ).0 \le \sin((K+1)\theta) - (K+n+1)\tan\theta \cos((K+1)\theta).

Rearranging,

cos((K+2)θ)2sin(Kθ)(K+n)tanθcos(Kθ)<cos(Kθ).\cos((K+2)\theta) \le \frac{2\sin(K\theta)}{(K+n)\tan\theta} - \cos(K\theta) < \cos(K\theta).

Hence we may define

α=12(Kθ+arccos ⁣(2sin(Kθ)(K+n)tanθcos(Kθ))),\alpha = \frac{1}{2}\left( K\theta + \arccos\!\left( \frac{2\sin(K\theta)}{(K+n)\tan\theta} - \cos(K\theta) \right) \right),

and then

Kθ<α(K+1)θ.K\theta < \alpha \le (K+1)\theta.

Theorem 2

Theorem 2. Let QQ be obtained from PP by rotating counterclockwise by angle KθK\theta and scaling by

s=cosαcos(αKθ).s=\frac{\cos\alpha}{\cos(\alpha-K\theta)}.

With

λ=1cosα,\lambda=\frac{1}{\cos\alpha},

the hypotheses of Theorem 1 hold.

Remark. For the square, one has

K=1,α1.397,λ5.789.K=1, \qquad \alpha \approx 1.397, \qquad \lambda \approx 5.789.

Remark. For large nn, θ\theta is small and ntanθπn\tan\theta \approx \pi, so αKθμ\alpha \approx K\theta \approx \mu, where μ\mu satisfies

μ+π=tanμ.\mu+\pi=\tan\mu.

This agrees with the cutoff for a circular pool.

Proof. For kZk \in \mathbb{Z}, let

qk=s(cos((2k+K)θ),sin((2k+K)θ)).q_k = s\bigl(\cos((2k+K)\theta),\sin((2k+K)\theta)\bigr).

Then QQ is the convex hull of the points qkq_k. By similarity, the perimeters pp and qq of PP and QQ satisfy

q=sp,q=sp,

so

qp=s=cosαcos(αKθ)>cosα=1λ.\frac{q}{p}=s=\frac{\cos\alpha}{\cos(\alpha-K\theta)} > \cos\alpha = \frac{1}{\lambda}.

We next determine δQ(q1)\delta_Q(q_1). If the line segment q1yq_1y intersects QQ, then the shortest path from q1q_1 to yy in XQX_Q must pass through q0q_0 or q2q_2; assume without loss of generality that it passes through q0q_0. By symmetry,

dQ(q1,y)=dQ(q1,q0)+dQ(q0,y)=qn+dQ(q1,ρ(y)).d_Q(q_1,y)=d_Q(q_1,q_0)+d_Q(q_0,y)=\frac{q}{n}+d_Q(q_1,\rho(y)).

Since qλ>pq\lambda>p, we obtain

aQ(q1,y)<aQ(q1,ρ(y)),a_Q^-(q_1,y) < a_Q^-(q_1,\rho(y)),

and

aQ+(q1,y)>aQ+(q1,ρ(y)).a_Q^+(q_1,y) > a_Q^+(q_1,\rho(y)).

Thus we may restrict attention to segments from q1q_1 to P\partial P whose interiors are disjoint from QQ.

By Lemma 1, it suffices to consider segments terminating in the interior of a side at angle α\alpha. Let yky_k be the unique point on the side pkpk+1p_kp_{k+1} such that

pk+1ykq1=α,\angle p_{k+1}y_kq_1=\alpha,

whenever such a point exists. Let

ϕk=opkq1.\phi_k = \angle op_kq_1.

Then yky_k exists exactly when

ϕk>π2αθandϕk+1<π2α+θ.\phi_k > \frac{\pi}{2}-\alpha-\theta \qquad\text{and}\qquad \phi_{k+1} < \frac{\pi}{2}-\alpha+\theta.

Suppose yk1y_{k-1} and yky_k exist. By the sine rule,

q1ykcos(ϕk+θ)=ykpkcos(α+ϕk+θ)=q1pksinα=yk1pkcos(α+ϕkθ)=q1yk1cos(ϕkθ).\frac{|q_1y_k|}{\cos(\phi_k+\theta)} = \frac{-|y_kp_k|}{\cos(\alpha+\phi_k+\theta)} = \frac{|q_1p_k|}{\sin\alpha} = \frac{|y_{k-1}p_k|}{\cos(\alpha+\phi_k-\theta)} = \frac{|q_1y_{k-1}|}{\cos(\phi_k-\theta)}.

Assuming that both q1ykq_1y_k and q1yk1q_1y_{k-1} are disjoint from QQ, we find

aQ+(q1,yk)aQ+(q1,yk1)=q1pksinαcosα(cos(ϕk+θ)cos(ϕkθ)+cosα(cos(α+ϕkθ)cos(α+ϕk+θ)))=2q1pksinθcosαcos(α+ϕk).\begin{aligned} a_Q^+(q_1,y_k)-a_Q^+(q_1,y_{k-1}) &= \frac{|q_1p_k|}{\sin\alpha \cos\alpha} \Bigl(\cos(\phi_k+\theta)-\cos(\phi_k-\theta) \\ &\qquad\qquad + \cos\alpha\bigl(\cos(\alpha+\phi_k-\theta)-\cos(\alpha+\phi_k+\theta)\bigr)\Bigr) \\ &= \frac{2|q_1p_k|\sin\theta}{\cos\alpha}\cos(\alpha+\phi_k). \end{aligned}

Thus the sign of

aQ+(q1,yk)aQ+(q1,yk1)a_Q^+(q_1,y_k)-a_Q^+(q_1,y_{k-1})

is the sign of

π2αϕk.\frac{\pi}{2}-\alpha-\phi_k.

Let a1a \le 1 be maximal and b1b \ge 1 be minimal such that the segments q1paq_1p_a and q1pb+1q_1p_{b+1} intersect QQ. Then it is enough to consider the points yky_k with

akb.a \le k \le b.

We now verify the following five facts:

  1. ϕkπ/2α\phi_k \le \pi/2-\alpha for all kk.
  2. π/2α=ϕ1ϕ2ϕ3ϕb\pi/2-\alpha = \phi_1 \ge \phi_2 \ge \phi_3 \ge \cdots \ge \phi_b.
  3. ϕ0>π/2αθ\phi_0 > \pi/2-\alpha-\theta.
  4. a=0a=0.
  5. The segments q1y0q_1y_0 and q1y1q_1y_1 do not intersect QQ.

Assuming these, there is some bb' with

1bb1 \le b' \le b

such that

ϕk>π2αθ(0kb),\phi_k > \frac{\pi}{2}-\alpha-\theta \qquad (0 \le k \le b'),

and

ϕkπ2αθ(b<kb).\phi_k \le \frac{\pi}{2}-\alpha-\theta \qquad (b' < k \le b).

By (1), this means yky_k exists for 0kb0 \le k \le b' and not for b<kbb' < k \le b. If b=bb'=b and q1ybq_1y_b intersects QQ, let b=b1b''=b-1; otherwise let b=bb''=b'. By (5), the segments q1ykq_1y_k are disjoint from QQ for 0kb0 \le k \le b'', and not for b<kbb''<k \le b'. Finally, by (1) and (2),

aQ+(q1,y0)=aQ+(q1,y1)aQ+(q1,y2)aQ+(q1,yb).a_Q^+(q_1,y_0)=a_Q^+(q_1,y_1)\le a_Q^+(q_1,y_2)\le \cdots \le a_Q^+(q_1,y_{b''}).

Hence both y0y_0 and y1y_1 achieve aQ+(q1)a_Q^+(q_1).

We now prove the five facts. Applying the sine rule in triangle oq1p1oq_1p_1 gives

cosαcos(αKθ)=s=sinϕ1sin(ϕ1+Kθ).\frac{\cos\alpha}{\cos(\alpha-K\theta)} = s = \frac{\sin\phi_1}{\sin(\phi_1+K\theta)}.

Hence

ϕ1=π2α,\phi_1 = \frac{\pi}{2}-\alpha,

and

oq1p1=π2+αKθ.\angle oq_1p_1 = \frac{\pi}{2}+\alpha-K\theta.

By symmetry,

ϕk=opkq1=op1q2k.\phi_k=\angle op_kq_1=\angle op_1q_{2-k}.

Also a1a \le 1 is maximal and b1b \ge 1 is minimal such that q2ap1q_{2-a}p_1 and q1bp1q_{1-b}p_1 intersect QQ. That is, q1ap1q_{1-a}p_1 and q2bp1q_{2-b}p_1 are tangent to QQ. Now

q0q1p1=(π2+αKθ)(π2θ)>0,\angle q_0q_1p_1 = \left(\frac{\pi}{2}+\alpha-K\theta\right)-\left(\frac{\pi}{2}-\theta\right) > 0,

and

p1q1q2=(K+1)θα0.\angle p_1q_1q_2 = (K+1)\theta-\alpha \ge 0.

Thus a=0a=0, proving (4). Consequently ϕk\phi_k is decreasing from k=1k=1 to k=bk=b, and increasing from k=bk=b to k=n+1k=n+1, proving (1) and (2).

Since q1q_1 lies inside the circumcircle of PP,

p0q1p1>12p0op1=θ.\angle p_0q_1p_1 > \frac{1}{2}\angle p_0op_1 = \theta.

Therefore

ϕ0=ϕ1+p0q1p1p0op1>ϕ1θ,\phi_0 = \phi_1+\angle p_0q_1p_1 - \angle p_0op_1 > \phi_1-\theta,

which proves (3).

Finally, summing angles in the quadrilateral opkykq1op_ky_kq_1 gives

2π=(K+22k)θ+(π2θ)+(πα)+oq1yk.2\pi = (K+2-2k)\theta + \left(\frac{\pi}{2}-\theta\right) + (\pi-\alpha) + \angle oq_1y_k.

Hence

q0q1yk=α(K2k)θ.\angle q_0q_1y_k = \alpha-(K-2k)\theta.

This is positive for k=0,1k=0,1, proving (5).

Let y0y_0' and y1y_1' be the reflections of y0y_0 and y1y_1 in the line oq1oq_1. By symmetry,

aQ(q1)=aQ(q1,y0)=aQ(q1,y1).a_Q^-(q_1)=a_Q^-(q_1,y_0')=a_Q^-(q_1,y_1').

Moreover,

y0q1y0=2oq1y0=2(π2+α(K+1)θ)π.\angle y_0' q_1 y_0 = 2\angle oq_1y_0 = 2\left(\frac{\pi}{2}+\alpha-(K+1)\theta\right) \le \pi.

Hence q1q_1 is a convex point.

The point y0y_0' lies on the side pK+1pK+2p_{K+1}p_{K+2}, so the distance from y0y_0 to y0y_0' along P\partial P is

2Ksinθ+2p1y0.2K\sin\theta + 2|p_1y_0|.

Therefore

δQ(q1)=aQ+(q1)aQ(q1)=2λq1y02Ksinθ2p1y0.\delta_Q(q_1) = a_Q^+(q_1)-a_Q^-(q_1) = 2\lambda |q_1y_0| - 2K\sin\theta - 2|p_1y_0|.

Applying the sine rule in triangle y0p1q1y_0p_1q_1,

q1y0sin(α+θ)=p1y0sinθ=q1p1sinα.\frac{|q_1y_0|}{\sin(\alpha+\theta)} = \frac{|p_1y_0|}{\sin\theta} = \frac{|q_1p_1|}{\sin\alpha}.

Thus

λq1y0p1y0=q1p1sinαcosα(sin(α+θ)cosαsinθ)=q1p1cosθcosα.\lambda |q_1y_0| - |p_1y_0| = \frac{|q_1p_1|}{\sin\alpha \cos\alpha} \bigl(\sin(\alpha+\theta)-\cos\alpha \sin\theta\bigr) = \frac{|q_1p_1|\cos\theta}{\cos\alpha}.

Applying the sine rule in triangle op1q1op_1q_1,

q1p1=sin(Kθ)cos(αKθ).|q_1p_1|=\frac{\sin(K\theta)}{\cos(\alpha-K\theta)}.

Hence

δQ(q1)+2Ksinθ=2cosθsin(Kθ)cosαcos(αKθ)=4cosθsin(Kθ)cos(Kθ)+cos(2αKθ).\delta_Q(q_1)+2K\sin\theta = 2\frac{\cos\theta \sin(K\theta)}{\cos\alpha \cos(\alpha-K\theta)} = 4\frac{\cos\theta \sin(K\theta)}{\cos(K\theta)+\cos(2\alpha-K\theta)}.

By the definition of α\alpha,

cos(2αKθ)+cos(Kθ)=2sin(Kθ)(K+n)tanθ.\cos(2\alpha-K\theta)+\cos(K\theta) = \frac{2\sin(K\theta)}{(K+n)\tan\theta}.

Therefore

δQ(q1)=2nsinθ=p.\delta_Q(q_1)=2n\sin\theta = p.

Similarly,

δQ(q2)=p.\delta_Q(q_2)=p.

Now Lemma 4 shows that

δQ(x)p\delta_Q(x)\ge p

for all xx on the side q1q2q_1q_2.

On the other hand, aQ+(q1)a_Q^+(q_1) and aQ(q1)a_Q^-(q_1) are achieved by y1y_1 and y0y_0' on the sides p1p2p_1p_2 and pK+1pK+2p_{K+1}p_{K+2} respectively. Moreover,

y1q1y0=2πy1q1oy0q1o=π+2α2(K+1)θ<π.\angle y_1q_1y_0' = 2\pi-\angle y_1q_1o-\angle y_0q_1o = \pi+2\alpha-2(K+1)\theta < \pi.

By symmetry, aQ+(q2)a_Q^+(q_2) and aQ(q2)a_Q^-(q_2) are achieved by ρ(y0)\rho(y_0) and ρ(y1)\rho(y_1'). Also q1y1q_1y_1 is parallel to q2ρ(y0)q_2\rho(y_0), and q1y0q_1y_0' is parallel to q2ρ(y1)q_2\rho(y_1'). Interpolating along the side q1q2q_1q_2 shows that every point xx on q1q2q_1q_2 is concave and satisfies

δQ(x)=p.\delta_Q(x)=p.

By rotational symmetry, the same is true on every side of QQ. Therefore all hypotheses of Theorem 1 are satisfied. This proves Theorem 2. \square

Hexagon Computation

For Problem 761 we set

n=6,θ=π6,tanθ=13.n=6, \qquad \theta=\frac{\pi}{6}, \qquad \tan\theta=\frac{1}{\sqrt{3}}.

Define

f(k)=sin(kθ)(k+6)tanθcos(kθ).f(k)=\sin(k\theta)-(k+6)\tan\theta \cos(k\theta).

Then

f(0)=6tan(π6)=23<0,f(0)=-6\tan\left(\frac{\pi}{6}\right)=-2\sqrt{3}<0, f(1)=1271332=3<0,f(1)=\frac{1}{2}-7\cdot\frac{1}{\sqrt{3}}\cdot\frac{\sqrt{3}}{2}=-3<0, f(2)=3281312=523<0,f(2)=\frac{\sqrt{3}}{2}-8\cdot\frac{1}{\sqrt{3}}\cdot\frac{1}{2} = -\frac{5}{2\sqrt{3}}<0,

and

f(3)=1>0.f(3)=1>0.

Hence

K=2.K=2.

Now

α=12(π3+arccos ⁣(2sin(π/3)8tan(π/6)cos(π/3))).\alpha = \frac{1}{2}\left( \frac{\pi}{3} + \arccos\!\left( \frac{2\sin(\pi/3)}{8\tan(\pi/6)} - \cos(\pi/3) \right)\right).

The argument of the arccosine simplifies to

2sin(π/3)8tan(π/6)cos(π/3)=2(3/2)8(1/3)12=3812=18.\frac{2\sin(\pi/3)}{8\tan(\pi/6)} - \cos(\pi/3) = \frac{2(\sqrt{3}/2)}{8(1/\sqrt{3})}-\frac{1}{2} = \frac{3}{8}-\frac{1}{2} = -\frac{1}{8}.

Therefore

α=12(π3+arccos ⁣(18)),\alpha = \frac{1}{2}\left(\frac{\pi}{3}+\arccos\!\left(-\frac{1}{8}\right)\right),

and

VHexagon=λ=secα=1cos ⁣(12(π3+arccos(1/8)))5.055050463303889.V_{\text{Hexagon}} = \lambda = \sec\alpha = \frac{1}{\cos\!\left(\frac{1}{2}\left(\frac{\pi}{3}+\arccos(-1/8)\right)\right)} \approx 5.055050463303889.

Thus

VHexagon=5.05505046V_{\text{Hexagon}} = 5.05505046

to eight digits after the decimal point.

Numerical Procedure

For a general convex pool, one may iteratively search for the cutoff speed as follows. Suppose QQ is a convex subset of PP with

δQ(x)pfor all xQ.\delta_Q(x)\le p \qquad \text{for all } x \in \partial Q.

Pick a point qQq \in Q as far as possible from Q\partial Q. For each xQx \in \partial Q, let ϕ(x)\phi(x) be the point on the segment xqxq whose distance from xx is

pδQ(x)3λ.\frac{p-\delta_Q(x)}{3\lambda}.

Let ϕ(Q)\phi(Q) be the convex hull of ϕ(Q)\phi(\partial Q). Starting from Q=PQ=P, apply ϕ\phi repeatedly. There are two possible outcomes:

  • the procedure terminates when the perimeter of QQ drops below p/λp/\lambda, in which case the swimmer wins for v=λv=\lambda;
  • the procedure continues forever and converges to a convex set QQ invariant under ϕ\phi, in which case
δQ(x)=pfor all xQ.\delta_Q(x)=p \qquad \text{for all } x \in \partial Q.

Then for v=λv=\lambda, the runner wins if the swimmer starts in QQ, while the swimmer wins from suitable boundary-phase starting data outside that trapped region.

Algorithm

For the regular nn-gon, the implementation is:

theta = pi / n
find the largest K with sin(K theta) - (K+n) tan(theta) cos(K theta) < 0
alpha = 0.5 * (K theta + arccos(2 sin(K theta)/((K+n) tan(theta)) - cos(K theta)))
return 1 / cos(alpha)

For Problem 761, set n = 6.

Complexity Analysis

  • Time: O(K)O(K).
  • Space: O(1)O(1).

Answer

5.05505046\boxed{5.05505046}

Code

Each problem page includes the exact C++ and Python source files from the local archive.

C++ project_euler/problem_761/solution.cpp
#include <cmath>
#include <iomanip>
#include <iostream>
#include <sstream>

int cutoff_index_regular_polygon(int sides) {
    const double pi = std::acos(-1.0);
    const double theta = pi / static_cast<double>(sides);
    const double tangent = std::tan(theta);

    auto threshold_function = [&](int k) {
        const double angle = k * theta;
        return std::sin(angle) - (k + sides) * tangent * std::cos(angle);
    };

    int k = 0;
    while (threshold_function(k) < 0.0) {
        ++k;
    }
    return k - 1;
}

double critical_speed_regular_polygon(int sides) {
    const double pi = std::acos(-1.0);
    const double theta = pi / static_cast<double>(sides);
    const double tangent = std::tan(theta);
    const int k = cutoff_index_regular_polygon(sides);

    const double angle = k * theta;
    // Theorem 2 gives V_n = sec(alpha).
    const double correction = std::acos(
        2.0 * std::sin(angle) / ((k + sides) * tangent) - std::cos(angle)
    );
    const double alpha = (angle + correction) / 2.0;
    return 1.0 / std::cos(alpha);
}

std::string solve() {
    std::ostringstream output;
    output << std::fixed << std::setprecision(8)
           << critical_speed_regular_polygon(6);
    return output.str();
}

int main() {
    std::cout << solve() << '\n';
    return 0;
}