The Lizard and the Fly

An open cylinder garbage container has a height of 4 ft and a circumference of 6 ft. On the inside of the container, 1 ft from the top, is a fly. On the opposite side of the container 1 ft from the bottom and on the outside, is a lizard. What is the shortest distance that the lizard must walk to reach the fly?


To reach the fly, the lizard must first walk a path on the exterior surface of the garbage container to the opening. From there, it continues walking along a path on the interior surface to catch the prey.

The most salient piece of knowledge we have about minimum distance is that the shortest distance between two points comes from the straight line connecting them. However, it is not immediately apparent how to apply this knowledge in the present problem, since we are constrained to the bent lines on a curved wall. Nonetheless, the curved wall can be cut and flattened, result in a completely flat two dimensional surface. We can then connect the points by a straight line.

Fig. 1

Having flattened out the wall in the manner shown in Fig. 1, we see the lizard’s walking path consists two segments of straight line. The length of the path is

\sqrt{x^2+3^2} + \sqrt{(3-x)^2+1^2}.\quad\quad\quad(1)

Fig. 2

Three centuries before the birth of Christ, Euclid discovered the reflection law of light: if a ray of light is reflected by a mirror from point A to point B, the point of reflection P is such that the rays AP and PB make equal angles with the mirror (\theta_1 = \theta_2 in Fig. 2). However, it was Heron who first observed that if the point P on the mirror were such that \theta_2 \ne \theta_2, then the resulting total path length AP+PB would be longer; i.e.,

AP + PB is minimized when \theta_1 = \theta_2.

For the lizard, when \alpha = \beta, it walks the least (Fig. 1).

From \alpha=\beta, we have \cot(\alpha) = \cot(\beta); i.e.,

\frac{x}{3} = \frac{3-x}{1}\quad\quad\quad(2)

Solving (2) gives

x = \frac{9}{4}

so that (1) yields

\sqrt{(\frac{9}{4})^2 + 3^2} + \sqrt{(3-\frac{9}{4})^2+1^2} = 5.

Therefore, the shortest distance the lizard must walk is 5 ft.


Exercise-1 Find x that minimizes \sqrt{x^2+25} + \sqrt{(x-4)^2+4}.

Exercise-2 If x and N are real numbers such that N=\sqrt{5x+6}+\sqrt{7x+8}, then what is the smallest possible value of N?

Exercise-3 An open cylinder garbage container has a height of 4 ft and a circumference of 6 ft. On the inside of the container, 1 ft from the top, is a fly. On the opposite side of the container, 1 ft from the bottom inside the container, is a lizard. What is the shortest distance that the lizard must walk to reach the fly?

Wallis’ Pi

There is a remarkable expression for the number \pi as an infinite product. Starting with definite integral \int\limits_{0}^{\frac{\pi}{2}} \sin^{m}(x)\;dx, m=0,1,2,3,4..., we derive it as follows:

\int\limits_{0}^{\frac{\pi}{2}} \sin^m(x)\;dx

=\int\limits_{0}^{\frac{\pi}{2}}\sin^{m-1}(x)\cdot\sin(x)\;dx

= \int\limits_{0}^{\frac{\pi}{2}} \sin^{m-1}(x)\cdot(-\cos(x))'\;dx

By \int\limits_{a}^{b} u\cdot v'\;dx = u\cdot  v \bigg|_{b}^{a}- \int\limits_{b}^{a} u' \cdot v\;dx,

= \sin^{m-1}(x)\cdot(-\cos(x))\bigg|_{0}^{\frac{\pi}{2}} - \int\limits_{0}^{\frac{\pi}{2}}(\sin^{m-1}(x))'\cdot(-\cos(x))\;dx

= 0 - \int\limits_{0}^{\frac{\pi}{2}}(m-1)\sin^{m-2}(x)\cos(x)\cdot(-\cos(x))\;dx

= +\int\limits_{0}^{\frac{\pi}{2}}(m-1)\sin^{m-2}(x)\cdot\cos^2(x)\;dx

\overset{\cos^2(x) = 1-\sin^2(x)}{=}\int\limits_{0}^{\frac{\pi}{2}}(m-1)\sin^{m-2}(x)\cdot (1-\sin^{2}(x))\;dx

= \int\limits_{0}^{\frac{\pi}{2}}(m-1)\sin^{m-2}(x) - (m-1)\sin^{m}(x)\;dx

= (1-m)\int\limits_{0}^{\frac{\pi}{2}}\sin^{m}(x)\;dx + (m-1)\int\limits_{0}^{\frac{\pi}{2}}\sin^{m-2}(x)\;dx.

That is,

m\int\limits_{0}^{\frac{\pi}{2}}\sin^{m}(x)\;dx = (m-1)\int\limits_{0}^{\frac{\pi}{2}}\sin^{m-2}(x)\;dx.

And so,

\int\limits_{0}^{\frac{\pi}{2}}\sin^{m}(x) \; dx= \frac{m-1}{m}\int\limits_{0}^{\frac{\pi}{2}}\sin^{m-2}(x)\;dx.\quad\quad\quad(1)

By repeated application of (1) we have the following values for I_{m} = \int\limits_{0}^{\frac{\pi}{2}} \sin^{m}(x)\;dx:

For even m,

I_{2n} =  \left(\prod\limits_{k=0}^{n-1}\frac{2n-2k-1}{2n-2k}\right)I_0\overset{I_0 =  \int\limits_{0}^{\frac{\pi}{2}}\;dx = \frac{\pi}{2}}{\implies}I_{2n}= \left(\prod\limits_{k=0}^{n-1}\frac{2n-2k-1}{2n-2k}\right)\cdot \frac{\pi}{2}.

