Monday, February 2, 2026

Rapidly scattering food

Frankie has stored all of her food on lily pad A. However, her food has a tendency to “fly” away. Every second, the food that’s on every lily pad splits up into six equal portions that instantaneously relocate to the six neighboring pads.

At zero seconds, all the food is on lily pad A. After one second, there’s no food on pad A, and $1/6$ of the food is on each of the surrounding six pads. After two seconds, $1/6$ of the food is again on pad A, while the rest of the food is elsewhere.

After how many seconds $N$ (with $N > 2$) will pad A have less than $1$ percent of its original amount?

Here we can code up the six possible directions and let the probability distribution evolve through time. Let's say that at time $t$ we have $\pi(t, a, b) \in (0,1)$ proportion of all of Frankie's food at the lily pad with center at $a\zeta + b\xi.$ Then we see that this means that it recursively should have received 1/6 of the food on lily pads $(a\pm 1, b)$, $(a, b\pm 1),$ and $(a \pm 1, b\mp 1)$ at time $t-1,$ that is \begin{align*}\pi( t, a, b ) &= \frac{1}{6} \Biggl( \pi (t-1, a+1, b) + \pi( t-1, a-1, b) \\ & \quad\quad\quad +\pi( t-1, a, b+1) + \pi (t -1, a, b-1) \\ &\quad\quad\quad\quad + \pi( t -1, a+1, b-1) + \pi (t-1, a-1, b+1) \Biggr),\end{align*} for all $a, b \in \mathbb{Z}, t \in \mathbb{N},$ with initial condition $\pi(0,0,0) = 1$ and $\pi(0,a,b) = 0$ for $a\ne b \ne 0.$

Coding this up in Python and then solving for $T = \min \{ t \gt 2 \mid \pi(t, 0,0) \lt 0.01 \}$ yields that Frankie's food on lily pad A will be less than $1\%$ of the total after $T = 17$ seconds.

Slowly spiraling eastward

Frankie the frog is hopping on a large, packed grid of lily pads, shown below. The pads are circular and each is a distance 1 from its nearest neighbors. (More concretely: Each pad has a diameter of 1 and they are arranged in a hexagonal lattice.) Frankie starts at (0, 0), the center of the pad labeled A. Then she hops due east to pad B at (1, 0), and from there she hops to pad C at (1.5, √(3)/2).

She wants to continue hopping in a counterclockwise, spiral-like pattern. Each of her jumps is to the center of a neighboring pad, a net distance of 1. But there are two rules her spiral must follow:

  • Each next pad must be in a more counterclockwise direction (relative to spiral’s origin at pad A) than the previous pad.
  • Each pad must be farther from A than the previous pad.

After a number of hops spiraling around, Frankie realizes she is, once again, due east from A. What is the closest to A she could possibly be? That is, what is the minimum possible distance between the center of the pad she’s currently on from the center of pad A?

There are only six possible directions for Frankie to jump in, namely $\pm 1$ and $( \pm \frac{1}{2}, \pm \frac{\sqrt{3}}{2} ).$ If we let $\zeta = e^{i \pi/3}$ then we see that the directions are actually all $\zeta,$ $\zeta^2,$ $\zeta^3 = -1,$ $\zeta^4,$ $\zeta^5$ and $\zeta^6 = 1.$ Let's let define $\xi = \zeta^2$ and not that $1 = \zeta - \xi.$ In this way we see that the directions that Frankie can jump in are either $\pm \zeta$, $\pm \xi$ or $\pm 1 = \pm (\zeta - \xi),$ so all in terms of $\zeta, \xi$ coordinates. While we are still establishing preliminaries, let's also see that if we have some point $z=a\zeta + b\xi$ for any $a, b \in \mathbb{Z},$ that \begin{align*}|z|^2 &= (a\zeta + b\xi) \left(\frac{a}{\zeta} + \frac{b}{\xi}\right) \\ &= a^2 + b^2 + ab\left(\zeta + \frac{1}{\zeta}\right) \\ &= a^2 + b^2 + 2ab\cos \frac{\pi}{3} \\&= a^2 + b^2 + ab.\end{align*}

Since she wants to do make the tightest possible spiral, she will want to keep going in the same direction until the next possible clockwise motion, which will be dictated by her more counterclockwise and more distant from A requirements.

Let's see this in action. We have $C = 1 + \zeta = 2\zeta - \xi,$ with $$|C| = \sqrt{2^2 + 1^2 + 2\cdot (-1)} = \sqrt{4 + 1 - 2} = \sqrt{3}.$$ Since $|C + \xi| = |2\zeta| = 2 \gt |C|,$ we have $D = 2\zeta.$.

