Monte-Carlo-Method



Description:

The Monte Carlo Method is a numerical method based on probabilistic procedures, used in statistics for the resolution of problems of various kinds, which present analytical difficulties or are difficult to overcome.

The Monte Carlo method can be used to determine the surface of a lake.
Let us be given a rectangular or square area of which we know the length of the sides. Within this area there is a lake whose surface is unknown. Thanks to the measurements of the sides of the zone, the area of the rectangle is known.

To determine the area of the lake, X dots are randomly generated on this area. We then count the number N of dots that have remained on the earth and we can now determine the number of dots that are inside the lake, that are X-N.


Example

We can establish a relationship between values:

areaeartharealake=XXN
So you have: arealake=(XN)×areaearthX



Example:

At this point, we can take at look an real example.
Suppose we have the following image:

Lake Map

This image shows Lake Garda inscribed in a rectangle of area equal to 2034,81 Km2. At this point, consider another image whose dimensions are equal to those of the rectangle:

Lake Garda

The image was taken from the following link: https://mapstyle.withgoogle.com/

Now, we want to calculate the area of ​​the Lake Garda using the Monte Carlo method, so we need to generate X random dots within the image. In order to determine if a point is inside the lake, the color of the pixel is considered. If the color has a certain shade of blue then it is considered as a hit and turns black, otherwise it is considered a miss and turns red. The results of the areas will be displayed in a chart. We use two colors to distinguish the dots:

  • red for earth dots;
  • black for lake dots.

First of all, we try to calculate the lake area using only 100 dots and we calculate the confidence interval for alpha equal to 0.01.