Introduction This post is about an algorithm for numerical integration. Consider computing an integral $\int f \mathrm{d} P$ of a function $f: \mathcal{X} \to \mathbb{R}$ with respect to (say) a probability distribution $P$ on some (nice) space $\mathcal{X}$. It is often not easy to compute such an integral exactly, and we need to numerically approximate it. To proceed, suppose we have a collection $(x_1, \dots, x_n)$ of $n$ points in $\mathcal{X}$, which we use to approximate the integral.