Monday, November 4, 2024

Is that what squaring the circle means?

A pseudo-square has the following properties:

  1. It is a simple, closed curve.
  2. It has four sides, all the same length.
  3. Each side is either a straight line segment or the arc of a circle.
  4. The four sides are joined at four corners, with each corner having an internal angle of 90 degrees or 270 degrees.

The pseudo-square pictured above has two straight sides, which run radially between arcs of two concentric circles. Assuming this is a unit pseudo-square (i.e., each side has length 1), what is its area?

As you can see, I've pre-doctored the image from the prompt with some parameters. Let $r$ be the radius of the smaller circle and let $\theta$ be the angle inscribed between the two straight line edges. From here, if the shape is a unit pseudo-square then the larger radius is $1+r,$ so we can find the formula for the area of the shape in terms of $r$ and $\theta,$ as $$A(r,\theta) = \pi r^2 + \frac{1}{2} \theta \left((1+r)^2 - r^2\right) = \pi r^2 + \frac{1}{2} \theta (1 + 2r).$$ That is all well and good, but we now have to find the particular value of $r$ and theta that allow for this shape to be unit pseudo-square. In particular, the length of the arc on the larger of the two concentric circles is $$\ell = \theta (1 + r).$$ The length of the other arc is $$\tilde{\ell} = (2\pi - \theta) r.$$ Since the shape is a unit pseudo-square we have the nonlinear system of equations \begin{align*} \theta ( 1 + r) &= 1 \\ (2\pi - \theta) r &= 1.\end{align*} By setting $\theta = (1 + r)^{-1}$ and plugging into the second equation we get $$\left(2\pi - \frac{1}{1+r}\right) r = 1,$$ which is equivalent to the quadratic equation $$2\pi r^2 + 2(\pi - 1) r - 1 = 0.$$ Thus, if the shape is a unit pseudo-square then the smaller radius $r$ is equal to $$r^* = \frac{1-\pi + \sqrt{1+\pi^2}}{2\pi}.$$

By plugging $\theta = (1+r)^{-1}$ into the area formula we get $A(r) = \pi r^2 + \frac{1+2r}{2(1+r)},$ so plugging in $r^*$ from above we get the area of the unit psuedo-square with two straight lines is \begin{align*}A^* = A(r^*) &= \pi \left( \frac{1-\pi + \sqrt{1+\pi^2}}{2\pi} \right)^2 + \frac{ 1 + 2 \frac{1-\pi + \sqrt{1+\pi^2}}{2\pi} }{2 \left( 1 + \frac{1-\pi + \sqrt{1+\pi^2}}{2\pi} \right)}\\ &= \frac{1+\sqrt{1+\pi^2}}{2\pi} \approx 0.683874197466......\end{align*}

Can you find a unit pseudo-square that has three curved sides and just one straight side? What is the area of your new unit pseudo-square?

Without loss of generality, we can assume that the one flat side is positioned along the bottom. We would need to have two curved sides connected to this flat bottom that curve towards each other, with there being a third circle that is tangent to the circular arcs. The resulting shape is sort of like the shape of some pawns in chess. See the figure below. We again insert some parameters. Let the flat side be the line segment from $(-\frac{1}{2},0)$ to $(\frac{1}{2},0).$ Let the two symmetric sides attached to flat bottom be arcs of the circles centered at $(-a,0)$ and $(a,0),$ respectively, each with radius $a+\frac{1}{2},$ with subtended angle $\theta$. Let the final arc be from the circle centered $(0,b)$ with radius $r$ and subtended angle $2(\pi - \theta).$

Let's first try to figure out how to quantify the area of the pseudo-square with three curved sides. The region denoted by $B$ has area given by $$A_B = \frac{1}{2} (\pi - \theta) r^2.$$ The region denoted by $C$ has area given by $$A_C = \frac{1}{2} r^2 \tan \theta.$$ Finally, the region denoted by $D$ has aread given by $$A_D = \frac{1}{2} \theta \left(a + \frac{1}{2}\right)^2 - \frac{1}{2} a^2 \tan \theta.$$ The area of the entire pseudo-square with three curved sides is thus \begin{align*}A = A(a,r,\theta) &= 2 \left(A_B + A_C + A_D\right) \\ &= (\pi - \theta + \tan \theta) r^2 + \theta \left(a + \frac{1}{2}\right)^2 - a^2 \tan \theta.\end{align*}