Now we will keep adding $\xi$ steps until $\xi - \zeta = -1$ gives us an acceptable step. So let's build up the cases here. We will have steps of $2\zeta + n\xi$ for each $n = 0, 1, \dots, N_1$ where we have \begin{align*}N_1 &= \min \{ k \mid |\zeta + (k+1)\xi| \gt |2\zeta + k\xi|\} \\ &= \min \{ k \mid 1 + (k+1)^2 + k+1 \gt 4 + k^2 + 2k \}\\ &= \min \{ k \mid k \gt 1 \} = 2.\end{align*} So after we are done with $3\xi$ steps we find ourselves at $G = 2\zeta + 2\xi = (0,2\sqrt{3})$ and ready to make steps in the $-1$ direction.

Again we will keep adding $-1=-\zeta + \xi$ steps until $-\zeta$ gives us an acceptable step. So we have steps $(2-n)\zeta + (2 + n)\xi$ for $n = 0, 1, \dots, N_2$ where \begin{align*}N_2 &= \min \{ k \mid | (1-k)\zeta + (2+k) \xi | \gt | (2-k) \zeta + (2+k) \xi | \} \\ &= \min \{ k \mid (1-k)^2 + (2+k)^2 + (1-k)(2+k)\gt (2-k)^2 + (2+k)^2 + (2-k)(2+k) \} \\ &= \min \{ k \mid k^2 +k + 7 \gt k^2 + 12 \} \\ &= \min \{ k \mid k \gt 5 \} = 6.\end{align*} So we will find ourselves at $M = -4\zeta + 8\xi = (-6,2\sqrt{3}).$

Noting that the number of $-1$ steps was exactly twice the number of $\xi$ steps, we continue on we see that we take 12 $(-\zeta)$ steps followed by 24 $(-\xi)$ steps, then 48 $+1 = \zeta - \xi$ steps to arrive at $32\zeta - 64 \xi,$ ready to take new $\zeta$ steps. Eventually we will arrive at the positive $x$-axis, which is due east of the center of A, whenever we have some number of $n (\zeta - \xi) = (n,0).$ Since we are starting with $-64\xi,$ Frankie will arrive at the point $64\zeta - 64\xi = (64,0),$ which is 64 units from the center of A.

Monday, January 26, 2026

Baby Bingo

Consider a smaller version of the game with a 3-by-3 grid: a “Free” square surrounded by eight other squares with numbers. Suppose each of these eight squares is equally likely to be called, and without replacement (i.e., once a number is called, it doesn’t get called again).

On average, how many markers must you place until you get “bingo” in this 3-by-3 grid?

To do this, let's define some terms. Let's denote the squares, as follows: the top row moving left to right is $a, b, c$, then the left box on the middle row is $d$ and the right box on the middle row is $e$, and finally the bottom row from left to right is $f, g, h.$ Let $N$ be the random number of markers needed until getting bingo on this 3-by-3 grid. Since it is a random variable on the natural numbers, we can use the sum of tail probabilities to obtain the expected value, that is, $\mathbb{E}[N] = \sum_{n=0}^\infty \mathbb{P} \{ N \gt n \}.$

We see that since you need three in a row, the smallest number of markers you will need to get bingo with the help of the free center square is $2$. So we have $\mathbb{P} \{ N \gt 0 \} = \mathbb{P} \{ N \gt 1 \} = 1.$ Additionally, we see that there are only four configurations where $N=2,$ namely, $\{a,h\}$, $\{b,g\}$, $\{c,f\}$ and $\{d,e\}$. Since these can be selected in any order, we actually have $2! \cdot 4 = 8$ possible winning combinations out of a total possible of $8 \cdot 7 = 56$ combinations of $2$ squares, so $\mathbb{P} \{ N = 2 \} = \frac{8}{56} = \frac{1}{7},$ so therefore, $\mathbb{P} \{ N \gt 2 \} = \frac{6}{7}.$ Similarly, we see that there are 11 winning combinations with $N \leq 3,$ namely $\{a,b,c\},$ $\{a,b,g\},$ $\{a, b, h\}$, $\{a, c, f\},$ $\{a, c, h\}$, $\{a, d, e\},$ $\{a, d, f\},$ $\{a, d, h\}$, $\{a, e, h\},$ $\{a, f, h\},$ $\{a, g, h\},$ $\{b, c, f\},$ $\{b, c, g\},$ $\{b, d, e\},$ $\{b, d, g\},$ $\{b, e, g\},$ $\{b, f, g\},$ $\{b, g, h\},$ $\{c, d, e\},$ $\{c, d, f\},$ $\{c, e, f\},$ $\{c, e, h\},$ $\{c, f, g\},$ $\{c, f, h\},$ $\{d, e, f\},$ $\{d, e, g\},$ $\{d, e, h\},$ and $\{f, g, h\}.$ If we wanted to make sure that $N = 3,$ then we would need to make sure we know the right order to ensure that for instance we don't have $d$ then $e$ then $a$, which would win after $N=2.$ However, let's just focus on $N \leq 3$, where we don't care, so we have $3! \cdot 28 = 168$ possible winning combinations with $N \leq 3$ out of $8 \cdot 7 \cdot 6 = 336$ possible combinations of 3 squares. So we have $\mathbb{P} \{ N \leq 3 \} = \frac{168}{336} = \frac{1}{2},$ which leaves $\mathbb{P} \{ N \gt 3 \} = \frac{1}{2}.$

