Estimate π using random sampling
Random points are generated in a 1×1 square. Points that fall within a quarter circle (radius = 1) are counted. The ratio of points inside the circle to total points approximates π/4, so π ≈ 4 × (inside points / total points).