With some creative trigonometry we can obtain $r = r(a,\theta),$ thus reducing the dimensions of the problem a smidge. The region denoted by $C$ is a triangle whose height is $r$ and base $\beta,$ which is some portion of line segment of total length $a + \frac{1}{2},$ since that line segment is a radius of the circle centered at $(-a,0)$ of radius $a+\frac{1}{2}.$ Since the line segment, negative $x$-axis and positive $y$-axis form a triangle, we can compute $\beta$ as $$\beta = a + \frac{1}{2} - a\sec \theta.$$ Since $r = \beta \cot \theta,$ we have $$r = r(a,\theta) = \left( \left(a+\frac{1}{2}\right) - a \sec \theta \right) \cot \theta = \frac{ (a + \frac{1}{2}) \cos \theta - a }{ \sin \theta }.$$ Therefore, we have $$A = A(a,\theta) = (\pi - \theta + \tan \theta) \left( \frac{ \left(a + \frac{1}{2}\right) \cos \theta - a }{\sin \theta} \right)^2 + \theta \left(a + \frac{1}{2} \right)^2 - a^2 \tan \theta.$$

OK, now that that significantly more intricate foundational work is out of the way, we need to ensure that each of these curves sides is unit length. Since the more vertical arcs are symmetric, we only need to quantify $\ell=(a+\frac{1}{2}) \theta$ and $\tilde{\ell} = 2(\pi - \theta) r,$ and set them both equal to $1$ to obtain the nonlinear system of equations \begin{align*} (a + \frac{1}{2}) \theta &= 1 \\ 2(\pi - \theta) r = (\pi - \theta) \frac{(a+1/2)\cos \theta - a}{\sin \theta} &= 1\end{align*} Solving for $a$ in the second equation and then plugging back into the first we get $$\frac{ \sin \theta - \pi + \theta }{ 2(\pi - \theta) ( \cos \theta - 1) } \theta = 1.$$ This non-linear equation is solved with $$\theta^* \approx 0.74960359...$$ which leads to $$a^* = \frac{2-\theta^*}{2\theta^*} \approx 0.8340377...$$ which ultimately leads to the area of a unit pseudo-square with three curved sides of $$A^* = A(a^*, \theta^*) \approx 0.8317044...$$

Monday, October 28, 2024

Conditional candy

It’s Halloween time! While trick-or-treating, you encounter a mysterious house in your neighborhood.

You ring the doorbell, and someone dressed as a mathematician answers. (What does a “mathematician” costume look like? Look in the mirror!) They present you with a giant bag from which to pick candy, and inform you that the bag contains exactly three peanut butter cups (your favorite!), while the rest are individual kernels of candy corn (not your favorite!).

You have absolutely no idea how much candy corn is in the bag—any whole number of kernels (including zero) seems equally possible in this monstrous bag.

You reach in and pull out a candy at random (that is, each piece of candy is equally likely to be picked, whether it’s a peanut butter cup or a kernel of candy corn). You remove your hand from the bag to find that you’ve picked a peanut butter cup. Huzzah!

You reach in again and pull a second candy at random. It’s another peanut butter cup! You reach in one last time and pull a third candy at random. It’s the third peanut butter cup!

At this point, whatever is left in the bag is just candy corn. How many candy corn kernels do you expect to be in the bag?

The probability of drawing three peanut butter cups in a row, conditional on there being $k$ candy corn kernels, is $$\mathbb{P} \{ c = 3 \mid k \} = \frac{ 3 }{k + 3 } \frac{ 2}{k + 2} \frac{1}{k+1} = \frac{6}{(k+3) (k+2) (k+1) }.$$ Using Bayes' theorem, we can retrieve the conditional distribution of the number of candy corn kernels conditional on pulling three peanut butter cups in a row, namely, \begin{align*}\mathbb{P} \{ k \mid c = 3 \} &= \frac{ \mathbb{P} \{ c = 3 \mid k \} \mathbb{P} \{ k \} }{ \mathbb{P} \{ c = 3 \} } \\ &= \frac{ \mathbb{P} \{ c = 3 \mid k \} }{ \sum_{\ell = 0}^\infty \mathbb{P} \{ c = 3 \mid \ell \} } \\ &= \frac{ \frac{6}{(k+1)(k+2)(k+3)} }{ \sum_{\ell=0}^\infty \frac{6}{(\ell+1)(\ell+2)(\ell+3)} }\\ &= \frac{1}{M (k+1)(k+2)(k+3)},\end{align*} where $$M = \sum_{\ell=0}^\infty \frac{1}{(\ell +1)(\ell+2)(\ell+3)}.$$

