Monday, August 31, 2026

Uniquely Non-Genius Queen Bees

Let’s put the rank of “Genius” aside. Here are some other ranks you can attain in Spelling Bee:

  • Amazing (if you get 50 percent of the maximum, rounded to the nearest whole number)
  • Great (40 percent)
  • Nice (25 percent)
  • Solid (15 percent)
  • Good (8 percent)
  • Moving Up (5 percent)
  • Good Start (2 percent)

Suppose a given round of Spelling Bee has some very large, randomly chosen point total. What is the probability that this total can be precisely determined from these cutoffs (i.e., from “Good Start” through “Amazing,” inclusive)?

The first thing that we see is that there are many, many, many levels that start with $G$, so let's forego the step of naming each function of $Q$ and instead have a mapping $F: \mathbb{N} \to \mathbb{N}^7$ with $$Q \mapsto F(Q) = \begin{pmatrix} [0.5Q], [0.4Q], [0.25Q], [0.15Q], [0.08Q], [0.05Q], [0.02Q] \end{pmatrix} \in \mathbb{N}^7.$$ Firstly, we see that we have the recursion formula $$F(100d+k) = (50d, 40d, 25d, 15d, 8d, 5d, 2d) + F(k),$$ for all $d, k \in \mathbb{N},$ so we need only really calculate the ratio for any sufficiently chosen $100$ values of $Q$ in order to determine how many of those are

Let's start with $Q=101$ and start enumerating:

qF(q) qF(q)
101(50,40,25,15,8,5,2)151(75,60,38,23,12,8,3)
102(51,41,25,15,8,5,2)152(76,61,38,23,12,8,3)
103(51,41,26,15,8,5,2)153(76,61,38,23,12,8,3)
104(52,42,26,16,8,5,2)154(77,62,38,23,12,8,3)
105(52,42,26,16,8,5,2)155(77,62,39,23,12,8,3)
106(53,42,26,16,8,5,2)156(78,62,39,23,12,8,3)
107(53,43,27,16,9,5,2)157(78,63,39,24,13,8,3)
108(54,43,27,16,9,5,2)158(79,63,39,24,13,8,3)
109(54,44,27,16,9,5,2)159(79,64,40,24,13,8,3)
110(55,44,27,16,9,5,2)160(80,64,40,24,13,8,3)
111(55,44,28,17,9,6,2)161(80,64,40,24,13,8,3)
112(56,45,28,17,9,6,2)162(81,65,40,24,13,8,3)
113(56,45,28,17,9,6,2)163(81,65,41,24,13,8,3)
114(57,46,28,17,9,6,2)164(82,66,41,25,13,8,3)
115(57,46,29,17,9,6,2)165(82,66,41,25,13,8,3)
116(58,46,29,17,9,6,2)166(83,66,41,25,13,8,3)
117(58,47,29,18,9,6,2)167(83,67,42,25,13,8,3)
118(59,47,29,18,9,6,2)168(84,67,42,25,13,8,3)
119(59,48,30,18,10,6,2)169(84,68,42,25,14,8,3)
120(60,48,30,18,10,6,2)170(85,68,42,25,14,8,3)
121(60,48,30,18,10,6,2)171(85,68,43,26,14,9,3)
122(61,49,30,18,10,6,2)172(86,69,43,26,14,9,3)
123(61,49,31,18,10,6,2)173(86,69,43,26,14,9,3)
124(62,50,31,19,10,6,2)174(87,70,43,26,14,9,3)
125(62,50,31,19,10,6,2)175(87,70,44,26,14,9,3)
126(63,50,31,19,10,6,3)176(88,70,44,26,14,9,4)
127(63,51,32,19,10,6,3)177(88,71,44,27,14,9,4)
128(64,51,32,19,10,6,3)178(89,71,44,27,14,9,4)
129(64,52,32,19,10,6,3)179(89,72,45,27,14,9,4)
130(65,52,32,19,10,6,3)180(90,72,45,27,14,9,4)
131(65,52,33,20,10,7,3)181(90,72,45,27,14,9,4)
132(66,53,33,20,11,7,3)182(91,73,45,27,15,9,4)
133(66,53,33,20,11,7,3)183(91,73,46,27,15,9,4)
134(67,54,33,20,11,7,3)184(92,74,46,28,15,9,4)
135(67,54,34,20,11,7,3)185(92,74,46,28,15,9,4)
136(68,54,34,20,11,7,3)186(93,74,46,28,15,9,4)
137(68,55,34,21,11,7,3)187(93,75,47,28,15,9,4)
138(69,55,34,21,11,7,3)188(94,75,47,28,15,9,4)
139(69,56,35,21,11,7,3)189(94,76,47,28,15,9,4)
140(70,56,35,21,11,7,3)190(95,76,47,28,15,9,4)
141(70,56,35,21,11,7,3)191(95,76,48,29,15,10,4)
142(71,57,35,21,11,7,3)192(96,77,48,29,15,10,4)
143(71,57,36,21,11,7,3)193(96,77,48,29,15,10,4)
144(72,58,36,22,12,7,3)194(97,78,48,29,16,10,4)
145(72,58,36,22,12,7,3)195(97,78,49,29,16,10,4)
146(73,58,36,22,12,7,3)196(98,78,49,29,16,10,4)
147(73,59,37,22,12,7,3)197(98,79,49,30,16,10,4)
148(74,59,37,22,12,7,3)198(99,79,49,30,16,10,4)
149(74,60,37,22,12,7,3)199(99,80,50,30,16,10,4)
150(75,60,37,22,12,7,3)200(100,80,50,30,16,10,4)

From our recurrence formula we see that $F(100) = F(200) - (50,40,25,15,8,5,2) = (50,40,25,15,8,5,2) = F(101)$ and similarly that $F(201) = F(200).$ Therefore, we see that if $U \subset \mathbb{N}$ such that the values of $Q$ can be uniquely recovered from the mapping $F,$ then the only integers in \begin{align*}\{ 101, \dots, 200 \} \setminus U &= \{ 101, 104, 105, 112, 113, 120, \\ & \quad\quad 121, 124, 125, 132, 133, 140, \\ & \quad\quad 141, 144, 145, 152, 153, 160,\\ &\quad\quad 161, 164, 165, 172, 173, 180, \\ &\quad\quad 181, 184, 185, 192, 193, 200 \},\end{align*} which means that we are left with $$\left|U \cap \{101, \dots, 200\}\right| = 100 - 30 = 70.$$ Therefore, availing ourselves of the squeeze theorem and some of the other argumentation that we went through for the classic problem, we have that the probability that this total can be precisely determined from these cutoffs is $$\mathbb{P}(U) = 70\%.$$

Uniquely Genius Queen Bees

In Spelling Bee, a word game from The New York Times, you must create words using seven letters arranged in a honeycomb grid. Letters can be used more than once per word, but each word must be at least four letters long and include the central letter. You may recall a previous puzzle (RIP, FiveThirtyEight) based on Spelling Bee.

Each day, your goal is to score as many points as possible. Four-letter words are worth 1 point, longer words are worth the number of letters they contain, and “pangrams” (words containing every letter) provide 7 bonus points. But these specific details don’t matter for this week’s puzzle.

If you find all the words in a given day and therefore accrue the maximum number of points, you earn the “Queen Bee” ranking. Meanwhile, accruing smaller point totals earns you other rankings. In particular, the point cutoff for “Genius” is 70 percent of the maximum number of points, rounded to the nearest whole number. While the cutoff for “Genius” is clearly displayed in the puzzle, the “Queen Bee” point total is not readily shown.

Of course, this maximum total can be approximated by dividing the “Genius” cutoff by 0.7. Even so, the total may be ambiguous, since multiple “Queen Bee” values can result in the same “Genius” cutoff.

Suppose a given round of Spelling Bee has some very large, randomly chosen point total. What is the probability that this total can be precisely determined (i.e., without any ambiguity) from its point cutoff for “Genius”?

Let's assume that $Q$ is the Queen Bee point total and that $G$ is the Genius cutoff, and we have the functional definition $G: \mathbb{N} \to \mathbb{N}$ with $Q \mapsto G(Q) = [ 0.7 Q ],$ where $[\cdot]$ denotes the closest integer function, that is $[t] = \min \arg\!\min \{ |n - t | \mid n \in \mathbb{N} \},$ where we are rounding halves downward towards $0$. While the concept of uniform distribution on the natural numbers is untenable, let us assume that here we mean by some very large, randomly chosen point total of $Q$ that we have the following probabilistic definition. For any subset $A \subseteq \mathbb{N}$, let us define its probability as $$\mathbb{P} (A) = \lim_{n \to \infty} \frac{ \left| A \cap \{1, 2, \dots, n \} \right| }{n}.$$ This is loosely a limit of the sequence of uniform distributions on the sets $\{1, 2, \dots, n \}$ as $n \to \infty,$ but again I don't really want to get into the formal definitions of how that limit should be defined, let's just kinda run with it.

Anywhoozle, in this case, let's define $U = \{ n \in \mathbb{N} \mid |G^{-1}(n)| = 1 \}$ to be the desired set of all values of $Q$ that can be precisely and unambiguously determiend by the corresponding value of the $G$ function. It would probably be good to have some idea of what $U$ looks like before plowing ahead and getting to the calculation of the desired answer, that is, $\mathbb{P}(U).$ Let's start super simple and just give the first few values of the $G$ function:

q0.7qG(q)
10.71
21.41
32.12
42.83
53.53
64.24
74.95
85.66
96.36
107.07
117.78

