Exercises — Monte Carlo simulation — law of large numbers basis
This page is a self-test ladder for the parent topic. Work each problem before opening its solution. Levels climb from recognising the machinery to synthesising whole estimators. Every number you'll be asked for is checked in the vault's verify block, so trust the answers.
Reused constants throughout: the standard error (spread of the estimate), and for a yes/no (Bernoulli) count, .
Level 1 — Recognition
L1.1
The quantity is to be estimated by Monte Carlo. Rewrite as an expectation and name the distribution you sample from.
Recall Solution
WHAT we do: match to the expectation template. WHY: the Uniform density is exactly on , so Here , so You would draw and average .
L1.2
A Monte Carlo run gives sample standard deviation with samples. Write the standard error.
Recall Solution
WHY not : the variance of the sample mean is ; taking a square root to get a standard deviation (an error in the same units as ) introduces the .
Level 2 — Application
L2.1
You estimate by the dart method: , . Using , compute for .
Recall Solution
Step 1 — variance of one dart. is Bernoulli, so . Step 2 — SE of the mean . . Step 3 — scale by 4 (because and , so SE multiplies by 4): So is good to about — roughly two decimals. Look at the figure: only the fraction of dots inside the red arc carries information.
L2.2
For the same estimator, how many samples do you need so that ?
Recall Solution
Set . Solve for : WHY so large: shrinking the L2.1 error () by needs more samples. That's the tax.
Level 3 — Analysis
L3.1
Two runs estimate the same : run A uses , run B uses . Assuming the same , by what factor is B's standard error smaller than A's?
Recall Solution
B is 3× more accurate, even though it used 9× the samples. See the figure below: error falls along the curve, which flattens — later samples buy less.
L3.2
Use Chebyshev's Inequality to bound the probability that a Monte Carlo estimate with deviates from by at least . Then evaluate the bound for , , .
Recall Solution
Chebyshev says . With : Plug in: So at most a 1% chance the estimate is off by or more. This is exactly Step 3 of the WLLN proof made numeric.
Level 4 — Synthesis
L4.1
Design a Monte Carlo estimator for the double integral State the estimator, its exact mean , and explain why the error is unchanged by moving from 1-D to 2-D.
Recall Solution
Build it. The joint density of is , so Estimator: draw pairs and average : Exact value (for checking): expand and integrate, Why dimension doesn't hurt: the error formula depends only on the variance of the scalar and the count — never on the dimension of . A grid method would need points for a 2-D grid; Monte Carlo keeps the same . That is the numerical-integration payoff.
L4.2
For the estimator in L4.1, the variance of a single is . Compute (leave 4 decimals) and the SE at .
Recall Solution
First (a moment integral). Then A variance cannot be negative — so was mis-stated. Recompute honestly: . With , . Then Lesson baked in: if your variance comes out negative, a moment was wrong — variance is always.
Level 5 — Mastery
L5.1 — When the LLN fails
You try to estimate the mean of a Cauchy-like variable whose density has tails so heavy that . Explain, using the proof structure of the WLLN, exactly which step breaks and what you observe if you plot vs .
Recall Solution
Which step breaks: the WLLN derivation needs a finite variance (Step 2) — and even the weaker strong law needs . For a Cauchy, the integral defining diverges, so there is no to converge to. Step 3 (Chebyshev) is vacuous because . What you observe: the running average never settles — it keeps getting knocked around by occasional gigantic samples. Plot it and you see wild jumps forever, not a flattening curve. Always check the integrand's tails before trusting Monte Carlo.
L5.2 — Variance reduction budget
Two estimators target the same . Estimator A has ; a smarter importance-sampling estimator B has . How many samples does A need to match the error B achieves with ?
Recall Solution
Match standard errors: . Why this is the whole point of variance reduction: cutting variance by is worth 16× fewer samples for the same accuracy. Cleverness in beats brute force in — because the two enter the error as a ratio .
L5.3 — Confidence interval, full pipeline
A run of samples of gives sample mean and sample standard deviation . Report the 95% confidence interval (use , CLT).
Recall Solution
Step 1 — SE: . Step 2 — half-width: . Step 3 — interval: WHY the CLT: it tells us is approximately Normal for large , and standard errors captures the middle 95% of a Normal. A point estimate without this interval hides the randomness.
Recall Rapid self-check (cover the answers)
Standard error formula? ::: . To halve the error you multiply by...? ::: 4. Which property makes ? ::: independence of the samples. What condition must the integrand satisfy for the LLN to hold? ::: finite mean (finite variance for the clean rate). Cutting variance by saves how many samples for equal accuracy? ::: .