F
Feed Atlas
OPML directory + server-side RSS reader

johndcook.com

SiteRSSBlogs
Back

Latest posts

  • Intersecting spheres and GPS
    Apr 14, 2026John

    If you know the distance d to a satellite, you can compute a circle of points that passes through your location. That’s because you’re at the intersection of two spheres—the earth’s surface and a sphere of radius d centered on the satellite—and the intersection of two spheres is a circle. Said another way, one observation […] Intersecting spheres and GPS first appeared on John D. Cook.

  • Finding a parabola through two points with given slopes
    Apr 14, 2026John

    The Wikipedia article on modern triangle geometry has an image labeled “Artzt parabolas” with no explanation. A quick search didn’t turn up anything about Artzt parabolas [1], but apparently the parabolas go through pairs of vertices with tangents parallel to the sides. The general form of a conic section is ax² + bxy + cy² […] Finding a parabola through two points with given slopes first appeared

  • Mathematical minimalism
    Apr 13, 2026John

    Andrzej Odrzywolek recently posted an article on arXiv showing that you can obtain all the elementary functions from just the function and the constant 1. The following equations, taken from the paper’s supplement, show how to bootstrap addition, subtraction, multiplication, and division from the eml function. See the paper and supplement for how to obtain […] Mathematical minimalism first appeare

  • Lunar period approximations
    Apr 12, 2026John

    The date of Easter The church fixed Easter to be the first Sunday after the first full moon after the Spring equinox. They were choosing a date in the Roman (Julian) calendar to commemorate an event whose date was known according to the Jewish lunisolar calendar, hence the reference to equinoxes and full moons. The […] Lunar period approximations first appeared on John D. Cook.

  • The gap between Eastern and Western Easter
    Apr 12, 2026John

    Today is Orthodox Easter. Western churches celebrated Easter last week. Why are the Eastern and Western dates of Easter different? Is Eastern Easter always later than Western Easter? How far apart can the two dates be? Why the dates differ Easter is on the first Sunday after the first full moon in Spring [1]. East […] The gap between Eastern and Western Easter first appeared on John D. Cook.

  • Distribution of digits in fractions
    Apr 10, 2026John

    There’s a lot of mathematics just off the beaten path. You can spend a career in math and yet not know all there is to know about even the most basic areas of math. For example, this post will demonstrate something you may not have seen about decimal forms of fractions. Let p > 5 […] Distribution of digits in fractions first appeared on John D. Cook.

  • The Great Pyramid of Giza and the Speed of Light
    Apr 09, 2026John

    Saw a post on X saying that the latitude of the Pyramid of Giza is the same as the speed of light. I looked into this, expecting it to be approximately true. It’s exactly true in the sense that the speed of light in vacuum is 299,792,458 m/s and the line of latitude 29.9792458° N […] The Great Pyramid of Giza and the Speed of Light first appeared on John D. Cook.

  • Random hexagon fractal
    Apr 09, 2026John

    I recently ran across a post on X describing a process for creating a random fractal. First, pick a random point c inside a hexagon. Then at each subsequent step, pick a random side of the hexagon and create the triangle formed by that side and c. Update c to be the center of the new triangle […] Random hexagon fractal first appeared on John D. Cook.

  • Root prime gap
    Apr 09, 2026John

    I recently found out about Andrica’s conjecture: the square roots of consecutive primes are less than 1 apart. In symbols, Andrica’s conjecture says that if pn and pn+1 are consecutive prime numbers, then √pn+1 − √pn < 1. This has been empirically verified for primes up to 2 × 1019. If the conjecture is true, […] Root prime gap first appeared on John D. Cook.

  • A Three- and a Four- Body Problem
    Apr 08, 2026John

    Last week I wrote about the orbit of Artemis II. The orbit of Artemis I was much more interesting. Because Artemis I was unmanned, it could spend a lot more time in orbit. The Artemis I mission took 25 days while Artemis II will take 10 days. Artemis I took an unusual path, orbiting the […] A Three- and a Four- Body Problem first appeared on John D. Cook.

  • Toffoli gates are all you need
    Apr 07, 2026John

    Landauer’s principle gives a lower bound on the amount of energy it takes to erase one bit of information: E ≥ log(2) kB T where kB is the Boltzmann constant and T is the ambient temperature in Kelvin. The lower bound applies no matter how the bit is physically stored. There is no theoretical lower […] Toffoli gates are all you need first appeared on John D. Cook.

  • HIPAA compliant AI
    Apr 05, 2026John

    The best way to run AI and remain HIPAA compliant is to run it locally on your own hardware, instead of transferring protected health information (PHI) to a remote server by using a cloud-hosted service like ChatGPT or Claude. [1]. There are HIPAA-compliant cloud options, but they’re both restrictive and expensive. Even enterprise options are […] HIPAA compliant AI first appeared on John D. Cook.

  • Kalman and Bayes average grades
    Apr 04, 2026John

    This post will look at the problem of updating an average grade as a very simple special case of Bayesian statistics and of Kalman filtering. Suppose you’re keeping up with your average grade in a class, and you know your average after n tests, all weighted equally. m = (x1 + x2 + x3 + […] Kalman and Bayes average grades first appeared on John D. Cook.

  • Roman moon, Greek moon
    Apr 03, 2026John

    I used the term perilune in yesterday’s post about the flight path of Artemis II. When Artemis is closest to the moon it will be furthest from earth because its closest approach to the moon, its perilune, is on the side of the moon opposite earth. Perilune is sometimes called periselene. The two terms come from […] Roman moon, Greek moon first appeared on John D. Cook.

  • Hyperbolic version of Napier’s mnemonic
    Apr 03, 2026John

    I was looking through an old geometry book [1] and saw a hyperbolic analog of Napier’s mnemonic for spherical trigonometry. In hindsight of course there’s a hyperbolic analog: there’s a hyperbolic analog of everything. But I was surprised because I’d never thought of this before. I suppose the spherical version is famous because of its […] Hyperbolic version of Napier’s mnemonic first appeared on

  • Artemis II, Apollo 8, and Apollo 13
    Apr 02, 2026John

    The Artemis II mission launched yesterday. Much like the Apollo 8 mission in 1968, the goal is to go around the moon in preparation for a future mission that will land on the moon. And like Apollo 13, the mission will swing around the moon rather than entering lunar orbit. Artemis II will deliberately follow […] Artemis II, Apollo 8, and Apollo 13 first appeared on John D. Cook.

  • Pentagonal numbers are truncated triangular numbers
    Apr 01, 2026John

    Pentagonal numbers are truncated triangular numbers. You can take the diagram that illustrates the nth pentagonal number and warp it into the base of the image that illustrates the (2n − 1)st triangular number. If you added a diagram for the (n − 1)st triangular number to the bottom of the image on the right, you’d […] Pentagonal numbers are truncated triangular numbers first appeared on John D. C

  • Quantum Y2K
    Mar 31, 2026John

    I’m skeptical that quantum computing will become practical. However, if it does become practical before we’re prepared, the world’s financial system could collapse. Everyone agrees we should prepare for quantum computing, even those of us who doubt it will be practical any time soon. Quantum computers exist now, but the question is when and if […] Quantum Y2K first appeared on John D. Cook.

  • Morse code tree
    Mar 31, 2026John

    Peter Vogel posted the following image on X yesterday. The receive side of the coin is a decision tree for decoding Morse code. The shape is what makes this one interesting. Decision trees are typically not very compact. Each branch is usually on its own horizontal level, with diagonal lines going down from each node […] Morse code tree first appeared on John D. Cook.

  • An AI Odyssey, Part 3: Lost Needle in the Haystack
    Mar 27, 2026Wayne Joubert

    While shopping on a major e-commerce site, I wanted to get an answer to an obscure question about a certain product. Not finding the answer immediately on the product page, I thought I’d try clicking the AI shopping assistant helper tool to ask this question. I waited with anticipation for an answer I would expect […] An AI Odyssey, Part 3: Lost Needle in the Haystack first appeared on John D. Coo

  • Computing sine and cosine of complex arguments with only real functions
    Mar 27, 2026John

    Suppose you have a calculator or math library that only handles real arguments but you need to evaluate sin(3 + 4i). What do you do? If you’re using Python, for example, and you don’t have NumPy installed, you can use the built-in math library, but it will not accept complex inputs. >>> import math >>> […] Computing sine and cosine of complex arguments with only real functions first appeared on Jo

  • Lebesgue constants
    Mar 26, 2026John

    I alluded to Lebesgue constants in the previous post without giving them a name. There I said that the bound on order n interpolation error has the form where h is the spacing between interpolation points and δ is the error in the tabulated values. The constant c depends on the function f being interpolated, and to a […] Lebesgue constants first appeared on John D. Cook.

  • How much precision can you squeeze out of a table?
    Mar 26, 2026John

    Richard Feynman said that almost everything becomes interesting if you look into it deeply enough. Looking up numbers in a table is certainly not interesting, but it becomes more interesting when you dig into how well you can fill in the gaps. If you want to know the value of a tabulated function between values […] How much precision can you squeeze out of a table? first appeared on John D. Cook.

  • From Mendeleev to Fourier
    Mar 24, 2026John

    The previous post looked at an inequality discovered by Dmitri Mendeleev and generalized by Andrey Markov: Theorem (Markov): If P(x) is a real polynomial of degree n, and |P(x)| ≤ 1 on [−1, 1] then |P′(x)| ≤ n² on [−1, 1]. If P(x) is a trigonometric polynomial then Bernstein proved that the bound decreases from n² to n. Theorem […] From Mendeleev to Fourier first appeared on John D. Cook.

  • Mendeleev’s inequality
    Mar 24, 2026John

    Dmitri Mendeleev is best known for creating the first periodic table of chemical elements. He also discovered an interesting mathematical theorem. Empirical research led him to a question about interpolation, which in turn led him to a theorem about polynomials and their derivatives. I ran across Mendeleev’s theorem via a paper by Boas [1]. The […] Mendeleev’s inequality first appeared on John D.

  • Set intersection and difference at the command line
    Mar 23, 2026John

    A few years ago I wrote about comm, a utility that lets you do set theory at the command line. It’s a really useful little program, but it has two drawbacks: the syntax is hard to remember, and the input files must be sorted. If A and B are two sorted lists, comm A B […] Set intersection and difference at the command line first appeared on John D. Cook.

  • Embedded regex flags
    Mar 20, 2026John

    The hardest part of using regular expressions is not crafting regular expressions per se. In my opinion, the two hardest parts are minor syntax variations between implementations, and all the environmental stuff outside of regular expressions per se. Embedded regular expression modifiers address one of the environmental complications by putting the modifier in the regular expression […] Embedded r

  • A lesser-known characterization of the gamma function
    Mar 19, 2026John

    The gamma function Γ(z) extends the factorial function from integers to complex numbers. (Technically, Γ(z + 1) extends factorial.) There are other ways to extend the factorial function, so what makes the gamma function the right choice? The most common answer is the Bohr-Mollerup theorem. This theorem says that if f: (0, ∞) → (0, […] A lesser-known characterization of the gamma function first app

  • Tighter bounds on alternating series remainder
    Mar 18, 2026John

    The alternating series test is part of the standard calculus curriculum. It says that if you truncate an alternating series, the remainder is bounded by the first term that was left out. This fact goes by in a blur for most students, but it becomes useful later if you need to do numerical computing. To […] Tighter bounds on alternating series remainder first appeared on John D. Cook.

  • Powers don’t clear fractions
    Mar 17, 2026John

    If a number has a finite but nonzero fractional part, so do all its powers. I recently ran across a proof in [1] that is shorter than I expected. Theorem: Suppose r is a real number that is not an integer, and the decimal part of r terminates. Then rk is not an integer for any positive integer […] Powers don’t clear fractions first appeared on John D. Cook.