# Paddling workouts

May 18, 2024 at 12:22 PM by Dr. Drang

I bought a kayak a couple of weeks ago. It’s one of those fold-up jobs by Oru, and I got it instead of a more traditional kayak because it’s very light and can easily fit *inside* my car instead of being strapped to the roof.

I’ve been taking it out to local lakes and paddling around to get myself used to it. The first couple of times, because I was focused on assembling it correctly and getting in without tipping over, I forgot to start the Paddling workout on my Apple Watch, so I didn’t have a complete record of either of those little trips. But I have recorded the more recent paddles and have learned a rather disappointing fact: the Workout app doesn’t keep track of where you went.

This was quite a shock. For years, I’ve been using Workout to track my walks, getting both a nice map of my path and a sense of how fast I was going during each stretch.

(The map can also show that you got in the car and drove away before turning the workout off.)

I assumed the Paddling workout would do the same, but here’s what I saw after paddling around at Busse Woods a few days ago:

It gives you a dot where you started the workout but nothing else. A search of the web to see if I’d done something wrong soon told me that I hadn’t and that lots of paddlers were unhappy about this deficiency.

Apple has always been concerned with battery life on the Watch, but I don’t understand why keeping track of my location while kayaking is going to be any more draining than doing the same thing while hiking. Or biking, for that matter, a workout type that also tracks location and presents a map.

There are third-party paddling apps that will track my location, so I guess I’ll have to start trying them out. My initial sense is that these apps are meant for people who are a lot more serious about kayaking than I ever expect to be and therefore have features I’ll never use. Oh, well. Every hobby has hidden costs.

**Update 18 May 2024 5:42 PM**

A few updates:

- On Mastodon, Steve told me that cross-country skiing also records just a single dot on the workout map. Just as stupid as how it treats kayaking.
- Joe Rosensteel wrote a nice followup post in which he pointed out another Apple Watch/Workout deficiency that you’d think could be easily fixed: while your watch will (a) notify you when it detects that you’ve started a walk without starting a workout for it, and (b) also notify you if it notices that you’re standing (mostly) still without pausing your current workout, it won’t do the obvious (c) notify you to resume your workout when you start walking again. I’ve been bitten by this bug several times.
- I’ve signed up for a free month of Strava rather than a paddling-specific app/service. I’m hoping this will make it easy to track both my walking and kayaking in a single place.

# A factoring trick

May 17, 2024 at 6:23 PM by Dr. Drang

In Matt Parker’s latest video, he gives two proofs to show that if you

- choose any number,
- raise it to any power, and
- subtract one,

you’ll get a number that is a multiple of your original number minus one. In words, this seems magical; in equation form,

$${b}^{n}-1=(b-1)\phantom{\rule{thinmathspace}{0ex}}(\phantom{\rule{thinmathspace}{0ex}}\mathrm{something}\phantom{\rule{thinmathspace}{0ex}})$$not so much. Certainly you know that

$${b}^{2}-1=(b-1)\phantom{\rule{thinmathspace}{0ex}}(b+1)$$because that comes up so often. You may also remember from algebra class that

$${b}^{3}-1=(b-1)\phantom{\rule{thinmathspace}{0ex}}({b}^{2}+b+1)$$So it isn’t tremendously surprising to hear that $b-1$ is a factor no matter what $n$ is. But what’s the proof?

Matt’s first proof is to notice that $b=1$ is a solution to

$${b}^{n}-1=0$$for any $n$. Therefore, $(b-1)$ has to be one of the factors of ${b}^{n}-1$. He considers this a rather prosaic proof, and quickly moves on to the fun one, which involves expressing the numbers in different bases. It *is* a cute proof, and you should watch the video to see it.

But I wanted to go back to

$${b}^{n}-1=(b-1)\phantom{\rule{thinmathspace}{0ex}}(\phantom{\rule{thinmathspace}{0ex}}\mathrm{something}\phantom{\rule{thinmathspace}{0ex}})$$and see if there’s a solution for *something* that works for every $n$. Obviously there is, or I wouldn’t have written this post. And you’ve probably already guessed what that solution is, but let’s figure it out systematically.

We’ll set up the polynomial division of ${b}^{n}-1$ by $b-1$ and run it out for a few steps:

As you can see, after Step $m$ in the process, the difference (i.e., the expression under the horizontal line) is

$${b}^{n-m}-1$$So after $m=n-1$ steps, the difference will be $b-1$, which means that the last term in the quotient will be $+1$ and there will be no remainder. Therefore, *something* is

which is easier to remember than I would have guessed.

# Gravity and Edgar Rice Burroughs

May 12, 2024 at 10:36 PM by Dr. Drang