We can calculate the convergent series $M$ by method of partial fractions. Let \begin{align*} \frac{1}{(\ell + 1)(\ell + 2)(\ell + 3)} &= \frac{A}{\ell+1} + \frac{B}{\ell+2} + \frac{C}{\ell+3} \\ &= \frac{ A (\ell + 2) (\ell + 3) + B(\ell + 1)(\ell + 3) + C(\ell + 1)(\ell + 2)}{ (\ell + 1) (\ell+2) (\ell+3) } \\ &= \frac{ (A + B + C) \ell^2 + (5A + 4B + 3C) \ell + (6A + 3B + 2C)}{(\ell+1)(\ell+2)(\ell+3)}.\end{align*} So we have the resulting system of linear equations \begin{align*} A + B + C &= 0 \\ 5A + 4B + 3C &= 0 \\ 6A + 3B + 2C & = 1 \end{align*}, which has solution $A = C = \frac{1}{2}$ and $B = -1.$ Therefore, $$\frac{1}{(\ell + 1) (\ell + 2)(\ell + 3)} = \frac{1}{2} \frac{1}{\ell+1} - \frac{1}{\ell+2} + \frac{1}{2} \frac{1}{\ell+3},$$ so we have \begin{align*} M &= \sum_{\ell = 0}^\infty \frac{1}{(\ell+1)(\ell+2)(\ell+3)} = \lim_{L\to \infty} \sum_{\ell=0}^L \frac{1}{(\ell+1)(\ell+2)(\ell+3)} \\ &= \lim_{L \to \infty} \sum_{ell=0}^L \left( \frac{1}{2} \frac{1}{\ell+1} - \frac{1}{\ell+2} + \frac{1}{2} \frac{1}{\ell+3} \right) \\ &= \lim_{L \to \infty} \frac{1}{2} \left( 1 + \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{L+1} \right) - \left( \frac{1}{2} + \frac{1}{3} + \cdots + \frac{1}{L+1} + \frac{1}{L+2} \right) + \frac{1}{2} \left( \frac{1}{3} + \cdots + \frac{1}{L+1} + \frac{1}{L+2} + \frac{1}{L+3} \right) \\ &= \lim_{L\to \infty} 1 \cdot \frac{1}{2} + \frac{1}{2} \cdot \left( \frac{1}{2} - 1 \right) + \left( \frac{1}{2} - 1 + \frac{1}{2} \right) \cdot \left( \frac{1}{3} + \cdots + \frac{1}{L+1} \right) + \frac{1}{L+2} \cdot \left(-1 + \frac{1}{2} \right) + \frac{1}{L+3} \cdot \frac{1}{2} \\ &= \lim_{L \to \infty} \frac{1}{2} - \frac{1}{4} + O(L^{-2}) = \frac{1}{4}.\end{align*}

Therefore, we have $$\mathbb{P} \{ k \mid c = 3 \} = \frac{4}{(k+1)(k+2)(k+3)},$$ for $k = 0, 1, \dots,$ so we can calculated the conditional expectation as $$\mathbb{E} \left[ K \mid c = 3 \right] = \sum_{k=0}^\infty k \mathbb{P} \{ k \mid c = 3 \} = 4 \sum_{k=0}^\infty \frac{k}{(k+1)(k+2)(k+3)}.$$ As before, we can solve this series by the method of partial fractions. Here instead of the earlier system of equations, we now want to solve \begin{align*} A + B + C &= 0 \\ 5A + 4B + 3C &= 1 \\ 6A + 3B + 2C &= 0 \end{align*} which has solution $A = -\frac{1}{2},$ $B = 2,$ $C = - \frac{3}{2}.$ Thus the conditional expected number of candy corn kernels given that I drew the three peanut butter cups is \begin{align*}\mathbb{E} \left[ K \mid c = 3 \right] &= 4 \sum_{k=0}^\infty \frac{k}{(k+1)(k+2)(k+3)}\\ &= \lim_{L \to \infty} 4 \left(-\frac{1}{2} + \left( -\frac{1}{2} + 2 \right) \cdot \frac{1}{2} + O(L^{-2}) \right) = 4 \cdot \frac{1}{4} = 1.\end{align*}

Sunday, October 20, 2024

How boring can you get?

I have a large, hemispherical piece of bread with a radius of $1$ foot. I make a bread bowl by boring out a cylindrical hole with radius $r,$ centered at the top of the hemisphere and extending all the way to the flat bottom crust.

What should the radius of my borehole be to maximize the volume of soup my bread bowl can hold?

N.B. I originally conceived of this week's Fiddler problem in my mind's eye with the hemispherical bread having a flat upper crust, which led to initially thinking that it was a very weird setup where you keep cutting your cylindrical hole downward until you ever so slightly bump up against the curved bottom crust at which point you stop since obviously otherwise your bread bowl would have a hole in it and your soup would leak out. This is essentially the inverted logic of the handwavy no-surface-tension argument I make below, so in the end I think the math ends up being roughly the same ....

So anyway, freely choosing the coordinate system that best suits me, assume that your bread fills the space $B = \{ (x,y,z) \mid x^2 + y^2 + z^2 \leq 1, z \geq 0 \}.$ Assume that a cylindrical borehole takes would remove the portion of the $B$ that satisfyies $x^2 + y^2 \leq r^2,$ for some radius $r \gt 0.$ Ultimately, since we cannot rely on molecular properties of the varying soups that might fill the bread bowl to postulate any additional volume of soup due to surface tension, let's assume that the bread bowl can only be filled up to its upper rim, that is, the cylindrical cavity is given by $C(r) = \{ (x,y,z) \mid x^2 + y^2 \leq r^2, 0 \lt z \leq \sqrt{1-r^2}\}.$ The volume of $C(r)$ is given by $V(r) = \pi r^2 \sqrt{1-r^2}.$

