Quantifying uncertainty · page 1 of 4

From Dice to a Tree

We start with one die. We end with a tree. The question is the same for both: what can many readings tell us about the thing that produced them?

The page uses the same random numbers every time you open it. Press the button to get new ones.
Before we start

Revisiting probability using a die and a coin

Probability is a number between 0 and 1. It says how likely a result is. 0 means "never". 1 means "always". 1/2 means "half of the time". When every result has the same chance, the rule is simple:

Probability of a result = number of ways to get that result ÷ total number of possible results

A die has 6 faces

Rolling…

1/6
1/6
1/6
1/6
1/6
1/6

Probability of any one number, for example 4
= 1 ÷ 6 = 1/6 ≈ 0.167 ≈ 16.7 %

Each face has the same probability, 1/6. The six probabilities add up to 6/6 = 1, because some face must come up.

H
T

A coin has 2 faces

Flipping…

H
1/2
T
1/2

Probability of head (H) = 1 ÷ 2 = 1/2 = 0.5 = 50 %
Probability of tail (T) = 1 ÷ 2 = 1/2 = 0.5 = 50 %

Head or tail: 1/2 + 1/2 = 1. One of the two must come up.

Careful: 1/6 does not mean "4 comes up exactly once in every 6 rolls". In 6 rolls, 4 may come up 0 times, or 1 time, or 3 times. The probability 1/6 tells you what happens over many rolls: about one roll in six shows a 4. The next sections show this with many rolls.

Words used on this page

The words, in the order you will meet them

Read this once now, and come back whenever a word is unclear. Every word is explained with the same tiny example: three readings, 5, 6 and 7. A later section, "Simple calculations", works out all the numbers by hand.

1 · The data

Reading
One measured number. Also called a value or an observation. Example: one student measures the tree and writes 6.4 m. That is one reading.
DBH
Diameter at breast height. The thickness of the trunk, measured 1.3 m above the ground, in cm.
n
The number of readings. For 5, 6, 7 n is 3. For 2, 6, 10 n is also 3.

2 · The middle of the data

Mean
The average. Add all the readings, then divide by n. (5 + 6 + 7) ÷ 3 = 18 ÷ 3 = 6. On this page "mean" and "average" are the same thing.
Running mean
The mean of the readings you have so far. It changes after every new reading or roll. If you roll a die again and again, the running mean after 10 rolls is the mean of those 10 rolls. After 100 rolls it is the mean of those 100.

3 · How far apart the readings are

Spread
An everyday word, not a number. It means how far the readings are from each other and from the mean. 5, 6, 7 have a small spread. 2, 6, 10 have a large spread. Both have mean 6. "Less spread" means the readings stay closer to the mean.
SD
Standard deviation. The number that measures the spread. It is roughly the typical distance of a reading from the mean. 5, 6, 7: SD = 1. 2, 6, 10: SD = 4. SD has the same unit as the readings (metres for heights, centimetres for diameters). SD = 0 means all readings are the same.
CV
Coefficient of variation. SD as a percentage of the mean: CV = SD ÷ mean × 100. For 5, 6, 7: 1 ÷ 6 × 100 = 16.7 %. CV has no unit, so you can compare the spread of heights (in m) with the spread of diameters (in cm).
Try it: spread and SD. Move the slider. Three readings sit on a number line, always with mean 6. The slider changes how far apart they are. Watch the SD change with them.

4 · How sure we are about the mean

√n
The square root of n. √4 = 2, √9 = 3, √25 = 5, √100 = 10. √3 is about 1.73 and √10 is about 3.16.
SE
Standard error. The SD of a mean. It says how much the mean would typically move if you threw away all the readings and measured n new ones. If you could collect many such means, the SE would be their SD. Formula: SE = SD ÷ √n. For 5, 6, 7: SD = 1, so SE = 1 ÷ √3 = 1 ÷ 1.73 = 0.58. More readings make √n bigger and SE smaller.
95 % range
Two numbers, a low one and a high one, between which the true mean very probably lies. Quick rule: from mean − 2 × SE to mean + 2 × SE. For 5, 6, 7: 6 ± 2 × 0.58 = 6 ± 1.16, so 4.84 to 7.16. Also called a 95 % interval. There is a second way to find it, used later on this page: sort many values, then cut off the lowest 2.5 % and the highest 2.5 %.

5 · Chance

Probability
A number between 0 and 1 that says how likely a result is (see the die and coin above). A fair die: 1/6 for each face. A fair coin: 1/2 for each side.
Share so far
How often a result has actually come up, divided by the number of rolls so far. 21 fours in 100 rolls is a share of 21 %. With many rolls the share gets close to the probability.

Easy to confuse

These twoHow they differ
Spread and SDSpread is the idea: how far apart the readings are. SD is the number that measures it. "Large spread" and "large SD" mean the same thing. You can see spread; you calculate SD.
SD and SESD is the spread of the readings. SE is the spread of the mean: how much the mean would move if you measured everything again. SE is always smaller: SE = SD ÷ √n. For 5, 6, 7: SD = 1 but SE = 0.58. Note that an SE is itself an SD: "SE" is just the special name for the SD of a mean.
SD and CVBoth measure spread. SD has a unit (for example 1 m). CV has no unit, it is a percentage (for example 16.7 %). Use CV to compare two things measured in different units.
Mean and running meanThe mean uses all the readings. The running mean uses the readings so far and keeps changing. When all readings are in, the two are the same.
SE and 95 % rangeSE is one number, a distance. The 95 % range is two numbers, a low end and a high end, about 2 × SE on each side of the mean.
Probability and share so farProbability (1/6) is what theory says before rolling. The share so far (for example 21 fours in 100 rolls = 21 %) is what actually happened. With many rolls the share gets close to the probability. You will see this below, when a die is rolled thousands of times.
Panel A

Probability means "how often, in the long run"

A fair die shows each face (1, 2, 3, 4, 5 or 6) with probability 1/6. You cannot see "1/6" in one roll. One roll gives one face, nothing more. After thousands of rolls, each face has come up close to 1 time in 6. Then every bar in the left chart is close to the dashed line, and the running mean is close to 3.5 (the average of 1, 2, 3, 4, 5, 6).

rolls: 0
Press Play or Step to roll.
How often each face came up, as a share of all rolls so far. Dashed line: the probability 1/6, which is about 16.7 %.
The running mean after n rolls. The horizontal axis is a log scale: 1, 10, 100, 1,000, 10,000. Shaded band: 3.5 ± 1.71 ÷ √n. This band shows how far from 3.5 the running mean usually is after n rolls (1.71 is the SD of a single roll). The band gets narrower as n grows: 100 times more rolls makes the band 10 times narrower.
Running mean (so far)
–
Expected mean (theory)
3.500
SD of the rolls so far
–
SD of one roll (theory)
1.708
Largest gap between a bar and 16.7 %
–

The SD of one die roll is 1.708. This is the "typical distance" of a roll from 3.5: a roll of 2 is 1.5 below, a roll of 6 is 2.5 above, and so on. As you roll more, the "SD of the rolls so far" moves close to 1.708. How 1.708 is calculated from the six faces is shown later on this page, in the section on expected value.

Panel B

Turn it around: guess the die from its rolls

In Panel A we could see the die. We knew it had six faces, 1 to 6, so we could calculate the probability 1/6 before rolling even once. After many rolls, the share of each face matched that probability, and the running mean settled at 3.5.

Now suppose you cannot see the die. Somebody rolls it behind a screen and only tells you the number. Can you work out what the die looks like? How many faces does it have? Which numbers are on them? Is every number equally likely? Below are three mystery dice. One may be an ordinary die. One may have faces 1, 2, 3, 4, 5, 5. One may have eight faces, 1 to 8. Choose a die, roll it many times, study the shares, and make your guess. Then press "Reveal the die".

rolls: 0
?
Press Play or Step. The number that comes up is shown here.
Share of rolls for each number from 1 to 8. A number that never comes up has no bar. After "Reveal the die", dashed marks show the true probability of each number.
Numbers seen so far
–
Running mean
–
SD of the rolls so far
–
Biggest share ÷ smallest share
–

Three questions to answer from the rolls: (1) How many different numbers appear? (2) Do all the bars become equally high? (3) Is one bar about twice as high as the others?

What this has to do with trees

For the mystery die, the hidden thing is the set of faces and how likely each one is. The rolls are what we get to see. For a tree, the hidden thing is its true height. Each measurement is one "roll": it comes out a little different every time, because of the person measuring, the instrument, the angle and the ground. In both cases we never see the hidden thing directly. We only see readings.

From the readings we make three guesses: a middle (the mean), a spread (the SD), and a range inside which the hidden value very probably lies. And in both cases more readings make the guesses better: the shares settle down, the running mean settles down. The rest of this page builds exactly these three guesses, first with dice, then with a real tree.

