Log inStart free
LESSON 2.19 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Sampling and Monte Carlo methods

Throw random darts at a box, and watch them estimate π.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 2.19 · MONTE CARLO BAY400 DARTS · BOX 1 × 1
01
Stage 1 of 6 · Throw darts
Each dart takes two uniform random numbers: x across, y up. The darts cover the box evenly.
Explain it simply

Each dart needs two random numbers between 0 and 1. The first sets how far right it lands, and the second sets how high. Every spot in the box is equally likely, so 400 darts spread out evenly. The computer makes these numbers from a seed, here seed 1.

400 darts spread evenly over a box 1 wide and 1 tall. A quarter circle of radius 1 sits in its corner.

dart, darts thrown nbox B, curve f, predicted shapekept dart, kept x, estimate π̂rejected dart, error, SE
darts in the boxcount000.50.5111.5xx01ydarts thrown n = 400box B × 1 = 1 × 1f(x) = √(1 − x²)box 1 × 1darts in the boxcount000.50.5111.5xx01ydarts thrown n = 400box B × 1 = 1 × 1f(x) = √(1 − x²)box 1 × 1
Toy: a quarter circle of radius 1 in a box · 100 to 1600 darts · seeds 1 to 400
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
x=B u1,y=u2,u∼U(0,1)\sy{x}{data}{x} = \sy{B}{param}{B}\,\sy{u}{data}{u_1},\quad \sy{y}{data}{y} = \sy{u}{data}{u_2},\quad u \sim U(0, 1)
dart 1: x=1⋅0.627=0.627,y=0.003\text{dart 1: } x = 1\cdot 0.627 = 0.627,\quad y = 0.003

Two uniform numbers place each dart: x across, y up.

Common mix-ups

MYTHTen times more darts makes the error ten times smaller.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01From 400 to 1600 darts, what happens to the standard error?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.