Using these first 10 integers, we see that $3, 6, 7, 10 \in U.$ We also can see that for any $d \in \mathbb{N}$ that $$G(10d+k) = \left[0.7 \left(10d+k\right)\right] = 7d+G(k).$$ So we can surmise that in face for any $Q \in \mathbb{N}$ if $Q\! \mod\! 10 \in \{0, 3, 6, 7 \}$ then $Q \in U,$ then $$U = \left(10 \mathbb{N} \cup (3 + 10 \mathbb{N}) \cup (6 + 10\mathbb{N}) \cup (7 + 10\mathbb{N}) \right).$$ We see that $$\left| U \cap \{ 1,2, \dots, n\} \right| = \begin{cases} 4 \lfloor \frac{n}{10} \rfloor, &\text{if $n \!\mod\! 10 \in \{0,1,2\};$}\\ 4\lfloor \frac{n}{10} \rfloor+1, &\text{if $n \!\mod\!10 \in \{3,4,5\};$}\\ 4\lfloor \frac{n}{10} \rfloor+2, &\text{if $n \!\mod\!10 \equiv 6;$}\\ 4\lfloor \frac{n}{10} \rfloor+3, &\text{if $n \!\mod\!10 \in \{7,8,9\}.$}\end{cases}$$ Using the squeeze theorem and the fact that $$\lim_{n\to \infty} \frac{4 \lfloor \frac{n}{10} \rfloor}{n} \leq \mathbb{P} (U) \leq \lim_{n\to \infty} \frac{4 \lfloor \frac{n}{10} \rfloor + 3}{n},$$ we have the probability of getting a value of $Q$ that is precisely, unambiguously determined from its value of $G$ is $$\mathbb{P} (U) = \lim_{n \to \infty} \frac{1}{n} \left| U \cap \{1, 2, \dots, n \} \right| = \frac{2}{5} = 40\%.$$

Monday, August 24, 2026

Frederica's Trochoidal Film

For her next show, Frederica wants to mix things up. Instead of placing the light on the circumference of the wheel, she will pick a random point inside the circle. (Before you ask, let me clarify what “random” means here: Any two regions with the same area are equally likely to contain the point.)

As before, she will roll the wheel for one revolution along the ground and capture the motion with a single long exposure on her camera. On average, what can she expect the length of the path to be?

As before we will compute for any given starting point $$(x_0, y_0) \in \{ (x,y) \mid \sqrt{x^2 + (y-1)^2} \leq 1 \}$$ and calculate the path that it traces out as the wheel makes a full rotation. If the point $(x_0,y_0)$ is on the circumference of the circle, the path is known as a cycloid; however, if $(x_0,y_0)$ is in the interior of the wheel it is known as a curtate trochoid. Anywhoozle, let's again define our parametric equations ...

Let's assume that the point of light is at $x(0) = x_0, y(0) = y_0$, where without loss of generality let's assume that $x_0 \gt 0,$ and of course $r = \sqrt{x_0^2 + (y_0-1)^2} \leq 1.$ Then we see that we can write $x(0) = r \sin \theta, y(0) = 1 + r \cos \theta,$ for $\theta = \tan^{-1} \frac{x_0}{y_0 - 1} \in [0, \pi].$ Since after a rotation of $t \in [0,2\pi)$ we will have the wheel centered at $(t,1),$ while the angle that the point of light now makes as measured with respect to the positive $y$-axis, will now be $\theta + t.$ So at time $t$ the point of light would be at \begin{align*} x(t) &= t + r \sin (\theta + t) \\ y(t) &= 1 + r \cos (\theta + t).\end{align*} Differentiating with respect to time we get \begin{align*} \frac{dx}{dt} &= 1 + r \cos (\theta + t) \\ \frac{dy}{dt} &= -r \sin (\theta + t), \end{align*} so we see that the arclength of the path the light takes is \begin{align*}\ell &= \int_0^{2\pi} \sqrt{ \left( \frac{dx}{dt} \right)^2 + \left( \frac{dy}{dt} \right)^2 }\,dt \\ &= \int_0^{2\pi} \sqrt{ \left( 1 + r \cos (\theta + t)\right)^2 + \left( - r \sin (\theta + t) \right)^2 } \,dt \\ &= \int_0^{2\pi} \sqrt{ 1 + r^2 + 2r \cos (\theta + t) } \,dt.\end{align*} We can easily set $u = \theta + t$ and then through periodicity recognize that we have \begin{align*}\ell = \ell(r) &= \int_0^{2\pi} \sqrt{ 1 + r^2 + 2r \cos(\theta+t) } \,dt\\ &= \int_\theta^{\theta + 2\pi} \sqrt{ 1 + r^2 + 2r \cos u} \,du\\& = \int_0^{2\pi} \sqrt{ 1 + r^2 + 2r \cos u } \,du,\end{align*} regardless of the the value of $\theta.$ Now at this point, if we wanted to we could do some more algebra and appeal to the complete elliptic integrals of the second kind to find that $$\ell(r) = 4(1+r)E\left(\frac{2 \sqrt{r}}{1+r}\right),$$ where $$E(k) = \int_0^{\pi/2} \sqrt{1-k^2\sin^2t}\,dt;$$ however, since we would still need to plug this into another integral, this doesn't really do us any good.

However, we can us the integral definition of $\ell(r)$ and the definition of the randomly chosen starting point to get an expression for the expected length of the path. If we want to get the probability that some starting point $(x_0,y_0)$ is in the annulus centered at $(0,1)$ between radii $r$ and $r + dr,$ we get that the area of the annulus is $2\pi r \,dr,$ while the total probability of the unit disk centered at $(0,1)$ is $\pi,$ then we see that the conditional probability of the starting point being in the annulus between radii $r$ and $r + dr$ is $2r\, dr.$ Therefore, we get from the law of total expectation that $$\mathcal{L} = \mathbb{E} \left[ \ell \right] = \int_0^1 \ell(r) 2r \,dr.$$ Plugging back in the integral form of $\ell(r),$ we get $$\mathcal{L} = \int_0^1 \ell(r) 2r\,dr = \int_0^1 \int_0^{2\pi} 2r \sqrt{ 1 + r^2 + 2r \cos u } \,du \,dr,$$ which we can also recognize as the polar area integral of the function $$f(x,y) = 2\sqrt{ (1-x)^2 + y^2 }$$ over the unit disk. That is, $$\mathcal{L} = \int_{-1}^1 \int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}} 2\sqrt{(1-x)^2 + y^2} \,dy \,dx.$$

Since $$\int \sqrt{a^2 + t^2} \,dt = \frac{t}{2} \sqrt{a^2 + t^2} + \frac{a^2}{2} \ln \left| t + \sqrt{a^2 + t^2} \right| + C,$$ we can do this integration directly. We first get that \begin{align*}g(x) &= \int_{-\sqrt{1-x^2}}^{\sqrt{1-x^2}} 2 \sqrt{ (1-x)^2 + y^2} \,dy \\ &= 4 \int_0^{\sqrt{1-x^2}} \sqrt{ (1-x)^2 + y^2} \,dy \\ &= 4 \left[ \frac{y}{2} \sqrt{ (1-x)^2 + y^2 } + \frac{(1-x)^2}{2} \ln \left| y + \sqrt{ (1-x)^2 + y^2 } \right| \right]_0^{\sqrt{1-x^2}} \\ &= 4 \left[ \frac{\sqrt{1-x^2} \sqrt{2 - 2x}}{2} + \frac{(1-x)^2}{2} \ln \left| \sqrt{1-x^2} + \sqrt{2-2x} \right| - \frac{(1-x)^2}{2} \ln |1-x| \right] \\ &= 2\sqrt{2} (1-x) \sqrt{1+x} + 2(1-x)^2 \ln \left( \frac{\sqrt{1+x} + \sqrt{2}}{\sqrt{1-x}} \right).\end{align*} So we now have \begin{align*}\mathcal{L} &= \int_{-1}^1 g(x) \,dx \\ &= \int_{-1}^1 2\sqrt{2} (1-x)\sqrt{1+x} \,dx + \int_{-1}^1 2(1-x)^2 \ln \left( \frac{\sqrt{1+x} + \sqrt{2}}{\sqrt{1-x}} \right) \,dx.\end{align*} Using integration by parts, we have first integral is \begin{align*}I_1 &= \int_{-1}^1 2\sqrt{2}(1-x) \sqrt{1+x} \,dx \\ &= 2 \sqrt{2} \left( \left[ \frac{2}{3} (1-x) (1+x)^{3/2} \right]_{-1}^1 + \frac{2}{3} \int_{-1}^1 (1+x)^{3/2} \,dx \right) \\ &= 2 \sqrt{2} \left.\frac{4}{15} (1+x)^{5/2} \right|_{-1}^1 = 2\sqrt{2} \frac{4}{15} 2^{5/2} = \frac{64}{15}.\end{align*} We can break the second integral further into two integrals, namely $$I_2 = \int_{-1}^1 2(1-x)^2\ln \left( \sqrt{1+x} + \sqrt{2} \right) \,dx$$ and $$I_3 = \int_{-1}^1 2(1-x)^2 \ln \sqrt{1-x} \,dx = \int_{-1}^1 (1-x)^2 \ln (1-x) \,dx.$$

