Building a Pace Calculator with ChatGPT

Given the snow storm that hit the Mid-Atlantic last week and that it was just New Year’s, it has been a rather slow week in the world. So, I thought to myself, “Jay, you need a challenge.” And then it hit me – why not turn my spreadsheet-based pace calculator into a web app? “Great idea”, I thought, but how could I do it in a fun and interesting way?

That’s when it hit me – this might be an excellent challenge for artificial intelligence.

For the uninitiated, a pace calculator helps runners convert their race times across different distances. It also helps calculate training paces (i.e. Tempo pace, Easy pace, etc.). These calculators are very useful tools for anyone training with specific performance goals. And I’ve always wanted to share mine with everyone else.

So, I fired up the ole’ ChatGPT, loaded my spreadsheet calculator and said “Hey Chat – let’s turn this calculator into a web app!” Chat, of course, was up for the challenge. It always is. And yes, my nickname for ChatGPT is Chat. Chat even approves of the nickname, or so it says. It can’t really approve of anything as it’s an LLM, but it never hurts to be courteous. If Chat does become our robotic overlord, I hope it remembers that I was polite.

Still, I excitedly uploaded my Excel calculator – expecting some AI magic. Instead, I got AI tragedy.

Chat misunderstood my initial direction. Rather than replicating my beautiful calculator, Chat cloned the interface (the part where you a recent time for a given distance) and calculated just the pace for that. And it didn’t calculate anything else. There was no conversion to 800m, mile, 5K, 10K, half-marathon, or marathon. There was just the pace for the distance you selected.

That is not at all what I intended.

So, I gave Chat more specific instructions. I didn’t want just the pace for a specific distance calculated. I wanted the equivalent time across a range of distances calculated. I even gave Chat a formula for doing that. While it did produce a table, it did not produce the proper calculations. Instead, if you put in that you ran an 800m in 2:00, it calculated your mile pace as 4:00. That, for an equivalent performance calculator, makes no sense. You should slow down when the distance doubles. I had to explain that to Chat, and reiterate the importance of our formula:

t2 = t1 * (d2 / d1)1.06

t2 = the time for the distance you’re converting to

t1 = your time for the distance you’re inputting

d2 = the distance you’re converting to (in meters)

d1 = the distance you’re converting from (in meters)

1.06 =the adjustment factor recommended by Pete Riegel, the author of that formula. Pete first published it back in the 1970s in an article titled Athletic Records and Human Endurance. That article was published in American Scientist.

That’s when Chat made it’s first contribution. Let me set the stage. I was frustrated because Riegel’s formula is extremely aggressive, particularly at the 800m. Chat was able to explain why. Rigel’s formula assumed a perfect conversion from event to event.

Athletic Records and Human Endurance” published in American
Scientist
. And now, the formula:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *