Practice question · Numerical answer
In a Monte Carlo estimate of pi, points are scattered in a unit square containing a quarter-circle and the estimate is four times the fraction landing inside. If 800 of 1000 points land inside, what is the estimate of pi?
Hints
- Compute the fraction of points inside first.
- Then multiply by 4, because the quarter-circle is a quarter of the relevant area.
Show the answer
3.2 (answers within ±0.01 count)
Why
800/1000 = 0.8, and 4 * 0.8 = 3.2. The true value is 3.14159..., so this run is off by about 0.06, a reminder that a Monte Carlo answer is a sample statistic, not a computation of pi.
Practise Programming for Mathematics
The app has 6 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.
More questions on Programming for Mathematics
- Sort each task by the kind of computation it needs.
- A test suite passes and the program is wrong. Which of these does testing structurally fail to catch?
- Complete the description of a simulated result.
- Testing a program on a hundred inputs and finding no failures does not prove it correct. Why is testing…
- Order the steps of using a program to investigate a conjecture.
- Because a computer performs arithmetic faster and more reliably than a human, a numerical result it prints…