If we set $u = \ln \left( \sqrt{1+x} + \sqrt{2} \right)$ then we see that $$du = \frac{dx}{2 \sqrt{1+ x} ( \sqrt{1+x} + \sqrt{2} )} = \frac{ \sqrt{2} - \sqrt{1+x} }{2 \sqrt{1+x} (1-x)} dx,$$ so then if we pursue integration by parts we get to obtain \begin{align*}I_2 &= \int_{-1}^1 2(1-x)^2 \ln \left(\sqrt{1+x} + \sqrt{2}\right) \,dx \\ &= 2 \left( \left[ -\frac{(1-x)^3}{3} \ln \left( \sqrt{1+x} + \sqrt{2} \right) \right]_{-1}^1 + \int_{-1}^1 \frac{(1-x)^3}{3} \frac{\sqrt{2} - \sqrt{1+x}}{2 \sqrt{1+x} (1-x) } \,dx \right) \\ &= 2 \left( -\frac{4}{3} \ln 2 + \int_{-1}^1 \frac{\sqrt{2}}{6} \frac{(1-x)^2}{\sqrt{1+x}} \,dx - \int_{-1}^1 \frac{(1-x)^2}{6} \,dx \right) \\ &= 2 \left( -\frac{4}{3} \ln 2 + \left[ \frac{\sqrt{2}}{3} (1-x)^2 \sqrt{1+x} \right]_{-1}^1 + \frac{2\sqrt{2}}{3} \int_{-1}^1 (1-x) \sqrt{1+x} \,dx + \left[ \frac{(1-x)^3}{18} \right]_{-1}^1 \right) \\ &= 2 \left( -\frac{4}{3} \ln 2 + \frac{4}{9} + \frac{1}{3} \left( \frac{64}{15} \right) \right) = \frac{56}{15} -\frac{8}{3} \ln 2, \end{align*} where we are using our precalculated knowledge of $I_1$ in the second to last step.

Using integration by parts gives $$\int t^2 \ln t \,dt = \frac{t^3}{3} \ln t - \int \frac{t^2}{3} \,dt = \frac{t^3}{3} \ln t - \frac{t^3}{9} + C.$$ With the u = 1-x substituion we get $$I_3 = \int_{-1}^1 (1-x)^2 \ln (1-x) \,dx = \int_{0}^2 u^2 \ln u \,du = \left[\frac{u^3}{3} \ln u - \frac{u^3}{9} \right]_{0}^2 = \frac{8}{3} \ln 2 - \frac{8}{9}.$$ So putting it altogether we get the expected length of the uniformly random point of light to be \begin{align*}\mathcal{L} &= I_1 + I_2 + I_3 \\ &= \frac{64}{15} + \left( \frac{56}{15} - \frac{8}{3} \ln 2 \right) + \left( \frac{8}{3} \ln 2 - \frac{8}{9} \right) \\ &= 8 - \frac{8}{9} = \frac{64}{9} = 7.111111\dots.\end{align*}

Sunday, August 23, 2026

Frederica's Cycloidal Film

For her photography show, Frederica Fiddleria attaches a light to a point on the circumference of a circular wheel with a radius of 1 meter. She points a camera at the wheel and, during a single long exposure, rolls the wheel for one revolution along the ground.

When she develops the film, she is curious about the path the light took as the wheel rolled. What is the length of this path?

Lo, and behold! Frederica's light source is traveling along a cycloidal path, which has some fairly well defined properties, but let's try to derive them from scratch. Let's assume that the center of the wheel starts at the point $(0,1).$ Since the circumference of the wheel is $2\pi,$ after one full revolution of the wheel, the center would end up at the point $(2\pi, 1).$ Without loss of generality, let's assume that the light was added to a point $P$ on the circumference of the circle such that the angle between $P$, the center of the circle and the positive $y$-axis is $\theta \in [0,\pi].$ In this case, we see that the point of light is at $x(0) = \sin \theta,$ and $y(0) = \cos \theta.$ After rotating for some time $t \in [0,2\pi),$ the center of the circle will be at the point $(t,1),$ while the angle that the point of light now makes as measured with respect to the positive $y$-axis, will now be $\theta + t.$ So the point of light will be given by the parametric equations \begin{align*} x(t) &= t + \sin(\theta + t),\\ y(t) & = 1 + \cos (\theta + t).\end{align*} In particular, taking derivatives with respect to time, we get \begin{align*} \frac{dx}{dt} &= 1 + \cos (\theta + t) \\ \frac{dy}{dt} &= - \sin (\theta + t).\end{align*}

Therefore, integrating the arclength formula and appealing to the half-angle formula, we see that no matter what the value of $\theta$ is, the length of the path the light took is given by \begin{align*}\ell &= \int_0^{2\pi} \sqrt{ \left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2 } \,dt \\ &= \int_0^{2\pi} \sqrt{ \left(1 + \cos (\theta + t)\right)^2 + \left( - \sin (\theta + t) \right)^2 } \,dt \\ &= \int_0^{2\pi} \sqrt{ 2 + 2 \cos (\theta + t) } \,dt \\ &= 2 \int_0^{2\pi} \sqrt{ \frac{ 1 + \cos (\theta + t) }{2} } \,dt \\ &= 2 \int_0^{2\pi} \left|\cos \left( \frac{\theta + t}{2}\right)\right| \,dt \\ &= 2 \int_0^{\pi - \theta} \cos \left(\frac{\theta + t}{2}\right) \,dt + \int_{\pi-\theta}^{2\pi} - \cos \left(\frac{\theta + t}{2}\right) \,dt \\ &= 4 \left. \sin \left(\frac{\theta + t}{2}\right) \right|_0^{\pi - \theta} - 4 \left. \sin \left(\frac{\theta + t}{2}\right) \right|_{\pi - \theta}^{2\pi} \\ &= 4 \left( \sin \frac{\pi}{2} - \sin \frac{\theta}{2} \right) - 4 \left( \sin \left(\pi + \frac{\theta}{2}\right) - \sin \frac{\pi}{2} \right) \\ &= 4 + 4 \sin \frac{\theta}{2} + 4 - 4 \sin \frac{\theta}{2} = 8\end{align*}

Monday, August 3, 2026

Fiddler: The Helical Ball?

Instead of requiring a vertical line down the cylinder’s surface, now any helix down the surface is allowed. An example of such a helix passing through all three gaps is shown below.

What is the probability that there exists at least one such helix that can pass through each ring’s gap?

Again, let's assume that we have cylinder with radius one, that the broken rings are embedded within the planes $z=2,$ $z=1$ and $z=0$ and finally that the gap on the ring at $z=2$ is from $\theta \in [0, \pi / 4],$ while the gaps at $z=1$ and $z=0$ are from $\theta \in [\alpha, \alpha+\pi/4]$ and $\theta \in [\beta, \beta + \pi / 4]$ for some $\alpha, \beta \sim U(0,2\pi),$ respectively. Here again we will play a little fast and loose with notation and say that $[\psi_1, \psi_2] \subseteq [0,2\pi]$ should mean the set $[0, \psi_2 - 2\pi] \cup [\psi_1, 2\pi]$ in the case that $\psi_1 \lt 2\pi \lt \psi_2.$

We also see that the helical path from any point $(2, \theta_2)$ to $(1, \theta_1)$ for any $\theta_1, \theta_2 \in [0,2\pi)$ is given by $z(t) = 2-t,$ $\theta(t) = \theta_2 + t(\theta_1 - \theta_2).$ All we need to do is understand where this helical path will hit the plane $z = 0,$ in this case at $\theta(2) = 2 \theta_1 - \theta_2.$ Since any helical path that gets through the upper and middle gaps will have $\theta_2 \in [0, \pi/4]$ and $\theta_1 \in [\alpha, \alpha + \pi/4],$ we see that $\theta_0 = \theta(2) = 2 \theta_1 - \theta_2 \in [2 \alpha - \pi/4, 2 \alpha + \pi/2].$ See the figure below, for instance for the choice of $\alpha = 4.613846199712232.$

So in order to fit through all of the gaps, then we would need to have $$[\beta, \beta + \pi/4] \cap [2 \alpha - \pi/4, 2 \alpha + \pi/2 ] \ne \emptyset,$$ that is, we would need to have $\beta \in [ 2 \alpha - \pi/2, 2\alpha + \pi/2].$ Therefore, the conditional probability of there being a helical path conditional on choice of $\alpha$ is $$p(\alpha) = \mathbb{P} \{ \beta \in [ 2 \alpha - \pi/2, 2 \alpha + \pi/2 ] \mid \alpha \} = \frac{\pi}{2\pi} \equiv \frac{1}{2}.$$ Therefore, the probability of there being at least one such helix that can pass through each of the gaps is $p = \int_0^{2\pi} p(\alpha) \,d\alpha = \frac{1}{2}.$

Ring around the cylinder

A long vertical cylinder has three narrow open rings, each of which wraps around seven-eighths of the cylinder (leaving a one-eighth “gap”). The rings are evenly spaced vertically, but are otherwise randomly rotated about the cylinder’s central axis. For some orientations of the rings, there exists at least one vertical line down the cylinder’s surface that passes through each ring’s gap, as illustrated below.

What is the probability that at least one such vertical line exists?

Let's define some terms. Let's assume we have a unit cylinder and that the broken rings are embedded within the planes $z=2,$ $z=1$ and $z=0.$ Let's, without loss of generality, assume that the opening at the topmost ring is one-eighth of the way around and oriented such that it is from $\theta \in [0, \pi/4].$ Let's further assume that for $\alpha, \beta \sim U(0,2\pi)$ that the middle and bottom rings at z=1 and z=0 are given by $\theta \in [\alpha, \alpha+\pi/4]$ and $\theta \in [\beta, \beta+\pi/4],$ respectively. Here we shall abuse notation slightly and assume that if $\psi_1 \lt 2\pi \lt \psi_2$ then by $[\psi_1, \psi_2] \subseteq [0,2\pi]$ we mean $[0, \psi_2 - 2\pi] \cup [ \psi_2, 2\pi].$

