Blog Profile / The Endeavour


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

Blog Post Archive

Putting SHA1 failure in perspective

The web is all abuzz about how SHA1 is “broken”, “a failure,” “obsolete”, etc. It is supposed to be computationally impractical to create two documents that have the same secure hash code, and yet Google has demonstrated that they have done just that for the SHA1 algorithm. I’d like to make two simple observations to […]

Assignment complete, twenty years later

In one section of his book The Great Good Thing, novelist Andrew Klavan describes how he bluffed his way through high school and college, not reading anything he was assigned. He doesn’t say what he majored in, but apparently he got an English degree without reading a book. He only tells of one occasion where […]

Microresumés

I posted a couple things on Twitter today about micro-resumés. First, here’s how I’d summarize my work in a tweet. What I’ve done: Math prof, programmer, statistician What I do now: Consulting #microresume — John D. Cook (@JohnDCook) February 21, 2017 (The formatting is a little off above. It’s leaving out a couple line breaks […]

Visualizing graph spectra like chemical spectra

You can associate a matrix with a graph and find the eigenvalues of that matrix. This gives you a spectrum associated with the graph. This spectrum tells you something about the graph analogous to the way the spectrum of a star’s light tells you something about the chemical composition of the start. So maybe it […]

Simulating seashells

In 1838, Rev. Henry Moseley discovered that a large number of mollusk shells and other shells can be described using three parameters: k, T, and D. First imagine a thin wire running through the coil of the shell. In cylindrical coordinates, this wire follows the parameterization r = ek? z = Tt If T = 0 this is a […]

Recreating the Vertigo poster

In his new book The Perfect Shape, Øyvind Hammer shows how to create a graph something like the poster for Alfred Hitchcock’s movie Vertigo. Hammer’s code uses a statistical language called Past that I’d never heard of. Here’s my interpretation of his code using Python. import matplotlib.pyplot as plt from numpy import arange, sin, cos, […]

Approximate inverse of the gamma function

The other day I ran across a blog post by Brian Hayes that linked to an article by David Cantrell on how to compute the inverse of the gamma function. Cantrell gives an approximation in terms of the Lambert W function. In this post we’ll write a little Python code to kick the tires on […]

Inverse Fibonacci numbers

As with the previous post, this post is a spinoff of a blog post by Brian Hayes. He considers the problem of determining whether a number n is a Fibonacci number and links to a paper by Gessel that gives a very simple solution: A positive integer n is a Fibonacci number if and only if either 5n2 – […]

How efficient is Morse code?

Morse code was designed so that the most frequently used letters have the shortest codes. In general, code length increases as frequency decreases. How efficient is Morse code? We’ll compare letter frequencies based on Google’s research with the length of each code, and make the standard assumption that a dash is three times as long as a dot. […]

Tidying up trivial details

The following quote gives a good description of the value of abstract mathematics. The quote speaks specifically of “universal algebra,” but consistent with the spirit of the quote you could generalize it to other areas of mathematics, especially areas such as category theory. Universal algebra is the study of features common to familiar algebraic systems […]

Measuring graph robustness

There are a couple ways to measure how well a graph remains connected when nodes are removed. One ways is to consider nodes dropping out randomly. Another way, the one we look at here, assumes an adversary is trying to remove the most well-connected nodes. This approach was defined by Schneider et al [1]. It […]

Data-driven charity

In this post I interview GiveDirectly co-founder Paul Niehaus about charitable direct cash transfers and their empirical approach to charity. JC: Can you start off by telling us a little bit about Give Directly, and what you do? PN: GiveDirectly is the first nonprofit that lets individual donors like you and me send money directly to […]

Big data and the law

Excerpt from the new book Big Data of Complex Networks: Big Data and data protection law provide for a number of mutual conflicts: from the perspective of Big Data analytics, a strict application of data protection law as we know it today would set an immediate end to most Big Data applications. From the perspective of […]

Particle filter and unscented Kalman filter in a nutshell

Suppose you have a linear dynamic system. That is, the function that predicts the next state from the current state to the next is linear. Suppose also that the states in your system are not known precisely but have some uncertainty modeled by a (multivariate) normal distribution. Then the uncertainty in the state at the […]

Heavy-tailed random matrices

Suppose you fill the components of a matrix with random values. How are the eigenvalues distributed? We limit our attention to large, symmetric matrices. We fill the entries of the matrix on the diagonal and above the diagonal with random elements, then fill in the elements below the diagonal by symmetry. If we choose our […]

Simplify integration with complex variables

Last night I was helping my daughter with her calculus homework. One of the problems was the following integral: This is an interesting problem for two reasons. First, it illustrates a clever variation on integration by parts; that’s why it was assigned. But it can also be computed using complex variables. As is often the […]

Sticky cards

Suppose you shuffle a deck of cards. How likely is it that there are two cards that were next to each other before the shuffle are still next to each other after the shuffle? It depends on how well you shuffle the cards. If you do what’s called a “faro shuffle” then the probability of […]

Probability of secure hash collisions

A hash function maps arbitrarily long input strings to fixed-length outputs. For example, SHA-256 maps its input to a string of 256 bits. A cryptographically secure hash function h is a one-way function, i.e. given a message m it’s easy to compute h(m) but it’s not practical to go the other way, to learn anything about m from h(m). Secure hash functions are useful for […]

Three proofs that 2017 is prime

Aaron Meurer asked on Twitter whether there’s a proof that 2017 is prime that would fit into 140 characters. My first reply was this: sqrt(2017) < 45. 2017 not divisible by 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, or 43. Ergo prime. I’m not sure that’s what he had […]

Cover time of a graph: cliques, chains, and lollipops

Cover time The cover time of a graph is the expected time it takes a simple random walk on the graph to visit every node. A simple random walk starts at some node, then at each step chooses with equal probability one of the adjacent nodes. The cover time is defined to be the maximum […]

Copyright © 2015 Regator, LLC