Mean Value Theorem for Integrals and Monte Carlo Integration
Mean Value Theorem for Integrals and Monte Carlo Integration
The mean value theorem for integrals states that if is continuous over , then there exists a real number with such that f(x)dx=f(c). Writing this as f(x)dx=(b-a)f(c) shows that the area under the curve is the base times the "average height" . To estimate this integral by the Monte Carlo method, use the following steps:
f(x)
[a,b]
c
a<c<b
1
b-a
b
∫
a
b
∫
a
(b-a)
f(c)
(1) Pick uniformly distributed numbers ,,…, in the interval [,].
n
x
1
x
2
x
n
a
b
(2) Evaluate the function at each point and calculate the average function value: =f().
f
-
f
1
n
n
∑
i=1
x
i
(3) Compute the approximate value of the integral: .
(b-a)×
-
f