Sign up

John D. Cook

Not verified No WebSub updates No webmention support Not yet validated

Applied Mathematics Consulting

Public lists
davewiner/hackerNewsStars
Fetched

John D. Cook
Text • John

Empirical fractal

There’s a common saying in discussion of fractals that the length of a coastline depends on how small a device you use to measure it. I thought this was a hypothetical, say as applied to the steps in the construction of the Koch snowflake. But the saying has its roots in actually surveying. Lewis Fry […]

The post Empirical fractal first appeared on John D. Cook.

John D. Cook
Text • John

Phone words

I recently bought a copy of Los Alamos Rolodex, a book displaying business cards from Los Alamos Nation Labs from 1967 to 1978. You can find some examples of the cards here. One of the cards in the book is for Eugene Frank, President of B & F Instruments. His card lists his phone number […]

The post Phone words first appeared on John D. Cook.

John D. Cook
Text • John

Converting between cosine similarity and concentration ratio

I’ve written three posts on cosine similarity lately. The first looked at interpreting cosine similarity. The second looked at an approximation related to the first. The third looked at how ranking according to cosine similarity works better than cosine similarity itself. Normalized word vectors are points on a high dimensional sphere, and geometry in high […]

The post Converting between cosine similarity and concentration ratio first appeared on John D. Cook.

John D. Cook
Text • John

Coffee + milk ≠ latte

Yesterday I wrote about the canonical example of how vector embeddings of words add: “king” − “man” + “woman” ≈ “queen” This should be interpreted as saying that the word vector for king, minus the word vector for man, plus the word vector for woman, is in some sense close to the word vector for queen. This post will […]

The post Coffee + milk ≠ latte first appeared on John D. Cook.

John D. Cook
Text • John

Fibonacci product

The product of four consecutive Fibonacci numbers equals the product of two consecutive integers. For example, 3 × 5 × 8 × 13 = 39 × 40. I ran across this theorem in a note [1] that says “The product of any four consecutive Fibonacci numbers is twice a triangular number.” Since triangular numbers have […]

The post Fibonacci product first appeared on John D. Cook.

John D. Cook
Text • John

Simple approximation for spherical cap area

The previous post looked at how to interpret cosine similarity, or equivalently angles between word vectors. In a high-dimensional space, randomly chosen vectors are likely nearly perpendicular, and so relatively large angles, such as 50°, indicate very closely related words. Another way to look at this, as explained in the previous post, is that in […]

The post Simple approximation for spherical cap area first appeared on John D. Cook.

John D. Cook
Text • John

What counts as a large cosine similarity?

Machine learning represents words as vectors and measures the similarity of words by the angles between the vectors. For vectors x and y, where θ is the angle between the vectors, and so This is the cosine similarity between the words represented by x and y. Small angles have large cosines, and so words with larger cosine similarities […]

The post What counts as a large cosine similarity? first appeared on John D. Cook.

John D. Cook
Text • John

Guessing the meaning of a number

Suppose I give you an n-digit number and ask you what it represents. This seems impossible, and in theory it is impossible. But in practice it’s often possible. Apps on a phone may automatically interpret a 10-digit number as a phone number or a 16-digit number as a package tracking number. And very often these interpretations are […]

The post Guessing the meaning of a number first appeared on John D. Cook.

John D. Cook
Text • John

Bayesian OCR

The Greek letter β (beta) and the German letter ß (eszett) look similar, especially in some fonts. Now suppose an OCR program sees some character that could be a beta or could be an eszett. It could calculate some kind of distance between between the pixel pattern of the character and the pixel patterns of […]

The post Bayesian OCR first appeared on John D. Cook.

John D. Cook
Text • John

A 50-year-old computer-assisted proof

The idea of using computers to assist with proofs is not new. The first major computer-assisted proof was published in 1976, the proof of the four color theorem by Kenneth Appel and Wolfgang Haken. The authors reduced the proof of the four color theorem to verifying calculations on 1,834 configurations, each checked by a computer […]

The post A 50-year-old computer-assisted proof first appeared on John D. Cook.

John D. Cook
Text • John

AI is an intelligence multiplier

A rising tide may lift all boats, but the AI tide lifts some boats much more than others. By all accounts, the best programmers have had the biggest productivity boost from AI. And top tier mathematicians are using AI to settle long-standing mathematical conjectures. AI is a powerful tool, but tools don’t come to life […]

The post AI is an intelligence multiplier first appeared on John D. Cook.

John D. Cook
Text • John

The part of Navier-Stokes no one is talking about

Yesterday OpenAI announced a proof that settled a long-standing question about the Navier-Stokes equations from fluid dynamics. The announcement has created a lot of buzz, as one would expect. But there’s an aspect of OpenAI’s work that I haven’t seen anyone talk about: they posted a Lean 4 formal proof at the same time as […]

