A classic illustration of the Monte Carlo method is estimating the value of \(\pi\). By inscribing a circle of radius \(r\) within a square of side length \(2r\), the ratio of their areas is \(\frac{\pi r^2}{(2r)^2} = \frac{\pi}{4}\). Randomly scattering points within the square and counting the fraction \(p\) that fall inside the circle provides an estimate: \(\pi \approx 4p\).
