Sunday, May 31, 2026

Two sheep

Two sheep are at two random points inside a square pen. They are munching grass and staring in two random directions. Each sheep has a field of view that’s 180 degrees. What is the probability that they both see each other?

Let's first start with two sheep in a one-dimensional unit interval pen each of which randomly either look to the right or to the left. Obviously in this case, each sheep has a $50\%$ chance of randomly looking at the other sheep and their directional choices are independent, so the probability is $25\%.$

But wait, weren't we dealing with two sheep in a unit square pen? Sure, let's assume that one sheep is at the point $(a,b)$ and another is at $(c,d).$ Next let's draw the straight line $y = \frac{d-b}{c-b} (x - a) + b$ through these two points. The sheep at $(a,b)$ is staring into space in a direction that makes an angle $\theta$ with respect to the ray of the line that we just drew as $x$ increases. We see that either $0 \leq \theta \leq \frac{\pi}{2},$ in we can think of this as looking to the right with respect to the line between the sheep, or $\frac{\pi}{2} \leq \theta \leq \pi$ in which case we can think of this as looking to the left. Therefore, despite living in a fully two dimensional field, we can project this problem back into the one dimensional problem. Similarly, we can therefore conclude that the probability of these two sheep seeing each other in the square pen is $25\%.$

Three sheep

Now, three sheep are at three random points inside a square pen. They are munching grass and staring in three random directions. As before, each sheep has a field of view that’s 180 degrees. What is the probability that all three sheep see each other?

Here we have to be a bit less handwavy, but let's assume that the sheep are located at points $A=(a_1,a_2),$ $B=(b_1,b_2)$ and $C=(c_1,c_2)$, where the measure of the angle $m\angle CAB = \alpha,$ $m\angle ABC = \beta,$ and $m\angle BCA = \gamma.$ In this case the sheep at $A$ can only see $B$ if it is looking up to an angle of $\frac{\pi}{2}$ to the left or right of the line between $A$ and $B$. Similarly, it can only see $C$ if it is looking up to an angle of $\frac{\pi}{2}$ to the left or right of the line between $A$ and $C.$ Let's assume that the line between $A$ and $B$ forms an angle of $\theta$ with respect to the positive $x$-axis. Then since $m\angle CAB = \alpha,$ we see that the line between $A$ and $C$ must either form an angle of $\theta-\alpha$ or $\theta+\alpha.$ That means that either the sheep must be staring in the direction of $\phi \in \left[ \theta - \frac{\pi}{2}, \theta + \frac{\pi}{2} \right] \cap \left[ \theta - \alpha - \frac{\pi}{2}, \theta - \alpha + \frac{\pi}{2} \right] = \left[ \theta - \frac{\pi}{2}, \theta - \alpha + \frac{\pi}{2} \right]$ or $\phi \in \left[ \theta - \frac{\pi}{2}, \theta + \frac{\pi}{2} \right] \cap \left[ \theta + \alpha - \frac{\pi}{2}, \theta + \alpha + \frac{\pi}{2} \right] = \left[ \theta + \alpha - \frac{\pi}{2}, \theta + \frac{\pi}{2} \right],$ so in either case we have that the probability of the sheep at $A$ looking at both the sheep at $B$ and the sheep at $C$ is $$\frac{ \pi - \alpha }{ 2\pi} = \frac{1}{2} - \frac{\alpha}{2\pi}.$$ Since there was nothing special about $A$ and everything is independent, we see that the probability of all of the sheep looking at each other given the angles $\alpha,$ $\beta$ and $\gamma$ are $$p(\alpha, \beta, \gamma) = \left( \frac{1}{2} - \frac{\alpha}{2\pi}\right) \left( \frac{1}{2} - \frac{\beta}{2\pi} \right) \left( \frac{1}{2} - \frac{\gamma}{2\pi}\right).$$ We see that the maximum probability for any particular shape would be for an equilateral triangle $(\alpha=\beta=\gamma=\frac{\pi}{3})$, where the probability is $\frac{1}{27} = 3.\overline{703}\%,$ whereas the minimum probability is for three collinear points where say $\alpha=\pi$ and $\beta=\gamma=0,$ where the probability is $0.$