The post The part of Navier-Stokes no one is talking about first appeared on John D. Cook.

John D. Cook
Text • John

Navier-Stokes in the news

There are rumors that a long-standing math problem, one of the Millennium Prize problems, has been solved. The problem concerns technical properties of solutions to the Navier-Stokes equations [1], an equation that describe the dynamics of fluid flow. Popular accounts of the problem are often oversimplified and misleading. Some reports will speak of the problem […]

The post Navier-Stokes in the news first appeared on John D. Cook.

John D. Cook
Text • John

Ngram error rate

The Online Etymological Dictionary gives the following etymology for grok: grok (v.) “understand empathically,” 1961, an arbitrary formation by U.S. science fiction writer Robert A. Heinlein (1907-1988) in his book “Stranger in a Strange Land.” In the book it is a transliteration of a Martian word and is said to mean etymologically “to drink.” It attained […]

The post Ngram error rate first appeared on John D. Cook.

John D. Cook
Text • John

Proof of the rank-trace theorem

The previous post discussed the motivation for and application of the rank-trace theorem. This post will give a proof. Suppose A is a real symmetric matrix. The rank-trace inequality says where tr is the trace operator, the sum of the elements along the diagonal of the matrix. Terse proof Here’s the proof in a nutshell: diagonalize A […]

The post Proof of the rank-trace theorem first appeared on John D. Cook.

John D. Cook
Text • John

Computing a lower bound on matrix rank

Suppose you want to know the rank of an n × n matrix A, the number of linearly independent rows of A, or equivalently the number of linearly independent columns. There are at least three difficulties. Difficulties in computing rank First of all, rank is not a continuous function of a matrix. Since rank is an […]

The post Computing a lower bound on matrix rank first appeared on John D. Cook.

John D. Cook
Text • John

Hugging Face Easter Egg

NVIDIA has offered by buy Hugging Face for $12,930,300,000. 129303 is the Unicode code point for the Hugging Face emoj (U+1F917), which you can verify with the following Python code. >>> import unicodedata >>> 129303 == 0x1F917 True >>> unicodedata.name(chr(0x1F917)) 'HUGGING FACE' Related posts Prevent characters from displaying as emoji Unicode, Tolkien, and Privacy Unicode […]

The post Hugging Face Easter Egg first appeared on John D. Cook.

John D. Cook
Text • John

New RSA number factored

Eric Lu announced on X today that he has factored RSA-260, a number N with 260 digits (862 bits) that is the product of two large primes [1]. RSA numbers are challenge problems posed to gauge the security of RSA encryption, which rests on the difficulty of factoring large numbers [2]. The naming scheme is […]

The post New RSA number factored first appeared on John D. Cook.

John D. Cook
Text • John

Patented application of linear algebra

I just found out Brian Beckman and I got a patent on work we did for GSI Technology [1]. Nearly all the work I do is under an NDA, so I don’t often get a chance to talk about my projects. This work is public now that it’s in a patent; I suppose it has […]

The post Patented application of linear algebra first appeared on John D. Cook.

John D. Cook
Text • John

Making the unnecessary easier

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 […]

The post Making the unnecessary easier first appeared on John D. Cook.

John D. Cook
Text • John

Second solutions

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 […]

The post Second solutions first appeared on John D. Cook.

John D. Cook
Text • Wayne Joubert

What is the quality of software that AI writes?

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 […]

The post What is the quality of software that AI writes? first appeared on John D. Cook.

John D. Cook
Text • John

Junk solutions

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]. […]

The post Junk solutions first appeared on John D. Cook.

John D. Cook
Text • John

Ultraspherical

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 […]

The post Ultraspherical first appeared on John D. Cook.

John D. Cook
Text • John

Numerical (in)stability of recurrece relations

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 […]

The post Numerical (in)stability of recurrece relations first appeared on John D. Cook.

John D. Cook
Text • John

Three-term recurrences

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 […]

The post Three-term recurrences first appeared on John D. Cook.

John D. Cook
Text • John

The von Mises-Fisher distribution

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 post The von Mises-Fisher distribution first appeared on John D. Cook.

John D. Cook
Text • John

What exactly is modified about a modified Bessel function?

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 a reason. Discovering that reason helps you understand their motivation and […]

The post What exactly is modified about a modified Bessel function? first appeared on John D. Cook.

John D. Cook
Text • John

Why special function terminology is arcane

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 […]

The post Why special function terminology is arcane first appeared on John D. Cook.

John D. Cook
Text • John

The difference orbit inclination makes

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 post The difference orbit inclination makes first appeared on John D. Cook.