Differentiating $V(r)$ gives $$V^\prime(r) = 2\pi r \sqrt{1-r^2} + \pi r^2 \left( \frac{-r}{\sqrt{1-r^2}} \right) = \frac{\pi r \left( 2(1-r^2) -r^2 \right)}{\sqrt{1-r^2}} = \frac{\pi r (2-3r^2)}{\sqrt{1-r^2}}.$$ Thus $V$ has critical points as $r_1 = 0$, $r_2 = \sqrt{\frac{2}{3}} = \frac{\sqrt{6}}{3},$ and $r_3 = 1.$ Since $V(0)=V(1)=0,$ the maximum possible volume of soup contained in this bread bowl is $$V^* = \frac{2\pi\sqrt{3}}{9} \approx 1.20919957616\dots$$ cubic feet, which occurs when choosing a radius of $$r^* = \frac{\sqrt{6}}{3} \approx 0.816496580928\dots$$ feet.

Instead of a hemisphere, now suppose my bread is a sphere with a radius of $1$ foot. Again, I make a bowl by boring out a cylindrical shape with radius $r,$ extending all the way to (but not through) the curved bottom crust of the bread. The central axis of the hole must pass through the center of the sphere.

What should the radius of my borehole be to maximize the volume of soup my bread bowl can hold?

Again hearkening back to my earlier spatial reasoning struggles, I could not for the life of me understand why this extra credit problem was in any way different from just having double the volume since you would then stop cutting as soon as you hit the curved bottom crust. Since I take Axiom of the Benevolent Fiddlermeister as a given, I have to assume that the extra credit problem is somehow different from the regular problem, so we will assume that I have a precision instrument that can bore a perfectly cylindrical hole in the spherical bread until I ever so slightly approach the curved lower crust and then somehow liquefy and extract the remaining bready portions all the way down to curved lower crust. So in this case the bowl takes the shape $\tilde{C}(r) = \{ (x,y,z) \mid x^2 + y^2 \leq r^2, -\sqrt{1-x^2-y^2} \lt z \leq \sqrt{1-r^2} \}.$ In this case, the volume is \begin{align*}\tilde{V}(r) &= \int_{ x^2 + y^2 \leq r^2 } \int_{-\sqrt{1-x^2-y^2}}^{\sqrt{1-r^2}} \, dz \,dy \,dx\\ &= \int_{x^2 + y^2 \leq r^2} \left( \sqrt{1-r^2} + \sqrt{1-x^2 -y^2}\right) \,dy \,dx \\ &= \int_0^{2\pi} \int_0^r \left( \sqrt{1-r^2} + \sqrt{1 - \rho^2} \right) \rho \,d\rho \, d\theta \\ &= \pi r^2 \sqrt{1-r^2} + 2\pi \int_0^r \rho \sqrt{1-\rho^2} \,d\rho \\ &= \pi r^2 \sqrt{1-r^2} + \frac{2\pi}{3} \left( 1 - (1-r^2)^{3/2} \right).\end{align*} We can write $(1-r^2)^{3/2} = (1-r^2) \sqrt{1-r^2}$ to then factor even further and see that $$\tilde{V}(r) = \pi r^2 \sqrt{1-r^2} + \frac{2\pi}{3} \left( 1 - (1-r^2) \sqrt{1-r^2} \right) = \frac{2\pi}{3} + \frac{\pi \sqrt{1-r^2}}{3} (5r^2 - 2).$$

Differentiating we get \begin{align*}\tilde{V}^\prime (r) &= \frac{10\pi r}{3} \sqrt{1-r^2} + \frac{\pi}{3} (5r^2 - 2) \left( \frac{-r}{\sqrt{1-r^2}} \right)\\ &= \frac{\pi r}{3\sqrt{1-r^2}} \left( 10 (1-r^2) - (5r^2 - 2) \right)\\ &= \frac{\pi r (4-5r^2)}{\sqrt{1-r^2}}.\end{align*} Thus $\tilde{V}$ has critical points at $r_1 = 0,$ $r_2 = \sqrt{\frac{4}{5}} = \frac{2\sqrt{5}}{5},$ and $r_3 = 1.$ Here since we have $\tilde{V}^\prime \gt 0$ when $r \lt \frac{2\sqrt{5}}{5}$ and $\tilde{V}^\prime \lt 0$ when $r \gt \frac{2\sqrt{5}}{5},$ we see that the maximum possible volume of our miraculously scooped out bread bowls with curved lower crusts is $$\tilde{V}^* = \frac{2\pi(5+\sqrt{5})}{15} \approx 3.03103706653\dots$$ cubic feet, which occurs when choosing a radius of $$\tilde{r}^* = \frac{2\sqrt{5}}{5} \approx 0.894427191\dots$$ feet.