Any vertical line on this cylinder can be written in cylindrical coordinates as $\theta = \theta_0$ for some $\theta_0 \in [0,2\pi).$ If a vertical line can pass through the top and middle gaps, then we must have $[0, \pi/4] \cap [\alpha, \alpha+\pi/4] \ne \emptyset,$ or equivalently, $\alpha \leq \pi/4$ and $\alpha + \pi/4 \geq 0,$ that is $\alpha \in [-\pi/4, \pi/4].$ In order for this line to pass through all three gaps, we must have $$[ \beta, \beta + \pi/4 ] \cap [ \alpha, \alpha + \pi/4 ] \cap [0, \pi/4] \ne \emptyset,$$ or equivalently $\beta \in [ \max \{ 0, \alpha \} - \pi/4, \min \{0, \alpha\} + \pi/4 ].$

Therefore, the probability that a vertical line can pass through all gaps is \begin{align*}p &= \int_{-\pi/4}^{\pi/4} \int_{\max \{0, \alpha\} - \pi/4}^{\min \{0, \alpha\} + \pi/4} \frac{d\beta}{2\pi} \, \frac{d\alpha}{2\pi} \\ &= \int_{-\pi/4}^{\pi/4} \left( \frac{\pi}{2} - |\alpha| \right) \,\frac{d\alpha}{4\pi^2}\\ &= \frac{1}{2\pi^2} \int_0^{\pi/4} \left( \frac{\pi}{2} - \alpha \right), d\alpha\\ &= \frac{1}{2\pi^2} \int_{\pi/4}^{\pi/2} u \,du = \frac{1}{4\pi^2} \left[ \left(\frac{\pi}{2}\right)^2 - \left(\frac{\pi}{4}\right)^2 \right] \\ &= \frac{1}{4\pi^2} \frac{3\pi^2}{16} = \frac{3}{64} = 4.6875\%\end{align*}

Sunday, July 19, 2026

Fiddling for the win

Congratulations to Fiddler Nation for making it to the semifinals of the World Cup! All four teams that made it this far are equally matched in that they each possess the same total amount of “energy.” In advance of each semifinal game, teams must independently decide how much of their energy to allocate to the match; all remaining energy goes toward the finals. The team that spends more energy in any given game will win. The semifinals and finals occur so close in time that teams can’t recuperate any of their energy in between.

You’ve heard that the managers for the other three teams are abysmal and have no idea how to allocate their teams’ energy. Each of the other managers will independently pick a random percentage between 0 and 100 and allocate that portion of their team’s energy to the semifinal game; the rest of that team’s energy will go toward the final. Since you’re the cleverest manager of the bunch, you can choose an optimal strategy that will maximize Fiddler Nation’s probability of winning the World Cup. What is this optimal probability?

Let's define some terms, let's let $V$, $W$ and $X \sim U(0,1)$ be the i.i.d. random energy levels selected by the other three coaches to the first match. Without loss of generality, let's assume Fiddler Nation's first draw is against the team that devotes $V$ energy to the first match. Therefore, if we devote some level of energy $E \in [0,1]$ to the first match, then the probability of making the final is $\mathbb{P} \{ V \leq E \} = E.$

On the other hand since the other two coaches devoted $W$ and $X$ energies respectively to the first match, the coach that devoted $\max \{ W, X \}$ will have won the match, and the amount of energy remaining for the final is only $1 - \max \{W, X \}.$ Again, if our strategy was to devote $E$ to the first match that Fiddler Nation's fierce fiddling team would only have $1-E$ energy left for the final, which means that we will win the final only if $1 - E \geq 1 - \max \{W,X\},$ or equivalently, $\max \{W,X \} \geq E.$ So the probability of winning the final if you only have $1-E$ energy remaining is $$\mathbb{P} \{ \max \{W, X \} \geq E \} = 1 - \mathbb{P} \{ \max \{ W, X \} \leq E \} = 1 - E^2.$$

Putting these together we see that the probability of winning the final by devoting energy $E$ to the semifinal is $$f(E) = \mathbb{P} \{ V \leq E \} \mathbb{P} \{ \max \{W, X \} \geq E \} = E (1-E^2) = E - E^3.$$ In this case, we want to maximize this probability, which will occur when $f^\prime(E) = 1-3E^2 = 0,$ or at $E^* = \frac{1}{\sqrt{3}}.$ In this case, we see that the maximum probability of winning the World Cup is $$f(E^*) = \frac{1}{\sqrt{3}} - \left(\frac{1}{\sqrt{3}}\right)^3 = \frac{2\sqrt{3}}{9} \approx 0.38490017946\dots.$$

Sunday, July 12, 2026

The one where they end up at the same place

The climber and the sprinter are racing up a perfectly sinusoidal hill. They go from the base, where the gradient is 0 percent, to the peak, where the gradient is again 0 percent. For them to reach the top at the same time, what should the maximum gradient of the hill be?

Ok, so a few things are left unstated here, so let's insert them. Let's assume that the horizontal distance of this hill section is 1, since units don't seem to matter in the slightest at Tour de Fiddler. Since we know that the hill is perfectly sinusoidal, we see that the height at horizontal distance $x \in [0,1]$ from the start is given by $$h(x) = \frac{h}{2} + \frac{h}{2} \sin \left( \pi x - \frac{\pi}{2} \right) = \frac{h}{2} \left(1 - \cos (\pi x) \right),$$ where $h$ is the total height of the hill. In particular, we additionally see that the gradient at a vertical distance of $x$ from the start is given by $$g(x) = h^\prime (x) = \frac{\pi h}{2} \sin (\pi x).$$ So like the Classic problem we will solve the problem with respect to one variable, in this case the height $h,$ and then transform it into the desired variable, in this case $$g_{max} = \max_{x \in [0,1]} \frac{\pi h}{2} \sin(\pi x) = \frac{\pi h}{2}.$$

In order to figure out the time elapsed for a rider, we might first want to chop the horizontal distance into say $N$ small pieces, say with $x_n = \frac{n}{N},$ for $n = 0, 1, \dots, N.$ In this case, we can determine for each short segment of horizontal distance from say $x_{n-1}$ to $x_n,$ what the horizontal inclination $\theta_n$ is, in order to determine the speed of the rider over that small interval $v_n = v(\theta_n).$ Then we see that since $v_n$ represents the total speed, that the horizontal speed is only $v_n \cos \theta_n,$ so that the time it would take for the rider to traverse the small segment would be $$t_n = \frac{x_{n+1} - x_n}{ v_n \cos \theta_n} = \frac{1}{N v_n \cos \theta_n}.$$ Then the total time elapsed is \begin{align*}T = \sum_{n=1}^{N} t_n = \sum_{n=1}^N \frac{1}{N (v_n \cos \theta_n)} &\to \int_0^1 \frac{dx}{ v(\theta(x)) \cos \theta(x) } \\ &= \int_0^1 \frac{dx}{ \frac{P}{m \sin \theta(x) + 10} \cos \theta(x) } \\ &= \frac{1}{P} \int_0^1 \left(m \tan \theta(x) + 10 \sec \theta(x) \right) \,dx \end{align*} as $N \to \infty.$

Since $$\theta(x) = \tan^{-1} g(x) = \tan^{-1} h^\prime(x) = \tan^{-1} \left( \frac{\pi h}{2} \sin (\pi x) \right),$$ we have $$T(h) = \frac{1}{P} \int_0^1 \left( m \tan \left( \tan^{-1} \left( \frac{\pi h}{2} \sin (\pi x) \right) \right) + 10 \sec \left( \tan^{-1} \left( \frac{\pi h}{2} \sin (\pi x) \right) \right)\right) \,dx.$$ Because $\tan( \tan^{-1} u) = $u and $\sec (\tan^{-1} u) = \sqrt{1 + u^2}$ for all $u \in \mathbb{R},$ we have \begin{align*} T(h) &= \frac{m}{P} \int_0^1 \frac{\pi h}{2} \sin(\pi x) \,dx + \frac{10}{P} \int_0^1 \sqrt{ 1 + \left( \frac{\pi h}{2} \sin(\pi x)\right)^2} \,dx \\ &= \frac{mh}{P} + \frac{10}{P} \int_0^1 \sqrt{1 + \left( \frac{\pi h}{2} \sin(\pi x)\right)^2} \,dx \\ &= \frac{mh}{P} + \frac{20}{P \pi} E\left(-\frac{\pi^2 h^2}{4}\right),\end{align*} where $E(k) = \int_0^{\pi/2} \sqrt{1 - k \sin^2 t} \,dt$ is the complete elliptical integral of the second kind.

In this case, in particular, if we wanted to see when does $T_c(h) = T_s(h),$ then we have \begin{align*}0 = T_c(h) - T_s(h) &= \left( \frac{m_c h}{P_c} + \frac{20}{P_c \pi} E\left( - \frac{\pi^2 h^2}{4} \right) \right) - \left( \frac{m_s h}{P_s} + \frac{20}{P_s \pi} E \left( - \frac{\pi^2 h^2}{4} \right) \right) \\ &= \frac{1}{P_cP_s} \left( h (P_s m_c - P_c m_s) + \frac{20 (P_s-P_c)}{\pi} E\left( - \frac{\pi^2 h^2}{4} \right) \right),\end{align*} so the two times will be equal when we have $$h \left( \frac{P_c m_s - P_s m_c}{10 (P_s - P_c)} \right) = \frac{2}{\pi} E \left( - \frac{\pi^2 h^2}{4} \right).$$ For our particular climber and sprinter, we know from the Classic problem that $\frac{P_c m_s - P_s m_c}{10 (P_s - P_c)} = 18,$ so we have the implicit equation $$18h = \frac{2}{\pi} E \left(-\frac{\pi^2h^2}{4} \right).$$

