Solving Pipes Puzzles with Constraint Propagation

One of my guilty timewasters is playing pipe puzzles on my phone. The rules are fairly simple: you get a grid of pipes and you need to rotate them such that all of the pipes connect with no broken connections and no cycles. I vibecoded a JavaScript implementation to embed here so you can play around to understand the mechanics. If you want to play for real go to puzzle-pipes.com. Solving these individually is certainly a waste of my time. A marginally better use of my time is writing a solver. At least this way I might learn something. ...

March 26, 2026

Estimating Prevalence using Imperfect Classifiers

How to correct prevalence estimates using PPI

September 8, 2025

Well-calibrated predictions are not enough

Calibration is an important idea in statistical prediction. However, it’s not the only thing.

August 21, 2018

Diagnosing Bad Hypothesis Tests

I find a strange plot of p-values from a hypothesis test and investigate.

June 18, 2017

Correlation Chains

SMBC had a interesting comic recently on correlation chains. It suggests the new “Funtime Activity” of creating correlation chains. As a statistician, I naturally wanted to evaluate the methodology. The basic idea is that you start with a given variable X1 (“Amount of Sex” in the comic) and start by linking to a positively correlated variable X2 (“Happiness”). Then X2 is positively correlated to X3 (“Income”) so you expand the chain to X1 → X2 → X3. Eventually you end up at variable Xn (“Likelihood that you are, in fact, J.K. Rowling”) that’s you conclude is positively correlated the variable X1. ...

May 22, 2016

Reservoir Sampling

How do you sample from a stream of unknown length?

August 1, 2015