Monday, October 14, 2024

Leading the logarithmic pack

You’re doing a $30$-minute workout on your stationary bike. There’s a live leaderboard that tracks your progress, along with the progress of everyone else who is currently riding, measured in units of energy called kilojoules. Once someone completes their ride, they are removed from the leaderboard.

Suppose many riders are doing the $30$-minute workout right now, and that they all begin at random times. Further suppose that they are burning kilojoules at different constant rates (i.e., everyone is riding at constant power) that are uniformly distributed between $0$ and $200$ Watts.

Halfway through (i.e., $15$ minutes into) your workout, you notice that you’re exactly halfway up the leaderboard. How far up the leaderboard can you expect to be as you’re finishing your workout?

Let's start by determining the distribution of the random other riders' outputs at any one time. At any particular time, say $\tau$, the only riders still on the leaderboard would have started at times $t \in (\tau - 1800, \tau).$ Let's assume that riders join the $30$ minute class uniformly randomly such that the probability that any join between the time $t$ and $t+dt$ is proportional to $dt,$ that is, at time \tau, the riders would have already completed $T \sim U(0,1800)$ seconds of the rider. These riders would also have uniformly distribution constant powers, $P \sim U(0,200).$ The total output is $O = P \cdot T,$ which we can get the distribution of by directly computing the \begin{align*}\mathbb{P} \{ O \leq \theta \} &= \frac{1}{360000}\int_0^{200} \int_0^{1800} \chi \{ p t \leq \theta \} \,dt \,dp \\ &= \frac{1}{360000} \int_0^{200} \int_0^{\min \{ 1800, \theta / p \}} \,dt \,dp \\ &= \frac{1}{360000} \int_0^{200} \min \left\{1800, \frac{\theta}{p} \right\} \,dp \\ &= \frac{1}{360000} \left( \int_0^{\theta/1800} 1800 \,dp + \int_{\theta / 1800}^200 \frac{\theta}{p} \,dp \right) \\ &= \frac{1}{360000} \left( \theta + \theta \left( \ln 200 - \ln (\theta / 1800) \right) \right) \\ &= \frac{\theta}{360000} \left( 1- \ln \left( \frac{\theta}{360000} \right) \right).\end{align*}

So let's simplify slightly and focus on the function $\Phi(t) = t ( 1 - \ln t ).$ So in particular, if at some point I find myself half way up the leaderboard, then that would mean that my output $\tilde{O} = 360000 \tilde{\theta}$ where $\Phi(\tilde{\theta}) = \frac{1}{2}.$ Of course, $\Phi$ does not have a neat and tidy inverse function, so we would have to implicitly solve for $\tilde{\theta} = \Phi^{-1}(0.5),$ but more on this later.

So since the distribution of random riders is time invariant, if halfway through my ride I have output $\tilde{O} = 360000 \Phi^{-1}(0.5),$ then I can expect my output at end of my ride I have output $2\tilde{O}.$ In this case, the proportion of riders that I will be ahead of the leaderboard is \begin{align*}\Phi(2 \Phi^{-1}(0.5)) &= 2\Phi^{-1}(0.5) \left( 1- \ln (2\Phi^{-1}(0.5))\right) \\ &= 2 \Phi^{-1}(0.5) \left( 1- \ln 2 - \ln \Phi^{-1}(0.5) \right) \\ &= -2 \Phi^{-1}(0.5) \ln 2 + 2 \Phi^{-1} (0.5) \left( 1 - \ln \Phi^{-1}(0.5) \right) \\ &= -2 \Phi^{-1}(0.5) \ln 2 + 2 \Phi \left( \Phi^{-1}(0.5) \right) \\ &= 1 - 2 \Phi^{-1}(0.5) \ln 2 = 1 - 2 \tilde{\theta} \ln 2 .\end{align*} So, since we can analytically solve the inverse function to find that $\tilde{\theta} = \Phi^{-1}(0.5) = 0.1866823,$ I can expect to be ahead of about $$1-2 \tilde{\theta} \ln 2 \approx 74.1203380189...\%$$ of the riders at the end of my ride.

As an added bonus problem (though not quite Extra Credit), what’s the highest up the leaderboard you could expect to be $15$ minutes into your workout?

If I am killing it at 200 Watts for the first 15 minutes, then I would have an output of $\hat{O} = 200 \cdot 900 = 180000$ kJ, which would put me ahead of about $$\Phi\left(\frac{\hat{O}}{360000}\right) = \Phi(0.5) = 0.5 (1 + \ln 2) \approx 84.657359028...\%$$ of the riders after $15$ minutes.

Sunday, August 18, 2024

The arc of high jumping bends towards ... 2?