To properly root-solve for this implicit equation, we can use a fixed-point iteration method to solve for the point where $f(x) = \frac{1}{9\pi} E(-\frac{\pi^2 x^2}{4} )$ has a fixed point where $f(x)=x.$ In particular, we can define the small Python snippet, using the built-in special function $\textsf{scipy.special.ellipe}$:

Since $\frac{2}{\pi} E(z) \approx 1$ for $z \approx 0,$ let's start with an initial guess of $h_0 = \frac{1}{18}.$ Doing so, quickly retrieves, after 6 iterations the approximate solution of $$h^* \approx 0.05566157787953384\dots,$$ which means that for them to reach the top of the hill at the same time that maximum gradient should be $g_{max} = \frac{\pi h^*}{2} = 8.743300207677981\dots \%.$

The one where they go the same speed

As it’s now July, the Tour de Fiddler is back!

This time, we’ll be looking at a model for a cyclist’s speed $v$ as a function of their pedaling power $P,$ their mass $m,$ and the ground’s angle of inclination $\theta$: $$v = \frac{P}{m \sin \theta + 10}.$$

In cycling, roads are marked with a gradient $g,$ which is a hill’s slope, typically expressed as a percentage. Thus, an incredibly steep 45-degree incline has a gradient of 1, or “100 percent.”

Consider the following two riders:

  • A “climber,” who has a power of 300 and a mass of 60
  • A “sprinter,” who has a power of 325 and a mass of 80

At what gradient will the climber and sprinter cycle at the same speed?

In this case, since the formula involves the ground's angle of inclination $\theta,$ but we then want an answer in terms of gradient, $g,$ we need to understand how these two quantities relate to one another. In particular, we see that $g = \tan \theta,$ or equivalently $\theta = \tan^{-1} g,$ but more on this later.

In general if $v_c$ and $v_s$ are the climber's and sprinter's velocities, then they will be equal when $$\frac{P_c}{m_c \sin \theta + 10} = \frac{P_s}{m_s \sin \theta + 10},$$ or equivalently when $$P_c(m_s \sin \theta + 10) = P_s(m_c \sin \theta + 10)$$ which in turn is equivalent to when $$(P_cm_s - P_sm_c) \sin \theta = 10 (P_s - P_c),$$ or when $$\sin \theta^* = \frac{ 10 (P_s - P_c) }{ P_cm_s - P_s m_c }.$$ In particular, when we have $P_c = 300,$ $m_c = 60,$ $P_s = 325,$ and $m_c = 80,$ then we have $$\sin \theta^* = \frac{10 \cdot ( 325 - 300 )}{ 300 \cdot 80 - 325 \cdot 60 } = \frac{250}{4500} = \frac{1}{18},$$ or equivalently $\theta^* = \sin^{-1} \frac{1}{18}.$

Since we have $$\tan (\sin^{-1} u) = \frac{u}{\sqrt{1-u^2}},$$ for any $u \in [-1,1],$ we see that the gradient at which the climber and sprinter will have the same speed is $$g^* = \tan \left( \sin^{-1} \frac{1}{18} \right) = \frac{ \frac{1}{18} }{ \sqrt{ 1 - \left( \frac{1}{18} \right)^2 } } = \frac{1}{\sqrt{18^2 -1}} = \frac{\sqrt{323}}{323} \approx 5.56414884\dots\%.$$

Monday, July 6, 2026

Retsy Boss VIII's Star Fitting Homage

After 250 years, the nation has commissioned Retsy Boss VIII to design a new flag with one star for each of the nation’s current $58$ states. As an homage to the original flag design, Retsy wants to select $58$ stars from the square grid that are all at most some distance $R$ from a point on the plane. What is the minimum distance $R$ that Retsy can use?

Thankfully for Retsy Boss VIII, her namesake left her the Python code to run the optimization to find the number of stars given $h,$ $k$ and $R.$ Also, fortunately for Retsy Boss VIII she knew to look at OEIS to look up the integer sequence A000328, which captures the case of $h=k=0$ and $R \in \mathbb{N},$ to give her a decent idea of where to start. In particular, we see that $N(0,0,4) = 49$ and $N(0,0,5)=81,$ so let's start looking for $R \in [4,5].$ In particular, she wants to find $$R^* = \inf \left\{ R \in [4,5] \mid N^*(R) = \sup_{(h,k) \in [0,1]^2} N(h,k,R) \geq 58 \right\}.$$

Retsy didn't want to exhaustively search the entire phase space, so first she went about implementing a secant method update to arrive at some point $R$ for which $N^*(R) = 58.$ In particular, let's let $R_0 = 4,$ $R_1 = 5$ and $$R_{n+1} = \frac{R_{n-1} N^*(R_n) - R_n N^*(R_{n-1}) + 58 (R_n - R_{n-1})}{N^*(R_n) - N^*(R_{n-1})}.$$ Note that relatively quickly we arrive at some value with $N^*(R) = 58,$ that is,

$n$ $R_n$ $N^*(R_n)$
$0$ $4$ $49$
$1$ $5$ $81$
$2$ $4.20689655\dots$ $59$
$3$ $4.17084639\dots$ $58$

That is all well and good, but Retsy VIII wants the minimal such value of $R$ such that $N^*(R) = 58.$ Now she turns to a binary search of the interval $[a_0,b_0] = [4, 4.17084639],$ to within a tolerance of $\varepsilon = 10^{-6}.$ For each $n,$ she defines $c_n = \frac{a_n+b_n}{2}.$ If $N^*(c_n) \lt 58,$ then she defines $a_{n+1} = c_n$ and $b_{n+1} = b_n;$ however if $N^*(c_n) = 58,$ then she defines $a_{n+1} = a_n$ and $b_{n+1} = c_n.$ We can stop as soon as

$n$ $a_n$ $b_n$ $c_n$ $N^*(c_n)$
$0$ $4$ $4.17084639$ $4.08542320$ $56$
$1$ $4.08542320$ $4.17084639$ $4.12813480$ $57$
$2$ $4.12813480$ $4.17084639$ $4.14949060$ $57$
$3$ $4.14949060$ $4.17084639$ $4.16016850$ $58$
$4$ $4.14949060$ $4.16016850$ $4.15482955$ $57$
$5$ $4.15482955$ $4.16016850$ $4.15749902$ $58$
$6$ $4.15482955$ $4.15749902$ $4.15616428$ $58$
$7$ $4.15482955$ $4.15616428$ $4.15549691$ $58$
$8$ $4.15482955$ $4.15549691$ $4.15516323$ $57$
$9$ $4.15516323$ $4.15549691$ $4.15533007$ $58$
$10$ $4.15516323$ $4.15533007$ $4.15524665$ $58$
$11$ $4.15516323$ $4.15524665$ $4.15520494$ $58$
$12$ $4.15516323$ $4.15520494$ $4.15518409$ $57$
$13$ $4.15518409$ $4.15520494$ $4.15519451$ $58$
$14$ $4.15518409$ $4.15519451$ $4.15518930$ $57$
$15$ $4.15518930$ $4.15519451$ $4.15519191$ $57$
$16$ $4.15519191$ $4.15519451$ $4.15519321$ $58$
$17$ $4.15519191$ $4.15519321$ $4.15519256$ $58$

So we see that the optimal value of $R^*$ is about $4.15519256$ to within a tolerance of $\varepsilon = 10^{-6}.$ At this point, we can use map a contour plot, shown below, similar to what we did for the Classic problem. It is hard to discern, but the only place that the maximum is attained (up to the various symmetries of the $N$ function) when $R = 4.15519256$ is in a small neighborhood of the point $(h,k) = (1/2, 1/8)$ (seem familiar ... wink, wink?). If we were to graph the circle of radius $R = 4.15519256$ centered at $(1/2, 1/8),$ we see that it ever so slightly includes the lattice points $(-1,4),$ $(2,4),$ $(0,-4)$ and $(1,-4).$ In particular, since we see that the distance from $(1/2, 1/8)$ to any of these four lattices points is exactly the same, we can reduce the value of $R$ to precise that distance and maintain a value of $N^*(R) = 58,$ and hence the minimum distance that Retsy Boss VIII can use to honor her forebear's design is exactly $$R^* = \sqrt{0.5^2 + 4.125^2} = \sqrt{1.5^2 + 3.875^2} = \frac{\sqrt{1105}}{8} \approx 4.155192534648665\dots.$$

Move Over Ed McMahon, It's Retsy Boss's Star Search

When designing her new nation’s flag, Retsy Boss wanted to compactly arrange some stars. These stars were positioned along a square grid, but she only wanted to include stars whose centers were at most two units away from some point on the plane.

For example, if she had centered the circle on a star itself, then she could have placed a total of 13 stars on the flag, as shown below:

What is the greatest number of stars Retsy could have placed on the flag?

