Estimate pi by Monte Carlo
Asked at Jane Street
Estimate by simulation: sample points uniformly in the unit square and count how many land inside the quarter circle . The quarter circle has area , so
estimate_pi(1_000_000) -> 3.1418... (varies by seed)
Write the estimator, then answer: how many samples do you need for roughly 3 correct decimal places?
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.