So if we know where $A$, $B$ and $C$ are all then we can get the side lengths of the triangle $a=\|B-C\|,$ $b=\|A-C\|,$ and $c=\|A-B\|.$ From this we can use the law of cosines to get \begin{align*}\alpha &= \cos^{-1} \left( \frac{b^2 + c^2 - a^2}{2bc} \right) = \cos^{-1} \left( \frac{ \|A-C\|^2 + \|A-B\|^2 - \|B-C\|^2}{ 2 \|A-B\| \|A-C\| } \right)\\ \beta &= \cos^{-1} \left( \frac{a^2 + c^2 - b^2}{2ac} \right) = \cos^{-1} \left( \frac{ \|B-C\|^2 + \|A-B\|^2 - \|A-C\|^2}{ 2 \|A-B\| \|B-C\| } \right)\\ \gamma &= \cos^{-1} \left( \frac{a^2 + b^2 - c^2}{2ab} \right) = \cos^{-1} \left( \frac{ \|B-C\|^2 + \|A-C\|^2 - \|A-B\|^2}{ 2 \|A-C\| \|B-C\| } \right),\end{align*} so we get $$p(A,B,C) = \left( \frac{1}{2} - \frac{\alpha(A,B,C)}{2\pi} \right) \left( \frac{1}{2} - \frac{\beta(A,B,C)}{2\pi} \right) \left( \frac{1}{2} - \frac{\gamma(A,B,C)}{2\pi} \right)$$ Putting this all together we get the probability that all three sheep see each other as $$P = \iint_{A \in [0,1]^2} \iint_{B \in [0,1]^2} \iint_{C \in [0,1]^2} p(A,B,C) \,dA\,dB\,dC,$$ which we will just use some Monte Carlo to estimate this probability.

After 10,000 Monte Carlo simulations for $A$, $B$, and $C,$ we obtain an estimated probability of all three sheep looking at one another $P \approx 2.72\%$. Knowing the way that these problems work out I wouldn't be surprised if somehow the integral works out to roughly $\frac{e}{100},$ but looking at the gnarliness of the integral, I would also be relatively surprised if it did.

Monday, May 25, 2026

June's Shortest Cylindrical Shell Path

Now, June is on a hollowed-out cylinder, also known as a “cylindrical shell.” The shell’s outer radius is $2$ meters and its inner radius is $1$ meter. The shell is $2$ meters tall. June is on the outer edge of one of the cylinder’s two flat faces. Her dinner is on the opposite face, and all the way around on the other end of that face.

Once again, your job is to help June find the shortest path along the surface of the shell so that she can chow down as quickly as possible. What’s the length of this shortest path?

In the classic problem, June was able to roughly ignore the rounded edge of the cylinder and use two straight lines to reach the food. Here, the hollowed out center will force her to take another approach. Let's again assume that June starts at $(2, 0, 2),$ her food is at $(-2, 0, 0),$ June's last stop on the upper face is at the point $(\cos \theta, \sin \theta, 2)$ and first stop on the lower face is at the point $(\cos \phi, \sin \phi, 0),$ for some $0 \leq \theta \leq \frac{\pi}{3}$ and $\frac{2\pi}{3} \leq \phi \leq \pi.$ Here, we note that we can constrain $\theta$ and $\phi$ a little bit more than in the Classic problem, since the distance from $(\cos \theta, \sin \theta, 2)$ to $(\cos \phi, \sin \phi, 0)$ is $$d_2(\theta, \phi) = \sqrt{4 + (\phi-\theta)^2},$$ which is always less than descending vertically down from the upper to lower faces and then traversing along the inner radius from angle $\theta$ to $\phi,$ or vice versa. This means that we can rule out any of the values for $\theta$ and $\phi$ in $[\pi/3, 2\pi/3],$ where the straight line path would cross within the hollowed out inner circle and require June to travel along the curved inner radius.

Therefore, taking the Euclidean distances along the upper and lower faces of the cylindrical shell, we have that the Extra Credit distance formula is given by $$d(\theta, \phi) = \sqrt{5 - 4 \cos \theta} + \sqrt{5 + 4 \cos \phi} + \sqrt{4 + (\phi - \theta)^2}.$$ so we need to find $$d^* = \inf \left\{ d(\theta, \phi) \mid 0 \leq \theta \leq \frac{\pi}{3}, \frac{2\pi}{3} \leq \phi \leq \pi \right\}.$$ From a symmetry perspective, let's assume that $\phi = \pi - \theta,$ which means that we can define \begin{align*}\tilde{d} (\theta) &= d(\theta, \pi-\theta) \\ &= \sqrt{5 - 4\cos \theta} + \sqrt{5 + 4 \cos (\pi - \theta)} + \sqrt{4 + (\pi - \theta - \theta)^2} \\ &= 2 \sqrt{5 - 4 \cos \theta} + \sqrt{4 + (\pi - 2\theta)^2}.\end{align*} Here we see that $$\tilde{d}^\prime (\theta) = \frac{4\sin \theta}{\sqrt{ 5 - 4 \cos \theta}} + \frac{ 2 (2\theta - \pi) }{\sqrt{ 4 + (\pi - 2\theta)^2} },$$ so setting this equal to zero we get $$\frac{4 \sin \theta}{\sqrt{5 - 4 \cos \theta}} = \frac{ 2 (\pi - 2\theta) }{\sqrt{4 + (\pi - 2\theta)^2}}.$$ Squaring both sides and using some trigonometry identities, we see that this is equivalent to the implicit function $$\theta + \frac{2\sin \theta}{2 \cos \theta - 1} = \frac{\pi}{2}.$$

