Suppose you have a cable of length 2s suspended from two poles of equal height a distance 2x apart. Assuming the cable hangs in the shape of a catenary, how much does it sag in the middle? If the...
https://www.johndcook.com/blog/2024/03/09/catenary-sag-approx/
Gnu Privacy Guard includes a way to encode binary files as plain ASCII text files, and turn these text files back into binary. This is intended as a way to transmit encrypted data, but it can be ...
https://www.johndcook.com/blog/2024/01/13/binary-to-text-to-binary/
The exponential sum page on this site draws a new image every day based on plugging the month, day, and year into a formula. Some of these images are visually appealing; I’ve had many people as...
https://www.johndcook.com/blog/2024/01/04/january-exponential-sums/
What factorial is closest to the square root of 2024 factorial? A good guess would be 1012, based on the idea that √(n!) might be near (n/2)!. This isn’t correct—the actual answer is 1112�...
https://www.johndcook.com/blog/2024/01/01/square-root-factorial/
A blog carnival is a round up of recent blog posts. The Carnival of Mathematics is a long-running carnival of blog posts on mathematical topics. This is the 222nd edition of the carnival. Facts a...
https://www.johndcook.com/blog/2023/12/02/222nd-carnival-of-mathematics/
Suppose you want to wrap Christmas lights around a tree trunk that we can approximate by a cylinder of radius r. You want to wrap lights around the tree in a helix, going up a distance h every ti...
I was looking at frequencies of pitches and saw something I hadn’t noticed before: F# and G have very nearly integer frequencies. To back up a bit, we’re assuming the A above middle C has fre...
Straight lines on a globe are not straight on a map, and straight lines on a map are not straight on a globe. A straight line on a globe is an arc of a great circle, the shortest path between two...
This post will define multisets and basic operations on multisets. We’ll view union, intersection, inclusion and sum each from four perspectives: Examples with words Example with prime factoriz...
Ellipses have been studied for over two thousand years, and so some of the terminology is ancient and sounds odd to modern ears. One such term is latus rectum. What is the latus rectum and does h...
As far as I know, all contemporary math libraries use the same branch cuts when extending elementary functions to the complex plane. It seems that the current conventions date back to Kahan’s p...
https://www.johndcook.com/blog/2022/09/06/branch-cuts-for-elementary-functions/
I had some errors in a recent blog post that might have been eliminated if I had programmatically generated the content of the post rather than writing it by hand. I rewrote the example in this p...
https://www.johndcook.com/blog/2022/09/05/literate-programming/
The previous post looked at the analog of the Pythagorean theorem on a sphere. This post looks at the law of cosines on a sphere. Yesterday we looked at triangles on a sphere with sides a and b m...
https://www.johndcook.com/blog/2022/08/24/law-of-cosines-on-a-sphere/
Given a random variable X, you often want to compute the probability that X will take on a value less than x or greater than x. Define the functions FX(x) = Prob(X ≤ x) and GX(x) = Prob(X > x) ...
Let f be a monotone, strictly convex function on a real interval I and let g be its inverse. For example, we could have f(x) = ex and g(x) = log x. Now suppose we round our results to N digits. T...
https://www.johndcook.com/blog/2022/08/05/stability-of-inverses/
James Gregory’s series for π is not so fast. It converges very slowly and so does not provide an efficient way to compute π. After summing half a million terms, we only get five correct decim...
What are Galois connections and what do they have to do with Galois theory? Galois connections are much more general than Galois theory, though Galois theory provided the first and most famous ex...
The previous post listed three posts I’d written before about images on the covers of math books. This post is about the image on the first edition of Dummit and Foote’s Abstract Algebra. Her...
When a math book has an intriguing image on the cover, it’s fun to get to the point in the book where the meaning of the image is explained. I have some ideas for book covers I’d like to writ...
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 clock...
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...
https://www.johndcook.com/blog/2022/07/06/dijkstra-extends-pythagoras/
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 ...
The Collatz conjecture, a.k.a. the 3n + 1 problem, a.k.a. the hailstone conjecture, asks whether the following sequence always terminates. Start with a positive integer n. If n is even, set n ←...
https://www.johndcook.com/blog/2021/07/27/polynomial-collatz/
I was watching one of Brian Douglas’ videos on control theory (Discrete Control #5) and ran into a simple derivation of an approximation I presented earlier. Back in April I wrote several post ...
https://www.johndcook.com/blog/2021/07/24/bilinear-exp-approximation/
Math and physics use Greek letters constantly, but seldom do they use letters from any other alphabet. The only Cyrillic letter I recall seeing in math is sha (Ш, U+0428) for the so-called Dirc ...
https://www.johndcook.com/blog/2021/06/23/hebrew-letters-in-math/
The previous post looked at Gray code, a way of encoding digits so that the encodings of consecutive integers differ in only bit. This post will look at how to compute the inverse of Gray code. T...
https://www.johndcook.com/blog/2020/09/08/inverse-gray-code/
Two polynomials p(x) and q(x) are said to be permutable if p(q(x)) = q(p(x)) for all x. It’s not hard to see that Chebyshev polynomials are permutable. First, Tn(x) = cos (n arccos(x)) where Tn...
https://www.johndcook.com/blog/2020/08/22/permutable-polynomials/
One of the things that makes numerical computation interesting is that it often reverses the usual conceptual order of things, using advanced math to compute things that are introduced earlier. H...
https://www.johndcook.com/blog/2020/08/03/conceptual-vs-numerical/
Courant & Hilbert is a classic applied math textbook, still in print nearly a century after the first edition came out. The actual title of the book is Methods of Mathematical Physics, but everyo...
If a function is smooth and has thin tails, it can be well approximated by sinc functions. These approximations are frequently used in applications, such as signal processing and numerical integr...
https://www.johndcook.com/blog/2020/06/01/sinc-approximation/