Blog Profile / The Endeavour


URL :http://www.johndcook.com/blog/
Filed Under:Academics
Posts on Regator:1309
Posts / Week:4.9
Archived Since:April 26, 2011

Blog Post Archive

New Twitter account for functional programming and categories

I’m starting a new Twitter account @FunctorFact for functional programming and category theory. These two subjects have a lot of overlap, and some tweets will combine both, but many will be strictly about one or the other. So some content will be strictly about programming, some strictly about math, and some combining ideas from both.

Prime factors, phone numbers, and the normal distribution

Telephone numbers typically have around three distinct prime factors. The length of a phone number varies by country, but US a phone number is a 10 digit number, and 10-digit numbers are often divisible by three different prime numbers, give or take a couple. Assuming phone numbers are scattered among possible 10-digit numbers in a way that […]

Five lemma, ASCII art, and Unicode

A few days ago I wrote about creating ASCII art in Emacs using ditaa. Out of curiosity, I wanted to try making the Five Lemma diagram. [1] The examples in the ditaa site all have arrows between boxes, but you don’t have to have boxes. Here’s the ditaa source: A? ---> A? ---> A? ---> […]

Benford’s law, chi-square, and factorials

A while back I wrote about how the leading digits of factorials follow Benford’s law. That is, if you look at just the first digit of a sequence of factorials, they are not evenly distributed. Instead, 1’s are most popular, then 2’s, etc. Specifically, the proportion of factorials starting with n is roughly log10(1 + 1/n). […]

Hypothesis testing and number theory

This post uses a hypothesis test for proportions to look at a couple conjectures in number theory. It is similar to my earlier post on the chi-square test and prime remainders. You could read this as a post on statistics or a post on number theory, depending on which you’re less familiar with. Using statistical […]

Musical instrument acoustics posts

Four posts about musical instrument acoustics: Electric guitars Kettledrums Saxophones Leaf blowers

Category theory and micro-epiphanies

Once in a while something big suddenly makes sense. Far more often, things make sense a little at a time. I was talking with someone a few days ago, and we both said that we never had an epiphany when category theory suddenly made sense. Instead, we both said we had a sequence of micro-epiphanies. […]

ASCII art diagrams in Emacs org-mode

Yesterday I wrote about ASCII art diagrams and gave four reasons you might want to use this ancient approach to creating simple diagrams: It could be quicker than creating a graphical image. You can paste them into plain text documents like source code files. They can be produced programmatically. There is software to turn ASCII […]

Ascii art diagrams

“Technology is additive.” — Kevin Kelly Old technologies never die. Instead, their range of application shrinks. Or maybe it grows when conditions change. ASCII art, drawing pictures with fixed-width plain text characters, is no longer how many people want to produce diagrams. Just fire up Adobe Illustrator and you get incomparably more resolution of expression. […]

Interview with Chris Toomey of Upcase

The other day I spoke to Chris Toomey from thoughtbot. Chris runs Upcase, thoughtbot’s online platform for learning about Rails, test-driven development, clean code, and more. I was curious about his work with Ruby on Rails since I know little about that world. And at a little deeper level, I wanted to get his thoughts […]

Insertion sort as a fold

I’ve written several posts lately about various algorithms that can be expressed as functional folds: updating conjugate Bayesian models solving differential equations computing sample statistics These have all been numerical algorithms. Show More Summary

Prime remainders too evenly distributed

First Brian Hayes wrote an excellent post about the remainders when primes are divided by other primes. Then I wrote a follow-on just focusing on the first part of his post. He mostly looked at pairs of primes, but I wanted to look in more detail at the first part of his post, simulating dice […]

Computing higher moments with a fold

Folds in functional programming are often introduced as a way to find the sum or product of items in a list. In this case the fold state has the same type as the list items. But more generally the fold state could have a different type, and this allows more interesting applications of folds. Previous […]

Chi-square goodness of fit test example with primes

Yesterday Brian Hayes wrote a post about the distribution of primes. He showed how you could take the remainder when primes are divided by 7 and produce something that looks like rolls of six-sided dice. Here we apply the chi-square goodness of fit test to show that the rolls are too evenly distributed to mimic […]

Grateful for failures

I’ve been thinking lately about different things I’ve tried that didn’t work out and how grateful I am that they did not. The first one that comes to mind is my academic career. If I’d been more successful with grants and publications as a postdoc, it would have been harder to decide to leave academia. […]

Ten spectral graph theory posts

Here are 10 blog posts I wrote earlier this year about spectral graph theory, studying graphs via the eigenvalues of matrices associated with the graphs. Measuring graph connectivity with eigenvalues Graph regularity and Laplacian eigenvalues...Show More Summary

ODE solver as a functional fold

One of the most widely used numerical algorithms for solving differential equation is the 4th order Runge-Kutta method. This post shows how the Runge-Kutta method can be written naturally as a fold over the set of points where the solution is needed. These points do not need to be evenly spaced. Given a differential equation […]

Functional folds and conjugate models

Bayesian calculations are intrinsically recursive: The posterior distribution from one step becomes the prior for the next step. With conjugate models, the prior and posterior belong to the same family of distributions. If a distribution...Show More Summary

Retronyms and Backronyms

A retronym is a new name created for an old thing, often made necessary by technological changes. For example, we have terms like “postal mail” or “snail mail” for what used to simply be “mail” because email has become the default. What was once called a “transmission” is now called a “manual transmission” since most […]

Flood control parks

The park in the photo above flooded. And that’s a good thing. It’s designed to flood so that homes don’t. It’s not really a park that flooded. It’s a flood control project that most of the time doubles as a park. Ordinarily the park has a lake, but a few days a year the park is […]

Copyright © 2015 Regator, LLC