Let's use Newton-Raphson method on the function $$f(\theta) = \theta + \frac{2\sin \theta}{2\cos \theta - 1} - \frac{\pi}{2},$$ where $$f^\prime(\theta) = 1 + \frac{4-2\cos \theta}{(2\cos \theta - 1)^2},$$ to figure out the proper root of this implicit function, we see that we can start with an example of $\theta_0 = \frac{1}{2},$ then $$\theta_{n+1} = \theta_n - \frac{f(\theta_n)}{f^\prime(\theta_n)},$$ for $n = 0, 1, 2, \dots.$ We see that after only a few steps we quickly settle into $$\theta^* = \lim_{n \to \infty} \theta_n = 0.457751785361\dots.$$ This translates into a minimal distance for June to get to her food on the cylindrical shell of $$\tilde{d}^* = \tilde{d}(\theta^*) \approx 5.368959019243\dots$$ meters.

$n$ $\theta_n$ $f(\theta_n)$ $f^\prime(\theta_n)$ $\tilde{d}(\theta_n)$
1 0.500000000000 0.198927402511 4.936412045223 5.371299778386
2 0.459702026353 0.008790035183 4.516178419967 5.368964120693
3 0.457755682704 0.000017530945 4.498196526681 5.368959019263
4 0.457751785377 0.000000000070 4.498160714274 5.368959019243
5 0.457751785361 0.000000000000 4.498160714132 5.368959019243

June's Shortest Cylindrical Path

June the ant is on a cylinder. More specifically, she is on the edge of one of the cylinder’s two circular faces. Her dinner is on the edge of the opposite circular face, and all the way around on the other side of that face. The radius of the cylinder is $2$ meters and its height is $2$ meters.

Your job is to help June find the shortest path along the surface of the cylinder so that she can chow down as quickly as possible. What’s the length of this shortest path?

Let's assume that June is located at the point $(2,0,2)$ while her food is located at $(-2,0,0),$ making the center of the cylinder aligned with the positive $z$-axis. Let's assume that June's path last leaves the top circular face at the point $(2\cos \theta, 2\sin \theta, 2),$ for some $0 \leq \theta \leq \pi.$ Similarly, let's assume that June's path first arrives on the bottom circular face at the point $(2 \cos \phi, 2\sin \phi, 0),$ for some $\theta \leq \phi \leq \pi.$ Though June's path could theoretically wander about anywhere, let's assume that she will walk in straight lines when on the two circular faces and on a straight line with respect to the curved outer edge. The path along the upper circular face will have a distance $$d_1(\theta) = \sqrt{ (2\cos \theta - 2)^2 + (2 \sin \theta)^2 + (2-2)^2 } = 2 \sqrt{ 1 - 2 \cos \theta } = 4 \sin \frac{\theta}{2}.$$ The path along the lower circular face will have a distance $$d_3(\phi) = \sqrt{ (2 \cos \phi + 2)^2 + (2 \sin \phi)^2 + (2-2)^2 } = 2 \sqrt{ 1 + 2 \cos \phi } = 4 \cos \frac{\phi}{2}.$$ The path along the curved outer edge is given by $d_2(\theta, \phi) = 2 \sqrt{1 + (\phi - \theta)^2},$ which we can see either by unrolling the curved outer edge into a rectangle and realizing that the path is the hypotenuse of a triangle with height $2$ and base $2 (\phi - \theta)$, or more formally by paramaterizing the path along the outer edge as the curve $x(t) = 2 \cos t,$ $y(t) = 2 \sin t,$ $z(t) = 2 \frac{\phi - t}{\phi - \theta},$ for $t \in [\theta, \phi]$ and finding \begin{align*}d_2(\theta, \phi) &= \int_\theta^\phi \sqrt{ \left(\frac{dx}{dt}\right)^2 + \left( \frac{dy}{dt} \right)^2 + \left( \frac{dz}{dt} \right)^2 } \,dt \\ &= \int_\theta^\phi \sqrt{ (-2\sin t)^2 + (2 \cos t)^2 + \left(\frac{-2}{\phi - \theta}\right)^2 } \,dt \\ &= \int_\theta^\phi \sqrt{ 4 \sin^2 t + 4 \cos^2 t + \frac{4}{(\phi - \theta)^2} } \,dt \\ &= \frac{2 \sqrt{1 + (\phi - \theta)^2}}{\phi - \theta} \int_\theta^\phi \,dt \\ &= 2 \sqrt{ 1 + (\phi - \theta)^2 }.\end{align*} So the total distance is $$d(\theta, \phi) = d_1(\theta) + d_2(\theta, \phi) + d_3(\phi) = 4 \sin \frac{\theta}{2} + 4 \cos \frac{\phi}{2} + 2 \sqrt{ 1 + (\phi - \theta)^2 }.$$