Yesterday, I was thinking about what textbook I would move on to after I finish *Adventures in Celestial Mechanics*. Because I’ve been thinking about gravity, I pulled Oliver Kellogg’s *Foundations of Potential Theory* off my shelf and started leafing through it. I soon came upon a gravity problem that I first heard about when I was a teenager but never saw the solution for. The problem has to do with Pellucidar, and it’s not as tricky as I expected.

Pellucidar is an imaginary land created by Edgar Rice Burroughs for a series of pulpy adventure books, starting with *At the Earth’s Core*. The conceit of the stories is that the Earth is actually a hollow shell and that there’s an inhabited land, Pellucidar, on the inside surface of the shell. Intrepid adventurers from our side of the shell dig through to Pellucidar, meet the strange people and creatures who live there, and have adventures intrepidly. Never one to let an idea go unexploited, Burroughs even had Tarzan visit Pellucidar.

While I read one or two Tarzan books and several of the John Carter of Mars books, I never picked up any of the Pellucidar novels. But I did read somewhere—possibly in an Isaac Asimov science essay—that the concept of Pellucidar was flawed in a way apart from the many obvious ways: the inhabitants of Pellucidar would not “stick” to the inner surface of a hollow Earth because there’s no net gravitational force inside a spherical shell.

This seemed very odd to the teen-aged me, but Asimov (or whomever) didn’t explain it, and I didn’t have the analytical tools to check it out myself. But now I do, following more or less the derivation given by Kellogg.

Suppose we have a thin spherical shell of radius $a$. We want to know the gravitational attraction that the sphere exerts on a particle, $P$, which may be either inside or outside the sphere.

We’ll set up our coordinate system so that $P$ is on the $z$ axis. Every point on the sphere, $Q$, can be identified by two angular coordinates, $\theta $ and $\varphi $, which are the point’s latitude and longitude.

(If you’re wondering how we should handle the analysis if $P$ isn’t on the $z$ axis, don’t. One of the most important things to learn in mechanics is that the coordinate systems we use are up to us; there is no $x\text{-}y\text{-}z$ stamped on the universe. Wherever $P$ happens to be, we can draw a $z$ axis that runs through it from the center of the sphere.)

The gravitational force that some small differential element at $Q$ on the sphere exerts on particle $P$ is

$$dF=\frac{G\rho \phantom{\rule{thinmathspace}{0ex}}dA}{{r}^{2}}$$where $G$ is the universal gravitational constant, $\rho $ is the areal density of the sphere (i.e., it has units of mass per area, not mass per volume), and $r$ is the distance from $Q$ to $P$. $dA$ is the differential area of the element on the sphere, and $dF$ is the differential force (per unit mass of $P$) that element exerts on particle $P$.

Here’s a sketch of the differential area at $Q$:

It’s bounded by lines of latitude that are $d\theta $ apart from one another and lines of longitude that are $d\varphi $ apart from one another. The area of the element is

$$dA=(a\phantom{\rule{thinmathspace}{0ex}}d\theta )(a\mathrm{cos}\theta \phantom{\rule{thinmathspace}{0ex}}d\varphi )={a}^{2}\mathrm{cos}\theta \phantom{\rule{thinmathspace}{0ex}}d\varphi \phantom{\rule{thinmathspace}{0ex}}d\theta $$If you’re wondering why we can use the formula for the area of a rectangle when the edges and the surface itself are curved, I will remind you that this is how calculus works. These differential lengths are teeny tiny and therefore the difference between the area of the surface and the area of a rectangle is extra extra teeny tiny. In calculus, we keep track of the teeny tiny and throw away the extra extra teeny tiny.

To express the differential force in terms of $\theta $ and $\varphi $, let’s look at a side view of the sphere with $P$ and $Q$. First, we’ll consider the case where $P$ is “above” $Q$:

The distance between $P$ and $Q$ is

$$r=\sqrt{(a\mathrm{cos}\theta {)}^{2}+(z-a\mathrm{sin}\theta {)}^{2}}=\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}$$Although I’ve drawn the figure with $P$ outside the sphere, the formula above also applies when $P$ is inside the sphere. What matters is that $P$ is above $Q$.

Now let’s consider the case where $P$ is “below” $Q$:

Here, $r$ is the hypotenuse of a different right triangle, but it turns out that

$$r=\sqrt{(a\mathrm{cos}\theta {)}^{2}+(a\mathrm{sin}\theta -z{)}^{2}}=\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}$$is the same formula as before. That’s convenient. So the magnitude of the differential force is

$$dF=\frac{G\rho {a}^{2}\mathrm{cos}\theta}{\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}}\phantom{\rule{thinmathspace}{0ex}}d\varphi \phantom{\rule{thinmathspace}{0ex}}d\theta $$To determine the force on $P$ due to the entire sphere, we’re going to integrate on $\theta $ from $-\pi /2$ to $\pi /2$ and on $\varphi $ from $0$ to $2\pi $. But first, we need to think about the direction of the differential force.

