Doug McIlroy and Bing Copilot

This morning, I read a short article describing certain deficiencies in Bing Copilot when it comes to doing math. The article interested me for two reasons:

The article investigates three math problems: one having to do with time zones, one an elementary logic problem, and the third a simple calculus problem. At first, I thought the time zone problem wasn’t really a math problem, but I soon learned that it was. McIlroy asked Copilot for the minimum time difference between Oregon and Florida. Copilot knew that both states have two time zones, and it could regurgitate the definition of “minimum,” but it didn’t know how to put those two pieces of information together.

I’ll let you explore the logic problem on your own. Suffice it to say that you shouldn’t worry about beating Copilot in a game of rock-paper-scissors.

The calculus problem was the most complicated: given a general ellipse defined by the usual equation,

x 2a 2+y 2b 2=1

find the points on the ellipse where the magnitude of the slope is one.

McIlroy gave Copilot several opportunities to solve this problem. Although it always got the formula for the slope correct, it failed in different ways each time to apply that formula to the problem at hand.

The value of the article isn’t in simply pointing out that LLMs can be wrong. It’s in McIlroy’s detailed review of Copilot’s answers and where it went wrong in every step. By taking small problems and exploring the errors thoroughly, McIlroy does a better job of finding faults in large language models than any of the broad-brush criticisms I’ve read.

In the notes at the end of the article, McIlroy gives us its editing history. First written in December of last year; last edited just a few days ago. I should mention here that McIlroy will be celebrating his 92nd birthday tomorrow.


Typing special characters

A couple of days ago, two tweets appeared in my Mastodon timeline1 that got me thinking about how and why I type special characters on my Mac. The first was from Cabel Sasser,

… these are permanently hardwired into my brain: Option-2 for ™, Option-R for ®, Option-G for ©, Option-. for …, and Option-8 for •

and the second was a reply from David Friedman,

Great idea. Personally I use macOS text replacement: hhalf for ½, ccent for ¢, ttm for ™, ccopy for ©, aapple for , bbull for •, etc. Table of text substitutions, including the command and degree symbols.

What struck me was that I use a mixture of these two techniques (OK, I use Typinator instead of the macOS’s text replacement system, but the idea is the same).

For example, like Cabel, I type the bullet (•) and ellipsis (…) characters directly; But like David, I use abbreviations (the Typinator term for text substitutions) for the cent (¢), trademark (™), and apple () symbols. Is there any logic to my system?

Certainly, some symbols that I use fairly frequently, like ⌘, ⌥, ⇧, and ⌃, have to be handled by abbreviations because they can’t be typed directly using the Option or Option-Shift keys.

Keyboard viewer with option key pressed

Keyboard viewer with option and shift keys pressed

But as you can see, the  and ¢ characters can be typed directly. So why don’t I? I guess it comes down to habit. Long, long ago—back in the 80s, before the Mac had text substitutions or abbreviation utilities—I learned how to type certain characters using Option and Option-Shift because I needed them and there was no other way to get them. So bullet (•), degree (°), ellipsis (…), the n- and m-dashes (– and —), and all the curly quotation marks (‘,’,“, and ”) became part of my muscle memory—muscle memory that was somehow retained even after I took an eight-year Mac hiatus in the late 90s and early 00s.

But I never needed ™, ©, or  enough to train my fingers how to type them. When I returned to the Mac and started using text expansion utilities,2 these were among the special characters I created abbreviations for. Expansion made it unnecessary to learn new key combinations.

There is one special character I’ve recently learned to type directly: Δ. I use this character to delimit equations here on the blog. I wanted something that was easy to type (⌥J) and had a mathy feel to it. So when I want to show something like

∫ 0 asinxdx

I type

ΔΔ \int_0^a \sin x \, d x ΔΔ

For inline equations I use a single Δ.

I have a feeling many longtime Mac users are like me: some special characters are typed directly, some are done through expansion, and the rest—never used before and never expected to be used again—come through the Character Viewer.

Character viewer


  1. Since Twitter is now X, I feel “tweet” has fallen into the public domain and can be applied to any shortform social media system. 

  2. I’ve used TypeIt4Me, TextExpander (originally as Textpander), and now Typinator. 


Gravitational potential energy