So June would want to find $$d^* = \inf \{ d(\theta, \phi) \mid 0 \leq \theta \leq \phi \leq \pi \}.$$ Let's treat the case where $\theta = \phi$ and hence we have a univariate problem $$\tilde{d}(\theta) = 4 \sin \frac{\theta}{2} + 4 \cos \frac{\theta}{2} + 2.$$ We see that in this case, we have $$\frac{d}{d\theta} \tilde{d} = 2 \cos \frac{\theta}{2} - 2 \sin \frac{\theta}{2}$$ which has critical points whenever $\tan \frac{\theta}{2} = 1,$ that is $\frac{\theta}{2} = \frac{\pi}{4},$ or $\theta^* = \frac{\pi}{2}.$ Therefore, we see that the minimal value of $$ \tilde{d}^* = \inf_{0 \leq \theta \leq \pi} \tilde{d}(\theta) = \min \left\{ \tilde{d}(0), \tilde{d}(\pi), \tilde{d} \left( \frac{\pi}{2} \right) \right\} = \min \{ 6, 6, 4\sqrt{2}+2 \} = 6,$$ which occurs when either $\theta=0$ or $\theta=\pi.$ This amounts to either going straight down the curved side and then taking a straightline path across the diameter to the food, or vice versa.

Let's fix some $\theta \in [0,\pi)$ and then try to minimize with respect to $\phi.$ We see that $$\frac{\partial d}{\partial \phi} = -2 \sin \frac{\phi}{2} + \frac{ 2(\phi - \theta)}{\sqrt{1 + (\phi-\theta)^2}}.$$ Setting this equal to zero and doing a bunch of algebra and trigonometry identities we get the implicit function $$\phi - \tan \frac{\phi}{2} = \theta.$$ Letting $g(t) = t - \tan \frac{t}{2},$ we see that $g^\prime(t) = 1 - \frac{1}{2} \sec^2 \frac{t}{2},$ so the largest possible value of $g$ occurs when $\sec^2 \frac{t}{2} = 2$ or equivalently when $\cos \frac{t}{2} = \frac{\sqrt{2}}{2},$ that is when $t = \frac{\pi}{2},$ and in particular we see that $$g(t) \leq g^* = g( \frac{\pi}{2} ) = \frac{\pi}{2} - 1.$$ Therefore, we see that if $\theta \geq \frac{\pi}{2} - 1$ then we have $\frac{\partial d}{\partial \phi} \leq 0$ for all $\phi \in [\theta, \pi],$ so if $\theta \gt \frac{\pi}{2} - 1,$ then the shortest path that can be obtained by choosing $\phi = \pi$ is $$ \inf_{\phi \in [\theta, \pi]} d(\theta, \phi) = d(\theta, \pi) = 4 \sin \frac{\theta}{2} + 2 \sqrt{ 1 + (\pi - \theta)^2}.$$ We see that in this case if we set $$\delta(\theta) = 4 \sin \frac{\theta}{2} + 2 \sqrt{ 1 + (\pi - \theta)^2}$$ that $$ \delta^* = \inf_{\theta \in [\frac{\pi}{2} -1, \pi]} \delta(\theta) = \delta(\pi) = 6.$$