We are making good progress. One item to note is that we also have $\mathbb{P}\{ N \leq 5 \} = 1$ or conversely $\mathbb{P} \{ N \gt n \} = 0$ for all $n \geq 5.$ We can see this by appealing to a slightly modified pigeonhole principle. We see that there are 8 total sets of three, but since these sets contain overlapping squares, we will assume that whenever a square is selected a marker is added to each set that contains that square. From the pigeonhole principle, if we have 17 total markers, then at least one set must be complete. We start off with 4 markers from the free center square. We also note that the corner squares are each in three sets, while the middle squares are in two apiece. If we have 5 squares to play with and want to try not to have a set, then we could have at most one of the squares from the middle column and at most one of the squares from the middle row, which would mean that we have 3 corner squares (for a total of 9 markers) and 2 middle squares (for a total of 4 markers). Together with the free central square we see that 5 squares gives at least 9 + 4 + 4 = 17 markers, so we are guaranteed to have a full set with $N=5.$

So the only thing remaining is to determine $\mathbb{P} \{ N \gt 4 \}.$ We see that there are 8 configurations of four squares that do not yet win, namely $\{a, b, e, f\},$ $\{a, c, d, g\},$ $\{a, c, e, g \},$ $\{a, e, f, g \},$ $\{b, c, d, h \},$ $\{b, d, f, h\}$ $\{b, e, f, h\},$ and $\{c, d, g, h\}.$ Since the order of these non-winning configurations does not matter, we have a total of $4! \cdot 8 = 192$ not yet winning combinations out of a total of $8 \cdot 7 \cdot 6 \cdot 5 = 1680$ four square combinations, so we see that $\mathbb{P} \{ N \gt 4 \} = \frac{96}{1680} = \frac{4}{35}.$

Therefore putting everything together we get that the expected number of markers you must place until you get bingo on a 3-by-3 grid is $$\mathbb{E}[N] = \sum_{n=0}^\infty \mathbb{P} \{ N \gt n \} = 1 + 1 + \frac{6}{7} + \frac{1}{2} + \frac{4}{35} = \frac{243}{70} = 3.4\overline{714285}.$$

Sunday, January 18, 2026

Who listens to their architect anyway?

Now suppose the lamp has a radius $r$ and is suspended a height $h$ off the ground in a room with height $2h$. Again, the radius of the shadow on the ceiling is $R.$

For whatever reason, the restaurant’s architect insists that she wants $r$, $h$, and $R$, as measured in feet, to all be whole numbers. What is the smallest value of $R$ for which this is possible?

Let's imagine that this restaurant is named, say Cafe Pythagoras. Abstracting the Classic problem's solution by having a circle of radius $r$ centered at $(0,h),$ then we have the minimal distance from the lamp to the reflected path of the light from the ground to the ceiling as $d^* = 2h \sin \theta.$ Therefore, we see that $$R = \min \{ 3h \tan \theta \mid 2h \sin \theta \geq r \} = 3h \tan \left( \sin^{-1} \left(\frac{r}{2h} \right) \right) = \frac{3hr}{\sqrt{4h^2 - r^2}}.$$