Note that in each of the two side views, the gravitational force on $P$ has two components: a component parallel to the $z$ axis (vertical in our drawings) and a component perpendicular to the $z$ axis (horizontal in our drawings). When we integrate over $\varphi $, we’re dealing with forces associated with a circle of constant latitude, and the components perpendicular to the the $z$ axis (horizontal) will cancel each other out. For example, the horizontal component when $Q$ is at $\varphi =180\text{\xb0}$ cancels the horizontal component when $Q$ is at $\varphi =0\text{\xb0}$, the horizontal component for $\varphi =270\text{\xb0}$ cancels the horizontal component for $\varphi =90\text{\xb0}$, and so on.

The upshot is that we only have to worry about the “vertical” component of the force, i.e., the component in the $z$ direction. To get that component, we multiply $dF$ by the $z$ direction cosine.

When $P$ is above $Q$, the $z$ direction cosine is

$$-\frac{z-a\mathrm{sin}\theta}{\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}}$$where the minus sign out in front indicates that the component is acting in the negative $z$ direction. Remember, we’re computing the gravitational force on $P$ due to $Q$, so the force acts from $P$ toward $Q$.

When $P$ is below $Q$, the $z$ direction cosine is

$$\frac{a\mathrm{sin}\theta -z}{\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}}$$Compare this formula with the previous one and you’ll see that they are algebraically identical. As with the expressions for $r$, the signs work out to give the same equation for both cases.

So the $z$ component of the differential force acting on $P$ due to $Q$ is

$$d{F}_{z}=\frac{G\rho {a}^{2}\mathrm{cos}\theta \phantom{\rule{thinmathspace}{0ex}}(a\mathrm{sin}\theta -z)}{({a}^{2}+{z}^{2}-2az\mathrm{sin}\theta {)}^{3/2}}\phantom{\rule{thinmathspace}{0ex}}d\varphi \phantom{\rule{thinmathspace}{0ex}}d\theta $$and the total force that the sphere exerts on $P$ is

$$F={F}_{z}={\∫}_{-\pi /2}^{\pi /2}{\∫}_{0}^{2\pi}\frac{G\rho {a}^{2}\mathrm{cos}\theta \phantom{\rule{thinmathspace}{0ex}}(a\mathrm{sin}\theta -z)}{({a}^{2}+{z}^{2}-2az\mathrm{sin}\theta {)}^{3/2}}\phantom{\rule{thinmathspace}{0ex}}d\varphi \phantom{\rule{thinmathspace}{0ex}}d\theta $$This may seem awful, but it isn’t. First, notice that $\varphi $ doesn’t appear in the integrand, so the integral over $\varphi $ is just

$${\∫}_{0}^{2\pi}d\varphi =2\pi $$We can pull that and the other constants out to get

$$F=2\pi G\rho {a}^{2}{\∫}_{-\pi /2}^{\pi /2}\frac{\mathrm{cos}\theta \phantom{\rule{thinmathspace}{0ex}}(a\mathrm{sin}\theta -z)}{({a}^{2}+{z}^{2}-2az\mathrm{sin}\theta {)}^{3/2}}\phantom{\rule{thinmathspace}{0ex}}d\theta $$This still looks bad, but with tools like Mathematica and SymPy, integrations like this aren’t the pain in the ass they used to be. After a few seconds of chugging in Mathematica,

the answer pops out:

$$F=\frac{2\pi G\rho {a}^{2}}{{z}^{2}}\phantom{\rule{thinmathspace}{0ex}}(sgn(a-z)-1)$$where the signum function ($sgn$) is $+1$ if the argument is positive and $-1$ if the argument is negative. Therefore, if $P$ is outside the sphere ($a<z$),

$$F=\frac{2\pi G\rho {a}^{2}}{{z}^{2}}(-1-1)=-\frac{4\pi G\rho {a}^{2}}{{z}^{2}}$$At this point, we recall that $4\pi {a}^{2}$ is the area of the sphere, so that multiplied by the areal density, $\rho $ , is the mass of the sphere, which we’ll call $M$. So for this case

$$F=-\frac{GM}{{z}^{2}}$$which is just what we’d expect (remember that this is the force per unit mass of $P$, so there’s no mass term for the particle).

On the other hand, if $P$ is inside the sphere ($a>z$),

$$F=\frac{2\pi G\rho {a}^{2}}{{z}^{2}}(1-1)=0$$which is the surprising (to me, anyway) result that the sphere exerts no net gravitational force on a particle inside it.

How can this be? Well, certainly it makes sense if $P$ is at the center of the sphere. If we move $P$ up from the center, there’s more mass below $P$ but it is, on the average, farther away. It works out that the increasing mass and increasing distance balance each other to keep the net force at zero.