In the high jump, an athlete’s entire body must clear the bar. However, not every part of their body has to clear the bar at the same time. As a result, athletes arc their bodies over the bar, so that only a fraction of their mass is above the bar at any given time. In fact, athletes can theoretically clear the bar despite their center of mass remaining below the bar throughout the jump.

Let’s model the athlete’s jump as an arc of angle $2\phi$ that is centered over the bar, as shown below. For simplicity, assume that their mass is uniformly distributed across the length of their body. The dot in the diagram represents the athlete’s center of mass. Let $a$ represent the vertical distance between the athlete’s center of mass and their lowest points (presumably their outstretched fingers and toes), and let $b$ represent the vertical distance between the athlete’s center of mass and their highest point (presumably their waist).

If $\phi = \frac{\pi}{2}$ then the arc would be a complete semicircle. In that case, what is the ratio $a/b$?

As the angle $\phi$ gets very, very small (i.e., in the limit as $\phi$ goes to zero), what value does the ratio $a/b$ approach?

Let's solve the generic case for $\phi$ so that we can then do the two cases, both when $\phi = \frac{\pi}{2}$ and when $\phi \downarrow 0.$ Since we'll be taking ratios of everything anyway, let's just go ahead and assume that the circle on which the high jumper's arc is lying in the figure has radius $1$ and is centered at the origin. Then, with some trigonometric know-how, we see that the lowest point of the arc will be sitting at a height of $\cos \phi.$ So we must have $a + b = 1 - \cos \phi.$ Additionally we see that the jumper's body has a length of $2\phi,$ the length of this arc. So to find $a,$ we need only take the average of the jumper's height along this arc by taking the integral $$a + \cos \phi = \frac{1}{2\phi} \int_{\frac{\pi}{2} - \phi}^{\frac{\pi}{2} + \phi} \sin t \,dt = \frac{1}{2\phi} \left( -\cos (\frac{\pi}{2} + \phi) + \cos (\frac{\pi}{2} - \phi) \right) = \frac{\cos (\frac{\pi}{2} - \phi) }{\phi} = \frac{\sin \phi}{\phi}.$$ That is, $$a = \frac{\sin \phi}{\phi} - \cos \phi$$ and $$b = 1 - \cos \phi - a = 1 - \frac{\sin \phi}{\phi}.$$ Therefore for any value of \phi, the ratio of $a / b$ is $$r(\phi) = \frac{\frac{\sin \phi}{\phi} - \cos \phi}{1 - \frac{\sin \phi}{\phi}} = \frac{ \sin \phi - \phi \cos \phi }{\phi - \sin \phi}.$$

So in particular, if $\phi = \frac{\pi}{2}$ and the jumper's body makes a complete semicircle then the ratio $a/b$ is $$r(\frac{\pi}{2}) = \frac{\sin \frac{\pi}{2} - \frac{\pi}{2} \cos \frac{\pi}{2} }{\frac{\pi}{2} - \sin \frac{\pi}{2}} = \frac{1}{\frac{\pi}{2} - 1} = \frac{2}{\pi - 2} \approx 1.75193839388....$$

On the other hand, if we use some rough Taylor approximations around $\phi \approx 0$ we see that we have $$r(\phi) = \frac{\left(\phi - \frac{\phi^3}{6} + O(\phi^5)\right) - \phi \left( 1 - \frac{\phi^2}{2} + O(\phi^4)\right)}{\phi - \left(\phi - \frac{\phi^3}{6} + O(\phi^5)\right)} = \frac{ \frac{\phi^3}{3} + O(\phi^5) }{\frac{\phi^3}{6} + O(\phi^2)} = 2 \frac{1 + O(\phi^2)}{1 + O(\phi^2)}.$$ So, as $\phi \downarrow 0,$ we have $r(\phi) \to 2.$

Sunday, July 21, 2024

Tour de Fiddler fun

This time around, a lone rider in the Tour de Fiddler is being pursued by a group of four riders. The four riders have an advantage—they take equal turns being in the lead position, while the other three riders draft behind. At any given speed, being in the lead position (as well as riding solo) requires twice as much power as drafting.

Assume that every rider must maintain the exact same average power over time, whether they are the lone rider or in the pack of four. To be clear, their power can change over time, but the time-averaged value must be the same for every rider. Also, when leading a pursuing group or riding solo, one’s speed is directly proportional to one’s power. When drafting, one's speed matches that of the leader (again, at half the power output).

The pursuers just passed under a banner indicating there are 10 kilometers left in the stage. How far back of the lone rider can they afford to be, such that they still catch them at the finish line?

Let's first start with some preliminaries. Assume that all riders have average power output $\bar{P}$, such that, since speed is directly proportional to ones power, then the average speed of a single rider who has no one to draft off of is $v_1 = C\bar{P},$ for some constant of proportionality $C \gt 0.$

