CS(4) Hit or Miss Method
The Bounding Rectangle
The Hit or Miss Method is another approach for estimating the area under a curve using Monte Carlo simulation. It generates random points within a bounding rectangle that encloses the area of interest. Then, we count how many points fall below the curve versus how many fall outside. The proportion of points that hit below the curve can be used to estimate the area.
This approach is particularly visual, as it involves ‘throwing’ points at a region and seeing how many fall under the curve (hits) or outside (misses).
Steps of the Hit or Miss Method
- Define a rectangle that bounds the curve (e.g. over the interval [a,b] and up to a maximum height).
- Generate random points uniformly within this rectangle.
- Count the number of points that fall below the curve.
- Use the proportion of points below the curve to estimate the area.
If we want to estimate the area under
from x=0 to x=1, we first define a bounding rectangle that spans from x=0 to x=1 and from y=0 to y=1 (since the function is equal or less than 1 in this interval). The area of the bounding rectangle is simply the width times height, which is 1x1=1.