Mathematics I / Vectorised Computation and Libraries
Practice question · Multiple choice

A Monte Carlo simulation run twice with different random seeds gives two different answers. Why is that a feature of a correct implementation rather than a bug?

Hints
  1. Ask what the estimate is computed from. Is the input the same on both runs?
  2. What would it mean if two runs with different seeds agreed to every digit?
Show the answer

A. Because the output is itself a random variable with a spread.

Why

The estimate is an average over randomly drawn samples, so it is itself a random variable with spread about σ/√N, the standard error the method predicts. That variation is diagnostic: rerunning and looking at the spread is the standard way to estimate uncertainty. Record the seed for reproducibility, rather than quoting eight digits from a method whose error is in the third.

Read the lesson: Vectorised Computation and Libraries →

Practise Vectorised Computation and Libraries

The app has 5 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.

More questions on Vectorised Computation and Libraries