Oliver Kellogg didn’t have Mathematica. His suggestion was to do a change of variable from $\theta $ to $r$ and then integrate. He doesn’t give any details of the process, just the two answers. But I went ahead and did it his way, too, using

$$r=\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}$$ $$dr=-\frac{az\mathrm{cos}\theta}{\sqrt{{a}^{2}+{z}^{2}-2az\mathrm{sin}\theta}}\phantom{\rule{thinmathspace}{0ex}}d\theta =-\frac{az\mathrm{cos}\theta}{r}\phantom{\rule{thinmathspace}{0ex}}d\theta $$and

$$a\mathrm{sin}\theta -z=\frac{{a}^{2}-{z}^{2}-{r}^{2}}{2z}$$With those substitutions, the integrand becomes

$$-\frac{1}{2a{z}^{2}}\phantom{\rule{thinmathspace}{0ex}}\frac{{a}^{2}-{z}^{2}-{r}^{2}}{{r}^{2}}$$which is much easier to deal with than the original integrand. But we have to be careful with the limits. If $z>a$, the upper limit ($\theta =\pi /2$) becomes

$$r=z-a$$and the lower limit ($\theta =-\pi /2$) becomes

$$r=z+a$$Therefore, the integral is

$$F=\frac{\pi G\rho a}{{z}^{2}}{\∫}_{z-a}^{z+a}\frac{{a}^{2}-{z}^{2}-{r}^{2}}{{r}^{2}}\phantom{\rule{thinmathspace}{0ex}}dr$$where I got rid of the negative sign at the front of the integrand by exchanging the limits. With no trig functions to make life difficult, this works out very quickly to

$$F=-\frac{4\pi G\rho {a}^{2}}{{z}^{2}}$$when $P$ is outside the sphere. This is the same answer as before.

If $z<a$, the upper limit ($\theta =\pi /2$) becomes

$$r=a-z$$and the lower limit ($\theta =-\pi /2$) becomes

$$r=a+z$$Therefore, the integral is

$$F=\frac{\pi G\rho a}{{z}^{2}}{\∫}_{a-z}^{a+z}\frac{{a}^{2}-{z}^{2}-{r}^{2}}{{r}^{2}}\phantom{\rule{thinmathspace}{0ex}}dr$$which works out to

$$F=0$$when $P$ is inside the sphere. Again, a repeat of the answer we got when integrating over $\theta $.

While it was nice to see explicitly how Kellogg did the integration, it was faster to just let Mathematica do its thing. And I didn’t get any deeper physical insight doing the change of variable.

Anyway, now I understand the surprising thing I read about 45 or so years ago. And I’m downloading *At the Earth’s Core*.

# More than 100% pregnant

May 9, 2024 at 11:21 PM by Dr. Drang

Kieran Healy tweeted out a gem earlier this evening:

Yes, Professor Huberman, a probability of 120% is indeed “a different thing altogether.”^{1}

While I find it fascinating that someone can run through an argument that clearly proves they are wrong and continue along as if they hadn’t, I don’t have any expertise in psychology, so I won’t try to explain it.

I do, however, have some expertise in probability, and Huberman is dancing around the edge of one of my favorite problems: If there’s a 1 in *n* chance of something happening in one try, what’s the probability of it happening in *n* tries?

Remarkably, the answer is not

$$n\left(\frac{1}{n}\right)=1$$It’s

$$1-{(1-\frac{1}{n})}^{n}$$The term in the parentheses is the probability of it *not* happening in a single trial. That term raised to the *n*th power is the probability of it not happening in *n* trials (assuming independence between trials). And subtracting *that* from 1 gives us the probability of it happening (at least once) in *n* trials.

What’s great about this problem is that you can make a pretty decent estimate of the answer without doing any calculations. The reason is

$$\underset{n\→\mathrm{\infty}}{\mathrm{lim}}{(1-\frac{1}{n})}^{n}=\frac{1}{e}\≈0.37$$and so

$$\underset{n\→\mathrm{\infty}}{\mathrm{lim}}1-{(1-\frac{1}{n})}^{n}=1-\frac{1}{e}\≈0.63$$Now, in the Huberman problem *n* is 5, which is not especially close to infinity, but luckily the convergence to the limit is pretty rapid.

I would have guessed the answer for $n=5$ was about 0.65; it’s actually 0.67. Not super accurate, but better than 1.

**Update 10 May 2024 12:21 PM**

John D. Cook also saw the Huberman clip and wrote a nice post this morning about how adding probabilities is a reasonably close approximation if both

- the base probability for a single trial is small; and
- the number of trials is small.

Absolutely true, but not as much fun as a solution that ends up with Euler’s constant popping up out of nowhere.