Let's now analyze what would happen if $k$ riders work together, taking equal turns being in the lead position. Since the average power must be $\bar{P},$ but any of the riders in this group spends only $\frac{1}{k}$ amount of time leading and the rest drafting at half-power, the amount of power spent while leading a pack of $k$ riders, say $P_k$, can be found in the equation $$\bar{P} = \frac{1}{k} P_k + \frac{k-1}{k} \frac{1}{2} P_k = \frac{k+1}{2k} P_k,$$ that is, $$P_k = \frac{2k}{k+1} \bar{P}.$$ So that means that the average velocity of a group of $k$ riders working together must be $$v_k = C P_k = C \frac{2k}{k+1} \hat{P} = \frac{2k}{k+1} v_1.$$

Ok, so with that in mind, the pursuers will finish in $T_4 = \frac{10}{v_4} = \frac{25}{4v_1},$ while if the leader has a lead of $x$ kilometers, then he will finish in $T_1 = \frac{10-x}{v_1}.$ Since we want $$T_4 = \frac{25}{4v_1} \leq \frac{10-x}{v_1} = T_1$$ in order for the pursuers to catch the leader, then the leader can be no more than $x \leq \frac{15}{4} = 3.75$ kilometers ahead of the pursuers if they want to catch him.

In today’s stage of the Tour de Fiddler, there are 176 total riders. Some riders are grouped together in a single breakaway, while the remainder are grouped together in the peloton. The breakaway group is 10 kilometers from the finish, while the peloton is one kilometer behind (i.e., 11 kilometers from the finish). What is the smallest number of riders that the breakaway needs to reach the finish line before the pursuing peloton?

Let's say there are $B$ riders in the breakaway group and $P$ riders in the peleton, where here $B+P = 176.$ The average speed of the peleton will be $$v_P = C\frac{2P}{P+1} v_1,$$ while the average speed of the breakaway is $$v_B = C\frac{2B}{B+1} v_1,$$ so the finishing times are $$T_P = \frac{11}{v_P} = \frac{11(P+1)}{2Pv_1}$$ and $$T_B = \frac{10}{v_B} = \frac{10(B+1)}{2Bv_1},$$ respectively. Since we want the breakaway group to win the stage, we must have $T_B \leq T_P,$ or equivalently $$\frac{10B+10}{B} \leq \frac{11P+11}{P},$$ which is again equivalent to $$BP+11B-10P \geq 0.$$ Since we have restriction that $B + P = 176,$ we are now looking for the minimum integer $B$ such that $$B(176-B) + 11B -10(176-B) = -B^2 + 197B - 1760 \geq 0.$$ Since the quadratic inequality holds for all (real) values of $$ B \in \left[ \frac{197 -\sqrt{31769}}{2} , \frac{197 + \sqrt{31769}}{2} \right],$$ we see that the breakaway must have at least $$B_\min = \left\lceil \frac{197 - \sqrt{31769}}{2} \right\rceil = \lceil 9.3806979381.... \rceil = 10$$ riders in order to beat the peleton.

Sunday, June 2, 2024

If this is what the job entails, then I'm not sure I want it ....

Starting with a line segment of length $1$, randomly split it somewhere along its length into two parts. Compute the product of these two lengths. Then take each of the two resulting segments and repeat the process. That is, for each one, randomly split it somewhere along its length into two parts and compute the product. Then do this for all four resulting segments, then the eight after that, and the $16$ after that, and so on.

After doing this (forever), you add up all the products you computed throughout. On average, what value would you expect this sum to approach?

There is nothing magical about the initial value of the line segment, that is, $1$, so let's instead generalize and say that the function $f : \mathbb{R}_+ \to \mathbb{R}_+$ gives the expected value of the sum of the products of randomly splitting a line segment of initial length $\ell \in \mathbb{R}_+$ into two parts, then breaking each of those segments into two parts, etc. Then to restate the question, we want the value of $f(1).$

