## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

Chapter 10

# Simulation

Consider the problem of finding the area under the curve $f\left(x\right)={e}^{-{x}^{2}}$ between x = 0 and x = 2:

Figure 10.1:

Graph of $f\left(x\right)={e}^{-{x}^{2}}$ .

Even if you know calculus, this is a difficult task. However, a relatively simple idea will allow us to approximate the area.

The idea begins with putting a box around the graph that contains it completely. For a function that stays positive, this means finding a maximum value m; in this case, we can use m = 1:

Figure 10.2:

Box containing area.

Now imagine throwing random ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required