Ok, so we are now left with only the case where $\theta \in [0, \frac{\pi}{2} -1).$ In this case, we can approximate the implicit equation using a cubic function, since $\tan \frac{t}{2} \approx \frac{t}{2} + \frac{t^3}{24} + O(t^4)$ for $|t| \lt 1.$ This yields the new approximate implicit equation $$\phi - \left( \frac{\phi}{2} + \frac{\phi^3}{24} \right) = \theta,$$ or equivalently, $$\phi^3 - 12\phi + 24 \theta = 0.$$ This cubic has three real roots, and the middle one will yield a local minimum since it will represent the place where $\frac{\partial d}{\partial \phi} \lt 0$ to the left of the root and $\frac{\partial d}{\partial \phi} \gt 0$ to the right of the root. From the Viete formula, we see that this root will be at $$\phi^*(\theta) = 4 \cos \left( \frac{ \cos^{-1} \left( -\frac{3\theta}{2} \right) - 2\pi }{3} \right).$$ Importantly, we remember that we got into this mess because $\phi^*(\theta)$ roughly satisfies $$\frac{\partial d}{\partial \phi} (\theta, \phi^*(\theta)) \approx 0.$$ So let's define $$\Delta(\theta) = d(\theta, \phi^*(\theta)),$$ and look to find $\Delta^* = \inf \{\Delta(\theta) \mid \theta \in [0,\frac{\pi}{2}-1]\}.$ Thankfully, we see that \begin{align*}\Delta^\prime(\theta) &= 2 \cos \frac{\theta}{2} - 2 \sin \frac{\phi^*(\theta)}{2} (\phi^*)^\prime (\theta) + \frac{ 2(\phi^*(\theta) - \theta) }{ \sqrt{ 1 + (\phi^*(\theta) - \theta)^2 }} (\phi^*)^\prime (\theta) \\ &= 2 \cos \frac{ \theta}{2} + (\phi^*)^\prime (\theta) \left( - 2 \sin \frac{ \phi^*(\theta) }{2} + \frac{ 2( \phi^*(\theta) - \theta }{ \sqrt{ 1 + (\phi^* (\theta) - \theta)^2 }} \right) \\ & = 2 \cos \frac{ \theta}{2} + (\phi^*)^\prime (\theta) \frac{\partial d}{\partial \phi} (\theta, \phi^*(\theta)) \\ & \approx 2 \cos \frac{\theta}{2} \gt 0,\end{align*} for all $\theta \in [0, \frac{\pi}{2} - 1),$ therefore we see that $\Delta^* = \Delta(0) = 6.$

Therefore, since we went through all of the cases, we now anticlimactically confirm that in fact, June's shortest path to the food is 6 meters long.

Monday, May 11, 2026

Extra Credit Random-Ade Recipe

Once again I’m preparing random-ade, but this time I have three 12-ounce glasses.

I fill the first glass with a random amount of lemon juice, the second glass with a random amount of lime juice, and the third glass with a random amount of water. As before, each amount is chosen uniformly between 0 and 12 ounces, and all amounts are independent. Next, I pour an equal amount from each glass into the pitcher until one of the glasses is empty.

At this point, I refill that empty glass with yet another random amount of the same liquid it previously contained. Once again, I pour an equal amount from each glass into the pitcher until one of the glasses is empty.

Then I refill that now-empty glass with yet another random amount of the same liquid it previously contained. Again, I pour an equal amount from each glass into the pitcher until one of the glasses is empty.

On average, how much random-ade can I expect to prepare?

OK, so in the extra credit version we can let $E, I, W \sim U(0,12)$ represent the random volume in ounces of l"E"mon juice, l"I"me juice and "W"ater, respectively, that are initially poured into the glasses. Let $V_1, V_2 \sim U(0,12)$ be the additional random volumes that are poured into the then empty glasses. Here again we have $E, I, W, V_1,$ and $V_2$ independent. We have $$\tilde{R}(E,I,W,V_1,V_2) = \begin{cases} \min \{E,I,W\} + V_1 + V_2, & \text{if $V_1 + V_2 \leq \text{med} \{E, I, W \} - \min \{E, I, W \}$} \\ \text{med} \{E, I, W\}, &\text{if $V_1 \leq \text{med} \{E, I, W \} - \min \{E, I, W\} \leq V_1 + V_2$}\\ \text{med} \{E, I, W \} + \min \{ V_1, V_2 \}, &\text{if $\text{med}\{E, I, W\} - \min \{E, I, W\} \leq V_1$} \\ & \,\,\,\,\,\, \text{ and $\min \{V_1, V_2 \} \leq \max \{E, I, W \} - \text{med} \{E, I, W\}$}\\ \max \{E, I, W \}, &\text{if $\text{med} \{E, I, W\} - \min \{ E, I, W\} \leq V_1$}\\ & \,\,\,\,\,\, \text{ and $\min \{V_1, V_2\} \geq \max \{E, I, W\} - \text{med} \{E, I, W\}.$} \end{cases}$$