Similarly, for odd m,

I_{2n+1} = \left(\prod\limits_{k=0}^{n-1}\frac{2n+1-2k-1}{2n+1-2k}\right)\cdot I_{1}\overset{I_1 = \int\limits_{0}^{\frac{\pi}{2}}\sin^{1}(x)\;dx = 1}{\implies} I_{2n+1}= \prod\limits_{k=0}^{n-1}\frac{2n-2k}{2n-2k+1}.

i.e.,

I_{2n} = \frac{2n-1}{2n}\cdot\frac{2n-3}{2n-2}\cdot\frac{2n-5}{2n-4}\cdot\frac{2n-7}{2n-6}\cdots\frac{5}{6}\cdot\frac{3}{4}\cdot\frac{1}{2}\cdot\frac{\pi}{2}\quad\quad\quad(2)

I_{2n+1} =\frac{2n}{2n+1}\cdot\frac{2n-2}{2n-1}\cdot\frac{2n-4}{2n-3}\cdot\frac{2n-6}{2n-5}\cdots\frac{6}{7}\cdot\frac{4}{5}\cdot\frac{2}{3}\quad\quad\quad\quad\quad(3)

Since for 0<x<\frac{\pi}{2}, 0< \sin(x) < 1, we have \sin^{2n-1}(x) > \sin^{2n}(x) > \sin^{2n+1}(x). It means

\int\limits_{0}^{\frac{\pi}{2}}\sin^{2n-1}(x) > \int\limits_{0}^{\frac{\pi}{2}}\sin^{2n}(x)\;dx > \int\limits_{0}^{\frac{\pi}{2}}\sin^{2n+1}(x)\;dx>0

or,

I_{2n-1} > I_{2n} > I_{2n+1}>0.

Hence,

\frac{I_{2n-1}}{I_{2n+1}}>\frac{I_{2n}}{I_{2n+1}} > 1.\quad\quad\quad(4)

Moreover, we have

I_{2n+1} \overset{(1)}{=} \frac{(2n+1)-1}{2n+1}I_{(2n+1)-2} = \frac{2n}{2n+1} I_{2n-1},

so that

\frac{I_{2n-1}}{I_{2n+1}} = \frac{2n+1}{2n}.\quad\quad\quad(5)

And,

\frac{I_{2n}}{I_{2n+1}} \overset{(2), (3)}{=} \frac{(2n+1)\cdot(2n-1)^2\cdot (2n-3)^2 \cdots 7^2\cdot 5^2\cdot 3^2}{(2n)^2\cdot (2n-2)^2\cdot (2n-4)^2\cdots 6^2\cdot 4^2\cdot 2^2}\cdot \frac{\pi}{2}

= \frac{(2n)^2\cdot (2n-1)^2\cdot (2n-2)^2\cdot (2n-3)^2\cdot (2n-4)^2\cdots 7^2\cdot 6^2\cdot 5^2\cdot 4^2\cdot 3^2\cdot 2^2}{(2n)^4(2n-2)^4\cdot (2n-4)^4 \cdots 6^4\cdot 4^4\cdot 2^4}\cdot (2n+1)\cdot\frac{\pi}{2}

= \frac{\left((2n)\cdot (2n-1)\cdot (2n-2)\cdot (2n-3)\cdot (2n-4)\cdots 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2\right)^2}{(2^4\cdot n^4)\cdot (2^4\cdot(n-1)^4) \cdot (2^4\cdot (n-2)^4)\cdots(2^4\cdot 3^4)\cdot (2^4\cdot 2^4)\cdot 2^4}\cdot (2n+1)\cdot\frac{\pi}{2}

= \frac{((2n)!)^2}{\underbrace{2^4\cdot 2^4\cdots 2^4}_{n 2^4s}\cdot (n\cdot(n-1)\cdot(n-2)\cdots 3 \cdot 1)^4}(2n+1)\cdot\frac{\pi}{2}

= \frac{((2n)!)^2\cdot (2n+1)}{2^{4n}\cdot(n!)^4}\cdot \frac{\pi}{2}

gives

\frac{I_{2n}}{I_{2n+1}} = \frac{((2n)!)^2(2n+1)}{2^{4n}(n!)^4}\cdot\frac{\pi}{2}.\quad\quad\quad(6)

Substituting (5) and (6) into (4) yields

\frac{2n+1}{2n} >\frac{((2n)!)^2(2n+1)}{2^{4n}(n!)^4}\cdot\frac{\pi}{2}>1.

Since \lim\limits_{n \rightarrow \infty} \frac{2n+1}{2n} = 1, \lim\limits_{n \rightarrow \infty}1 = 1, by Squeeze Theorem for Sequences,

\lim\limits_{n \rightarrow \infty}\frac{((2n)!)^4(2n+1)}{2^{4n}(n!)^4} \cdot \frac{\pi}{2}= 1\implies \lim\limits_{n \rightarrow \infty}\frac{((2n)!)^2(2n+1)}{2^{4n}(n!)^4}=\frac{2}{\pi}.

Consequently,

\lim\limits_{n \rightarrow \infty} \frac{2^{4n}(n!)^4}{((2n)!)^2(2n+1)}= \frac{\pi}{2},

i.e.,

\pi = 2\cdot\lim\limits_{n \rightarrow \infty}\frac{2^{4n}(n!)^4}{((2n)!)^2(2n+1)}.

This is Wallis’ product representation for \pi, named after John Wallis who discovered it in 1665.


Maxima knows Wallis’ Pi:

Fig. 1

So does Mathematica:

Fig. 2

Its convergence to \pi is illustrated in Fig. 3:

Fig. 3