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 2024-11-22 04:47
Adding a tiny trap to stop chaos
The tent map is a famous example of a chaotic function. We will show how a tiny modification of the tent maps retains continuity of the function but prevents chaos. The tent map is the function f: [0, 1] → [0, 1] defined by This map has an unstable fixed point at x0 = 2/3. […]The post Adding a tiny trap to stop chaos first appeared on John D. Cook.
Ducci sequences
Pick four integers a, b, c, and d. Now iterate the procedure that takes these four integers to |b – a|, |c – b|, |d – c|, |a – d| You could think of the four integers being arranged clockwise in a circle, taking the absolute value of difference between each number and its neighbor […]The post Ducci sequences first appeared on John D. Cook.
Dijkstra extends Pythagoras
Suppose a triangle has sides a, b, and c. Label the angles opposite these three sides α, β, and γ respectively. Edsger Dijkstra published (EWD975) a note proving the following extension of the Pythagorean theorem: sgn(α + β – γ) = sgn(a² + b² – c²). Here the sgn function is -1, 0, or 1 […]The post Dijkstra extends Pythagoras first appeared on John D. Cook.
Phi Phi
I was reading something this afternoon and ran across φ(φ(m)) and thought that was unusual. I often run across φ(m), the number of positive integers less than m and relative prime to m, but don’t often see Euler’s phi function iterated. Application of φ∘φ This section will give an example of a theorem where φ(φ(m)) […]The post Phi Phi first appeared on John D. Cook.
Speculation on new SI prefixes
The SI prefixes giga and tera were adopted in 1960. The prefixes eta and peta were adopted in 1975, and zetta and yotta were adopted in 1991. Following this 15-year cadence, we should have adopted a few more prefixes by now. If we ever do introduce new prefixes, what might they be? The latest prefixes […]The post Speculation on new SI prefixes first appeared on John D. Cook.
NASA and conformal maps
A couple years ago I wrote about how NASA was interested in regions bounded by curves of the form For example, here’s a plot for A = 2, B = 1, α = 2.5 and β = 6. That post mentioned a technical report from NASA that explains why these shapes are important in application, […]The post NASA and conformal maps first appeared on John D. Cook.
Transformations of Olympic rings
The previous post gave the details of how Möbius transformations m(z) = (az + b)/(cz + d) transform circles. The image of a circle under a Möbius transformation is either a line or a circle, and in our examples the image will always be a circle. We start with an approximation of the Olympic rings […]The post Transformations of Olympic rings first appeared on John D. Cook.
Circles and lines under a Möbius transformation
This post will revisit a previous post in more detail. I’ve written before about how Möbius transformations map circles and lines to circles and lines. In this post I’d like to explore how you’d calculate which circle or line a given circle or line goes to. Given an equation of a line or circle, what […]The post Circles and lines under a Möbius transformation first appeared on John D. Cook.
Reciprocal of a circle
Let C be a circle in the complex plane with center c and radius r. Assume C does not pass through the origin. Let f(z) = 1/z. Then f(C) is also a circle. We will derive the center and radius of f(C) in this post. *** Our circle C is the set of points z satisfying […]The post Reciprocal of a circle first appeared on John D. Cook.
Computing zeta at even numbers
Last year I wrote several posts about computing ζ(3) where ζ is the Riemann zeta function. For example, this post. It happens that ζ can be evaluated in closed form at positive even arguments, but there’s still a lot of mystery about zeta at positive odd arguments. There’s a way to derive ζ(2n) using contour […]The post Computing zeta at even numbers first appeared on John D. Cook.
Constructive Picard
The previous post concerned the function h(z) = exp(-1/(1 – z² )). We said that the function is badly behaved near -1 and 1. How badly? The function has essential singularities at -1 and 1. This means that not only does h blow up near these points, it blows up spectacularly. Picard’s theorem says that […]The post Constructive Picard first appeared on John D. Cook.
No analytic bump
The word “smooth” in mathematics usually means infinitely differentiable. Occasionally the word is used to mean a function has as many derivatives as necessary, but without being specific about how many derivatives that is. A function is analytic if it has a convergent power series representation at every point of its domain. An analytic function […]The post No analytic bump first appeared on John D. Cook.
Bump functions
A bump function is a smooth (i.e. infinitely differentiable) function that is positive on some open interval (a, b) and zero outside that interval. I mentioned bump functions a few weeks ago and discussed how they could be used to prevent clicks in radio transmissions. Today I ran into a twitter thread that gave a […]The post Bump functions first appeared on John D. Cook.
The quality of an RNG depends on the application
A random number generator can be good for some purposes and not for others. This isn’t surprising given the fundamentally impossible task such generators are supposed to perform. Technically a random number generator is a pseudo random number generator because it cannot produce random numbers. But random is as random does, and for many purposes […]The post The quality of an RNG depends on the application first appeared on John D. Cook.
Numerically evaluating a theta function
Theta functions pop up throughout pure and applied mathematics. For example, they’re common in analytic number theory, and they’re solutions to the heat equation. Theta functions are analogous in some ways to trigonometric functions, and like trigonometric functions they satisfy a lot of identities. This post will comment briefly on an identity that makes a […]The post Numerically evaluating a theta function first appeared on John D. Cook.
Illegible work
When James Scott uses the word legible, he doesn’t refer to handwriting that is clear enough to read. He uses the word more broadly to mean something that is easy to classify, something that is bureaucrat-friendly. A thing is illegible if it is hard to pigeonhole. I first heard the term from Venkatesh Rao’s essay […]The post Illegible work first appeared on John D. Cook.
Length of periods in the (infinite) periodic table
A few days ago I wrote about what the periodic table would look like if we extended it, assuming the patterns that hold for known elements continue to hold. That post reported that the number of elements in nth period works out to There’s a simpler expression for Pn: Here ⌊x⌋ is the largest integer […]The post Length of periods in the (infinite) periodic table first appeared on John D. Cook.
Doubly periodic but not analytic
A sine wave is the canonical periodic function, so an obvious way to create a periodic function of two variables would be to multiply two sine waves: f(x, y) = sin(x) sin(y) This function is doubly periodic: periodic in the horizontal and vertical directions. Now suppose you want to construct a doubly periodic function of […]The post Doubly periodic but not analytic first appeared on John D. Cook.
Letter-like Unicode symbols
Unicode provides a way to distinguish symbols that look alike but have different meanings. We can illustrate this with the following Python code. import unicodedata as u for pair in [('K', 'K'), ('Ω', 'Ω'), ('ℵ', 'א')]: for c in pair: print(format(ord(c), '4X'), u.bidirectional(c), u.name(c)) This produces 4B L LATIN CAPITAL LETTER K 212A L KELVIN […]The post Letter-like Unicode symbols first appeared on John D. Cook.
Periodic table of abbreviations
I just updated my earlier post on chemical element abbreviations by adding a table to visualize the groupings, a sort of periodic table of element abbreviations. See that post for details. First letter First two letters First letter and next consonant Initials of first and second syllables Initials of first and third syllables First and […]The post Periodic table of abbreviations first appeared on John D. Cook.
Continued fractions as matrix products
Let pn / qn be the nth convergent of a continued fraction: Then Source: Julian Havil. The Irrationals. p. 212. Related posts Calendars and continued fractions Continued fractions of square roots Normal hazard continued fractionThe post Continued fractions as matrix products first appeared on John D. Cook.
Greek letter paradox
The Greek letter paradox is seeing the same symbol in two contexts and assuming it means the same thing. Maybe it’s used in many contexts, but I first heard it in the context of comparing statistical models. I used the phrase in my previous post, looking at α exp(5t) + β t exp(5t) and α […]The post Greek letter paradox first appeared on John D. Cook.
Double roots and ODEs
This post will resolve a sort of paradox. The process of solving a difference or differential equation is different when the characteristic equation has a double root. But intuitively there shouldn’t be much difference between having a double root and having two roots very close together. I’ll first say how double roots effect finding solutions […]The post Double roots and ODEs first appeared on John D. Cook.
Difference equations and differential equations
Difference equations are very much analogous to differential equations. Difference equations are more elementary, but differential equations are more familiar. It seems odd to use a more advanced thing to explain a simpler thing, like saying a quartet is a symphony orchestra with only four instruments. But if for some reason you managed to become […]The post Difference equations and differential equations first appeared on John D. Cook.
Generating functions for polynomial sequences
The previous post looked at a generating function for a specific polynomial sequence. This post will look at generating functions for polynomial sequences in general. (There’s an alternating term in the previous post that isn’t polynomial, but we’ll address that too.) The starting point for this post is a simple observation: If we let xD […]The post Generating functions for polynomial sequences first appeared on John D. Cook.
Generating noble gases
The previous post discussed what the periodic table would look like if it could be extended indefinitely and if certain patterns in the actual table continued to hold. In particular, the last element of each period would have atomic number and so we could call the Zn in the equation above noble numbers, atomic numbers […]The post Generating noble gases first appeared on John D. Cook.
Infinite periodic table
All the chemical elements discovered or created so far follow a regular pattern in how their electrons are arranged: the nth shell contains up to 2n – 1 suborbitals that each contain up to two electrons. For a given atomic number, you can determine how its electrons are distributed into shells and suborbitals using the […]The post Infinite periodic table first appeared on John D. Cook.
A footnote to year share
A couple weeks ago I wrote a post about the year share component of calculating the day of the week. To calculate the day of the week, you need to add the day of the week, a constant for the month, and the year share. Calculating year share is not that hard, but it’s the […]The post A footnote to year share first appeared on John D. Cook.
Inverse tetrahedral numbers
The previous post looked at the tetrahedral numbers: 1, 4, 10, 20, 35, … We could invert the process of creating tetrahedral numbers and ask for what n is a given number the nth tetrahedral number. So the inverse of 1 is 1, the inverse of 4 is 2, the inverse of 10 is etc. […]The post Inverse tetrahedral numbers first appeared on John D. Cook.
General tetrahedral numbers
Start with a list of ones: 1, 1, 1, 1, 1, … Taking the partial sums of this sequence gives consecutive numbers. That is, the nth number of the new series is the sum of the first n terms of the previous series. 1, 2, 3, 4, 5, … If we take partial sums again, […]The post General tetrahedral numbers first appeared on John D. Cook.
Visualizing C operator precedence
Here’s an idea for visualizing C operator precedence. You snake your way through the diagram starting from left to right. Operators at the same precedence level are on the same horizontal level. Following the arrows for changing directions, you move from left-to-right through the operators that associate left-to-right and you move right-to-left through the operators […]The post Visualizing C operator precedence first appeared on John D. Cook.
My interview in SIAM News
Just posted in SIAM News: A Conversation with Mathematical Consultant John D. Cook By Krešimir JosićThe post My interview in SIAM News first appeared on John D. Cook.
Numeric distance vs geographic distance in zip codes
If two zip codes numbers are close, are the regions they represent close? How much can you tell about how far apart two regions are by comparing their zip codes? (Zip codes are US postal codes. The name is an acronym for “Zone Improvement Plan” and was introduced in 1963.) To investigate this, I looked […]The post Numeric distance vs geographic distance in zip codes first appeared on John D. Cook.
Zip codes, geocodes, and Hilbert curves
You might think that if zip codes are close, then the regions they represent are close. Or that if zip codes are consecutive, then their regions touch. Neither of these are true. I explore how far they are from being true in the next post. But these statements could have been true [1]. It’s possible […]The post Zip codes, geocodes, and Hilbert curves first appeared on John D. Cook.
Conspicuously missing data
I was working on a report for a client this afternoon when I remembered this comic from Spiked Math. I needed to illustrate the point that revealing information about one person or group can reveal information on other people or other groups. If you give your genetic information to a company, for example, you also […]The post Conspicuously missing data first appeared on John D. Cook.
How to memorize the ASCII table
Before discussing how you could memorize an table of ASCII characters and numeric values, I should say a little about why you might do so. One reason is simply for the challenge. It’s more doable than it may sound. It’s also useful information, though it’s debatable whether it’s worth memorizing. YMMV. There was a time […]The post How to memorize the ASCII table first appeared on John D. Cook.
Harmonic e
Douglas Hofstadter discovered that the 8th harmonic number equals e. OK, not really. The following equation cannot possibly be true because the left side is rational and the right side is irrational. However, Hofstadter showed that the equation does hold if you carry all calculations out to three decimal places. 1.000 0.500 0.333 0.250 0.200 […]The post Harmonic e first appeared on John D. Cook.
Voiced and unvoiced consonants and digits
The latest episode of The History of English Podcast discusses the history of pronunciation changes in the Elizabethan period. The episode has a lot to say about the connections between voiced and unvoiced pairs of consonants, and the circumstances under which a consonant might change from voiced to unvoiced and vice versa. The major mnemonic […]The post Voiced and unvoiced consonants and digits first appeared on John D. Cook.
Year share
This post will be about psychology as much as math, looking at a number of algorithms for mentally calculating the same function. The most difficult part of mentally computing days of the week is computing ⌊5y/4⌋ % 7 where y is the last two digits of a year. This quantity is called the year share […]The post Year share first appeared on John D. Cook.
Decoding a grid square
I saw a reference last night to the grid square EL29fx and wanted to figure out where that is. There are many programs that will do this for you, but I wanted to do it by hand. I wrote about how grid squares work a year ago, but I was rusty on the details, so […]The post Decoding a grid square first appeared on John D. Cook.
Exponential of a line
Draw a line in the complex plane. What is the image of that line when you apply the exponential function? A line through w with direction z is the set of points w + tz where w and z are complex and t ranges over the real numbers. The image of this line is exp(w+ […]The post Exponential of a line first appeared on John D. Cook.
Discrete derivatives
If you’ve taken calculus, and someone asks you what the derivative of x5 is, you can say without hesitation that it’s 5x4. Now suppose they come back and say, “I’m sorry. I forgot to give you any context. Here x5 is a polynomial in the field of 343 elements.” It turns out that this additional […]The post Discrete derivatives first appeared on John D. Cook.
Chemical element abbreviation patterns
I’ve wondered occasionally about the patterns in how chemical elements are abbreviated. If you don’t know the abbreviation for an element, is there a simple algorithm that would let you narrow the range of possibilities or improve your odds at guessing? Here’s a survey of how the elements are abbreviated. Latin and German The elements […]The post Chemical element abbreviation patterns first appeared on John D. Cook.
Mental hash function
A few years ago I wrote about Manual Blum’s proposed method for mentally computing a secure hash function. He proposed using this method as a password manager, using the hash of a web site’s name as the password for the site. I first wrote about Blum’s method on the Heidelberg Laureate Forum blog, then wrote […]The post Mental hash function first appeared on John D. Cook.
Sampling with replacement until you’ve seen everything
Suppose you have a standard deck of 52 cards. You pull out a card, put it back in the deck, shuffle, and pull out another card. How long would you expect to do this until you’ve seen every card? Here’s a variation on the same problem. Suppose you’re a park ranger keeping data on tagged […]The post Sampling with replacement until you’ve seen everything first appeared on John D. Cook.
Tool recursion
“Literature about Lisp rarely resists that narcissistic pleasure of describing Lisp in Lisp.” — Christian Queinnec, Lisp in Small Pieces Applying software development tools to themselves has a dark side and a light side. There’s a danger of becoming obsessed with one’s tools and never getting around to using them. If it’s your job […]The post Tool recursion first appeared on John D. Cook.
New Twitter account: ElementFact
I started a new Twitter account this morning: @ElementFact. I’m thinking the account will post things like scientific facts about each element but also some history around how the element was discovered and named and other lore associated with the element. We’ll see how this goes. I’ve started many Twitter accounts over the years. Some […]The post New Twitter account: ElementFact first appeared on John D. Cook.
Approximating a golden spiral with circular arcs
The previous post included this image of a logarithm spiral passing through the corners of squares in a sequence of golden rectangles. The portion of the spiral in each square looks like a quarter of a circle. How well would circular arcs approximate the spiral? Very well. Here’s a plot. The circular arc inside the […]The post Approximating a golden spiral with circular arcs first appeared on John D. Cook.
Logarithmic spiral
I’ve seen an image similar to the following many times, but I don’t recall any source going into detail regarding how the spiral is constructed. This post will do just that. The previous post constructed iterated golden rectangles. We start with a golden rectangle and imagine chopping of first the blue, then the green, then […]The post Logarithmic spiral first appeared on John D. Cook.
Iterated golden rectangles in detail
I’ve seen the illustration of nesting golden rectangles many times, but I’ve never seen a presentation go into much detail. This post will go into more detail than usual, including Python code. Start with a golden rectangle in landscape mode. We’ll plot our rectangle with the lower left corner at the origin and the upper […]The post Iterated golden rectangles in detail first appeared on John D. Cook.
...13141516171819202122...