As we can see there are many possible cases to go through in order to get the theoretical solution; however, it is relatively easy to set up a Monte Carlo simulation. Doing so with $N= 100,000$ simulations gives an average $\tilde{R}$ value of $\hat{R} = 7.400516$ with standard error of $0.0081.$ So we can confidently say that the expected volume of the Extra Credit Ranom-Ade is about 7.40 ounces.

Classic Random-Ade Recipe

I’m preparing a mixture of “random-ade” using a large, empty pitcher and two 12-ounce glasses.

First, I fill one glass with some amount of lemon juice chosen randomly and uniformly between 0 and 12 ounces. I fill the other glass with some amount of water, also chosen randomly and uniformly between 0 and 12 ounces. Next, I pour an equal amount from each glass into the pitcher until one of the glasses is empty.

At this point, I refill that empty glass with yet another random amount of the same liquid it previously contained. Once again, I pour an equal amount from each glass into the pitcher until one of the glasses is empty.

On average, how much random-ade can I expect to prepare? (Note that all three random amounts in this problem are chosen independently of each other.)

Let's first define some terms. Let $L \sim U(0,12)$ be the random volume of lemon juice in ounces first poured into the lenom juice glass. Let $W \sim U(0,12)$ be the random volumn of water in ounces first poured into the water glass. Let $V \sim U(0,12)$ be the random volume poured into the empty glass after the first volume of random-ade was poured into the pitcher. By desing with have $L,$ $W,$ and $V$ independent.

There are two volumes of random-ade that are generated. First, the amount $\min \{ L, W \}$ is poured into the pitcher. After $V$ is poured into the now empty glass, the two glasses have volumes of $|L - W|$ and $V$. So the second volume of random-ade that is poured is $\min \{ V, |L - W | \}.$ Therefore, the total amount of random-ade that is generated is $$R(L, W, V) = \min \{ L, W \} + \min \{ V, |L - W |\}.$$ The only thing left to do is to take the average.

We can do this by first taking the conditional average based on the value of $V.$ This gives us a nice two dimensional integral, \begin{align*} R(V) = \mathbb{E} \left[ R( L, W, V ) \mid V \right] &= \int_0^{12} \int_0^{12} R( L, W, V ) \, \frac{dW}{12} \frac{dL}{12} \\ &= 2 \int_0^{12} \int_L^{12} R(L, W, V) \frac{dW}{12} \frac{dL}{12},\end{align*} where we second inequality is based on the symmetry about the line $L = W.$ We can break this further down into three cases:

  • $A = \{ (L, W) \mid 0 \leq L \leq 12 - V, L + V \leq W \leq 12 \},$ where we have $R(L, W, V) = L + V;$
  • $B = \{ (L, W) \mid 0 \leq L \leq 12 - V, L \leq W \leq L + V \},$ where we have $R(L, W, V) = L + (W-L) = W;$
  • $C = \{ (L, W) \mid 12 - V \leq L \leq 12, L \leq W \leq 12 \},$ where we have $R(L, W, V) = L + (W-L) = W.$