One of the things I planned to do upon retirement was study topics that I had missed, or nearly missed, in school. Some of these would be things that were barely touched on in class; some would be material that was in the textbook but not covered in class; and some would be topics that were adjacent to the classes I took. When I was just out of school, I thought I’d be able to start following up on these topics pretty much right away. And if you allow for an elastic definition of “pretty much right away,” I’m on schedule.

My first topic is orbital mechanics, and the textbook I’ve chosen is Victor Szebehely’s Adventures in Celestial Mechanics, published in 1989 by the University of Texas Press.

Adventures in Celestial Mechanics

As textbooks go, it’s fairly thin at 175 pages, and the math is pretty elementary—a good book to start with, I think. I’m seven chapters in and taking a little break to review what I’ve learned so far. I’m treating this as if I were in class and Szebehely was using the text as his lecture notes. In other words, I’m not just reading the book; I’m going through all the derivations and solving all the problems. If I wanted a shallow understanding, I’d just watch a few Neil deGrasse Tyson videos on YouTube and call it a day.1

One of the things I found odd about Szebehely’s approach is that he never derives—or even presents—the expression for gravitational potential energy. I decided to do it myself and then write it out here, so I could find it easily.

In outline, the derivation works this way:

The force of gravity between two bodies is

F=Gm 1m 2r 2

where m 1 and m 2 are the masses of the two bodies, r is the distance between their mass centers, and G is the universal gravitational constant,

G=6.674×10 11m 3kgs 2

This force acts on each body in the direction of the other body, so the work done by gravity as the distance between the bodies changes from r 1 to r 2 is2

W=∫ r 1 r 2Fdr=∫ r 1 r 2Gm 1m 2r 2dr

The minus sign is there because the force acts in the opposite direction of the distance increment, dr.

Carrying out the integration, we get

W=Gm 1m 2r 2Gm 1m 2r 1

The work and energy principle says

W=ΔU

where ΔU is the change in potential energy, i.e.,

ΔU=U(r 2)U(r 1)

The negative sign in the work-energy equation comes from what potential energy is all about: the potential to do work. If a force does positive work, its potential to do further work has decreased.

Putting this together, we get

ΔU=U(r 2)U(r 1)=W=(Gm 1m 2r 2Gm 1m 2r 1)

Sorting out the negative signs, we see that

U(r 2)=Gm 1m 2r 2

and

U(r 1)=Gm 1m 2r 1

so our expression for gravitational potential energy at any distance, r, is

U=Gm 1m 2r

If you’re worried about the negative sign in this expression, don’t be. Recall from your first course in physics that it’s the change in potential energy that matters, not the value at any given position. The key thing to note about this expression is that U increases as r increases, which is how it should be.


Well, that didn’t take too long. Let’s expand on this solution. You might also remember from physics class that the potential energy of a body of mass m near the surface of the Earth is

U=mgh

where h is the elevation of the body and g is the acceleration due to gravity. How does this expression compare to what we just derived?

First, let’s rewrite our expression for U to specialize it for a body near the surface of the Earth:

U=Gm Emr

where m E is the mass of the Earth.

Because the body is close to the surface of the Earth, we’ll expand our expression for U in a Taylor series about r E, the radius of the Earth. That will be

U(r)=U(r E)+U (r E)(rr E)+12!U (r E)(rr E) 2+

The further terms in the expansion will have higher derivatives of U, higher powers of rr E, and be divided by higher factorials.

Since

U (r)=Gm Emr 2 U (r)=2Gm Emr 3 U (r)=6Gm Emr 4

and so on, the expansion works out to

U(r)=Gm Emr E+Gm Emr E 2(rr E)Gm Emr E 3(rr E) 2+

where the further terms will be multiplied by higher powers of rr E and divided by higher powers of r E. Note that the factorials get canceled by the coefficients of the derivatives. Also, we get alternating signs because of the alternating signs of the derivatives.

At this point, we recognize that rr E is the distance above the Earth’s surface, which is h. And because we care only about the change in potential energy with changes in h, we can drop the constant initial term. So if we collect the common terms, we get

U=Gm Emr E 2h(1hr E+(hr E) 2)

Since h≪r E, the term in parentheses is approximately one, and

U=Gm Emr E 2h=m(Gm Er E 2)h

Is the term in the parentheses equal to g? According to NASA

m E=5.9722×10 24kg

and

