Skip to content

Simulating random points to approximate pi

Question

Describe a simulation method for estimating π\pi, and say how accurate it is.

Short answer

Throw uniform points in a square and count those inside the inscribed circle. For (U,V)(U,V) uniform on [0,1]2[0,1]^2, P(U2+V2≤1)=π/4P(U^2+V^2\le1)=\pi/4, so 4×4\times the hit fraction estimates π\pi. The standard error is π(4−π)/n≈1.64/n\sqrt{\pi(4-\pi)/n}\approx1.64/\sqrt n, so each extra digit costs about 100×100\times more points; quasi-random points or integrating 41−x24\sqrt{1-x^2} with variance reduction converge faster.

Adapted from Joshi, Denson & Downes, Quant Job Interview Questions and Answers, Q6.4, p.190; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question

Start with a free lesson: Basic Statistics and Regression is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.

Read it free