Latest posts
- Making the unnecessary easierAug 28, 2026John
I watched a few videos this morning, looking for ideas of what I could use AI to do. In one video, someone had an agent monitor tech news sites every 30 minutes to notify him of a variety of developments. No doubt that’s less effort than visiting a bunch of sites every half hour, but […] Making the unnecessary easier first appeared on John D. Cook.
- Second solutionsAug 27, 2026John
This post provides a couple examples to go along with two earlier posts. The pattern we’re illustrating is families of polynomials pn(x) that each satisfy a differential equation and a three-term recurrence. The differential equations have a second solution qn(x) that is the larger solution with respect to x but the smaller solution with respect to n. In both […] Second solutions first appeared on
- What is the quality of software that AI writes?Aug 26, 2026Wayne Joubert
AI-powered coding agents increase productivity for many developers. But do these agents produce good-quality code? Some say this doesn’t matter, we are heading toward dark software factories with source code never inspected, and maybe we should eliminate source code altogether—“source code is the new assembly code”. Others have a different view. Humans sometimes need to […] What is the quality of
- Junk solutionsAug 26, 2026John
When you’re interested in studying a family of functions, it can be useful to look at a differential equation that the functions solve. This is a theme I’ve written about several times, most recently here and here, but also three years ago here. Orthogonal polynomials are mathematically elegant as well as very useful in applications [1]. […] Junk solutions first appeared on John D. Cook.
- UltrasphericalAug 26, 2026John
When I hear the term ultraspherical I think of something extremely spherical. For example, a baseball is spherical, but a billiard ball is more spherical. Maybe a highly polished billiard ball is ultraspherical. Using this line of thought, the term ultraspherical polynomial is inexplicable. This is an example of the arcane terminology I wrote about recently. In […] Ultraspherical first appeared on
- Numerical (in)stability of recurrence relationsAug 25, 2026John
The previous post gave several examples of three-term recurrence relations for special functions. These relations can be computationally useful, but they have to be applied carefully. Several years ago I wrote a post on stable and unstable recurrences. In that post I show that the stability of the recurrence relation for Bessel functions produces depends […] Numerical (in)stability of recurrence r
- Three-term recurrencesAug 24, 2026John
There many examples of families of functions where each function can be computed as a linear combination of the two previous terms where a and b are functions of x but not on n. This is called a three-term recurrence formula. It’s amazing how often you can run into three-term recurrence formulas. There are theorems that give conditions […] Three-term recurrences first appeared on John D. Cook.
- The von Mises-Fisher distributionAug 24, 2026John
Probability density function must integrate to 1, and so if you know a density function up to a constant, the constant is determined. When you’re looking at a probability density f(x) for the first time, it helps to ignore the normalizing constant. Concentrate on the part of the function involving x and know that the normalizing […] The von Mises-Fisher distribution first appeared on John D. Cook.
- What exactly is modified about a modified Bessel function?Aug 23, 2026John
Special functions often have arcane names that not very helpful without some context. The previous post goes into some reasons for this. This post will expand on a point at the end of the post about “modified” functions. Things are given their names for reasons. Discovering those reasons may help you understand their motivation and […] What exactly is modified about a modified Bessel function? fir
- Why special function terminology is arcaneAug 23, 2026John
Special functions are special because they’re useful. They can also be shrouded in arcane terminology. These two facts are related. The more widely useful a function is, the more likely it is that the function will be discovered independently multiple times. Independent discoveries lead to varying definitions and notations. For example, there are two widely […] Why special function terminology is
- The difference orbit inclination makesAug 23, 2026John
Suppose you wanted to find the distance between Earth and Mars over time. To first approximation, both planets orbit the sun in elliptic orbits in the same plane. If you wanted to be more accurate, you’d need to take into account the fact that the orbit of Mars is tilted about 1.85° relative to the […] The difference orbit inclination makes first appeared on John D. Cook.
- Coming soonAug 22, 2026John
There’s a pizza shop near my home with a sign out front that says “Coming Soon.” When I drove by it this morning I thought about how you would model the time until an event happens that is “coming soon.” Suppose I look at the sign one day and guess how many days until the […] Coming soon first appeared on John D. Cook.
- How would you know whether an ancient culture had zero?Aug 21, 2026John
A few weeks ago I wrote about the number system used in labeling spreadsheet columns. Labels run from A through Z, then AA through AZ, etc. This looks a lot like base 26, but it’s not quite the same. It has no analog of zero. If Z were like zero, Y would be followed by […] How would you know whether an ancient culture had zero? first appeared on John D. Cook.
- AI-generated ASCII diagramsAug 20, 2026John
I like AI-generated ASCII diagrams. Because nobody would ask AI to generate ASCII diagrams, and so, it’s congruous. I like incongruity [1]. Aside from the incongruity of using a gazillion-parameter neural network to make 1970’s style ASCII art, ASCII diagrams have some uses. They’re absolutely tiny compared to image files. But more importantly they can […] AI-generated ASCII diagrams first appeare
- Big little hexagonAug 19, 2026John
A new paper just came out, The Maximum-Area Small Polygon Problem. The paper solves the problem of finding, for each n, the n-gon with diameter 1 and maximum area. For odd n, the solution is what you might expect: a regular n-gon. I would expect this to be the solution for even n as well, […] Big little hexagon first appeared on John D. Cook.
- The imbalance theoremAug 18, 2026John
The imbalance conjecture is now a theorem. James Alexander Schreib and Yousof Yavari posted a proof last week. What does the conjecture theorem say? Start with a graph G with no edge between two nodes of the same degree. Then for every edge, calculate the absolute value of the difference of the degree of each end. […] The imbalance theorem first appeared on John D. Cook.
- Mean distance to the sunAug 18, 2026John
Suppose you have a planet in an elliptical orbit around a star. The math is identical for any light object orbiting a heavy object, such as a moon or satellite orbiting a planet, but we’ll call the heavy object a star and the light object a planet. The center of the star is not quite […] Mean distance to the sun first appeared on John D. Cook.
- Proportion of 1s in a Hadamard matrixAug 17, 2026John
The first post in the recent series of posts on Hadamard matrices describes a way of constructing new Hadamard matrices from two other Hadamard matrices by taking their Kronecker product. Starting with a Hadamard matrix H0 and a Hadamard matrix G, you can construct a sequence of Hadamard matrices by Hn+1 = G ⊗ Hn for […] Proportion of 1s in a Hadamard matrix first appeared on John D. Cook.
- Probability of correcting errorsAug 15, 2026John
Error correcting codes are most simply described in terms of the errors they can certainly correct. For example, the Hadamard code used for the Mariner 9 probe to Mars encoded each 6-bit pixel to a 32-bit codeword in such a way that the original pixel could be recovered if no more than 7 bits were […] Probability of correcting errors first appeared on John D. Cook.
- Compressing a Hadamard matrixAug 15, 2026John
Hadamard matrices are in the news following the recent announcement of a newly discovered Hadamard matrix. I’ve written three posts on Hadamard matrices recently, one as a sort of introduction and two on applications: the error correcting code used in the Mariner 9 probe and constructing sphere packings. A Hadamard matrix is an orthogonal matrix […] Compressing a Hadamard matrix first appeared on
- Hadamard Codes and Sphere PackingAug 14, 2026John
Yesterday Levent Alpöge announced that he and his colleagues had discovered a new Hadamard matrix using Claude AI. That motivated a post I wrote this morning on how to construct Hadamard matrices. I mentioned in that post that these matrices arise in applications. This evening I gave an example, describing how NASA used a Hadamard […] Hadamard Codes and Sphere Packing first appeared on John D. Coo
- How NASA’s Mariner 9 probe encoded imagesAug 13, 2026John
NASA set Mariner 9 to photograph Mars in 1971. The images had to be encoded for transmission using an error-correcting code, otherwise they would be significantly corrupted when they were received on Earth. The images were encoded for transmission using a code based on Hadamard matrices, specifically a (32, 6, 16) Hadamard code. This means […] How NASA’s Mariner 9 probe encoded images first appear
- Constructing Hadamard matricesAug 13, 2026John
A Hadamard matrix is an orthogonal matrix whose entries are all either 1 or − 1. For example is a Hadamard matrix of order 2. True to Stigler’s law of eponymy, James Joseph Sylvester investigated Hadamard matrices before Jacques Hadamard. Sylvester saw how to bootstrap the example above into more examples. If H is a […] Constructing Hadamard matrices first appeared on John D. Cook.
- Cryptic but consistentAug 12, 2026John
Suppose you’ve never worked at the command line and you’re reading a book about the bash shell. You read that !$ is a shortcut to refer to the last word of the previous command. That little fact will almost certainly not stick in your head for a couple reasons. First, you probably see no need […] Cryptic but consistent first appeared on John D. Cook.
- Dogs and fat tailsAug 11, 2026John
I was reading a blog post on boat names because it was on Hacker News this morning. The post contained a link to a data set on dog names in NYC and I poked around the data a little. The top names were not at all what I expected, but then again this is limited […] Dogs and fat tails first appeared on John D. Cook.
- Manually unbreakable cryptographyAug 11, 2026John
Suppose you were able to go back in time, to an era before computers, and give someone contemporary cryptography. Encryption methods that are essentially unbreakable now would certainly be unbreakable then. But there’s a catch: not only do attackers not have computers, neither do users. Manual cryptography If you told someone about RSA encryption, for […] Manually unbreakable cryptography first ap
- Learning from historical mistakesAug 10, 2026John
The following extraordinary paragraph comes from Knuth’s TAOCP Volume 4A, right before the last set of exercises. Many of the exercises below ask a modern reader to find and/or to correct errors in the literature of bygone days. The point is not to gloat over how smart we are in the 21st century; the point […] Learning from historical mistakes first appeared on John D. Cook.
- Inverse differential equationsAug 10, 2026John
In science and engineering classes, you might describe a system using Newton’s laws and end up with a differential equation. You then solve the differential equation, analytically or numerically, to see how the solutions behave. You might also do the opposite, especially in a mathematics class: look at what differential equation a set of functions […] Inverse differential equations first appeared
- DNA and Bessel functionsAug 09, 2026John
I was reading a book on the history of the discovery of the structure of DNA [1] and was surprised by a few passing references to Bessel functions. According to Claude, When X-rays are diffracted by a helical structure, the resulting diffraction pattern breaks into a series of horizontal “layer lines.” Cochran, Crick, and Vand […] DNA and Bessel functions first appeared on John D. Cook.
- A simple range reduction methodAug 09, 2026John
At the end of my post on how not to calculate cosine I said that the first step in calculating cosine, particularly cosine of a large number, would be to do range reduction. This post will present a simple range reduction method by Cody and Waite that is adequate for moderately large arguments. If you […] A simple range reduction method first appeared on John D. Cook.