Let's define the function $N(h,k,R)$ to be the number of integer lattice points within distance $R$ of the point $(h,k) \in \mathbb{R}^2,$ in particular, we have $$N(h,k,R) = \# \left\{ (m,n) \in \mathbb{Z}^2 \mid (m-h)^2 + (n-k)^2 \leq R^2 \right\}.$$ If we have a fixed value of $k,$ let's say, then we see will have $$\eta_n(h,k,R) = \left\lfloor \sqrt{R^2 - (n-k)^2} + h \right\rfloor + \left\lfloor \sqrt{R^2 - (n-k)^2} - h \right\rfloor + 1,$$ where for clarity $\lfloor x \rfloor = \max \{ n \in \mathbb{Z} \mid n \leq x \}$ and in particular $\lfloor x \rfloor = -1$ for $x \in [-1,0).$ So in particular, we have $$N(h,k,R) = \sum_{n=-\lfloor R - k \rfloor}^{\lfloor R + k \rfloor} \eta_n (h,k,R).$$ We see for instance, that when $h=k=0$ and $R=2,$ that we indeed recover $\eta_{-2}(0,0,2) = \eta_2(0,0,2) = 1, \eta_{-1}(0,0,2) = \eta_1(0,0,2) = 3,$ and $\eta_0 (0,0,2)= 5,$ so we have $$N(0,0,2) = \sum_{n=-2}^2 \eta_n(0,0,2) = 1 + 3 + 5 + 3 + 1 = 13.$$

Now, since we also see that everything is periodic and symmetric, in order to solve Retsy's problem we only need to find $$N^* = \max \left\{ N(h,k,2) \mid 0 \leq k \leq h \leq \frac{1}{2} \right\},$$ since everything else in the unit square will can be recovered from this region and everything else in the plane is periodic so $N(h,k,2) = N([h], [k],2),$ for all $(h,k) \in \mathbb{R}^2,$ where $[x] = x - \lfloor x \rfloor$ is the fractional part function.

We can code this up in the following Python code to explore the phase space and empirically determine $N^*$:

Using this Python code, we can plot the following contour plot, which shows that anywhere in the dark blue region produces the the largest possible number of stars that Retsy could place on the flag is $N^*=14.$ In particular, we can take the point $(h,k) = (0.5, 0.125)$ for foreshadowing purposes and explicitly compute that \begin{align*} \eta_{-1}(0.5,0.125,2) &= \lfloor \sqrt{ 4 - (-1-0.125)^2 } + 0.5 \rfloor + \lfloor \sqrt{ 4 - (-1-0.125)^2 } - 0.5 \rfloor + 1 \\ &\quad = \lfloor 1.654\dots + 0.5 \rfloor + \lfloor 1.654\dots - 0.5 \rfloor + 1 = 4\\ \eta_{0}(0.5,0.125,2) &= \lfloor \sqrt{ 4 - (-0.125)^2 } + 0.5 \rfloor + \lfloor \sqrt{ 4 - (-0.125)^2 } - 0.5 \rfloor + 1\\ &\quad =\lfloor 1.996\dots + 0.5 \rfloor + \lfloor 1.996\dots - 0.5 \rfloor + 1 = 4\\ \eta_{1}(0.5,0.125,2) &= \lfloor \sqrt{ 4 - (1-0.125)^2 } + 0.5 \rfloor + \lfloor \sqrt{ 4 - (1-0.125)^2 } - 0.5 \rfloor + 1\\ &\quad =\lfloor 1.798\dots + 0.5 \rfloor + \lfloor 1.798\dots - 0.5 \rfloor + 1 = 4\\ \eta_{2}(0.5,0.125,2) &= \lfloor \sqrt{ 4 - (2-0.125)^2 } + 0.5 \rfloor + \lfloor \sqrt{ 4 - (2-0.125)^2 } - 0.5 \rfloor + 1\\ &\quad =\lfloor 0.696\dots + 0.5 \rfloor + \lfloor 0.696\dots - 0.5 \rfloor + 1 = 2\end{align*} so that $$N(0.5,0.125,2)=N^*=4+4+4+2=14.$$

Sunday, June 21, 2026

A less than half-full tank

Frustrated with my old calculator, I toss it in the trash and buy a new one. But now I’m concerned this second calculator is also “tanked.” As before, every value of $A$ between $0$ and $1$ is equally likely, at first.

I ask my friend to generate one random number using this second calculator. My friend does so, and smirks. “I won’t tell you what the number is,” my friend says, “but it’s somewhere between $0$ and $0.5.$” On average, what can I expect the value of $A$ (for this second calculator) to be?

Similar to the classic problem, we will define terms with $A \sim U(0,1)$ at first and $X|A=a \sim U(0,a).$ In this case, we want to get the distribution of $A$ conditional on $0 \leq X \leq \frac{1}{2},$ that is, $$f_{A\mid 0 \leq X \leq 1/2} (a) = \lim_{da \downarrow 0} \frac{\frac{1}{da} \mathbb{P} \left\{ a -\frac{da}{2} \leq A \leq a + \frac{da}{2}, 0 \leq X \leq \frac{1}{2} \right\}}{ \mathbb{P} \{ 0 \leq X \leq \frac{1}{2} \} }.$$

Let's take the denominator first, like last time to see that \begin{align*}\mathbb{P} \{ 0 \leq X \leq \frac{1}{2} \} &= \int_0^1 \int_0^{1/2} \frac{1}{t} \chi_{[0,t]}(x) \,dx \,dt \\ &= \int_0^{1/2} \int_0^1 \frac{1}{t} \chi_{[0,t]}(x) \,dt \,dx \\ &= \int_0^{1/2} \left(\int_0^x 0 \,dt + \int_x^1 \frac{dt}{t} \right) \,dx \\ &= \int_0^{1/2} -\ln x \,dx \\ &= \frac{1}{2} - \frac{1}{2} \ln \frac{1}{2} = \frac{1}{2} \left( 1 + \ln 2 \right).\end{align*}

Let's assume that $a \gt \frac{1}{2},$ in which case, for small values of $da$ we have $\frac{1}{2} \leq a - \frac{da}{2},$ so we have $\chi_{[0,t]}(x) = 1$ for all $0 \leq x \leq 1/2$ and $t \in (a-da/2, a+da/2).$ Therefore, if $a \gt \frac{1}{2},$ then we have the numerator equal to \begin{align*}\frac{1}{da} \mathbb{P} \{ a - da/2 \leq A \leq a + da/2, 0 \leq X \leq 1/2 \} &= \frac{1}{da}\int_{a-da/2}^{a+da/2} \int_0^{1/2} \frac{1}{t} \chi_{[0,t]}(x) \,dx \, dt \\ &= \frac{1}{da} \int_{a-da/2}^{a+da/2} \frac{dt}{2t} = \frac{1}{2da} \left( \frac{a + \frac{da}{2}}{a - \frac{da}{2}} \right) \\&= \frac{1}{2} \left. \frac{d}{dt} \ln t \right|_{t=a} + O(da) = \frac{1}{2a} + O(da).\end{align*} On the other hand, if $a \lt \frac{1}{2},$ then if $da$ is small enough, then for every $t \in (a - da/2, a+da/2),$ we have $t \lt 1/2,$ so we have the denominator as \begin{align*}\frac{1}{da} \mathbb{P} \{ a - da/2 \leq A \leq a + da/2, 0 \leq X \leq 1/2 \} &= \frac{1}{da} \int_{a-da/2}^{a+da/2} \int_0^{1/2} \frac{1}{t} \chi_{[0,t]}(x) \,dx \,dt \\ &= \frac{1}{da} \int_{a-da/2}^{a+da/2} \left( \int_0^t \frac{1}{t}\, dx + \int_t^{1/2} 0 \,dx \right) \,dt \\ &= \frac{1}{da} \int_{a-da/2}^{a+da/2} 1 \,dt = 1\end{align*} Therefore, we see that as $da \downarrow 0,$ the numerator becomes the piecewise function $n(a) = \min \{ 1, \frac{1}{2a} \},$ so putting everything together, we see that $$f_{A\mid 0 \leq X \leq \frac{1}{2}} (a) = \frac{ n(a) }{ \frac{1}{2} (1 + \ln 2) } = \min \left\{ \frac{2}{1 + \ln 2}, \frac{1}{a(1 + \ln 2)} \right\}.$$

Therefore, if all we have is the knowledge that the draw from the tanked calculator is in the lower half of the interval, then the expected value of the tank parameter is \begin{align*}\mathbb{E} \left[ A \mid 0 \leq X \leq \frac{1}{2} \right] &= \int_0^{1/2} a \cdot \frac{2}{1 + \ln 2} \,da + \int_{1/2}^1 a \cdot \frac{1}{a(1 + \ln 2)} \,da \\ &= \left.\frac{2}{ 1 + \ln 2} \frac{a^2}{2} \right|_{a=0}^{a=1/2} + \frac{1}{1 + \ln 2} \cdot \frac{1}{2} \\ &= \frac{3}{4(1 + \ln 2)} \approx 0.442962081862\dots\end{align*}

A half-full tank

I think the random number generator on my calculator might be malfunctioning. Oh no!

Under normal conditions, it should generate random numbers between $0$ and $1.$ But my suspicion is that the calculator is “tanked,” meaning it only generates random numbers between $0$ and some value $0 \lt A \lt 1.$ Beyond that, I have no knowledge regarding the value of $A.$ At the moment, it’s equally likely to be any value from $0$ to $1$.

As an experiment, I ask the calculator to generate one random number. It produces a value of exactly $0.5.$ (While this is, admittedly, infinitely unlikely, let’s roll with it!) Based on this result, what can I expect the value of $A$ to be, on average?

Let's first define some terms. Let's assume that the tank paramater $A \sim U(0,1),$ and since the calculator is tanked that random draws are all independently and identically distributed as $X \sim U(0,A),$ that is, $$f_{X|A=a}(x) = \lim_{dx \downarrow 0} \frac{1}{dx} \mathbb{P} \{ x - \frac{dx}{2} \leq X \leq x + \frac{dx}{2} \mid A = a\} = \frac{1}{a} \chi_{[0,a]}(x).$$ Using Bayesian theorem, we see that \begin{align*}f_{A|X=x} (a) &= \lim_{da \downarrow 0} \frac{1}{da} \mathbb{P} \{ a - \frac{da}{2} \leq A \leq a + \frac{da}{2} \mid X = x \} \\ &= \lim_{da \downarrow 0} \frac{ \mathbb{P} \{ a - \frac{da}{2} \leq A \leq a + \frac{da}{2}, X = x \} }{ da \mathbb{P} \{ X = x \} } \\ &= \lim_{da \downarrow 0} \frac{ \frac{1}{da} \int_{a - da/2}^{a+da/2} \frac{1}{t} \chi_{[0,t]}(x) \,dt }{ \int_0^1 \frac{1}{t} \chi_{[0,t]}(x) \,dt }.\end{align*} In particular, the denominator can be calculated as $$\int_0^1 \frac{1}{t} \chi_{[0,t]}(x) \,dt = \int_0^x \frac{1}{t} \chi_{[0,t]}(x) \,dt + \int_x^1 \frac{1}{t} \chi_{[0,t]}(x) \,dt = \int_0^x 0 \,dt + \int_x^1 \frac{dt}{t} = -\ln x.$$ The numerator meanwhile is equivalent to $\frac{1}{a} \chi_{[0,a)} (x),$ since if $x \lt a,$ then there is some $\alpha \lt 2(a-x)$ for which for any $0 \lt da \lt \alpha,$ $\chi_{[0,t]}(x) = 1$ for all $t \in (a-\frac{da}{2}, a + \frac{da}{2}),$ so that $$\frac{1}{da} \int_{a - da/2}^{a+da/2} \frac{1}{t} \chi_{[0,t]}(x) \,dt = \frac{1}{da} \int_{a-da/2}^{a+da/2} \frac{dt}{t} = \frac{ \ln \left( \frac{a + \frac{da}{2}}{a - \frac{da}{2}} \right) }{da} = \left.\frac{d}{dt} \ln t \right|_{t=a} + O(da) = \frac{1}{a} + O(da).$$ Similarly, if $x \gt a,$ then there is some $\alpha^\prime \lt 2(x-a)$ for which for any $0 \lt da \lt \alpha^\prime,$ then $\chi_{[0,t]}(x) = 0$ for all $t \in (a - \frac{da}{2}, a + \frac{da}{2} ),$ so that $$\frac{1}{da} \int_{a-da/2}^{a+da/2} \frac{1}{t} \chi_{[0,t]}(x) \,dt = 0.$$ Putting this all together, we see that $$f_{A\mid X=x}(a) = \begin{cases} -\frac{1}{a \ln x}, &\text{if $x \lt a \leq 1$;}\\ 0, &\text{if $0 \leq a \lt x.$}\end{cases}$$

Therefore, in particular, since we observed that $X = \frac{1}{2},$ we have the expected value of the tank parameter $A$ as \begin{align*}E[A \mid X = \frac{1}{2}] &= \int_0^1 a f_{A \mid X=\frac{1}{2}} (a) \,da \\ &= \int_0^{1/2} a \cdot 0 \,da + \int_{1/2}^1 a \cdot \left(- \frac{1}{a \ln \frac{1}{2}}\right) \,da \\ &= \int_{1/2}^1 \frac{da}{ln 2} \\& = \frac{1}{2\ln 2} \approx 0.72134752044\dots\end{align*}

Sunday, June 14, 2026

The average wave

Another wave is approaching the island, but no one knows which direction it’s coming from—for the moment, all directions are equally likely. On average, what is the length of the stretch of land directly under the wave halfway between when the wave first and last makes contact with the island?

Using our function $$\ell (\theta) = \min \left\{ \sqrt{(3 - \cos \theta) (1 + \cos \theta)}, \frac{ \tan \theta (1- \cos \theta) + \sqrt{(3-\cos \theta) (1 + \cos \theta)}}{2} \right\}$$ from the Classic answer along with the symmetry arguments that we made there to come to the conclusion that the average length of the stretch of land is \begin{align*}\bar{\ell} &= \int_0^{\pi/2} \ell(\theta) \frac{ 2d\theta }{ \pi } = \frac{2}{\pi} \int_0^{\cos^{-1} 1/3} \frac{ \tan \theta ( 1- \cos \theta) + \sqrt{(3 - \cos \theta) (1 + \cos \theta) }}{2} \,d\theta \\ &\quad\quad\quad\quad\quad\quad\quad\quad\quad + \frac{2}{\pi} \int_{\cos^{-1} 1/3}^{\pi/2} \sqrt{ (3 - \cos \theta) (1 + \cos \theta) } \,d\theta \end{align*}

Well that is certainly a mouthful, but we can break it into some pieces and come up with an analytical solution. First we see that if we rewrite the portion under the radical as $$\frac{\sqrt{(3 - \cos \theta)( 1 + \cos \theta) }}{2} = \sqrt{ 1- \left(\frac{1-\cos \theta}{2} \right)^2}$$ that we can do some trigonometrical simplifications and substitutions. So in particular we see that since $\sin \frac{\theta}{2} = \sqrt{ \frac{1-cos \theta}{2} }$ when $\theta \in (0, \frac{\pi}{2}),$ then we get \begin{align*}\int \sqrt{ 1- \left( \frac{ 1 - \cos \theta }{2} \right)^2 } \,d\theta &= \int \sqrt{ 1 - \sin^4 \frac{\theta}{2} } \,d\theta \\&= \int \sqrt{ \left( 1 - \sin^2 \frac{\theta}{2} \right) \left( 1 + \sin^2 \frac{\theta}{2} \right) } \,d\theta \\ &= \int \cos \frac{\theta}{2} \sqrt{ 1 + \sin^2 \frac{\theta}{2} } \,d\theta \\ &= 2\int \sqrt{1 + u^2} \,du,\end{align*} where the last equation involves the substitution of $u = \sin \frac{\theta}{2}.$ Using integration by parts, we get $$\int \sqrt{1+u^2} \,du = u \sqrt{1 + u^2} - \int \frac{u^2 \,du}{\sqrt{1+u^2}} = u \sqrt{1+u^2} + \int \frac{du}{\sqrt{1+u^2}} - \int \sqrt{ 1 + u^2 } \,du,$$ so that we get $$\int \sqrt{1+u^2} \,du = \frac{1}{2} \left( u \sqrt{1 + u^2} + \int \frac{du}{\sqrt{1+u^2}} \right) = \frac{1}{2} \left( u \sqrt{1+ u^2} + \sinh^{-1} u\right) + C.$$ Therefore we see that \begin{align*}\int \frac{ \sqrt{ (3-\cos \theta) (1 + \cos \theta) } }{2} \,d\theta &= \int \sqrt{ 1 - \left( \frac{1 - \cos \theta}{2} \right)^2 } \,d\theta \\ &= \sin \frac{\theta}{2} \sqrt{ 1 + \sin^2 \frac{\theta}{2} } + \sinh^{-1} \left(\sin \frac{\theta}{2}\right) + C.\end{align*} Similarly, but with a lot less fuss, we can get $$\int \frac{\tan \theta (1 - \cos \theta)}{2} \,d\theta = -\frac{1}{2} \ln | \cos \theta | + \frac{\cos \theta}{2} + C.$$