Since the architect at Cafe Pythagoras wants to make sure that $r$, $h$ and $R$ are all integers, we should start searching through Pythagorean triples for possible solutions, since if the denominator $\sqrt{4h^2 -r^2}$ is not an integer, then there is no way for $R$ to be an integer. In particular we need $2h$ to be the hypotenuse of a Pythagorean triple and either $r=2a$ or $r=2b$. Naturally, let's start with the triple $(3,4,5)$. So we set $h=5$ and try $r=6,$ which yields the undesirable $R = \frac{45}{4} \not\in \mathbb{N}.$ If instead, $h=5$ and $r=8$, then we get $R = 20,$ so at least we know that this your architect is not asking for the impossible. By taking scaled multiples, say $h=5k$, $r=8k$ and $R=20k,$ for any $k \in \mathbb{N},$ we see that in fact the architect can have infinitely many solutions, with the smallest one generated by the (3,4,5) primitive Pythagorean triple having a shadow radius of $R=20$.

Let's assume that we have some integers $a, b, c \in \mathbb{N}$ with $a^2 + b^2 = c^2,$ $\gcd (a,b,c) = 1,$ and $c \gt 5$ and see if we can come up with any other solutions for our Pythagorean architect. Without loss of generality, let's see what would happen if we set $h = c$ and $r = 2b.$ In this case we get $$R = \frac{6bc}{\sqrt{4h^2 - (2b)^2}} = \frac{6bc}{2a} = \frac{3bc}{a}.$$ Since $\gcd(a,b,c) = 1,$ if $a \ne 3,$ then $R \not\in \mathbb{N}.$ Since the only primitive Pythagorean theorem that contains $3$ is $(3,4,5),$ we see that if $(a,b,c) \ne (3,4,5),$ then $R \not\in\mathbb{N}.$

Therefore, we have confirmed two very important things: Firstly, that the smallest possible value of $R$ at Cafe Pythagoras is $R=20,$ when $h=5$ and $r=8.$ And, lastly, but perhaps equally important, I don't think that I'll be going to Cafe Pythagoras. With a sizeable 8' radius orb floating with its center only 5' off the ground, that means that the orb would be larger than the actual ceiling height???!!! The beam of light does escape the ginormous lamp and properly reflect off the floor and up to the ceiling after 20' as promised, but something seems off about the architectural demands. Perhaps I'm just too old to be the target audience for this restaurant. I hear the food is good though!

Shadows on the ceiling

While dining at a restaurant, I notice a lamp descending from the ceiling, as shown in the diagram below. The lamp consists of a point light source at the center of a spherical bulb with a radius of 1 foot. The top half of the sphere is opaque. The bottom half of the sphere is semi-transparent, allowing light out (and thus illuminating my table) but not back in. The light source itself is halfway up to the ceiling—5 feet off the ground and 5 feet from the ceiling. The ground reflects light.

Above the light, on the ceiling, I see a circular shadow. What is the radius $R$ of this shadow?

Let's assume that the lightbulb is at the point $(0,5)$ and let's track the path of a ray of light that is emitted making an of $\theta$ with the $y$-axis as shown in the figure below. We see that it will bounce of the reflective floor at the point $(5\tan \theta, 0)$ and then return towards the ceiling with an angle of reflection of $\theta$ to make contact with the ceiling at the point $(15 \tan \theta, 10).$ The line from the bulb to the floor is given by $y = \left(-\cot \theta\right) x + 5,$ whereas the reflected line from the floor to the ceiling is given by $y= \left(\cot \theta\right) x - 5.$

To find the point along the reflected path from the floor to the ceiling we can either solve the optimization problem $$d^* = \min \{ (5+10\lambda)^2 \tan^2 \theta + (10 \lambda - 5)^2 \mid 0 \leq \lambda \leq 1 \}$$ either by some raw calculus or we can use the Lagrange multiplier theory and the knowledge that the line from the lightbulb to the point that minimizes the distance from the lightbulb should be perpendicular to the path of the light and some geometry. Going the geometric path, we see that since the hypotenuse of the right triangle has length $5 \sec \theta$ and the opposite angle measures $2\theta,$ so we have a distance of $$d^* = 5 \sec \theta \sin 2\theta = 10 \sec \theta \sin \theta \cos \theta = 10 \sin \theta.$$

Since the entire lamp, whether the opaque top or the semi-transparent lower half, would prevent the light from reaching the ceiling, we need to make sure that this minimal distance is at least 1, that is whenever $10 \sin \theta \geq 1$ then the ceiling will be illuminated. Therefore, the radius of the circular shadow is $$R = \min \{ 15 \tan \theta \mid 10 \sin \theta \geq 1 \} = 15 \tan \left( \sin^{-1} \frac{1}{10} \right) = \frac{15}{\sqrt{99}} = \frac{5}{\sqrt{11}} \approx 1.50755672289\dots,$$ since $\tan \left(\sin^{-1} x\right) = \frac{x}{\sqrt{1-x^2}}.$

