Fine-grained file differences

The diff utility compares files by lines, which is often what you’d like it to do. But sometimes you’d like more granularity. For example, supposed we want to compare two versions of Psalm 23. Here are the first three verses in the King James version: The Lord is my shepherd; I shall not want. He […]

Should you walk or run in the rain?

One of the problems in X and the City, a book I mentioned the other day, is deciding whether you’ll get wetter by walking or running in the rain. The author takes several factors into account and models the total amount of water a person absorbs as This assumes a person is essentially a rectangular […]

Data Privacy FAQ

Table of Contents 1. General data privacy questions 1.1. What’s wrong with the nothing-to-hide argument? 1.2. Does removing names make data deidentified? 2. HIPAA, Expert Determination, and Safe Harbor 2.1. Is there more to Safe Harbor than 18 rules? 2.2. Does Safe Harbor really protect privacy? 2.3. Why does Safe Harbor remove dates of service? […]

Differentially private stochastic gradient descent

Let’s work our way up to differentially private stochastic gradient descent (DP-SGD) a little at a time. We’ll first look at gradient descent, then stochastic gradient descent, then finally differentially private stochastic gradient descent. Gradient descent We’ll start with gradient descent. Suppose you have a function of several variables f(x) where x is a vector. […]

Pratt Primality Certificates

The previous post implicitly asserted that J = 8675309 is a prime number. Suppose you wanted proof that this number is prime. You could get some evidence that J is probably prime by demonstrating that 2J-1 = 1 mod J. You could do this in Python by running the following [1]. >>> J = 8675309 […]

Experimental design

Experiments can be expensive in terms of time and resources, and so an experiment needs to pay for itself. An experiment needs to be large enough to answer your questions, but not so large that it uses unnecessary resources and takes too long to complete. A small, well designed experiment can tell you things that […]

Da Vinci on wave propagation

From Leonardo da Vinci: The impetus is much quicker than the water, for it often happens that the wave flees the place of its creation, while the water does not; like the waves made in a field of grain by the wind, where we see the waves running across the field while the grain remains […]