We can approximate $f$ by not allowing for infinite recursion, but instead just a finite number of breaking into smaller pieces. If we just have one splitting then we get the expected value of the product is $$f_1(\ell) = \int_0^\ell x (\ell-x) \, dx = \left[ \ell \frac{x^2}{2} - \frac{x^3}{3} \right]^\ell_0 = \frac{\ell^3}{6}.$$ Going one step further, we then see that after two splits, we add in the expected product of two uniformly random numbers that add up to $x$ and the expected product of two uniformly random numbers that add up to $\ell - x.$ That is, we get $$f_2(\ell) = \int_0^\ell x(\ell - x) + f_1(x) + f_1(\ell-x) \,dx = f_1(\ell) + 2 \int_0^\ell f_1(x) \,dx.$$ Similarly, if we keep going with more recursion, we get that the expected sum of the products after $n+1$ rounds of splitting is given by $$f_{n+1} (\ell) = f_1 (\ell) + 2\int_0^\ell f_n(x) \,dx,$$ for $n \geq 1.$ As $n \to \infty,$ we get that we must have $$f(\ell) = f_1(\ell) + 2\int_0^\ell f(x)\,dx = \frac{\ell^3}{6} + \int_0^\ell f(x) \,dx.$$ Differentiating both sides with respect to $\ell,$ we get the differential equation $$f^\prime (\ell) = \frac{t^2}{2} + 2f(\ell),$$ with initial conditions $f(0) = 0.$ This is solved by the generic form $f(\ell) = Ce^{2\ell} + p(\ell),$ where $p$ is a polynomial, say $p(t) = at^2 + bt+ c.$ Plugging back into the differential equation we get that $$2at + b = \frac{t^2}{2} + 2at^2 + 2bt + 2c,$$ for all $t.$ By gathering like terms and setting equal to zero, we get \begin{align*}2a + \frac{1}{2} &= 0\\ 2b - 2a &= 0 \\ 2c - b &= 0, \end{align*} that is $a = b = -\frac{1}{4}$ and $c = -\frac{1}{8}.$ Additionally, we have $f(0) = C - \frac{1}{8} = 0,$ so $C = \frac{1}{8}.$ So finally, we see that $$f(\ell) = \frac{e^{2\ell} - 2\ell^2 -2\ell -1}{8},$$ and so the expected value of the sum of the products of random splitting into two subparts is $$f(1) = \frac{e^2 - 5}{8} \approx 0.29863201236.....$$

But wait ... there's more, what if as opposed to two pieces, each time we randomly split, we split into three pieces. Let $g: \mathbb{R}_+ \to \mathbb{R}_+$ be the expected value of the sum of the random triple products of splitting a line segement of initial length $\ell \in \mathbb{R}_+.$ Here too we can demonstrate the recurrence with a few small number of splits.

We see that after one splitting we get $$g_1(\ell) = \int_0^\ell \int_0^{\ell - x} xy(\ell - x -y) \,dy \,dx = \int_0^\ell x f_1(\ell - x) \,dx = \int_0^\ell x \frac{(\ell - x)^3}{6} \,dx = \frac{\ell^5}{120}.$$ If we again split each piece into three then after two splittings we have the original value of original splitting, followed by the expected product of three uniformly random numbers that add up to $x$, the expected product of three random numbers that add up to $y$, and the expected product of three random numbers that add up to $\ell - x - y.$ That is, \begin{align*}g_2(\ell) &= \int_0^\ell \int_0^{\ell - x} xy(\ell - x - y) + g_1(x) + g_1(y) + g_1(\ell - x - y) \,dy\,dx\\ &= g_1(\ell) + 3 \int_0^\ell (\ell - x) g_1(x) \,dx.\end{align*} In fact, this relation holds for any arbitrary number of splits, $n \geq 1,$ that is $$g_{n+1}(\ell) = g_1(\ell) + 3 \int_0^\ell (\ell-x) g_n(x) \,dx$$ and in particular as $n \to \infty$ we get $$g(\ell) = \frac{\ell^5}{120} + 3\int_0^\ell (\ell - x) g(x) \, dx.$$

Let's define the integral of $g$ to be $G(\ell) = \int_0^\ell g(x)\,dx.$ Differentiating under the integral sign with respect to $\ell,$ we get $$g^\prime(\ell) = \frac{\ell^4}{24} + 3\int_0^\ell g(x) \,dx = \frac{\ell^4}{24} + 3G(\ell).$$ Differentiating once more gives the second order inhomogeneous differential equation $$g^{\prime\prime}(\ell) - 3g(\ell) = \frac{\ell^3}{6},$$ where $g(0) = g^\prime(0) = 0.$ This is solved by a function of the form $$g(\ell) = C \sinh (\sqrt{3} \ell) + p(\ell),$$ where $p$ is a polynoial, say $p(t) = at^3 + bt^2 + ct + d.$ Plugging back into the differential equation we get $$6at + 2b - 3(at^3 + bt^2 + ct+d) = \frac{t^3}{6},$$ for all $t.$ By gathering terms and setting equal to zero, we get \begin{align*} -3a &= \frac{1}{6} \\ b &= 0 \\ 6a-3c &= 0 \\ 2b -3d &= 0, \end{align*} that is $a = -\frac{1}{18}, $$b = d = 0,$ and $c = -\frac{1}{9}.$ Additionally, we have $g^\prime(0) = \sqrt{3} C - \frac{1}{9} = 0,$ so $C = \frac{\sqrt{3}}{27}.$ So finally, we see that $$g(\ell) = \frac{2\sqrt{3} \sinh (\sqrt{3} \ell) - 3\ell^3 - 6\ell}{54},$$ and so the expected value of the sum of the triple products of random splittings into three subparts is $$g(1) = \frac{2\sqrt{3} \sinh(\sqrt{3}) - 9}{54} \approx 0.00895406261852....$$