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 08:17
Theory, practice, and integration
Theory and practice are both important. As Donald Knuth put it, If you find that you’re spending almost all your time on theory, start turning some attention to practical things; it will improve your theories. If you find that you’re spending almost all your time on practice, start turning some attention to theoretical things; it […]The post Theory, practice, and integration first appeared on John D. Cook.
Information loss and entropy
John Baez, Tobias Fritz, and Tom Leinster wrote a nice paper [1] that shows Shannon entropy is the only measure of information loss that acts as you’d expect, assuming of course you have the right expectations. See their paper for all the heavy lifting. All I offer here is an informal rewording of the hypotheses. […]The post Information loss and entropy first appeared on John D. Cook.
Partition symmetry
Let p(M, N, n) be the number of partitions of the integer n into at most M parts, each containing integers at most N. Then p(M, N, n) = p(N, M, n). That is, you can swap the size of the partition multisets and the upper bound on the elements in the multisets. For example, […]The post Partition symmetry first appeared on John D. Cook.
Numbering the branches of the Lambert W function
The previous post used the Lambert W function to solve an equation that came up in counting partitions of an integer. The first solution found didn’t make sense in context, but another solution, one on a different branch, did. The default branch k = 0 wasn’t what we were after, but the branch k = […]The post Numbering the branches of the Lambert W function first appeared on John D. Cook.
Solving equations with Lambert’s W function
In the previous post we wanted to find a value of n such that f(n) = 1012 where and we took a rough guess n = 200. Turns out f(200) ≈ 4 × 1012 and that was good enough for our purposes. But what if we wanted to solve f(n) = x accurately? We will […]The post Solving equations with Lambert’s W function first appeared on John D. Cook.
Estimating the number of integer partitions
Last week I wrote a few posts that included code that iterated over all partitions of a positive integer n. See here, here, and here. How long would it take these programs to run for large n? For this post, I’ll focus just on how many partitions there are. It’s interesting to think about how […]The post Estimating the number of integer partitions first appeared on John D. Cook.
Vector spaces and subspaces over finite fields
A surprising amount of linear algebra doesn’t depend on the field you’re working over. You can implicitly assume you’re working over the real numbers R and prove all the basic theorems—say all the theorems that come before getting into eigenvalues in a typical course—and all or nearly all of the theorems remain valid if you swap […]The post Vector spaces and subspaces over finite fields first appeared on John D. Cook.
Mathematical plot twist: q-binomial coefficients
The simplest instance of a q-analog in math is to replace a positive integer n by a polynomial in q that converges to n as q → 1. Specifically, we associate with n the polynomial [n]q = 1 + q + q² + q³ + … + qn-1. which obviously converges to n when q → 1. […]The post Mathematical plot twist: q-binomial coefficients first appeared on John D. Cook.
Another pentagonal number theorem
An earlier post presented Euler’s pentagonal number theorem. This post presents a similar theorem by N. J. Fine developed two centuries later. Define the jth pentagonal number by Pj = j(3j – 1) / 2 where j can be any integer, e.g. j can be negative. Theme Let De(n) is the number of distinct partitions […]The post Another pentagonal number theorem first appeared on John D. Cook.
Odd parts and distinct parts
The previous post looked at a result of Euler regarding even and odd distinct partitions. This post will illustrate a related theorem by Euler. Definitions A partition of a positive integer n is a way of writing n as the sum of positive integers, without distinguishing the order of the terms, only the multi-set of […]The post Odd parts and distinct parts first appeared on John D. Cook.
Partitions and Pentagons
This post will present a remarkable theorem of Euler which makes a connection between integer partitions and pentagons. Partitions A partition of an integer n is a way of writing n as a sum of positive integers. For example, there are seven unordered partitions of 5: 5 4 + 1 3 + 2 3 + […]The post Partitions and Pentagons first appeared on John D. Cook.
Rising and falling powers
I’ve mentioned rising powers several times recently. They come up in practice fairly often. Sometimes you see falling powers as well, and there’s a simple symmetry between the two. There are multiple ways to denote rising powers, and lately I’ve used the Pochhammer notation (x)k because it’s easy to type in HTML without having to […]The post Rising and falling powers first appeared on John D. Cook.
Three kinds of confluence
We say someone is fluent in a language if their words flow easily. The word fluent comes from the Latin fluere which means to flow. We say things are confluent if they flow together, such as the confluence of two streams. This post will give three examples of the use of confluent in math and […]The post Three kinds of confluence first appeared on John D. Cook.
Three error function series
A common technique for numerically evaluating functions is to use a power series for small arguments and an asymptotic series for large arguments. This might be refined by using a third approach, such as rational approximation, in the middle. The error function erf(x) has alternating series on both ends: its power series and asymptotic series […]The post Three error function series first appeared on John D. Cook.
A more powerful alternating series theorem
In application you often truncate an infinite series to give a practical approximation. Ideally you’d like to know how accurate the approximation is. It would be even better to know the sign of the error of the approximation. Alternating series let you do this. But some forms of the alternating series theorem leave money on […]The post A more powerful alternating series theorem first appeared on John D. Cook.
Gamma distribution tail probability approximation
This post will approximate of the tail probability of a gamma random variable using the heuristic given in the previous post. The gamma distribution Start with the integral defining Γ(a). Divide the integrand by Γ(a) so that it integrates to 1. This makes the integrand into a probability density, and the resulting probability distribution is […]The post Gamma distribution tail probability approximation first appeared on John D. Cook.
The 1/e heuristic
The previous post looked at the FWHM (full width at half maximum) technique for approximating integrals, applied to the normal distribution. This post is analogous, looking at the 1/e heuristic for approximating integral. We will give an example in this post where the heuristic works well. The next post will give an example where the […]The post The 1/e heuristic first appeared on John D. Cook.
Simple normal distribution tail estimate
A very common task in probability and statistics is to estimate the probability of a normal random variable taking on a value larger than a given value x. By shifting and scaling we can assume our normal random variable has mean 0 and variance 1. This means we need to approximate the integral We are […]The post Simple normal distribution tail estimate first appeared on John D. Cook.
Marden’s amazing theorem
The previous post was a warmup for this post. It gave an example of the theorem that if p is a polynomial, the roots of p′ lie inside the convex hull of the roots of p. If p is a cubic polynomial, we can say much more. Suppose p(z) is a polynomial with three distinct […]The post Marden’s amazing theorem first appeared on John D. Cook.
Convex hull of zeros
There’s a well-known theorem in complex analysis that says that if p is a polynomial, then the zeros of its derivative p′ lie inside the convex hull of the zeros of p. The convex hull of a set of points is the smallest convex set containing those points. This post gives a brief illustration of […]The post Convex hull of zeros first appeared on John D. Cook.
Escaping the unit disk
Hypergeometric functions are defined in terms of their power series representation. This power series converges inside the unit circle and diverges outside. The functions extend to most [1] of the complex plane, and do so in a computationally nice way. Analytic continuation is often sort of existential: we prove that it can be done, but […]The post Escaping the unit disk first appeared on John D. Cook.
Raabe’s convergence test
The ratio test for the convergence of a series is inconclusive if the ratio of consecutive terms converges to 1. There are more advanced variations on the ratio test, such as Raabe’s test than may succeed when the basic ratio test fails. For example, consider the hypergeometric function F(11, 3; 21; z) with parameters taken […]The post Raabe’s convergence test first appeared on John D. Cook.
Hypergeometric equation
I’ve asserted numerous times here that hypergeometric functions come up very often in applied math, but I haven’t said why. This post will give one reason why. One way to classify functions is in terms of the differential equations they satisfy. Elementary functions satisfy simple differential equations. For example, the exponential function satisfies y′ = […]The post Hypergeometric equation first appeared on John D. Cook.
It seemed like a good idea at the time
“Things are the way they are because they got that way … one logical step at a time.” — Gerald Weinberg English spelling is notoriously difficulty. It is the result of decisions that, while often unfortunate, were not unreasonable at the time. Sometimes pronunciation simplified but spelling remained unchanged. For example, originally all the letters […]The post It seemed like a good idea at the time first appeared on John D. Cook.
Fractions in Unicode
There are Unicode characters for a few fractions, such as ½. This looks a little better than 1/2, depending on the context. Here’s the Taylor series for log(1 + x) written in pure HTML: log(1 + x) = x – ½x² + ⅓x³ – ¼x⁴ + ⅕x⁵ – ⋯ See this post for how the […]The post Fractions in Unicode first appeared on John D. Cook.
Number sets in HTML and Unicode
When I started blogging I was very cautious about what characters I used because browsers often didn’t have font support for uncommon characters. Things have changed since then and I’ve gotten less cautious. Nobody has complained, so I assume readers are seeing the characters I intend them to see. There are Unicode characters for sets […]The post Number sets in HTML and Unicode first appeared on John D. Cook.
Unicode superscripts and subscripts
There are alternatives to using <sup> and <sub> tags for superscripts and subscripts in HTML. These alternatives may look better, depending on context, and they can be used in plain (Unicode) text files where HTML markup isn’t available. Superscripts When I started blogging I would use <sup>2</sup> and <sup>3</sup> for squares and cubes. Then somewhere […]The post Unicode superscripts and subscripts first appeared on John D. Cook.
Connections
One of my favorite things in math is connecting together things that do not seem related at first. This post will elaborate on a connection between two recent posts. Gauss’s constant A couple weeks ago I wrote about Gauss’s constant and several things it was related to. We can calculate g with n iterations of […]The post Connections first appeared on John D. Cook.
Foreshadowing hypergeometric functions
I’ve said in several blog posts that multi-factorials come up often in practice, and given examples. This post will give a glimpse of why this is. Rising powers The kth rising power of a is (a)k = a (a+1) (a + 2) … (a + k – 1). So, for example, (5)3 = 5*6*7 and […]The post Foreshadowing hypergeometric functions first appeared on John D. Cook.
Hidden double factorial example
A while back I wrote several about multi-factorials and gave examples of triple factorials and quadruple factorials in action. I didn’t do a post on double factorials because they are more common. But an example I ran into recently changed my mind. If you skim a table of power series you will run into a […]The post Hidden double factorial example first appeared on John D. Cook.
Euler polynomials
The previous post looked at the logistic function and showed how it illustrates Runge’s phenomenon: adding interpolation points makes the interpolation error worse. Here’s another interesting thing about the logistic function: it’s power series coefficients involve Euler polynomials. So, what are Euler polynomials? I don’t have a good answer to that, but I can say […]The post Euler polynomials first appeared on John D. Cook.
Logistic counterexamples
The function f(x) = 1/(1 + x²) is commonly used as an example to disprove a couple things students might be lead to believe. This post will show how the logistic function g(x) = exp(x)/(1 + exp(x)) could be used in the same contexts. This shows that f(x) is not an isolated example, and the […]The post Logistic counterexamples first appeared on John D. Cook.
Dirichlet series generating functions
A couple days ago I wrote about Dirichlet convolution, and in that post I said Define the function ζ to be the constant function 1. This was following the notation from the book I quoted in the post. Someone might question the use of ζ because it is commonly used to denote the Riemann ζ […]The post Dirichlet series generating functions first appeared on John D. Cook.
Unintended programming languages
As I mentioned a few days ago, I’ve been looking at Remora, a sort of child of Lisp and APL. I find it interesting that neither Lisp nor APL were initially intended to be programming languages. (I also find it interesting that Lisp and APL are at opposite ends of the syntax spectrum, from minimal […]The post Unintended programming languages first appeared on John D. Cook.
An interesting recursion
The previous post concerned finding the inverse of a function with respect to Dirichlet convolution. Given a function f defined on the positive integers, we want to find a function g, also defined on positive integers, such that f*g = δ. This means we want to find a function g such that the sum evaluates […]The post An interesting recursion first appeared on John D. Cook.
Dirichlet convolution
That can’t be right I was skimming a book on number theory [1] recently and came across the following theorem that makes no sense out of context: An arithmetical function f has an inverse if and only if f(1) ≠ 0. Wait, what?! That’s obviously false unless I’ve missed something. Maybe “arithmetical function” is far […]The post Dirichlet convolution first appeared on John D. Cook.
Nota bene
NB I was looking at the J programming language yesterday and I was amused to see that it uses “NB.” to mark the rest of a line of source code as a comment, just like # in Python or // in C++. This makes comments in J look like comments in English prose. “NB” abbreviates […]The post Nota bene first appeared on John D. Cook.
What’s “differential” about differential privacy?
Interest in differential privacy is growing rapidly. As evidence of this, here’s the result of a Google Ngram search [1] on “differential privacy.” When I first mentioned differential privacy to consulting leads a few years ago, not many had heard of it. Now most are familiar with the term, though they may not be clear […]The post What’s “differential” about differential privacy? first appeared on John D. Cook.
Everywhere chaotic map on the sphere
Let f be a complex-valued function of a complex variable. The Julia set of f is the set of points where f is chaotic. Julia sets are often complicated fractals, but they can be simple. In this post I want to look at the function f(z) = (z² + 1)² / 4z(z² – 1). I […]The post Everywhere chaotic map on the sphere first appeared on John D. Cook.
Quadruple factorials and Legendre functions
Last week I claimed that double, triple, and quadruple factorials came up in applications. The previous post showed how triple factorials come up in solutions to Airy’s equation. This post will show how quadruple factorials come up in solutions to Legendre’s equation. Legendre’s differential equation is The Legendre functions Pν and Qν are independent solutions […]The post Quadruple factorials and Legendre functions first appeared on John D. Cook.
Triple factorials and Airy functions
Last week I wrote in a post on multifactorials in which I said that Double factorials come up fairly often, and sometimes triple, quadruple, or higher multifactorials do too. This post gives a couple examples of triple factorials in practice. One example I wrote about last week. Triple factorial comes up when evaluating the gamma […]The post Triple factorials and Airy functions first appeared on John D. Cook.
Gauss’s constant
I hadn’t heard of Gauss’s constant until recently. I imagine I’d seen it before and paid no attention. But once I paid attention, I started seeing it more often. There’s a psychology term for this—reticular activation?—like when you buy a green Toyota and suddenly you see green Toyotas everywhere. Our starting point is the arithmetic-geometric […]The post Gauss’s constant first appeared on John D. Cook.
Gamma of integer plus one over integer
The gamma function satisfies Γ(x+1) = x Γ(x) and so in principle you could calculate the gamma function for any positive real number if you can calculate it on the interval (0, 1). For example, So if you’re able to compute Γ(π-3) then you could compute Γ(π). If n is a positive integer ε is some […]The post Gamma of integer plus one over integer first appeared on John D. Cook.
Multifactorial
The factorial of an integer n is the product of the positive integers up to n. The double factorial of an even (odd) integer n is the product of the positive even (odd) integers up to n. For example, 8!! = 8 × 6 × 4 × 2 and 9!! = 9 × 7 × […]The post Multifactorial first appeared on John D. Cook.
Discrete sum analog of Gaussian integral
A comment on a recent post lead me to a page of series on Wikipedia. The last series on that page caught my eye: It’s a lot more common to see exp(-πx²) inside an integral than inside a sum. If the summation symbol were replaced with an integration sign, the integral would be 1. You […]The post Discrete sum analog of Gaussian integral first appeared on John D. Cook.
The Calculus of Finite Differences
The Calculus of Finite Differences by L. M. Milne-Thompson is a classic. It covers a great deal of elegant and useful [1] mathematics that isn’t widely known, at least not any more. For a taste of the subject matter of the book, see this post. The book is now in the public domain—at least in […]The post The Calculus of Finite Differences first appeared on John D. Cook.
Multiple angle identity for cotangent
The previous post discusses generalized replicative functions, functions that satisfy Donald Knuth says in Exercise 40 of Section 1.2.4 of TAOCP that the functions cot πx and csc² πx fall into this class of functions. If this is true of cot πx then it follows by differentiation that it is true of csc² πx as […]The post Multiple angle identity for cotangent first appeared on John D. Cook.
Multiplication theorem rabbit hole
When I started blogging I was reluctant to allow comments. It seems this would open the door to a flood of spam. Indeed it does, but nearly all of it can be filtered out automatically. The comments that aren’t spam have generally been high quality. A comment on my post about the sawtooth function a […]The post Multiplication theorem rabbit hole first appeared on John D. Cook.
Gamma and the Pi function
The gamma function satisfies Γ(n+1) = n! for all non-negative integers n, and extends to an analytic function in the complex plane with the exception of singularities at the non-positive integers [1]. Incidentally, going back to the previous post, this is an example of a theorem that would have to be amended if 0! were […]The post Gamma and the Pi function first appeared on John D. Cook.
Why is it defined that way?
There are numerous conventions in mathematics that student continually question. Why isn’t 1 a prime number? Why is 0! defined to be 1? Why is an empty sum 0 and an empty product 1? Why can’t you just say 1/0 = ∞? Etc. There are good reasons for the existing conventions, and they usually boil […]The post Why is it defined that way? first appeared on John D. Cook.
...17181920212223242526...