Skip to main content

5.6 Mean-value theorem and high-D Monte Carlo

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §5.6. Rewritten in original wording. Continues 5.5 Monte Carlo integration. Labs: 5.6b Mean-value and high-D labs.

Mean-value form​

For a continuous ff on [a,b][a,b] there is some c∈[a,b]c\in[a,b] with ∫abf=(b−a)f(c)\int_a^b f=(b-a)f(c). Monte Carlo replaces the unknown f(c)f(c) by a sample mean. Walk the mean-value identity, the estimator (b−a)⟨f⟩(b-a)\langle f\rangle, equal weights wi=(b−a)/Nw_i=(b-a)/N, σI\sigma_I, and the 2D volume form — pick the matching equation at each step.

Figure 5.6 — mean height of random samples times width approximates the area.

Doubling accuracy costs about 4×4\times more samples — slow but predictable.

Why high dimensions favor Monte Carlo​

A conventional product grid with 6464 points per axis in D=36D=36 would need 643664^{36} evaluations — not a serious plan. Monte Carlo still needs only NN integrand calls, and the leading error remains ∼1/N\sim 1/\sqrt{N} independent of DD (for plain independent sampling). Rough crossover lore: around D≈3D\approx 3–44, Monte Carlo starts competing with simple deterministic rules; for larger DD it usually wins on cost-per-digit.

A 10-dimensional check​

A textbook calibration (smooth, known exact value) is

I=∫[0,1]10(∑i=110xi)2d10x=1556.I=\int_{[0,1]^{10}}\Biggl(\sum_{i=1}^{10} x_i\Biggr)^{2}d^{10}x=\frac{155}{6}.

One Monte Carlo trial: draw NN points in the unit hypercube, average f(x)=(∑xi)2f(\mathbf{x})=(\sum x_i)^{2}. Averaging several independent seeds reduces run-to-run jitter. Relative error ∣IMC−155/6∣/(155/6)|I_{\mathrm{MC}}-155/6|/(155/6) should shrink like 1/N1/\sqrt{N} as you raise NN or average trials.

Two-dimensional generalization​

On a rectangle (or hyper-rectangle of volume VV), the same pattern is I≃V⟨f⟩I\simeq V\langle f\rangle — the guide’s last step. Averaging several independent seeds reduces run-to-run jitter. Relative error should shrink like 1/N1/\sqrt{N} as you raise NN or average trials.

Quiz

Mean value and high-D

1 / 3

Mean-value MC writes I ≈ …

Pick an answer to see if you are right.

Next: 5.6b Mean-value and high-D labs.