Computing Library › AI & Foundations
AI & Foundations

Monte Carlo Methods

Monte Carlo methods estimate answers by simulating many random samples, which is ideal for high-dimensional and transport problems.

The idea

When a quantity is hard to compute directly, you can often estimate it by drawing many random samples and averaging. This is the Monte Carlo method. Its accuracy improves with the number of samples, and it copes gracefully with problems too high-dimensional for grid-based methods.

A simple example

Kronos motion — monte carlo
python
import random
def estimate_pi(n):
    inside = 0
    for _ in range(n):
        x, y = random.random(), random.random()
        if x*x + y*y <= 1.0:
            inside += 1
    return 4.0 * inside / n

print(estimate_pi(1_000_000))  # near 3.14159

Convergence rate

Monte Carlo error typically shrinks in proportion to one over the square root of the number of samples. To halve the error you need roughly four times the samples. This slow rate is the price for a method that does not care much about dimensionality.

Neutron transport

In fusion, Monte Carlo is the standard for neutronics: tracking how fusion neutrons scatter and are absorbed through a blanket. It underpins tritium breeding calculations, where a breeding ratio such as the 1.8 quoted for the breeder Hyperion design is estimated by simulating many neutron histories.

Making it trustworthy

Because it uses randomness, a Monte Carlo result must report a statistical uncertainty alongside its estimate, and its random seed must be recorded for reproducibility. A number without its error bar is not a Monte Carlo result — it is half of one.