Math Detours · Grade 9 · Around the corner · 9

Finding an area by throwing darts

Scatter random points over a square and count how many land under a curve. Luck, averaged, becomes a measurement.

Name ____________________Date ____________

Tonight's idea

Some shapes have no easy area formula. Here is a way to measure them that needs only counting.

Put the shape inside a box whose area you know. Pick points in the box at random, so that every spot is equally likely. Call each point a dart. A dart lands in the shape with probability (area of shape) ÷ (area of box). So the fraction of darts that land inside is an estimate of that ratio.

Area of shape \(\approx \dfrac{\text{darts inside}}{\text{darts thrown}} \times\) area of box.

One dart is pure luck. The average of many is not: the more you throw, the closer the fraction settles to the true ratio. It settles slowly. The typical error shrinks like \(1/\sqrt{N}\) for \(N\) darts, so ten times the accuracy costs a hundred times the darts. A computer can throw a million darts in a moment, which is why the method is used. It is called the Monte Carlo method, after the casino town.

Watch one: the area under \(y = x^2\)

011xyy = x²
Forty darts in a square of area 1. The filled ones are under the curve.

The box is the square from 0 to 1 each way, area 1. A computer picks \(x\) and \(y\) at random between 0 and 1. The dart \((x, y)\) is under the curve when \(y \lt x^2\).

Dart \((0.6, 0.2)\): \(0.6^2 = 0.36\) and \(0.2 \lt 0.36\), so under. Dart \((0.5, 0.4)\): \(0.5^2 = 0.25\), so above.

In the figure 14 of the 40 darts are under: area \(\approx \tfrac{14}{40} \times 1 = 0.35\). The exact area is \(\tfrac13\), which next year you can prove.

Throw up to 100,000 darts at a time at a quarter circle and watch the estimate of π settle: mathdetours.com/demos/pi-darts.html.

Your turn

  1. A quarter circle of radius 1 sits in the corner of a square of side 1. Of 1,000 random darts in the square, 785 land inside the quarter circle. (a) Estimate the area of the quarter circle. (b) That area is \(\pi/4\). What estimate of \(\pi\) does this give?
  2. A pond lies inside a rectangular field 20 m by 30 m. On an aerial photo, 500 points are chosen at random in the field and 140 of them fall in the pond. Estimate the area of the pond.
  3. A shape in the unit square is the region above \(y = x^2\) and below \(y = x\). A dart is inside when \(x^2 \lt y \lt x\). (a) Which of these darts are inside: \((0.5, 0.4)\), \((0.8, 0.7)\), \((0.3, 0.2)\), \((0.9, 0.5)\), \((0.4, 0.6)\), \((0.2, 0.03)\)? (b) A longer run has 498 darts inside out of 3,000. Estimate the area.
  4. With 100 darts, the typical error in the area under \(y = x^2\) is about 0.05. (a) About how many darts bring it down to 0.005? (b) To 0.0005? (c) A friend says that doubling the darts halves the error. What does doubling really do?

Stretch: weigh a ball

A ball of radius 1 fits exactly inside a cube of side 2. Random points \((x, y, z)\) are chosen in the cube, each coordinate between \(-1\) and 1. What test tells you a point is inside the ball? A long run puts the fraction 0.524 inside. Estimate the ball's volume and compare with \(\tfrac43\pi r^3\).

Answers

  1. (a) \(\tfrac{785}{1000} \times 1 = 0.785\). (b) \(\pi \approx 4 \times 0.785 = 3.14\).
  2. The field is \(20 \times 30 = 600\) m². The fraction in the pond is \(140/500 = 0.28\), so the pond is about \(0.28 \times 600 = 168\) m².
  3. (a) \((0.5, 0.4)\): \(0.25 \lt 0.4 \lt 0.5\), inside. \((0.8, 0.7)\): \(0.64 \lt 0.7 \lt 0.8\), inside. \((0.3, 0.2)\): \(0.09 \lt 0.2 \lt 0.3\), inside. \((0.9, 0.5)\): 0.5 is below \(0.81\), outside. \((0.4, 0.6)\): 0.6 is above the line, outside. \((0.2, 0.03)\): 0.03 is below \(0.04\), outside. Three of the six. (b) \(498/3000 = 0.166\). The exact area is \(\tfrac16\). Six darts gave 0.5, which shows how little a handful can tell you.
  4. (a) Ten times smaller error needs \(10^2 = 100\) times the darts: about 10,000. (b) A hundred times smaller needs \(100^2\) times: about 1,000,000. (c) Doubling divides the error by \(\sqrt2 \approx 1.4\), so 0.05 becomes about 0.035. To halve the error you need four times the darts.

Stretch. By Pythagoras in three dimensions the distance from the centre is \(\sqrt{x^2 + y^2 + z^2}\), so the point is inside when \(x^2 + y^2 + z^2 \le 1\). The cube has volume \(2^3 = 8\), so the ball is about \(0.524 \times 8 = 4.19\). The formula gives \(\tfrac43\pi = 4.189\). The same method works for shapes with no formula at all.

← PreviousNext: Timetabling by colouring →