r E=6.371×10 6m

Plugging in those values and the value of G we saw earlier, we get

Gm Er E 2=9.82m/s 2

which is pretty close to the textbook value for the acceleration due to gravity, g=9.81m/s 2.

But shouldn’t it be closer? We have enough digits in our values for G, m E, and r E that we shouldn’t be off in the third digit of g. What are we missing? Mainly that the Earth is spinning. The centrifugal effect on the surface of the Earth is small, but it’s the primary reason for the difference between Gm E/r E 2 and g.


  1. There’s a place for Neil deGrasse Tyson videos, but that’s not where I want to go. 

  2. Strictly speaking, the integrand of the work expression is the dot product of the force vector and the distance increment vector, but for gravity those two vectors are parallel, so we can get by with scalar terms. 


A tardy assessment of the Apple Sports app

I tried the Apple Sports app when it came out in February and abandoned it almost immediately. Lots was written about Sports in its first couple of weeks, but I was on a blogging hiatus back then. I’ve recently looked at it again to see if I was too hasty or if its failings had been fixed (no to both), so I figured I’d write up my thoughts.

I won’t be saying anything about how Sports fits into the Apple sports universe; go to Jason Snell for that. And I won’t be talking about how its design may be a harbinger of iOS 18; that’s Lickability’s baliwick. But I do want to talk about its design as a sports app.

You may recall that the main selling point of Sports was its ability to give you up-to-date scores. Eddy Cue said, “I just want to get the damn score of the game.” That’s Apple marketing at its best: it’s short, pithy, and it directs you to the app’s best feature, the presentation of today’s scores.

It’s easy to set up Sports to follow your favorite leagues/conferences and teams, and once that’s done the presentation of scores is logical. Games being played in your chosen leagues are displayed generally in chronological order, but the games with your favorite teams are floated to the top. That’s the right way to do it.

But scores are only part of what a good sports app is about. Sports apps are used not only when you can’t watch a game and want to be kept plugged in, they’re also used—even more often used, I think—to give you background information on the game you’re currently watching. Announcements during a broadcast are ephemeral, but a sports app can tell you how many fouls Nikola Jokić has at any time.1 And this is where Sports falls down.

In basketball, for example, the box score statistics are thin. There’s no info on free throws, steals, blocks, turnovers, or personal fouls. League standings are missing common stats like the home/away record, record over the last 10 games, and win/loss streaks, These are things fans want and that other sports apps provide. No amount of beautiful presentation is going to make up for missing data.

And, weirdly for an Apple app, the presentation isn’t beautiful—it’s actually awful. Here’s a screenshot of the box score from last night’s Chicago Bulls/Detroit Pistons game:

Chicago Bulls box score from Sports app

Like many sports apps, Sports splits the box score into starters and bench players (during a game, the players on the court have marks next to their names). Apple’s designers decided to put the headers only at the top of the Starters portion of the table, which I would applaud if they’d aligned the columns of the Bench portion of the table with the columns of the Starters portion. But they didn’t. Bench rebounds, for example, are more or less under the PTS header. This is not how you present a table of numbers, and it’s inconceivable to me that anyone would look at this mess and give it a pass.

The programming problem here is obvious. Although the use of a single header suggests this is meant to be seen as a single table, inside the app the Starters and Bench parts are two separate tables. The column spacing of the Starters table is based on widths that include the headers (several of which are wider than the data below them), and the column spacing of the Bench table is based on widths of the data alone. Instead of looking at both tables, getting the maximum width of each column, and applying that to both tables, the programmers simply allowed the tables to be formatted separately, thus saving themselves at least five lines of code.

Again, did nobody at Apple look at this before putting it in the App Store? And has nobody looked at it in the seven weeks since?

I admit I may be unduly irritated by this because I spent a lot of my career making tables of figures and doing my best to make them easy to read. But before you dismiss me as a crank, look at what happens when you swipe on the tables left and right to see the additional stats. They get even further misaligned because the two tables don’t scroll together.

When you use a single header, you’re telling the reader that they’re looking at a single table. But this design cheats the reader.

I’ve used several sports apps over the years. Many of them are crappy and fill your small screen with ads. A good Apple Sports app would fill a real need. But I can’t use it until it stops offending me.


  1. My examples are going to be about basketball because that’s the sport I care about the most.