Therefore, we see that \begin{align*}A(V) &= \iint_A R(L, W, V) dA = \int_0^{12-V} \int_{L+V}^{12} (L+V) \,\frac{dW}{12} \frac{dL}{12} \\ &= \frac{1}{144} \int_0^{12-V} (L+V)(12 - L - V) \,dL \\ &= \frac{1}{144} \int_V^{12} u(12-u) \,du \\ &= \frac{1}{144} \left[ 6u^2 - \frac{u^3}{3} \right]_{u=V}^{u=12} \\ &= 2 - \frac{1}{24}V^2 + \frac{1}{432}V^3\end{align*} along with \begin{align*}B(V) &= \iint_B R(L, W, V) dA = \int_0^{12-V} \int_{L}^{L+V} W \, \frac{dW}{12} \frac{dL}{12} \\ &= \frac{1}{144} \int_0^{12-V} \left[\frac{W^2}{2} \right]^{W=L+V}_{W=L} \,dL \\ &= \frac{1}{144} \int_0^{12-V} \left( \frac{(L+V)^2 - L^2}{2} \right) \,dL \\ &= \frac{1}{288} \int_0^{12-V} 2LV + V^2 \,dL \\ &= \frac{1}{288} \left( V(12-V)^2 + V^2(12-V) \right) \\ &= \frac{1}{2}V - \frac{1}{24} V^2,\end{align*} and finally \begin{align*}C(V) &= \iint_C R(L,W,V) dQ = \int_{12-V}^{12} \int_L^{12} W \,\frac{dW}{12} \frac{dL}{12} \\ &= \frac{1}{144} \int_{12-V}^{12} \left(72 - \frac{L^2}{2} \right) \,dL \\ &= \frac{1}{144} \left[ 72L - \frac{L^3}{6} \right]_{L=12-V}^{L=12} \\ &= \frac{1}{144} \left( \left(72 \cdot 12 - \frac{12^3}{6} \right) - \left( 72 \cdot (12 - V) - \frac{(12-V)^3}{6} \right) \right) \\ &= \frac{1}{144} \left( 6V^2 - \frac{V^3}{6} \right) = \frac{1}{24} V^2 - \frac{1}{864} V^3. \end{align*} So putting this altogether we see that \begin{align*}R(V) &= \mathbb{E}\left[ R(L, W, V) \mid V \right] \\ &= 2 \left( A(V) + B(V) + C(V) \right) \\ &= 2 \left( 2 + \frac{1}{2} V - \frac{1}{24} V^2 + \frac{1}{864} V^3 \right) \\ &= 4 + V - \frac{1}{12} V^2 + \frac{1}{432} V^3.\end{align*} Therefore, taking the expected value we get that the average volume of random-ade made with this Classic recipe is \begin{align*}\mathbb{E}[R] &= \int_0^{12} R(V) \, \frac{dV}{12} \\ &= \frac{1}{12} \int_0^{12} \left( 4 + V - \frac{1}{12} V^2 + \frac{1}{432} V^3 \right) \,dV \\ &= \frac{1}{12} \left( 4 \cdot 12 + \frac{12^2}{2} - \frac{12^3}{36} + \frac{12^4}{1728} \right) \\ &= 4 + 6 - 4 + 1 = 7\end{align*} ounces.

Monday, May 4, 2026

A frog's tour

The frog is jumping around the board with the same minimum distance $L$ you just found. But this time, the frog also wants to be able to hop to every location on the chessboard. What is the minimum value of $N$ for which this is possible?

In general, we want to find the equivalent of a knight's tour, a path taken by a knight that visits all of the squares on the chess board exactly once. The frog doesn't specify that it wants to start and end his tour of the board at the same spot, so this is known as an ``open'' tour, as opposed to a closed tour that starts and ends on the same square. In particular, if we hadn't added the extra condition of not being a rook's move away from the starting spot and could stick with knight moves for the frog, then the smallest possible board that has a knight's tour is a $5\times 5$ board. One heuristic method for finding knight's tour is known by Warnsdorf's rule: Move from the current square to the neighbor that has the fewest remaining viable moves.

Ok, so we found $L = \sqrt{65},$ which means any of the 16 possible steps: $(\pm 1, \pm 8),$ $(\pm 8, \pm 1),$ $(\pm 4, \pm 7),$ $(\pm 7, \pm 4).$ For $N\leq 13,$ there are inaccessible squares, e.g. on a $13\times 13$ board, the center square $g7$ has no adjacent squares, since each of the borders are only $6$ squares away from the center, so any frog jump away from the center square will end up off the board.

For $N=14,$ using a modified Warnsdorf's rule heuristi, we can find an open frog’s tour of all squares on a $14 \times 14$ board, see below using algebraic notation:

1.a129.j1457.g785.e5113.n2141.d14169.l2
2.h530.k658.n1186.d13114.j9142.e6170.d1
3.g1331.l1459.m387.k9115.f2143.f14171.k5
4.n932.h760.f788.d5116.m6144.m10172.c6
5.m133.a1161.b1489.l6117.e7145.f6173.j2
6.i834.e462.i1090.k14118.i14146.m2174.k10
7.a935.d1263.e391.d10119.j6147.e1175.c11
8.b136.c464.a1092.e2120.n13148.l5176.k12
9.f837.b1265.b293.i9121.f12149.e9177.j4
10.n738.f566.j194.b13122.m8150.i2178.b3
11.g339.n467.n895.c5123.i1151.h10179.i7
12.h1140.m1268.g496.g12124.a2152.a14180.b11
13.a741.l469.h1297.f4125.h6153.i13181.j10
14.h342.e870.a898.e12126.g14154.b9182.k2
15.g1143.l1271.h499.a5127.n10155.i5183.c3
16.k444.m472.l11100.i6128.g6156.a6184.j7
17.d845.i1173.k3101.e13129.c13157.h2185.b6
18.h146.a1274.j11102.l9130.b5158.g10186.c14
19.l847.b475.i3103.k1131.a13159.n14187.k13
20.d748.j376.b7104.g8132.h9160.f13188.d9
21.h1449.c777.j8105.n12133.g1161.g5189.c1
22.l750.k878.n1106.f11134.c8162.h13190.j5
23.e1151.d479.m9107.m7135.j12163.d6191.c9
24.a452.c1280.e10108.f3136.n5164.e14192.j13
25.h853.k1181.a3109.b10137.m13165.l10193.n6
26.l154.l382.i4110.c2138.f9166.d11194.g2
27.d255.m1183.b8111.g9139.m5167.k7195.f10
28.c1056.n384.i12112.f1140.l13168.d3196.m14

So, we have shown that if all the frog wanted was to make jumps of size $L=\sqrt{65}$ and have an open tour of the entire board, then $N=14$ would be the minimal size of the chess board.

However, covering bases and doing a deep grammatical scrub of the prompt, since it says the frog “also wants to be able to hop to every location on the chessboard", it means that the frog must still want to be able to do its rhomboidal path from the Classic problem. Since the path goes from $(-4,-7)$ to $(1,8),$ we need to have at least $N=16$ squares, that is, $\{-7, -6, \dots, -1, 0, 1, \dots, 8\}.$ This would rule out our $14 \times 14$ frog's path. However, we can again use Warnsdorf's rule to find a frog’s tour of all squares on a $16\times 16$ board, see below:

1.a133.m1165.j1297.f8129.l6161.c13193.i15225.d12
2.i234.e1066.b1398.b15130.d5162.k12194.j7226.k8
3.a335.m967.j1499.a7131.k1163.l4195.b8227.j16
4.b1136.n168.c10100.h11132.l9164.e8196.f1228.f9
5.c337.f269.g3101.a15133.p16165.i1197.e9229.m5
6.d1138.n370.n7102.i14134.o8166.h9198.i16230.l13
7.e339.f471.m15103.h6135.g9167.d16199.h8231.d14
8.a1040.g1272.f11104.a2136.c16168.l15200.d1232.h7
9.b241.o1173.b4105.i3137.d8169.m7201.l2233.p6
10.j142.g1074.a12106.a4138.l7170.n15202.p9234.h5
11.c543.o975.i13107.b12139.k15171.o7203.h10235.o1
12.k444.p176.j5108.j11140.c14172.h3204.d3236.g2
13.l1245.h277.c1109.b10141.d6173.g11205.c11237.n6
14.m446.p378.b9110.f3142.l5174.c4206.k10238.m14
15.n1247.h479.j10111.n4143.p12175.j8207.c9239.f10
16.g1648.p580.k2112.f5144.o4176.k16208.j13240.n9
17.o1549.o1381.l10113.m1145.k11177.l8209.k5241.j2
18.p750.k682.m2114.e2146.d7178.p15210.d9242.b3
19.l1451.d283.n10115.d10147.h14179.i11211.h16243.i7
20.d1352.l184.j3116.c2148.g6180.b7212.o12244.p11
21.e553.k985.c7117.k3149.k13181.j6213.p4245.o3
22.m654.o1686.g14118.o10150.c12182.b5214.i8246.n11
23.n1455.p887.f6119.n2151.g5183.a13215.e1247.g15
24.f1356.i488.e14120.m10152.o6184.e6216.a8248.o14
25.b657.a589.m13121.e11153.p14185.f14217.e15249.g13
26.a1458.e1290.i6122.m12154.h15186.n13218.l11250.c6
27.e759.d491.p2123.e13155.g7187.f12219.m3251.k7
28.d1560.l392.h1124.a6156.k14188.m16220.f7252.j15
29.l1661.p1093.o5125.i5157.c15189.n8221.b14253.b16
30.m862.o294.p13126.b1158.g8190.g4222.i10254.c8
31.n1663.g195.i9127.a9159.f16191.h12223.a11255.j4
32.f1564.n596.e16128.h13160.j9192.a16224.e4256.i12

So, we have shown that if the frog wanted both to make jumps of size $L=\sqrt{65}$ in a rhombus pattern from the Classic problem and have an open tour of the entire board, then $N=16$ is the minimal size of the chess board.