Therefore the the first integral \begin{align*}I_1 &= \frac{2}{\pi} \int_0^{\cos^{-1} 1/3} \frac{ \tan \theta (1 - \cos \theta) }{2} + \sqrt{ 1 - \left( \frac{1-\cos \theta}{2} \right)^2 } \,d\theta \\ &= \frac{2}{\pi}\left[ -\frac{1}{2} \ln | \cos \theta | - \frac{\cos \theta}{2} + \sin \frac{\theta}{2} \sqrt{ 1 + \sin^2 \frac{\theta}{2} } + \sinh^{-1} \left( \sin \frac{\theta}{2} \right) \right]^{\theta = \cos^{-1} 1/3}_{\theta = 0} \\ &= \frac{2}{\pi}\left( -\frac{1}{2} \ln \frac{1}{3} + \frac{1}{6} + \sqrt{ \frac{ 1 - \frac{1}{3}}{2}} \sqrt{ 1 + \left(\sqrt{ \frac{ 1 - \frac{1}{3} }{2} }\right)^2 } + \sinh^{-1} \sqrt{ \frac{1 - \frac{1}{3}}{2} } \right) \\ &\quad\quad\quad\quad\quad - \frac{2}{\pi}(0 + \frac{1}{2} + 0 + 0) \\ &= \frac{2}{\pi} \left(\frac{1}{2} \ln 3 + \frac{1}{3} + \sinh^{-1} \sqrt{\frac{1}{3}} \right) \\ &= \frac{2}{\pi}\ln 3 + \frac{2}{3\pi}, \end{align*} since $\sinh^{-1} t = \ln ( t + \sqrt{ 1 + t^2} ),$ so $$\sinh^{-1} \sqrt{\frac{1}{3}} = \ln \left( \sqrt{\frac{1}{3}} + \sqrt{1 + \frac{1}{3}} \right) = \ln \left( \sqrt{\frac{1}{3}} + \sqrt{ \frac{4}{3}} \right) = \ln \left( 3 \sqrt{\frac{1}{3}} \right) = \ln \sqrt{3} = \frac{1}{2} \ln 3.$$ The second integral is \begin{align*}I_2 &= \frac{4}{\pi} \int_{\cos^{-1} 1/3}^{\pi/2} \sqrt{ 1 - \left( \frac{1 - \cos \theta}{2} \right)^2 } \,d\theta \\ &= \frac{4}{\pi} \left[ \sin \frac{\theta}{2} \sqrt{ 1 + \sin^2 \frac{\theta}{2} } + \sinh^{-1} ( \sin \frac{\theta}{2} ) \right]_{\theta=\cos^{-1} 1/3}^{\theta=\pi/2} \\ &= \frac{4}{\pi} \left( \frac{1}{\sqrt{2}} \cdot \sqrt{1+\frac{1}{2}} + \sinh^{-1}\frac{1}{ \sqrt{2}} \right) \\ &\quad\quad\quad - \frac{4}{\pi} \left( \sqrt{ \frac{ 1 - \frac{1}{3}}{2}} \sqrt{ 1 + \left(\sqrt{ \frac{ 1 - \frac{1}{3} }{2} }\right)^2 } + \sinh^{-1} \sqrt{ \frac{1 - \frac{1}{3}}{2} } \right) \\ &= \frac{4}{\pi} \left( \frac{\sqrt{3}}{2} + \sinh^{-1} \frac{1}{\sqrt{2}} - \frac{2}{3} - \frac{1}{2} \ln 3 \right)\end{align*} Putting this all together and taking advantage of some beneficial cancelling, we get that the average length of the stretch of land covered by the wave at 10:05 a.m. if all directions for it to approach Semicircle Island are equally likely is $$\bar{\ell} = I_1 + I_2 = \frac{4}{\pi} \left( \frac{ \sqrt{3}}{2} + \sinh^{-1} \frac{1}{\sqrt{2}} \right) - \frac{2}{\pi} \approx 1.30443945503\dots$$ miles.

The longest wave

Semicircle Island is shaped like a perfect semicircle (or semidisk, technically), with a radius of $1$ mile. It doesn’t have any permanent residents, but it’s a very popular destination for surfers.

Rumor has it that a big wave is headed toward the island. This thin, straight wall of water never changes speed or direction. It will first make contact with the island at 10 a.m. and it will last be in contact with the island at 10:10 a.m. What is the longest possible stretch of land that is directly under the wave at 10:05 a.m.?

With my deepest apologies for my bad Paint skills, let's use a modified version of picture from the Extra Credit prompt and note that I inserted a ray that is perpendicular to the direction of travel of the wave that happens to make an angle of $\theta$ with the positive $x$-axis.

Let's assume that the center of the semi-disk is the point $(0,0),$ the place where the wave first hits the island is at the point $(\cos \theta, \sin \theta)$ and the formula for the ray connecting the origin and this point is $y = x \tan \theta$ as long as $\theta \ne \frac{\pi}{2}.$ Since the wave is perpendicular to this ray, the wave's slope must be the negative reciprocal of that of the ray, so we have the fomula for the wave at 10:00 a.m. is $y= -x \cot \theta + \csc \theta,$ which works as long as $x \not\in \{ 0, \pi\}.$ We similarly see that since the wave at each future point will be parallel to this line that the equation that models the position of the wave at 10:10 a.m. is either $y= -(x+1) \cot \theta,$ if $\theta \in (0, \frac{\pi}{2}),$ or $y = -(x-1) \cot \theta$ if $\theta \in ( \frac{\pi}{2}, \pi ).$ For simplicity, and by symmetry let's just assume going forward that $\theta \in (0, \frac{\pi}{2}).$ In this case, we see that the formula that models the position of the wave at 10:05 a.m., based on the uniform motion of the wave, is then $$y = -x \cot \theta + \frac{\left(\csc \theta + (-\cot \theta)\right)}{2} = -x \cot \theta + \frac{1 - \cos \theta}{2 \sin \theta}.$$

Let's pause here and think about what the length of a chord of a full circle would be. For simplicity let's assume that the chord is parallel to the $x$-axis, at say $y = h.$ In this case, we see that the endpoints of the chord are at $(\pm \sqrt{1-h^2}, h),$ so the length of the curve is $2\sqrt{1-h^2}.$ We further notice that if we rotate the entire $xy$-plane clockwise by angle $\frac{\pi}{2} - \theta,$ then the positive $y$-axis would be mapped to the ray $y= x \tan \theta,$ as we had before. In the case of the circle case, the chord length is obviously preserved in this orthogonal rotation, but now we want to only include the portion of the rotated chord that is now above the $x$-axis. We see that the portion of the chord that was in quadrant II before the rotation is still definitely in the upper half-plane post-rotation, so we should get at least $\sqrt{1-h^2}.$ The only thing to calculate is how much of the half-chord that was in the quadrant I. Firstly, it is perhaps the case depending on the height $h$ and rotational angle $\theta$ that the entirety of the half-chord is in the upper half-plane post-rotation, so the maximum that we could ever get is $\sqrt{1-h^2}.$ On the other hand, if we look at the right triangle formed by the ray $y = x\tan \theta,$ the rotated half-chord and the $x$-axis. Using trigonometry we see that the side with length $h$ is adjacent to the angle whose measure is \theta, with the half-chord opposite that angle, so we have the length of the half-chord in the upper half-plane as $h \tan \theta.$ So putting this altogether, we see that in a case where the we have the line $y=h$ and a rotation of the xy-plane clockwise by $\frac{\pi}{2}-\theta$ then the length of the chord that remains in the upper half-plane is $$\ell(h, \theta) = \min \{ 2 \sqrt{1-h^2}, \sqrt{1-h^2} + h \tan \theta \}.$$

That's cool an all, but let's return to our particular wave. We see that the we certainly have $\theta,$ by design, but all we need is to determine $h$ in this case. In the case of our wave that is modeled by the line $$y = -x\cot \theta + \frac{1- \cos \theta}{\sin \theta},$$ we can use that same right triangle that we used in the generic case above and the fact that the line crosses the $x$-axis as the point $x = \frac{\sec \theta - 1}{2}$ to determine that $$h = \frac{\sec \theta - 1}{2} \cos \theta = \frac{1 - \cos \theta}{2}.$$ Therefore, we see that the length of the stretch of land covered at 10:05 a.m. if it first touches the island at a point $(\cos \theta, \sin \theta)$ is \begin{align*}\ell(\theta) = \ell\left(\frac{1- \cos\theta}{2}, \theta\right) &= \min \left\{ 2 \sqrt{ 1 - \left(\frac{1 - \cos \theta}{2} \right)^2 }, \frac{1 - \cos \theta}{2}\tan \theta + \sqrt{ 1 - \left( \frac{1 - \cos \theta}{2} \right)^2 } \right\} \\ &= \min \left\{ \sqrt{ (3 - \cos \theta) (1 + \cos \theta) }, \frac{\tan \theta ( 1 - \cos \theta) + \sqrt{(3-\cos \theta)(1 + \cos \theta)} }{2} \right\},\end{align*} for $\theta \in (0, \frac{\pi}{2}).$ Analyzing the parts we see that $\tan \theta (1 - \cos \theta)$ is always increasing on this interval, while the term within the square root is always decreasing, therefore we can reason that that maximal length occurs exactly at the cutover point when $$\tan \theta (1 - \cos \theta) = \sqrt{ (3 - \cos \theta) (1 + \cos \theta) }.$$ While I am sure there are many who may want to try to solve analytically, from a geometric intuition perspective, this cutover occurs exactly when the point where the wave crosses the $x$-axis is at the point $(1,0)$, that is, when $$\frac{\sec \theta^* - 1}{2} = 1,$$ or $\sec \theta^* = 3,$ or $\theta^* = \cos^{-1} \frac{1}{3}.$ At this critical point, the longest possible stretch of land that the wave is covering at 10:05 a.m. is $$\ell^* = \ell( \cos^{-1} \frac{1}{3} ) = \sqrt{ (3 - \frac{1}{3}) (1 + \frac{1}{3} ) } = \frac{4}{3} \sqrt{2} \approx 1.88561808316\dots$$ miles.

For absolute completeness we can cover the cases of $\theta = 0,$ in which case wave is represented by vertical lines and at 10:05 a.m., the wave would be covering the unit interval along the positive $y$-axis and have a length of one mile. For the case of $\theta = \frac{\pi}{2},$ where the wave is represented by horizontal lines and the wave would be at $y= \frac{1}{2}$ and cover a distance of $2\sqrt{1 - \frac{1}{2}} = \sqrt{3} \lt \frac{4}{3} \sqrt{2}$ at 10:05 a.m. By symmetry, we can cover the case of $\theta \in (\frac{\pi}{2} , \pi)$ and by another symmetry we can cover the case of what if instead of last hitting the point at $(1,0)$ the wave first hits the point at $(1,0)$ and then only at 10:10 a.m. arrives at the point $(\cos \theta, \sin \theta),$ to show that there is certainly not a larger possible stretch of land to be found if instead of the subset $(0, \frac{\pi}{2})$ that we spent most of our time on, the wave came with an orientation of \theta with respect to the positive $x$-axis for some $\theta \in (\frac{\pi}{2}, 2\pi)$... but more on this later.

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.