Feed john-d-cook John D. Cook

Favorite IconJohn D. Cook

Link https://www.johndcook.com/blog
Feed http://feeds.feedburner.com/TheEndeavour?format=xml
Updated 2025-04-19 04:46
Overpowered proof that π is transcendental
There is no polynomial with rational coefficients that evaluates to 0 at π. That is, π is a transcendental number, not an algebraic number. This post will prove this fact as a corollary of a more advanced theorem. There are proof that are more elementary and direct, but the proof given here is elegant. A […]The post Overpowered proof that π is transcendental first appeared on John D. Cook.
Beta approximation to binomial
It is well-known that you can approximate a binomial distribution with a normal distribution. Of course there are a few provisos … It is also well-known that you can approximate a beta distribution with a normal distribution as well. This means you could directly approximate a binomial distribution with a beta distribution. This is a […]The post Beta approximation to binomial first appeared on John D. Cook.
Query, then deidentify
Suppose you have a database of personally identifiable information (PII) and you want to allow someone else to query the data while protecting the privacy of the individuals represented by the data. There are two approaches: Deidentify, then query Query, then deidentify The first approach is to do whatever is necessary to deidentify the data—remove […]The post Query, then deidentify first appeared on John D. Cook.
Can you have confidence in a confidence interval?
“The only use I know for a confidence interval is to have confidence in it.” — L. J. Savage Can you have confidence in a confidence interval? In practice, yes. In theory, no. If you have a 95% confidence interval for a parameter θ, can you be 95% sure that θ is in that interval? […]The post Can you have confidence in a confidence interval? first appeared on John D. Cook.
The essence of chaos
Linear systems can show sensitive dependence on initial conditions, but they cannot be chaotic. Only nonlinear systems can be chaotic. George Datseris and Ulrich Parlitz explain this well in their book Nonlinear Dynamics: … Sensitive dependence is not sufficient for a definition of chaos. … the state space is first stretched and then folded within […]The post The essence of chaos first appeared on John D. Cook.
Luhn checksum algorithm
After writing the previous post on credit card numbers, I intended to link to a previous post that discussed credit card check sums. But I couldn’t find such a post. I’ve written about other kinds of checksums, such as the checksum scheme used in Vehicle Identification Numbers, but apparently I haven’t written about credit card […]The post Luhn checksum algorithm first appeared on John D. Cook.
What can you learn from a credit card number?
The first 4 to 6 digits of a credit card number are the bank identification number or BIN. The information needed to decode a BIN is publicly available, with some effort, and so anyone could tell from a credit card number what institution issued it, what bank it draws on, whether its a personal or […]The post What can you learn from a credit card number? first appeared on John D. Cook.
Tradeoff between alphabet size and word size
Literal alphabets Natural language alphabets are all within an order of magnitude of the size of the Roman alphabet. The Hebrew alphabet has a few less letters and Russian has a few more. The smallest alphabet I’m aware of is Hawaiian with 13 letters. Syllabaries are larger than alphabets, but not an order of magnitude […]The post Tradeoff between alphabet size and word size first appeared on John D. Cook.
How Albrecht Dürer drew an 11-sided figure
You cannot exactly construct an 11-sided regular polygon (called a hendecagon or an undecagon) using only a straight edge and compass. Gauss fully classified which regular n-gons can be constructed, and this isn’t one of them [1]. However, Albrecht Dürer [2] came up with a good approximate construction for a hendecagon. To construct an eleven-sided […]The post How Albrecht Dürer drew an 11-sided figure first appeared on John D. Cook.
Gold, silver, and bronze ratios
The previous post showed that if you inscribe a hexagon and a decagon in the same circle, the ratio of the sides of the two polygons is the golden ratio. After writing the post I wondered whether you could construct the silver ratio or bronze ratio in an analogous way. Metallic ratios To back up […]The post Gold, silver, and bronze ratios first appeared on John D. Cook.
A pentagon, hexagon, and decagon walk into a bar …
The new book A Panoply of Polygons cites a theorem Euclid (Proposition XIII.10) saying If a regular pentagon, a regular hexagon, and a regular decagon are inscribed in congruent circles, then their side lengths form a right triangle. This isn’t exactly what Euclid said, but it’s an easy deduction from what he did say. Here’s […]The post A pentagon, hexagon, and decagon walk into a bar … first appeared on John D. Cook.
A new trig identity
This evening I ran across a trig identity I hadn’t seen before. I doubt it’s new to the world, but it’s new to me. Let A, B, and C be the angles of an arbitrary triangle. Then sin² A + sin² B + sin² C = 2 + 2 cos A cos B cos C. […]The post A new trig identity first appeared on John D. Cook.
Piranhas and prime factors
The piranha problem says an event cannot be highly correlated with a large number of independent predictors. If you have a lot of strong predictors, they must predict each other, analogous to having too many piranhas in a small body of water: they start to eat each other. The piranha problem is subtle. It can […]The post Piranhas and prime factors first appeared on John D. Cook.
Density of safe primes
Sean Connolly asked in a comment yesterday about the density of safe primes. Safe primes are so named because Diffie-Hellman encryption systems based on such primes are safe from a particular kind of attack. More on that here. If q and p = 2q + 1 are both prime, q is called a Sophie Germain prime and p is a […]The post Density of safe primes first appeared on John D. Cook.
Redoing images in Midjourney
My son in law was playing around with Midjourney v5 and I asked him to try to redo some of the images I’ve made with DALL-E 2. Back in August i wrote a post about using DALL-E 2 to generate mnemonic images for memorizing the US presidents using the Major mnemonic system. To memorize that […]The post Redoing images in Midjourney first appeared on John D. Cook.
Bringing regex modifiers into the regex
Suppose you’re using a program that takes a regular expression as an argument. You didn’t get the match you expected, then you realize you’d like your search to be case-insensitive. If you were using grep you’d go back and add a -i flag. If you were writing a Perl script, you could add a /i […]The post Bringing regex modifiers into the regex first appeared on John D. Cook.
Double duals of polyhedra
The previous post mentioned the dual of a tetrahedron is another tetrahedron. The dual of a cube is an octahedron and the dual of an octahedron is a cube. And the dual of a dodecahedron is an icosahedron, and the dual of an icosahedron is a dodecahedron. So if you take the dual of a […]The post Double duals of polyhedra first appeared on John D. Cook.
Hints of regular solid duality
I was looking back at the book The Concrete Tetrahedron and wondered what would happen if I used the title as a prompt to DALL-E. Could I get it to create an image of a concrete tetrahedron? It seemed to understand concrete but not tetrahedron, which is a little surprising since tetrahedron is such a […]The post Hints of regular solid duality first appeared on John D. Cook.
How to turn an unkeyed hash into a keyed hash
Secure hash functions often do not take a key per se, but they can be used with a key. Adding a key to a hash is useful, for example, to prevent a rainbow table attack. There are a couple obvious ways to incorporate a key K when hashing a message M. One is to prepend […]The post How to turn an unkeyed hash into a keyed hash first appeared on John D. Cook.
First names and Bayes’ theorem
Is the woman in this photograph more likely to be named Esther or Caitlin? Yesterday Mark Jason Dominus published wrote about statistics on first names in the US from 1960 to 2021. For each year and state, the data tell how many boys and girls were given each name. Reading the data “forward” you could […]The post First names and Bayes’ theorem first appeared on John D. Cook.
Identifiable to man or machine?
Like the previous post, this post riffs on a photo [1] I stumbled on while looking for something else. Would it be easier to identify the man in this photo or the man whose photo appeared in the previous post, copied below. I think it would be easier for a human to recognize the person […]The post Identifiable to man or machine? first appeared on John D. Cook.
Privacy and tomography
I ran across the image below [1] when I was searching for something else, and it made me think of a few issues in data privacy. The green lights cut across the man’s body like tomographic imaging. No one of these green lines would be identifiable, but maybe the combination of the lines is. We […]The post Privacy and tomography first appeared on John D. Cook.
Engine coolant temperature symbol
My wife and I were talking about the engine coolant temperature symbol on our car dashboard yesterday. I said I expect there’s a Unicode code point for this symbol. Now I don’t think there is. But there is an ISO Standard name for the symbol. It’s part of ISO 7000: Graphical symbols for use on […]The post Engine coolant temperature symbol first appeared on John D. Cook.
Privacy implications of hashing data
Cryptographic hash functions are also known as one-way functions because given an input x, one can easily compute its hashed value f(x), but it is impractical to recover x from knowing f(x). However, if we know that x comes from a small universe of possible values, our one-way function can effectively become a two-way function, […]The post Privacy implications of hashing data first appeared on John D. Cook.
Topological sort
When I left academia [1] my first job was working as a programmer. I was very impressed by a new programmer we hired who hit the ground running. His first week he looked at some problem we were working on and said “Oh, you need a topological sort.” I’d never heard of a topological sort […]The post Topological sort first appeared on John D. Cook.
“We won’t sell your personal data, but …”
When a company promises not to sell your personal data, this promise alone doesn’t mean much. “We will not sell your personal data, but … We might get hacked. We might give it to a law enforcement or intelligence agency. We might share or trade your data without technically selling it. We might alter our […]The post “We won’t sell your personal data, but …” first appeared on John D. Cook.
Connecting the dots differently
A couple weeks ago I wrote about how H. A. Rey introduced a new way of looking at the constellations, making them look more like their names. That post used Leo as an example. This post looks at Boötes (The Herdsman) [1]. Here is the constellation using the connections indicated in the IAU star chart. […]The post Connecting the dots differently first appeared on John D. Cook.
Famous constants and the Gumbel distribution
The Gumbel distribution, named after Emil Julius Gumbel (1891–1966), is important in statistics, particularly in studying the maximum of random variables. It comes up in machine learning in the so-called Gumbel-max trick. It also comes up in other applications such as in number theory. For this post, I wanted to point out how a couple […]The post Famous constants and the Gumbel distribution first appeared on John D. Cook.
Strengthen Markov’s inequality with conditional probability
Markov’s inequality is very general and hence very weak. Assume that X is a non-negative random variable, a > 0, and X has a finite expected value, Then Markov’s inequality says that In [1] the author gives two refinements of Markov’s inequality which he calls Hansel and Gretel. Hansel says and Gretel says Related posts […]The post Strengthen Markov’s inequality with conditional probability first appeared on John D. Cook.
There’s a woset in my reposit
The other day I was talking with someone I met while I was doing my postdoc at Vanderbilt and Eric Schechter’s book Handbook of Analysis and its Foundations came up. Eric was writing that book while we were there. He kindly listed me in the acknowledgements for having reviewed a few pages of the book. […]The post There’s a woset in my reposit first appeared on John D. Cook.
Solid angle of a star
The apparent size of a distant object can be measured by projecting the object onto a unit sphere around the observer and calculating the area of the projected image. A unit sphere has area 4π. If you’re in a ship far from land, the solid angle of the sky is 2π steradians because it takes […]The post Solid angle of a star first appeared on John D. Cook.
Fixed points of the Fourier transform
This previous post looked at the hyperbolic secant distribution. This distribution has density and characteristic function sech(t). It’s curious that the density and characteristic function are so similar. The characteristic function is essentially the Fourier transform of the density function, so this says that the hyperbolic secant function, properly scaled, is a fixed point of […]The post Fixed points of the Fourier transform first appeared on John D. Cook.
Hyperbolic secant distribution
I hadn’t run into the hyperbolic secant distribution until I saw a paper by Peng Ding [1] recently. If C is a standard Cauchy random variable, then (2/π) log |C| has a hyperbolic secant distribution. Three applications of this distribution are given in [1]. Ding’s paper contains a plot comparing the density functions for the hyperbolic […]The post Hyperbolic secant distribution first appeared on John D. Cook.
Two-letter abbreviations.
Countries and regions have two letter abbreviations (ISO 3166-1) as do languages (ISO 639-1). So do chemical elements, US states, and books filed using the Library of Congress system. I was curious how many of the 676 possible two-letter combinations are used by the abbreviation systems above. About two thirds, not as many as I […]The post Two-letter abbreviations. first appeared on John D. Cook.
Interpolating rotations with SLERP
Naive interpolation of rotation matrices does not produce a rotation matrix. That is, if R1 and R2 are rotation (orthogonal) matrices and 0 < t < 1, then is not in general a rotation matrix. You can represent rotations with unit quaternions rather than orthogonal matrices (see details here), so a reasonable approach might be […]The post Interpolating rotations with SLERP first appeared on John D. Cook.
Shuffle product
The shuffle product of two words, w1 and w2, written w1 Ш w2, is the set of all words formed by the letters in w1 and w2, preserving the order of each word’s letters. The name comes from the analogy with doing a riffle shuffle of two decks of cards. For example, bcd Ш ae, […]The post Shuffle product first appeared on John D. Cook.
Prime numbers and Taylor’s law
The previous post commented that although the digits in the decimal representation of π are not random, it is sometimes useful to think of them as random. Similarly, it is often useful to think of prime numbers as being randomly distributed. If prime numbers were samples from a random variable, it would be natural to […]The post Prime numbers and Taylor’s law first appeared on John D. Cook.
The coupon collector problem and π
How far do you have to go down the decimal digits of π until you’ve seen all the digits 0 through 9? We can print out the first few digits of π and see that there’s no 0 until the 32nd decimal place. 3.14159265358979323846264338327950 It’s easy to verify that the remaining digits occur before the […]The post The coupon collector problem and π first appeared on John D. Cook.
Adding stars to constellations
Until yesterday, I was only aware of the traditional assignment of stars to constellations. In the comments to yesterday’s post I learned that H. A. Rey, best know for writing the Curious George books, came up with a new way of viewing the constellations in 1952, adding stars and connecting lines in order to make […]The post Adding stars to constellations first appeared on John D. Cook.
Plotting constellations
Suppose you wanted to write a program to plot constellations. This leads down some interesting rabbit trails. When you look up data on stars in constellations you run into two meanings of constellation. For example, Leo is a region of the night sky containing an untold number of stars. It is also a pattern of […]The post Plotting constellations first appeared on John D. Cook.
Alien astronomers and Benford’s law
In 1881, astronomer Simon Newcomb noticed something curious. The first pages in books of logarithms were dirty on the edge, while the pages became progressively cleaner in later pages. He inferred from this that people more often looked up the logarithms of numbers with small leading digits than with large leading digits. Why might this […]The post Alien astronomers and Benford’s law first appeared on John D. Cook.
Dutton’s Navigation and Piloting
This morning Eric Berger posted a clip from The Hunt for Red October as a meme, and that made me think about the movie. I watched Red October this evening, for the first time since around the time it came out in 1990, and was surprised by a detail in one of the scenes. I […]The post Dutton’s Navigation and Piloting first appeared on John D. Cook.
The NBA and MLB trees are isomorphic
An isomorphism is a structure-preserving function from one object to another. In the context of graphs, an isomorphism is a function that maps the vertices of one graph onto the vertices of another, preserving all the edges. So if G and H are graphs, and f is an isomorphism between G and H, nodes x […]The post The NBA and MLB trees are isomorphic first appeared on John D. Cook.
Numbering minor league baseball teams
Last week I wrote about how to number MLB teams so that the number n told you where they are in the league hierarchy: n % 2 tells you the league, American or National n % 3 tells you the division: East, Central, or West n % 5 is unique within a league/division combination. Here […]The post Numbering minor league baseball teams first appeared on John D. Cook.
John Conway’s mental factoring method and friends
There are tricks for determining whether a number is divisible by various primes, but many of these tricks have to be applied one at a time. You can make a procedure for testing divisibility by any prime p that is easier than having to carry out long division, but these rules are of little use […]The post John Conway’s mental factoring method and friends first appeared on John D. Cook.
Major League Baseball and number theory
The previous post took a mathematical look at the National Football League. This post will do the same for Major League Baseball. Like the NFL, MLB teams are organized into a nice tree structure, though the MLB tree is a little more complicated. There are 32 NFL teams organized into a complete binary tree, with […]The post Major League Baseball and number theory first appeared on John D. Cook.
A mathematical look at the NFL
This post will look at the National Football League through the lens of graph theory, topology, and binary numbers. The NFL has a very nice tree structure, which isn’t too surprising in light of the need to make tournament brackets. The NFL is divided into two conferences, the American Football Conference and the National Football […]The post A mathematical look at the NFL first appeared on John D. Cook.
How Mr. Benjamin squares numbers
This post is a sequel to the post How Mr. Bidder calculated logarithms published a few days ago. As with that post, this post is based on an excerpt from The Great Mental Calculators by Steven B. Smith. Smith’s book says Arthur Benjamin squares large numbers using the formula n² = (n + a)(n − […]The post How Mr. Benjamin squares numbers first appeared on John D. Cook.
Bounding derivatives of the sinc function
The sinc function is defined either as sin(x)/x or as sin(πx)/πx. We’ll use the former definition here because we’ll cite a paper that uses that definition. Here’s a plot of the sinc function and its first two derivatives. Thomas Grönwall proposed a problem to the American Mathematical Monthly in 1913 [1] bounding the derivatives of […]The post Bounding derivatives of the sinc function first appeared on John D. Cook.
Another Napoleon-like theorem
A little while back I wrote about Napoleon’s theorem for triangles. A little later I wrote about Van Aubel’s theorem, a sort of analogous theorem quadrilaterals. This post presents another analog of Napoleon’s theorem for quadrilaterals. Napoleaon’s theorem says that if you start with any triangle, and attach equilateral triangles to each side, the centroids […]The post Another Napoleon-like theorem first appeared on John D. Cook.
...9101112131415161718...