Monday, January 12, 2026

Doesn’t matter eventually it’s the same

I have two glasses that can hold a maximum volume of 24 fluid ounces. Initially, one glass contains precisely 12 fluid ounces of coffee, while the other contains precisely 12 fluid ounces of tea.

Your goal is to dilute the amount of coffee in the “coffee cup” by performing the following steps:

  • Pour some volume of tea into the coffee cup.
  • Thoroughly mix the contents.
  • Pour that same volume out of the coffee cup, so that precisely 12 fluid ounces of liquid remain.

After doing this as many times as you like, in the end, you will have 12 ounces of liquid in the coffee cup, some of which is coffee and some of which is tea. In fluid ounces, what is the least amount of coffee you can have in this cup?

Let $C_k(x)$ be the ounces of coffee in the coffee cup after $k$ successive iterations of moving $x$ ounces back and forth for some $x\in (0, 12],$ since there's literally no action when $x=0.$ Here we have $C_0(x)=12$ for any value if $x \in (0,12].$ Since after each iteration we have the total volume in the coffee cup as 12, and extrapolating from the worked in the Classic problem where $x=1$, we will always have that the amount of tea in the coffee cup is equal to the amount of coffee in the tea cup, so we see that the amount of coffee in the tea cup at the end of $k$ successive iterations is $12-C_k(x).$

When $x$ ounces is transferred from the coffee cup to the tea cup, a total of $x\frac{C_k(x)}{12}$ ounces of coffee is trabsferred to the tea cup. At this point there is a total of $12-C_k(x) + x\frac{C_k(x)}{12}$ ounces of coffee in the tea cup, out of a total of $12+x$ ounces of liquid. After mixing, when the $x$ ounces of liquid is transferred back to the coffee cup, a total of $x\frac{12-(1-x/12)C_k(x)}{12+x}$ ounces of coffee is transferred. Using this information, we can get the recursive formula $$C_{k+1} (x) = C_k(x) - \frac{x}{12}C_k(x) + \frac{x}{x+12} \left( 12 - \left(1-\frac{x}{12}\right) C_k(x) \right) = \frac{12-x}{12+x} C_k(x) + \frac{12x}{12+x}.$$

In general a linear sequence $a_{n+1}=ra_n+b$, for $n\in \mathbb{N},$ will converge to some number $a^*=\frac{b}{1-r}$, whenever $|r|\lt 1.$ Here we have r=r(x)=\frac{12-x}{12+x} \in [0,1) for x \in (0,12], so we should converge for any value of $x$ to $$C^*=C^*(x) = \frac{\frac{12x}{12+x}}{1-\frac{12-x}{12+x}} = \frac{\frac{12x}{12+x}}{\frac{2x}{12+x}}=6.$$

In addition, we can rearrange the recursive formula to show that $C_{k+1}(x)$ is always a convex combination of $C_k(x)$ and $6,$ so in particular we see that $C_k(x)$ is a nonincreasing sequence for each $x \in (0,12].$ So we must have that the minimal amount of coffee in the coffee cup after many, many iterations is $\inf_k C_k(x) = C^* = 6$ ounces. Now for the strict constructivists amongst you, we need not appeal to countably infinitely many mixings or ignore infinitissimal quantities obtain optimality. Instead, if we chose $x=12$ ounces, then after a single iteration, voila, we have the perfect 6 oz coffee / 6 oz tea concoction.

Is it coftea? Teafee?

I have two glasses, one containing precisely 12 fluid ounces of coffee, the other containing precisely 12 fluid ounces of tea.

I pour one fluid ounce from the coffee cup into the tea cup, and then thoroughly mix the contents. I then pour one fluid ounce from the (mostly) tea cup back into the coffee cup, and then thoroughly mix the contents. Is there more coffee in the tea cup, or more tea in the coffee cup?

In this Classic case, after transferring 1 ounce of coffee to the tea cup, it would have 1 ounce of coffee and 12 ounces of tea. Once thoroughly mixed, each ounce of the liquid would have $1/13$ ounce of coffee and $12/13$ ounce of tea in it. So after moving one ounce back to the coffe cup, the coffee cup would have $11+1/13=144/13$ ounces of coffee and $12/13$ ounces of tea. Conversely, the tea cup would have $1-1/13=12/13$ ounces of coffee and $12-12/13=144/13$ ounces of tea. So after one mixing back and forth the volume of tea in the coffee cup is equal to the volume of coffee in the tea cup.