After Panel B

Expected value: the long-run average, calculated before rolling

In Panel A the running mean settled at 3.5. In Panel B each mystery die settled at its own number. These numbers can be calculated in advance, from the faces and their probabilities, without rolling at all. The result is called the expected value. It is the long-run average: the number the running mean settles at after many rolls.

Expected value = (value × probability of that value), added up over all the possible values

Every possible value takes part. A value with a high probability pulls the expected value toward itself more strongly. A picture helps: draw the probabilities as bars standing on the number line. The expected value is the balance point, the place where the bars would balance on a pivot (the small triangle).

Die 3, an ordinary die

Faces 1, 2, 3, 4, 5, 6. Each value has probability 1/6.

1 × 1/6 + 2 × 1/6 + 3 × 1/6 + 4 × 1/6 + 5 × 1/6 + 6 × 1/6
= (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 21 ÷ 6 = 3.5

When all values are equally likely, the expected value is simply the plain average of the faces.

Die 1, faces 1, 2, 3, 4, 5, 5

Values 1 to 4 have probability 1/6 each. Value 5 is on two faces, so its probability is 2/6. Value 6 has probability 0.

1 × 1/6 + 2 × 1/6 + 3 × 1/6 + 4 × 1/6 + 5 × 2/6 + 6 × 0
= (1 + 2 + 3 + 4 + 10) ÷ 6 = 20 ÷ 6 = 3.33

The second 5 and the missing 6 pull the balance point down from 3.5 to 3.33. The tall bar at 5 pulls harder than any other bar.

Die 2, faces 1 to 8

Eight values, each with probability 1/8.

1 × 1/8 + 2 × 1/8 + … + 8 × 1/8
= (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8) ÷ 8 = 36 ÷ 8 = 4.5

More faces with bigger numbers move the balance point to the right.

Two things to notice. First, "expected" does not mean "the value you expect on the next roll". No face shows 3.5 or 4.5. The expected value is about the average of many rolls, not about one roll. Second, the mean of the rolls (from data) and the expected value (from the probabilities) are two routes to the same number. With few rolls they differ. With thousands of rolls they almost agree. Go back to Panel B and compare "Running mean" with the numbers above.

What this means for readings of a tree

For a die we know the faces, so we can calculate the expected value exactly. For a tree we do not know the "faces": we do not know which readings are possible or how likely each one is. So we cannot calculate the expected value. We can only estimate it, with the mean of the readings we have. If the measuring method is fair, pulling neither up nor down, the expected value of a reading is the true height of the tree. The mean of our readings is our best guess for it, and the more readings, the better the guess.

The same recipe gives the SD from theory: where 1.71 comes from

The SD of the rolls so far in Panel A settles at 1.71. That number can also be calculated in advance, with the same recipe as the expected value. Instead of "value × probability" use "(distance from the expected value)² × probability", add up, and take the square root.

SD from theory = √[ (value − expected value)² × probability, added up over all the possible values ]

Step, for an ordinary die (expected value 3.5)Working
1. Distance of each value from 3.51 − 3.5 = −2.5, 2 − 3.5 = −1.5, 3 − 3.5 = −0.5, 4 − 3.5 = +0.5, 5 − 3.5 = +1.5, 6 − 3.5 = +2.5
2. Square each distance6.25, 2.25, 0.25, 0.25, 2.25, 6.25
3. Multiply each square by its probability, 1/6, and add(6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 6.25) ÷ 6 = 17.5 ÷ 6 = 2.917
4. Square root. This is the SD of one roll√2.917 = 1.708, written 1.71

Here we divide by 6, not by n − 1. The n − 1 correction is for data, where the mean had to be estimated from the readings. Here the expected value 3.5 is exact, so no correction is needed.

The same steps for the mystery dice. Die 1 (expected value 3.33): distances −2.33, −1.33, −0.33, +0.67, +1.67, +1.67; squares 5.44, 1.78, 0.11, 0.44, 2.78, 2.78; add and divide by 6: 13.33 ÷ 6 = 2.22; square root: 1.49. Die 2 (expected value 4.5): distances ±0.5, ±1.5, ±2.5, ±3.5; squares 0.25, 2.25, 6.25, 12.25, each twice; add and divide by 8: 42 ÷ 8 = 5.25; square root: 2.29. Compare these three numbers with "SD of the rolls so far" in Panel B after many rolls.

Simple calculations

Every word, worked out by hand

Two tiny data sets with the same mean, 6, but different spread. Follow the steps with a pen and a calculator. Then the same recipe is applied to ten rolls of an ordinary die.

Each dot is one reading. Dots with the same value are stacked.
step 1 of 6

The same steps as a table

StepSet 1: 5, 6, 7Set 2: 2, 6, 10
1. Count the readings, nn = 3n = 3
2. Mean = sum ÷ n(5 + 6 + 7) ÷ 3 = 18 ÷ 3 = 6(2 + 6 + 10) ÷ 3 = 18 ÷ 3 = 6
3. Distance of each reading from the mean5 − 6 = −1, 6 − 6 = 0, 7 − 6 = +12 − 6 = −4, 6 − 6 = 0, 10 − 6 = +4
4. Square each distance (the minus signs disappear)1, 0, 116, 0, 16
5. Add the squares1 + 0 + 1 = 216 + 0 + 16 = 32
6. Divide by n − 12 ÷ 2 = 132 ÷ 2 = 16
7. Square root. This is the SD√1 = 1√16 = 4
8. CV = SD ÷ mean × 1001 ÷ 6 × 100 = 16.7 %4 ÷ 6 × 100 = 66.7 %
9. SE = SD ÷ √n1 ÷ √3 = 1 ÷ 1.73 = 0.584 ÷ √3 = 4 ÷ 1.73 = 2.31
10. 95 % range for the mean ≈ mean ± 2 × SE6 ± 1.16 → 4.84 to 7.166 ± 4.62 → 1.38 to 10.62

Why divide by n − 1 and not n in step 6? With n readings, the mean was calculated from those same readings, so the distances are a little too small. Dividing by n − 1 corrects for that. For large n it makes almost no difference.

The same recipe for 10 rolls of an ordinary die

The rolls were 2, 5, 3, 6, 1, 4, 4, 2, 6, 3. n = 10. Sum = 36. Mean = 36 ÷ 10 = 3.6.

Distances from the mean: −1.6, +1.4, −0.6, +2.4, −2.6, +0.4, +0.4, −1.6, +2.4, −0.6. Squares: 2.56, 1.96, 0.36, 5.76, 6.76, 0.16, 0.16, 2.56, 5.76, 0.36. Sum of the squares = 26.4. Divide by n − 1 = 9: 2.93. Square root: SD = 1.71.

CV = 1.71 ÷ 3.6 × 100 = 48 %. √10 = 3.16, so SE = 1.71 ÷ 3.16 = 0.54.

95 % range for the mean ≈ 3.6 ± 2 × 0.54 = 3.6 ± 1.08, so 2.52 to 4.68.

Now compare with what we know about an ordinary die. Its true mean is 3.5 and the SD of one roll is 1.71. Ten rolls gave a mean of 3.6, not exactly 3.5, but the 95 % range 2.52 to 4.68 contains 3.5. The ten rolls did not tell us the exact answer. They gave us a range, and the true value is inside it. That is what readings can do, for a die and for a tree.

Where we go next

So far: one die and its probabilities, a mystery die guessed from its rolls, and the recipe for mean, SD, SE and the 95 % range. Four experiments remain. Each has its own Play, Step and Reset buttons.

Panel C rolls several dice at once and keeps only their average. It shows that an average has less spread than a single roll, and by how much. This is the reason why more readings make a guess better.

Panel D moves to a tree. We are 250 students in the class. Let us assume that, hypothetically, every one of us measured the height and the DBH of a single tree. (DBH is the diameter at breast height: the diameter of the trunk measured 1.3 m above the ground.) These readings are the "rolls" of the tree. The numbers are made up for this page, but they are the kind a class would get. Panel D is a revision: every idea from the dice, applied to the tree, ending with a 95 % confidence interval for its height.

Panel E finds the same 95 % interval a second way, without the formula, by "rolling the bag" of readings. This is called the bootstrap. Panel F asks what to do when a tree has only one reading, as in our project. The answer is the Monte Carlo method: build the bag yourself from an assumed error, and then roll it.

Press Play at slow speed first. Press Fast-forward only after you have understood one step.

Panel C

An average has less spread than a single roll

Now roll k dice at the same time and write down only their average. Compare two cases. One die (k = 1): the result can be anything from 1 to 6, and every value is equally likely. The average of 25 dice (k = 25): the result is usually between 3 and 4, and almost always between 2.8 and 4.2. It practically never goes below 2.5 or above 4.5. That is what "less spread" means: the values stay closer to the middle.

Why does the average stay in the middle? For the average of 25 dice to be 1, every one of the 25 dice must show 1 at the same time. The chance of that is 1/6 × 1/6 × … × 1/6, twenty-five times, which is about 1 in 3 × 1019, practically zero. For the average to be 6, all 25 dice must show 6, equally impossible. Even an average of 2 needs almost every die to show a low number, which is very unlikely. But there are very many ways to get an average near 3.5: some dice show high numbers, some show low numbers, and the high and low ones cancel each other out. So the average of many dice is pulled toward the middle, and its spread is small.

How much less spread? The SD of the averages is the SD of one die divided by √k. The SD of one ordinary die is 1.71, calculated from its six faces in the expected value section above. So with 25 dice (try it below) the SD of the averages is one fifth of 1.71, and with 100 dice it would be one tenth. This rule is the most useful fact in this course.

One number, two names. The SD of the averages has a special name: the standard error, SE. An SE is simply the SD of a mean. Here we can find it in two ways: measure it from the histogram of many averages, or calculate it from the formula SE = SD of one value ÷ √k. The two green boxes below show both. They give the same number.

rolls: 0
Histogram (bar chart of counts) of the average of k dice. Each bar shows how often an average fell in that small range. The faint grey dashed outline shows the one-die case (k = 1) for comparison: flat, from 1 to 6. Orange line: the mean of all the averages so far. The orange bracket at the top shows ± 1 SE (one SD of the averages) around it.
Mean of all the averages
–
Expected mean (theory)
3.500
SE, measured: SD of the averages in the histogram
–
SE, from the formula 1.71 ÷ √k
–
95 % range of the averages
–
CV = SD ÷ mean
–

How to read the two green boxes. The left one is measured: the SD of all the averages in the histogram, which is the SE found by experiment. The right one is the SE predicted by the formula: 1.71 divided by √k. Try each k with Fast-forward. The two numbers agree to about two decimal places every time.

The rule: when you average k independent values, the SD of the average (its SE) is the SD of one value divided by √k. "Independent" means one roll does not affect another.

95 % range: 95 out of 100 averages fall inside it. For k = 1 it is almost the whole range 1 to 6. For k = 25 it is roughly 2.8 to 4.2.

Panel D · revision

Everything so far, applied to one tree

Let us assume that all 250 of us measured the same tree, tree #406: one height reading and one DBH reading per student. The 250 numbers in the bag below are made up for this page. They are not real measurements. They are the kind of numbers a class would get, and they let us practise every idea from the dice on a tree.

Nothing new is introduced in this panel. The tree is the mystery die of Panel B. Its true height is the hidden thing. Each student's reading is one roll. The table shows the analogy line by line.

With a dieWith the tree
The hidden thing: the faces and their probabilitiesThe hidden thing: the true height (or DBH) of the tree
One rollOne student's reading
Many rolls250 readings
Expected value, calculated from the faces (3.5 for an ordinary die)The true height. It cannot be calculated, because we do not know the "faces". It can only be estimated.
The running mean settles at the expected valueThe mean of the readings settles at the true height, if the measuring is fair (no instrument that reads too high or too low for everyone)
SD of one roll, 1.71 for an ordinary die, calculated from the facesSD of the readings, calculated from the data: how far one reading typically is from the mean
SE of the average of k dice = 1.71 ÷ √k (Panel C)SE of the mean of n readings = SD ÷ √n
95 % range of the averages (Panel C)95 % confidence interval for the true height: mean ± 2 × SE

"Roll the tree": take the readings out of the bag one by one

Press Play to take the 250 readings out of the bag in the order the students handed them in. Watch the running mean and the 95 % confidence interval settle, exactly as the running mean of the die settled in Panel A.

readings: 0 of 250
The bag: 250 hypothetical height readings of tree #406 (m)

A chip turns orange once its reading has been taken out and counted. The chip being read now is highlighted.

Histogram of the readings taken so far. Dashed green line: the running mean. Green band: mean ± 1 SD, where about two thirds of the readings fall. Orange bracket: the 95 % confidence interval for the true height (or DBH), mean ± 2 × SE. It is much narrower than the spread of the readings.
Running mean after n readings (orange line), with the 95 % confidence interval around it (orange band). The band narrows as n grows, like the band in the running-mean chart of Panel A.
Readings so far, n
0
Mean so far
–
SD of the readings so far
–
CV = SD ÷ mean
–
SE = SD ÷ √n
–
95 % confidence interval = mean ± 2 × SE
–

The recipe from "Simple calculations", with all 250 readings

What "95 % confident" means

The interval is for the true height, not for one reading. It answers "where is the hidden value?", not "what will the next student write down?".

"95 %" describes the method, not this one interval. Imagine many classes, each of 250 students, each measuring this tree and each calculating its own interval. The intervals would differ a little, because the readings differ. About 95 out of 100 of those intervals would contain the true height; about 5 would miss it. We have one class and one interval. We cannot know whether ours is one of the 95 or one of the 5. That is why we say "95 % confident", not "certain".

Height is harder to measure than DBH

Height is measured from a distance with an angle reader (a clinometer) and some trigonometry. DBH is measured with a tape touching the trunk. The CV lets us compare the two even though one is in metres and the other in centimetres.

One thing the dice cannot show, and 250 readings cannot fix: if every student's instrument reads 0.5 m too high, the mean is also 0.5 m too high. All the readings would be "rolls" of a die whose faces are shifted. More readings make the interval narrower, but around the wrong value. Only a better instrument, or a check against a tree of known height, can find this kind of error. It is called a systematic error, and we will come back to it when we look at biomass equations.

Panel E

The bootstrap: the 95 % interval without the formula

In Panel D we used a formula: SE = SD ÷ √n, then interval = mean ± 2 × SE. In Panel C we found the SE a different way: by experiment. We rolled the dice thousands of times, made a histogram of the averages, and measured their spread. Can we do the same for the tree? Not directly: we cannot send 2,000 new classes to measure tree #406. We have one bag of 250 readings and nothing else.

The trick. Treat the bag of 250 chips as if it were the tree itself. Drawing one chip from the bag plays the role of measuring the tree once. This is the same idea as in Panel B, where many rolls were a good picture of the die: here, 250 readings are a good picture of what a reading of this tree can look like. So we can "measure the tree" as often as we like, by drawing chips from the bag:

  1. Draw one chip from the bag. Write down its value. Put the chip back.
  2. Repeat 250 times. This is one pretend class of 250 readings. Some chips come out two or three times. Some never come out.
  3. Calculate the mean of the pretend class. Drop it into the histogram.
  4. Repeat steps 1 to 3 thousands of times. The SD of the pretend means is the SE, found by experiment. Sort the pretend means and cut off the lowest 2.5 % and the highest 2.5 %: what remains is the 95 % interval.

Two new words

Bootstrap
The method above: draw chips from the bag of readings you already have, again and again, to make many pretend classes, and measure the spread of their results.
With replacement
Putting the chip back before the next draw, so that the same chip can come out again in the same pretend class. The tree can give the same reading to two students, so the bag must be able to give the same chip twice.
pretend classes: 0
The latest pretend class: the first 15 of its 250 draws
Press Step to draw one pretend class.
Mean of the original 250 readings
–
SE by bootstrap: SD of the pretend values
–
SE by formula: SD ÷ √250
–
95 % interval by bootstrap (sort and cut 2.5 % each end)
–
95 % interval by formula: mean ± 2 × SE
–
Each pretend class gives one value, dropped into this histogram. Green dashed line: the value from the original 250 readings. Orange bracket: the bootstrap 95 % interval. Green bracket (for the mean only): the formula interval from Panel D. The two brackets almost coincide.

Why use the bootstrap, if the formula gives the same answer?

1. The formula only works for the mean. Press "SD" above. We often want to know how sure we are about the SD, or the CV, or the median, or a biomass calculated from the readings. There is no simple "÷ √n" rule for those. The bootstrap uses the same four steps for any quantity: calculate it for each pretend class and look at the spread.

2. The formula makes an assumption. "Mean ± 2 × SE" assumes that the means of many classes would pile up in a bell shape. Panel C showed that averages do this when the readings are spread evenly around the middle. But if the readings are not symmetric, with a long tail on one side, for example because a few students made very large mistakes, the bell shape is only approximate. The bootstrap makes no such assumption. It uses the actual shape of the readings in the bag.

3. It is one recipe for everything. Draw with replacement, calculate, repeat, sort, cut 2.5 % at each end. The computer does the repeating. We will use exactly this recipe again for the biomass of a whole plot.

What if we did not put the chips back? Then every pretend class would contain exactly the same 250 chips, only in a different order. Every pretend mean would be identical. The histogram would be one single bar, and it would tell us nothing. Putting the chip back is what lets the bag behave like the tree: it can give the same reading twice.

Panel F

Monte Carlo: when a tree has only one reading

In our real project nobody measures one tree 250 times. Each tree is measured once: one height, one DBH. So for a single tree there is no bag of readings to roll. The bootstrap cannot start. A bag with one chip always gives the same answer.

The idea. If we cannot fill the bag with readings, we fill it with an assumption. From Panel D we know how far a height reading can be from the truth: the CV of height readings was about 10 %. (A flat die with limits ± 10 % is not quite the same as a bell die with CV 10 %; see the note at the end of this panel.) So we say: "the true height is somewhere between the reading − 10 % and the reading + 10 %, and we have no reason to prefer any value in that range." That is a die with very many faces, all equally likely, spread evenly from 5.4 m to 6.6 m for a reading of 6.0 m. This shape is called the uniform distribution: drawn as a picture, it has a flat top. The shape is our choice, and it is part of the assumption. The die could instead have the bell shape that the readings in Panel D made, with most values near the reading and fewer far away; this shape is called the normal distribution, and pages 3 and 4 use it. Whatever the shape, the method is the same. Then we roll the die, exactly as before. This is the Monte Carlo method, named after the casino town, because it works by rolling dice.

Two uniform distributions. Left: an ordinary die. Six values, each with probability 1/6. Right: the height die for a reading of 6.0 m. Every value from 5.4 m to 6.6 m is equally likely, and nothing outside is possible. Both pictures have a flat top: that is what "uniform" means. Compare the bell shape of the real readings in Panel D, where values near the middle were more common.

Two new words

Uniform distribution
Every value between a low limit and a high limit is equally likely. An ordinary die is uniform on 1 to 6. Here the die is uniform on "reading − 10 %" to "reading + 10 %".
Normal distribution (bell shape)
The other common die shape. Values near the middle are most likely and values far away are rare, like the pile of readings in Panel D. Its size is given by an SD or a CV, not by two limits. Pages 3 and 4 use this die.
Monte Carlo
The bootstrap with a bag that we build ourselves from an assumed shape (here uniform; on pages 3 and 4 the bell shape) and an assumed size of error (here ± 10 %). Draw, calculate, repeat, sort, cut 2.5 % at each end: the same steps.
Bootstrap (Panel E)Monte Carlo (this panel)
What is in the bagReal readingsValues made from an assumption: a shape and an error size
Where the spread comes fromThe data itselfThe assumed error, for example ± 10 %
NeedsMany readings of the same thingOne reading plus a known or assumed error
The rolling and countingIdentical: draw, calculate, repeat thousands of times, sort, cut 2.5 % at each end

A worked example by hand: the volume of a trunk

For one tree alone, Monte Carlo on the height gives nothing new: the mean is the reading and the range is ± 10 %. It becomes useful when the reading goes into a formula. Take the simplest tree formula: treat the trunk as a cylinder. Its volume is V = π × r² × H, where r is the radius, half the DBH.

One tree was measured once: H = 6.0 m and DBH = 8.0 cm, so r = 4.0 cm = 0.04 m. From the readings alone: V = 3.1416 × 0.04 × 0.04 × 6.0 = 0.0302 m³ = 30.2 litres (1 m³ = 1,000 litres). But how sure are we of 30.2? Height can be off by ± 10 %, DBH by ± 3 % (about the size of the DBH spread seen in Panel D). Two errors go into one formula, and the DBH is squared. Working this out with algebra is messy. Rolling is easy.

For a hand calculation, make the two dice with coarse faces. Height die: 13 faces, 5.4, 5.5, 5.6, …, 6.6 m (6.0 ± 10 %). DBH die: 5 faces, 7.8, 7.9, 8.0, 8.1, 8.2 cm (8.0 ± 3 %, rounded to 0.1 cm). Roll both, calculate V, repeat:

RollHeight die, mDBH die, cmr = DBH ÷ 2, mV = 3.1416 × r² × HV, litres
15.78.10.04053.1416 × 0.00164 × 5.7 = 0.0294 m³29.4
26.57.90.03953.1416 × 0.00156 × 6.5 = 0.0319 m³31.9
35.58.20.04103.1416 × 0.00168 × 5.5 = 0.0290 m³29.0
46.28.00.04003.1416 × 0.00160 × 6.2 = 0.0312 m³31.2
55.97.80.03903.1416 × 0.00152 × 5.9 = 0.0282 m³28.2

After 5 rolls the mean is (29.4 + 31.9 + 29.0 + 31.2 + 28.2) ÷ 5 = 29.9 litres. Five rolls are too few, just as 5 rolls of a die were too few in Panel A. Let the computer roll 2,000 times below. The pile of 2,000 volumes gives the mean, the SD and the 95 % interval of V. You will find: mean about 30.2 litres, SD about 2.0 litres, 95 % interval about 26.5 to 34.1 litres. So we report: V = 30.2 litres, 95 % interval 26.5 to 34.1 litres, or "30 litres, plus or minus about 13 %".

rolls: 0
The latest roll
Press Step to roll the two dice once.
The first five rolls of the computer
RollH, mDBH, cmV, litres
V from the readings alone
–
Mean of the rolled V
–
SD of the rolled V
–
CV = SD ÷ mean
–
95 % interval of V (sort and cut 2.5 % each end)
–
Each roll gives one possible volume, dropped into this histogram. Dashed green line: the mean of the rolls. Small orange triangle: V from the readings alone. Orange bracket: the 95 % interval. Change the readings or the error sizes above and roll again.

Three things to remember about Monte Carlo

The answer is only as good as the assumption. The bootstrap gets its spread from real readings. Monte Carlo gets it from the ± 10 % we put in. Where does the 10 % come from? From an exercise like Panel D, where many people measure one tree; from the instrument's manual; or from a small test. If we assume ± 5 % instead, the interval for V becomes narrower, but not because we measured better. Try it above.

Uniform is the honest choice when you only know the limits. In Panel D the readings piled up in a bell shape, with most readings near the middle. A uniform die says "anywhere between the limits, equally likely". It is the simplest shape, and it is a safe choice when all you know is "about ± 10 %". When more is known, other shapes can be used, for example the bell shape. One care is needed: a flat die with limits ± 10 % is not the same as a bell die with CV 10 %. The flat die from 5.4 m to 6.6 m has an SD of only 0.35 m, a CV of about 6 %, because its values never go beyond the limits. A bell die with CV 10 % has SD = 0.6 m, and about 1 draw in 20 lands more than 1.2 m from the reading. Panel D showed a bell shape with CV about 10 %, so the later pages use the bell die with CV 10 %. This page uses the flat die only because it is easy to roll by hand.

The same dice, a bigger formula. Here the formula was a cylinder with two inputs. For the project, the formula will be the real biomass equation, which has five uncertain inputs instead of two. The method does not change: build a die for each uncertain input, roll them all, calculate, repeat, sort, cut.

What to notice

  1. Probability needs many trials. After 10 rolls, the bars in Panel A are uneven. After 10,000 rolls they are almost flat. "1/6" describes the long run, not the next roll.
  2. Readings let you guess a hidden thing. In Panel B, a few hundred rolls were enough to tell an ordinary die from a die with two fives or from an eight-faced die. In Panel D, 250 readings tell us the height of a tree to within about ± 0.08 m, even though a single reading can be off by more than half a metre.
  3. The same √n rule appears three times. In Panel A, one roll has SD 1.71, so after n rolls the running mean is usually no further than 1.71 ÷ √n from 3.5. For example, after 100 rolls: 1.71 ÷ √100 = 1.71 ÷ 10 = 0.17, so the running mean is usually between 3.33 and 3.67. In Panel C, the SE of the average of k dice is 1.71 ÷ √k. In Panel D, the SE of the mean of 250 readings is SD ÷ √250. It is one rule in three places: averaging n values divides the spread by √n.
  4. Two different 95 % ranges. Mean ± 2 × SD is where 95 % of the single readings fall. Mean ± 2 × SE is where the true value very probably lies. The first is for one roll, the second for the average of many rolls. Do not mix them up.
  5. Two ways to the same interval. Panel D used the formula mean ± 2 × SE. Panel E rolled the bag of readings 2,000 times and got the same interval without any formula. The bootstrap also works for the SD, the median, or anything calculated from the readings, where no formula exists.
  6. Monte Carlo is the bootstrap with a bag you build yourself. When a tree has only one reading, assume the size and the shape of the error (here ± 10 %, uniform; on pages 3 and 4 a bell shape with CV 10 %), build the die from it, and roll. Panel F turned one height and one DBH into a volume of 30.2 litres with a 95 % interval of about 26.5 to 34.1 litres.
  7. Height is harder to measure than DBH. Press the "DBH, cm" button in Panel D. The DBH readings agree with each other much better (CV about 3 %) than the height readings (CV about 10 %, exactly 10.6 %).