Estimate pi by sampling points in a unit square and measuring the fraction inside the quarter circle.