🎓 Classroom Probability Theory Analysis

Predictions, Observations, Tables, Graphs, and Statistics for the Dice-Rolling Laboratory

by Professor Stephen T. Abedon Steve Abedon, Ph.D., has taught well over 100 individual classes and ~10 individual courses (including introductory biology, microbiology, physiology, biochemistry, etc.) over his 30+ years as a college professor. He has over 150 publications, including multiple monographs, and is ranked in the top 1 or 2 percent among researchers of all disciplines worldwide. His research focuses on bacteriophage biology and phage therapy. (abedon.1@osu.edu)

phage.org | phage-therapy.org | biologyaspoetry.org | abedon.phage.org | google scholar | publications

Jump to:   🎲 Roll Some Dice  |  📖 Definitions  |  🧠 Theory  |  ➗ Practice  |  📋 Enter Rolls  |  📊 Tables  |  🏫 Class Pool  |  ✏️ How to Graph  |  📈 Graphs  |  🧪 Statistics  |  ❓ Do You Understand?  |  🧮 More Calculators

What Is the Classroom Probability Theory Analysis? In the probability laboratory exercise, pairs of students roll dice, record what they got, work out what they should have gotten, and then confront the two. The gap between those two numbers is the whole subject: it is small when the underlying model is right and the sample is large, it is large when the sample is small, and learning to tell an honest gap from a meaningful one is most of what statistics is for. This page carries the exercise all the way through. It develops the probability theory from the sample space rather than asserting it, accepts rolls made with real dice or generates them on request, builds every table the handout asks for, draws the graphs, and then analyzes the result far past the point where a pencil would stop.

The statistics on the handout have been kept deliberately simple — a sum of absolute differences, compared between a smaller and a larger sample. For a first-year student with a pencil, that is the right choice. A computer is under no such constraint, so this page carries the analysis further, in four steps. It computes the chi-square goodness-of-fit test that a geneticist would actually use on these data. It computes the likelihood-ratio test that often serves better. It runs an exact Monte Carlo test, which sidesteps a problem the handout's numbers walk straight into: at twenty rolls the expected counts are far too small for the standard test to be trusted. And it shows what happens as the sample grows — the total departure from expectation gets larger, while the departure per roll gets smaller. All of it is developed from the beginning, with the arithmetic shown rather than hidden.

This is a biology course, not a mathematics course, so nothing below assumes any mathematics beyond arithmetic and a willingness to think carefully. Every formula that appears is explained in words first and symbols second, and every result the page computes can be checked by hand from numbers the page also shows.

Everything is saved in this browser as you go, so a crash, a reload, or an accidentally closed tab will not cost you your data. Nothing is transmitted anywhere: all of the work happens in the browser on the machine in front of you. 📄 The Laboratory Exercise (PDF) Your answers to the Check Yourself questions are kept in your browser as you go, and the Definitions tab has a button to download a summary of your work. To share a particular section, use the 🔗 link beside its heading, which copies a web address that opens the page right there. To cite this tool: Abedon, S.T. (2026). Classroom Probability Theory Analysis. biologyaspoetry.org/laboratories/probability/.

biologyaspoetry.org/laboratories/probability/  ·  Abedon’s Books

How can I improve this page?  contact: probability@biologyaspoetry.org

Showing this to a class? Hides the reading matter so that each experiment’s controls, graph and numbers sit together on one screen.
Want to see what unfair dice look like? One face will be favored, chosen at random and not shown to you. Roll for a while, then press Explain These Numbers and see whether the statistics can work out which face it was.

🎲 Before Anything Else, Roll Some Dice

This page could simply tell you that the chance of throwing a 4 is one in six. Instead, throw a die and watch the number appear. Everything on the tabs that follow is easier once the numbers have been seen arriving rather than announced.

There are five experiments below, and they are meant to be done in order. The first three watch one thing at a time: a chosen face on one die, then a chosen ordered pair on two, then a chosen total. The last two watch everything at once: all eleven totals as bars, then all thirty-six ordered outcomes as a grid. Each works the same way. You pick something to look for, you make the dice roll — one roll at a time by hand, by clicking the graph itself, or automatically if you would rather watch — and the graphs draw themselves as the rolls accumulate. The graphs are the point. Watch the wobbling line settle.

Two words, before you start, because both graphs use them. Expected is what the dice ought to do: a number worked out beforehand, which does not change no matter what happens on the table. It is the dashed line. Observed is what the dice actually did: counted, not calculated, and different every time you run the experiment. It is the solid line. The whole of this laboratory, and a surprising amount of biology, is about the gap between those two. Notice as you roll that the gap is enormous at first and shrinks as the rolls pile up. It never closes completely, and it is not supposed to.

Nothing on this tab is saved or recorded. It is a place to play. The rolls that count toward the exercise are entered on the Enter Rolls tab.

🎥 The Same Ground, on a Blackboard

Three recordings of this material being taught in a room, by the author of the laboratory. The first builds the theory from nothing on a blackboard; the second drives this very page and shows what every control on the tab above is for; the third is the graphing half of the same class. None is required, and the experiments above do not wait for them — but if you would rather be told than read, start here.

Basics of Probability Based on Dice
Biology as Poetry · a blackboard, from nothing
Six faces, so one chance in six. Then the two rules, built up rather than announced: the law of multiplication getting from one die to 6 × 6 = 36, and the law of addition collecting the four ordered ways of making a five into 4/36, which reduces to 1/9 and comes out as 0.111 repeating. Two things in it are worth carrying into the rest of this page. The first is a check you can apply to any probability you ever compute: run through every possibility, and they must add to one — if they do not, you have left one out or made an arithmetic mistake. The second is the distinction the whole page is built on, that an expectation is a prediction and an observation is what happened, and that an expectation is perfectly entitled to be fractional even if your observations are all going to be whole numbers like whole people.
Simulations of Observations: Driving This Page
Biology as Poetry · this page, in use
A walk through the tab above, unrehearsed and in real time, which makes it the closest thing to a guided tour: rolling once and then automatically, watching the count and the fraction climb on their two separate axes, loading the dice in secret and catching the bias, reordering the eleven sums from rarest to commonest to get the staircase, and switching the 6 × 6 grid between counts, frequencies and departures. The useful parts are where it goes wrong. Twenty thousand rolls still leave one sum visibly off, which is the point rather than a flaw. And a figure stated from memory in the first video, 0.056 for 1/36, is caught here by the page itself and corrected on camera to 0.0277 — a demonstration, not planned as one, of why you compute rather than recall.
Basic Ideas on How to Make a Graph
Biology as Poetry · the same lecture, five minutes
The graphing half of the same class. Axes first, then the one thing it most wants you to take away: use up as much of the graph real estate as you can, which is the rule the How to Graph tab states as the data filling the plotting area. Its definition of the dependent variable is sharper than this page's — the thing that may or may not change as we change the independent variable — because an experiment where nothing happens is still an experiment.

It then does something no other video here does: it log-transforms the vertical axis, which is routine in microbiology and turns a J-shaped growth curve into something whose early history you can actually read. That technique is the one respectable exception to the rule that a count axis starts at zero, for a reason worth understanding — see The one axis that cannot start at zero on the How to Graph tab. It is also the one piece of advice here you should not apply to this laboratory's own figures, and the box says why.
A word on the names. The videos say law of multiplication and law of addition; this page says rule throughout, as do most textbooks. They are the same two statements and the words are interchangeable — nothing turns on which you use.

⚀ Experiment 1: One Die, One Number

Pick a number from 1 to 6. The question is how often a single die comes up as that number. Almost everyone can guess the answer, but guessing it and watching it are different experiences, and the second one is the useful one.

What to look for. The first graph wanders violently for the first dozen rolls and then calms down. That is not the die changing its behavior; it is arithmetic. One hit in the first 3 rolls is a third, while one extra hit in 300 rolls barely moves the line. Early rolls have enormous leverage over the running fraction and later rolls have almost none, which is the whole reason that large samples are steadier than small ones — and the reason twenty rolls, in the exercise proper, will not look nearly as tidy as you might expect.

⚅ Experiment 2: Two Dice, in Order

Now two dice, and a harder target: a particular number on the first die followed by a particular number on the second. A 2 and then a 3, say. Order matters here, so a 3 and then a 2 does not count as a hit — set the two selectors the other way round and you are asking a different question.

Before rolling, guess how much rarer this is than Experiment 1. Then roll and find out. Most people guess too low.

What to look for. This one takes far longer to settle, and the reason is simply that hits are rarer: one time in thirty-six rather than one in six. You can roll fifty times and see none at all, which feels like evidence that something is wrong and is nothing of the kind. Run it automatically for a few hundred rolls and the line finds its level. The lesson worth carrying forward is that how many rolls is enough depends on how rare the thing you are counting is, and the rarest sums in the exercise are exactly this rare.

🎲 Experiment 3: Two Dice, Added Together

Last, the quantity the handout actually uses: the two numbers added together. Pick a total from 2 to 12 and count how often the pair comes to it.

Try 7 first, then try 2, and compare how long each takes to settle and where each line ends up. The two are not equally likely, and this is the experiment that shows it before the Theory tab explains it. If the eleven totals were equally likely, every one of them would settle at about 0.09, which is one in eleven. Watch whether they do.

What to look for. A total of 7 settles near 0.167, which is one in six. A total of 2 settles near 0.028, which is one in thirty-six, and is therefore six times rarer. Nothing settles at one in eleven. Run a few of the totals and the pattern becomes visible: the middling totals are common and the extreme ones are rare, because there are many ways to make a 7 and only one way to make a 2. Counting those ways is all the Theory tab does.

📊 Experiment 4: Fill In All Eleven at Once

The first three experiments watched one thing at a time. This one watches all eleven totals together. There are eleven empty bars, one for each total from 2 to 12, and every roll adds a brick to whichever bar matches the total it threw. Roll by hand to place bricks one at a time, or set it running and watch the shape build.

Two things to try. First, press Roll Until All Eleven Appear and notice how many rolls it takes before every bar has at least one brick — the 2 and the 12 keep you waiting a long time, and that is the whole difficulty the exercise runs into at twenty rolls. Second, change the ordering of the bars.

Why the ordering matters. Left to themselves, the totals come in their natural order, 2 through 12, and the bars make a tent: low at both ends, high in the middle. Switch the ordering to probability, rarest on the left and the same bars climb steadily from left to right instead, because they have been lined up by how likely each total is rather than by its numerical value. Nothing about the data changed; only the order of the columns did. That second arrangement is the one the handout asks for in Table 3, and this is the reason: when the bars are lined up by prediction, a bar that is out of step is visible immediately, which it is not when the tall ones sit in the middle. What must never be done is the third possibility — ordering the bars by their own observed heights, which turns any set of random numbers into a tidy staircase and invents a result. There is a figure on the How to Graph tab that does exactly that, deliberately, so that it can be recognized later.
What to look for. At twenty rolls the bars are a mess, with several totals missing altogether. At two hundred the tent is unmistakable. At two thousand the bars sit almost on top of the circles. The dice did not improve; there were simply more of them. Keep that picture in mind on the Tables tab, where your own twenty rolls are set against the same expected values, and on the Class Pool tab, where everyone's rolls together do to your Table 2 roughly what rolling on here does to these bars.

🎲 Experiment 5: The Same Rolls, Where Order Counts

One more, and it is the one the whole laboratory rests on. Experiment 4 sorted the rolls into eleven bars by their totals. This one sorts the very same kind of rolls into thirty-six cells by what each die actually showed. The row is the first die, the column is the second, so a 2 then a 5 goes in a different cell from a 5 then a 2.

Roll for a while and compare the two pictures. The eleven bars were wildly unequal, with 7 towering over 2 and 12. These thirty-six cells are not unequal at all: every one of them expects exactly the same count, the number of rolls divided by 36. Whatever unevenness you see here is noise, and it is worth staring at that unevenness for a moment, because it is what honest randomness looks like.

Then outline a total, and the whole exercise falls into place. Pick a total from the selector and the cells that make it are outlined. A 7 outlines six cells — 1 and 6, 2 and 5, 3 and 4, 4 and 3, 5 and 2, 6 and 1. A 2 outlines one cell, because only 1 and 1 will do. The cells are all equally likely; the groups of them are not, and a total is likely in exact proportion to how many cells carry it. Add up the outlined counts and you get precisely the height of that total's bar in Experiment 4. The eleven unequal bars and the thirty-six equal cells are the same rolls counted two ways, and every probability in this laboratory comes from counting the cells rather than the bars.
Counts and frequencies are the same thing said two ways. A count is how many times a cell has been hit: a whole number that climbs forever as you keep rolling. A frequency is that same count divided by the number of rolls, so it answers a different question — not how many but what share. Counts grow without limit; frequencies settle down. Use the display selector to put either one in the cells, or both at once, or to have the emphasis shift back and forth between them so that the two readings of a single cell can be held in mind together.
And every cell has the same frequency to settle on. This is the point worth leaving the room with. All thirty-six cells are equally likely, which means every one of them expects the same frequency: 1/36, or 0.0278, or about 28 rolls in every thousand. Not approximately the same — exactly the same, for all thirty-six. Switch to frequencies and roll for a while and the numbers in the cells converge on one value instead of scattering. Then add the thirty-six fractions up: they come to 1, and they come to 1 however the rolling went, because every roll landed in exactly one cell. Probabilities over all the things that could happen always total 1, and here you can watch that happen rather than be told it.
What to look for. Press Roll Until Every Cell Is Hit and compare the count with what the eleven bars needed. Filling all eleven totals takes around sixty rolls; filling all thirty-six cells takes around a hundred and fifty, and the last few cells can keep you waiting a very long time. Both numbers are worth knowing before you are handed twenty rolls and asked to say something about a die. Tables 6 and 8 of the handout are this grid, and the Tables tab builds it from your own rolls.

🎥 One Die, in Slow Motion

Nothing is being taught here. It is a die tumbling in slow motion, and it is on the page because it is worth looking once at the thing the rest of this laboratory is a model of. Everything on the other tabs rests on the claim that nothing about that tumble favors one face over another.

A Die Rolling in Slow Motion
Nonessential · watch it anyway
A die rolling in slow motion. That is all it is.

💡 What Those Graphs Were Telling You

Four things, and the rest of this page assumes all four. None of them had to be taken on trust; each one was on the screen.

  • A probability is a long-run frequency, not a promise about the next roll. The line settles toward one in six. It does not visit one in six and stay there, and nothing forces the next roll to cooperate.
  • Small samples wobble; large ones do not. The same experiment is wild at ten rolls and steady at a thousand. The dice did not change.
  • Rarer things need more rolls. One in six settles quickly; one in thirty-six takes much longer. Exactly this is why the exercise's twenty rolls have so much trouble with the sums 2 and 12.
  • Observed and expected are different kinds of number. One was counted off the table and one was worked out beforehand. They do not match, they are not supposed to match, and deciding how much mismatch is acceptable is what the Statistics tab is for.
  • The thirty-six ordered outcomes are equally likely, and the eleven totals are built out of them. Every cell of the grid expects the same count. A total is likely in proportion to how many cells carry it, which is 6 for a 7 and 1 for a 2. Counting cells is the one move behind every number on this page.
  • The eleven totals are not equally likely, and the shape shows it. Enough rolls and the bars make a tent with its peak at 7. Nothing imposed that shape; it followed from there being six ways to throw a 7 and one way to throw a 2. How the bars are ordered changes the picture completely without changing a single number in it, which is the first lesson of the How to Graph tab.

With that in hand, the vocabulary on the next tab has something to attach itself to.

📖 The Words You Will Need

Probability has a vocabulary that overlaps with ordinary English without quite matching it, and most of the confusion students meet in this laboratory comes from that overlap rather than from the arithmetic. The list below is worth reading once before the exercise and once again afterward, when the words have something to attach themselves to.

The four numbers this whole laboratory runs on. Four numbers come up on every tab of this page and all through the handout. None of them is assumed anywhere below. Here is where each one comes from. If you have come straight here, the Roll Some Dice tab shows the first three of them arriving on a graph, which is worth ten minutes before reading any of this.
  • 6. One die has six faces, carrying the numbers 1, 2, 3, 4, 5, and 6.
  • 1/6. On a fair die, no face is favored over any other. So the chance of throwing any one particular number — a 4, say — is one face out of six faces: 1/6. As a decimal that is 0.1667, and in plain words it is about 17 times in every 100 rolls, or roughly one roll in six.
  • 36. Two dice are thrown together. The first die can land six ways. For each of those six, the second die can land six ways. So the pair can land 6 × 6 = 36 different ways altogether. That is where every 36 on this page comes from, and the 36 cells of the grid on the Theory tab are those 36 ways written out.
  • 11. The exercise mostly works with the two numbers added together. The smallest total possible is 1 + 1 = 2 and the largest is 6 + 6 = 12, and every whole number in between can happen. So the possible totals are 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Count them and there are eleven. That is what “the eleven possible sums” means every time this page or the handout says it.
And one warning to carry into the exercise, because almost everyone gets it wrong the first time: those 36 ways are all equally likely, but those eleven sums are not. Eleven possible sums does not mean a one-in-eleven chance of each. The Theory tab shows why, by counting.

The apparatus

Die (plural dice). A cube whose six faces carry one through six dots. A fair die is one for which every face is equally likely to end up on top. Six faces, none of them favored, means the chance of any one of them is one out of six: 1/6, or 0.1667, or about 17 rolls in every 100. A die that is not fair is loaded, whether deliberately, through a manufacturing defect, or because it is being rolled onto a surface that favors one face. Fairness is an assumption about the world, not a property of the mathematics, and the last part of this page is devoted to how one would test it.

Trial. One performance of the random procedure — here, one roll. Sample size, written n, is the number of trials. In this exercise a trial is a roll of a pair of dice, so n = 20 means twenty pairs, which is forty individual dice.

Outcomes and events

Outcome. One of the indivisible things that can happen on a trial. For two dice that can be told apart there are thirty-six outcomes, one for each pairing of a face on the first die with a face on the second: six choices for the first die, times six choices for the second, which is 6 × 6 = 36.

Sum. The number on one die added to the number on the other. If the dice show 3 and 5, the sum is 8. The sum is what most of the handout's tables are built from, and it is worth being exact about how many sums there are. The smallest is 1 + 1 = 2; the largest is 6 + 6 = 12; every whole number from 2 to 12 can be thrown. Written out, the possible sums are 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12 — eleven possible sums in all. Two things to notice. A sum of 1 is impossible, because the lowest either die can show is 1 and there are two of them. And although there are thirty-six outcomes, there are only eleven sums, because many different outcomes give the same sum: (3, 5), (5, 3), (4, 4), (2, 6), (6, 2) all come to 8. That is the whole reason the eleven sums are not equally likely.

Sample space. The complete list of outcomes. Writing it down is the single most useful thing one can do when a probability question turns confusing, and it is what the grid on the Theory tab is. Every probability question in this laboratory can be answered by counting cells in that grid, with no formula at all.

Event. Any collection of outcomes that one chooses to care about — “the sum is 8,” “the two dice differ,” “at least one 5.” An event is a region of the sample space, and its probability is the fraction of the space it covers.

Mutually exclusive. Two events are mutually exclusive when they cannot both happen on the same trial. “Sum of 7” and “sum of 8” are mutually exclusive. “Sum of 7” and “at least one 5” are not, because (2, 5) satisfies both. Mutual exclusivity is the condition the addition rule needs, and it is not the same thing as independence, which is the next entry. Keeping the two apart is worth the effort: they are the most commonly swapped pair of words in the subject.

Independent. Two events are independent when knowing that one happened tells you nothing about whether the other did. The two dice in this exercise are independent: the first die has no way to learn what the second one did. Independence is an assumption about a mechanism, and it is the assumption that fails most often in real biology — which is why the word appears so frequently in the rest of this page. Note that an independent variable, the thing plotted on a horizontal axis, is a completely unrelated use of the word; the How to Graph tab has a box on the collision.

Dependent (also conditional). The opposite: knowing that one event happened does change the probability of the other. Drawing a second card from a deck with the first one still out is the standard example, and sampling anything from a small population is the biological one. Dependence does not break the multiplication rule, it only means the general form of it is needed; the Theory tab works that out under What to Do When Independence Fails.

Conditional probability. The probability of one event given that another has happened, written P(B | A) and read the probability of B given A. The vertical bar means given, not divided by. For independent events P(B | A) is just P(B), which is what independence means stated in symbols.

Independent and mutually exclusive are not the same, and are nearly opposites. Independence is about whether knowing one event changes the odds of the other. Mutual exclusivity is about whether they can both happen at all. Mutually exclusive events are about as far from independent as it is possible to get, since learning that one happened tells you the other certainly did not. The two words attach to different rules: multiplication needs independence, addition needs mutual exclusivity. The clearest case is “at least one die shows a 5.” Its two halves — the first die showing 5, the second die showing 5 — are independent and are not mutually exclusive, which is exactly why adding 6/36 and 6/36 overcounts: the two can both happen, in the cell (5, 5). The right answer is 11/36, and the sample space on the Theory tab walks through it beside the grid.
Probability, odds, and chance are not synonyms. The handout, like nearly all of casual English, uses odds to mean probability. Strictly they are different numbers computed from the same situation. A probability is favorable outcomes divided by all outcomes, and runs from 0 to 1. Odds are favorable outcomes divided by unfavorable ones, and run from 0 to infinity. Rolling a 5 on one die has a probability of 1/6 and odds of 1 to 5. The two are interconvertible — odds = p/(1 − p) — and this page always reports probabilities, saying so. It is worth knowing the distinction because odds are genuinely used in biology, in the odds ratios of epidemiology and in the logistic regressions built on them.

Rules

Multiplication rule. When two things happen independently, the probability that both happen is the product of their separate probabilities. Rolling a 3 and then a 2 has probability (1/6) × (1/6) = 1/36. Multiplication is the rule for and, and is also called the law of multiplication. It has a general form that drops the requirement of independence, P(A and B) = P(A) × P(B | A), worked out on the Theory tab.

Addition rule. When two events are mutually exclusive, the probability that one or the other happens is the sum of their separate probabilities. Getting a 3 then a 2, or a 2 then a 3, has probability 1/36 + 1/36 = 2/36 = 1/18. Addition is the rule for or, and is also called the law of addition. It too has a general form that drops its requirement, P(A or B) = P(A) + P(B) − P(A and B), which subtracts the overlap that plain addition would count twice. Both rules work the same way: state the easy version with its condition, then drop the condition and pay for it with one extra term.

Complement rule. The probability that an event does not happen is 1 minus the probability that it does. It earns its own name because it turns an awkward count into an easy one. “At least one die shows a 5” is painful to count forwards and cannot be reached by adding 6/36 and 6/36, since those two overlap in the cell (5, 5). Counted backwards it is almost nothing: neither die shows a 5 with probability (5/6) × (5/6) = 25/36, and everything else is the event wanted, so the answer is 1 − 25/36 = 11/36. Whenever an event is hard to count, the thing it leaves out is often easy, and the two must add to 1.

Order matters, or it does not. This is the distinction the exercise is built around. If (3, 2) and (2, 3) count as different results, order matters and there are thirty-six results. If they count as the same result, three things follow at once: order does not matter, several ordered outcomes collapse into one, and the probabilities of those outcomes add. Sums are the most familiar way of not caring about order: a sum of 5 does not record which die contributed what.

Predicting and observing

Prediction (also expectation, also expected value). What the model says should happen, computed before looking. For a count, the expected number is the sample size multiplied by the probability: E = np, where E is the expected count, n is the number of trials, and p is the probability of the event on any one trial. Expected values are routinely fractional. Expecting a total of 0.56 rolls of snake eyes in twenty trials is not a mistake and does not need rounding; it is the long-run average of a quantity that is always a whole number in any single experiment.

Observation. What actually happened, counted. Observations are whole numbers here, and they are not wrong when they disagree with the prediction. A prediction and an observation are different kinds of thing, and the entire enterprise of statistics exists to say how much disagreement between them should be tolerated.

Deviation (also residual). Observed minus expected, O − E. It carries a sign; the sign is informative and is discarded only deliberately, by taking the absolute value or by squaring.

Stochastic. Governed by chance. A stochastic process gives different answers on repetition even when nothing about the setup has changed. Its opposite is deterministic. Biology is stochastic at every scale that matters here: which sperm reaches the egg, which allele goes into which gamete, which cell mutates, which bacterium a phage happens to encounter.

Variance and standard deviation. Two measures of how widely a stochastic quantity scatters around its average. Variance is the average squared deviation; the standard deviation is its square root, which has the advantage of being in the same units as the thing measured. The handout uses the word variance informally for a sum of absolute differences, which is a legitimate measure of scatter but strictly, statistically, is not the variance; the Statistics tab computes both and keeps them apart.

Law of large numbers. The statement that as the sample grows, the observed fraction converges on the true probability. Note carefully what it does not say: it says nothing about the observed count getting closer to the expected count. The count usually drifts further from its expectation as the sample grows, and the exercise you are about to do demonstrates exactly that.

Testing

Null hypothesis. The dull explanation, held onto until the data make it untenable. Here it is that the dice are fair and independent, and that any gap between observation and prediction is chance alone.

Goodness of fit. A test asking whether one set of observed counts is consistent with a set of expected counts. The chi-square test is the classic one, and it is the test a geneticist reaches for when a cross gives 84 tall and 30 short instead of the 85.5 and 28.5 that a 3 : 1 ratio predicts.

p-value. The probability of seeing a discrepancy at least as large as the one observed, if the null hypothesis is true. Small p means the data sit awkwardly with the model — and the model here is the null hypothesis itself, the assumption that the dice are fair and independent. A small p is not the probability that the model is wrong, and it is not the probability that the result happened by chance. Those two misreadings — that the model is wrong, or that the result happened by chance — are so common that they have their own literature.

Degrees of freedom. The number of counts in a table that are free to vary once constraints are imposed. Eleven possible sums whose counts must total n give ten degrees of freedom: fix any ten and the eleventh is determined.

Negative control. A condition in which the effect being looked for is known to be absent, run so that the experiment can be caught if it produces an effect where none exists. Fair dice are the negative control of this exercise: every departure from expectation that they produce is, by construction, noise, which makes them the standard against which a real departure would have to be judged.

🧬 Where This Fits in Biology

Dice are a stand-in, and the thing they stand in for is most of quantitative genetics and a good deal of microbiology besides. The two rules that this laboratory teaches are the two rules that Mendelian genetics runs on, and they are applied there in exactly the form practiced here.

  • The multiplication rule is the dihybrid cross. Two genes assorting independently give a 9 : 3 : 3 : 1 ratio because (3/4) × (3/4) = 9/16, and so on through the four combinations. A Punnett square is a sample space drawn as a grid, which is precisely what the grid on the Theory tab is.
  • The addition rule is the heterozygote. In a population with allele frequencies p and q, the frequency of heterozygotes is 2pq and not pq, for exactly the reason that a 3-then-2 or a 2-then-3 has probability 2/36 and not 1/36: there are two paths to the same unordered result, and their probabilities add. The factor of two in the Hardy–Weinberg equation is this laboratory's Exercise 2, in different clothing.
  • The chi-square test is how Mendelian ratios are actually judged. No cross ever gives exactly 3 : 1. The question is always whether the departure is larger than chance would supply, and the standard answer for a century has been a goodness-of-fit test on the counts.
  • Fluctuation is itself evidence. Luria and Delbrück (1943) settled whether bacterial mutations arise before or in response to selection by looking at nothing but the scatter among replicate cultures. The mean was uninformative; the variance carried the whole answer. Learning to treat deviation as data rather than as error is what made that experiment possible, and it remains one of the more powerful habits in experimental biology.
  • Small samples are the normal condition. Twenty rolls leave an expected count of 0.56 in the rarest category, which is below one and far too small for a chi-square test to be trusted. The same arithmetic catches a genetics class: a dihybrid cross expects a 9 : 3 : 3 : 1 ratio, so sixteen offspring expect just one individual in the rarest class, and eleven offspring expect 0.69 of one. The remedy is the same in both places. Pool the sparse categories together, or abandon the approximation and test by simulation. Both are done on the Statistics tab.

📝 A Note on What This Page Is For

The laboratory exercise can be completed with a die, a pencil, and the handout, and that is how it is meant to be done: rolling a physical die and writing the result down is part of the point, because it puts a real stochastic process in the room rather than a simulated one. This page is not a replacement for that. It is what you use afterward, when twenty rolls of two dice are sitting on the page in front of you and the question becomes what they mean.

Everything here also works in the other direction: rolls can be generated on request, in any quantity. Generated rolls are no substitute for the exercise itself, the whole point of which is to roll real dice, but they are indispensable for the analysis that comes afterward. Once one can produce ten thousand imaginary classrooms in a second, questions that were unanswerable with a pencil — how unusual is a discrepancy this large? how many rolls would it take to catch a die that is loaded by ten percent? — become simple matters of counting.

🧭 What Is on Each Tab

💾 Your Work

Your answers are kept as you go. In most browsers they are still here if you leave and come back on the same device, though a private window, a different device, or cleared browser data will start you fresh. When you are done, download a summary to hand in or keep. It lists your answers and, for each, whether it was right the first time.

    📋 Everything Follows from Writing Down the List

    There is a temptation to treat probability as a subject made of formulas that have to be memorized and then matched to problems. It is not. For a situation as small as this one — two dice, and 6 × 6 = 36 possibilities — there is exactly one idea, and every formula in the exercise is a shortcut for applying it:

    probability of an event = number of outcomes in which it happens number of outcomes altogether valid whenever all of the outcomes are equally likely, which for fair dice they are

    The catch is the phrase equally likely. It is true of the thirty-six ordered pairs of faces, and it is emphatically not true of the eleven possible sums — the totals 2 through 12, which come to eleven numbers when you count them. That is the single most common error in this laboratory. There is no rule against working with sums; there is only a rule against assuming that eleven possibilities means one chance in eleven. So the list is written in terms of the things that are equally likely, and everything else is counted from it.

    🗺️ The Sample Space, Drawn

    Below is the complete list of what two dice can do. The row says what the first die — call it student A's die — showed; the column says what the second die, student B's, showed. Six rows and six columns make 6 × 6 = 36 cells, and each of those thirty-six cells is one outcome, every one as likely as any other. The number printed in a cell is the sum of its row and its column. Choose an event and the cells belonging to it are outlined.

    ✖️ The Multiplication Rule, and Why It Is a Rule

    The grid has thirty-six cells because there are six ways for the first die to land and, for each of those, six ways for the second to land. Six sixes is thirty-six. That is the whole derivation, and it explains the rule rather than asserting it: multiplying probabilities is what counting a grid does when the grid is expressed as fractions instead of as cells.

    P(A and then B) = P(A) × P(B) valid when A and B are independent — when the first result does not change the chances for the second

    A 3 followed by a 2 occupies one cell out of thirty-six, and (1/6) × (1/6) = 1/36 says the same thing.

    The rule extends to any number of independent steps, and it extends by multiplying one more time for each step. Three dice, for instance. The first can land six ways; for each of those the second can land six ways, which is already 6 × 6 = 36; and for each of those thirty-six the third can land six ways, giving 6 × 6 × 6 = 36 × 6 = 216 outcomes, each with probability 1/216. Ten flips of a coin work the same way with a 2 in place of each 6, because a coin has two sides rather than six faces: two flips give 2 × 2 = 4 outcomes, three flips give 4 × 2 = 8, and carrying on doubling once per flip — 16, 32, 64, 128, 256, 512 — the tenth flip brings it to 1,024. Each extra step multiplies the number of outcomes rather than adding to it, which is why the totals grow so quickly. A phage that must adsorb, inject, and replicate successfully is the same arithmetic in biology: its probability of getting all the way through is the three separate probabilities multiplied together, provided the three are independent.

    The condition is not decoration. Independence is what licenses the multiplication, and where it fails the rule fails with it. The probability that a student is over six feet tall is not independent of the probability that the same student plays center on the basketball team. The probability that a bacterium survives an antibiotic is not independent of whether its neighbor did, if they share a biofilm. Two dice on a table are independent because there is no mechanism by which one could influence the other — and it is the absence of a mechanism, not the absence of a correlation in the data, that establishes it.

    What to do when independence fails

    The rule above does not simply stop working when events are dependent. It generalizes, and the general form is worth knowing because in biology dependence is the normal case and independence the lucky one.

    P(A and B) = P(A) × P(B | A) always valid; the bar is read “given,” so P(B | A) is the probability of B once A is known to have happened

    P(B | A) is called a conditional probability. Read the formula aloud and it is almost obvious: the chance of both is the chance of the first, times the chance of the second in the world where the first already happened. Independence is simply the case where that second world looks like the first — where P(B | A) = P(B) — and the formula collapses into P(A) × P(B). The two dice are that case: the second die does not care what the first did, so the conditional probability is just 1/6 and the general rule and the simple one give the same 1/36.

    Cards are the standard counterexample because the deck remembers. Drawing a king and then a queen, without putting the king back, is (4/52) × (4/51) — four queens among the fifty-one cards that remain — which is 16/2652, or 0.60 percent. Treating it as independent would give (4/52) × (4/52), which is wrong, though here only slightly.

    It is not always slight, and the case where the error grows large is the one a biology class actually meets: a small population sampled without replacement. Suppose a cross yields eleven offspring and three of them are homozygous recessive, and you pick two of the eleven at random to grow on. The chance that both are homozygous recessive is (3/11) × (2/10) = 3/55, about 5.5 percent — two of the remaining three among the ten plants left. Assume independence and you get (3/11)2 = 9/121, about 7.4 percent, which is 36 percent too large. The error grows as the population shrinks, which is why it matters in a greenhouse and not at a roulette table.

    Why this exercise can ignore all of it. Rolling a die does not use the die up. Every roll draws from the same six faces, which is sampling with replacement, so the pool never changes and every conditional probability equals its unconditional one. That is the whole reason twenty rolls of two dice can be analyzed with 6 × 6 = 36 and nothing more. It is also the reason Punnett squares work: the pool of gametes is effectively bottomless, so taking one does not change what is left. Keep the general rule in reserve for the moment the pool is small and finite, because that moment arrives sooner in biology than anywhere else.

    ➕ The Addition Rule, and Why the Exercise Needs It

    Now stop caring about which die did what. A 3 and a 2, in whichever order, is now one result. Two cells of the grid have collapsed into one event, and the event is therefore twice as likely as either cell:

    P(A or B) = P(A) + P(B) valid when A and B are mutually exclusive — when they cannot both happen on the same trial; for events that can both happen there is a general form, two boxes below

    So P({3, 2} in any order) = 1/36 + 1/36 = 2/36 = 1/18, twice as large as the ordered version. This doubling is not a special trick for dice; it turns up in genetics under another name, and the next box works that out in full.

    One exception is worth stating because it catches people. A doubled result — two 2s, say — occupies only one cell, not two, because there is only one way to get it. A 2 and a 2 in either order is still just a 2 and a 2. So P({2, 2}) is 1/36 and not 2/36. Set the grid above to a specific unordered pair, try two different values and then two of the same, and count the outlined cells: two, then one.

    The same arithmetic, in genetics, is called Hardy–Weinberg equilibrium. It is worth spelling out, because it is the clearest case in biology of the two rules on this page doing real work, and dice can model it exactly.

    A note on one word first, because it is about to do double duty. In what follows, square means one of the thirty-six boxes of the grid, and nothing else. The eggs and sperm below are the biological cells; the squares are just places on a chart. Geneticists draw this chart and call it a Punnett square, which is where the word comes from.

    Suppose a gene comes in two versions, A and a, and across the whole population three gametes in every six carry A. A gamete is an egg or a sperm, and it carries one copy of the gene rather than two — which is exactly why a die, which shows one face at a time, can stand in for it. Let faces 1, 2 and 3 mean A and faces 4, 5 and 6 mean a. Now one roll is one gamete drawn at random, and a pair of rolls is one offspring: the first die is the egg, the second is the sperm. Each of the thirty-six squares is one possible fertilization, and they are all equally likely.
    • AA: egg and sperm both land in 1–3. That is 3 × 3 = 9 squares of the thirty-six, or 9/36 = 0.25. Written as a frequency it is (1/2) × (1/2), which geneticists write p2, where p is just the fraction of gametes carrying A. Multiplication rule, and it needs egg and sperm to be independent.
    • aa: both land in 4–6, again 9 squares, 9/36 = 0.25 — that is q2, with q the fraction of gametes carrying a.
    • Aa: one of each, in either order. An A egg meeting an a sperm is 9 squares; an a egg meeting an A sperm is another 9. Those cannot both happen for one offspring, so they add: 9 + 9 = 18 squares, 18/36 = 0.5. Written out that is pq + qp = 2pq. Addition rule, and the 2 is there for exactly the reason a 3 and a 2 in either order has twice the chance of a specified order.

    Add the squares up and they come to 9 + 18 + 9 = 36, every square used once, so the three frequencies add to 1 — p2 + 2pq + q2 = 1, which is the whole equation. There is no factor of two on the AA and aa terms for the same reason a double on two dice occupies one square rather than two: there is only one way to be AA, an A egg meeting an A sperm, whereas there are two ways to be Aa.

    Change the allele frequency by relabelling the die. Let only face 1 mean A and the other five mean a, so p = 1/6: then AA is 1 square, Aa is 1 + 1 × 5 = 10 squares, aa is 25 squares, and 1 + 10 + 25 = 36 again. Rare alleles are overwhelmingly found in heterozygotes, which falls straight out of the counting: 10 squares carry one A against the 1 square that carries two.

    When the events are not mutually exclusive, plain addition overcounts. “At least one 5” is not 1/6 + 1/6 = 1/3, because (5, 5) would then be counted twice, once for each die. The correct count is 11 cells out of 36, and the general repair is to subtract the overlap: P(A or B) = P(A) + P(B) − P(A and B), giving 1/6 + 1/6 − 1/36 = 11/36. Counting the grid gets this right without needing the repair, which is the argument for counting the grid.

    ⚖️ Why the Sums Are Not Equally Likely

    There are eleven possible sums — 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, which is eleven numbers — and they are famously unequal. The reason is visible in the grid: the sums lie along diagonals, and the diagonals are of different lengths. A sum of 2 has one cell, because only (1, 1) will do. A sum of 7 has six cells, because every face value has exactly one partner that completes it: 1 with 6, 2 with 5, 3 with 4, 4 with 3, 5 with 2, 6 with 1. So a 7 is six times as likely as a 2.

    Counted off the grid, the number of cells per sum runs 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 as the sum goes from 2 up to 12 — climbing to the peak at 7 and falling away symmetrically. Those eleven counts add to 36, as they must, since every cell belongs to exactly one sum. Anyone who prefers a formula to counting can get the same numbers from 6 − |s − 7|, where the bars mean “ignore the minus sign,” but the counting is the real thing and the formula is only a shortcut for it.

    The consequence is a distribution shaped like a tent rather than flat, and this is the first appearance in the course of something that will recur constantly: sums and averages of independent quantities pile up in the middle even when the quantities themselves do not. Push the exercise from two dice to ten and the tent becomes a bell. That tendency is the reason the normal distribution is everywhere in biology — heights, enzyme rates, and measurement errors are all sums of many small independent contributions — and it can be watched happening in a laboratory with dice.

    Table T1. The distribution of the sum of two fair, six-sided dice. Ways counts cells of the sample space. Expected is np, the prediction for the stated sample size, and is deliberately not rounded to a whole number. SD is the standard deviation of that count, √(np(1 − p)), which says how far from the prediction a single experiment should typically land.
    Figure T1. The probability of each sum of two fair dice. The shape is a triangle because the number of ways of making a sum rises to a peak at 7 and falls away symmetrically on either side.

    🔮 From Probability to Prediction

    A probability describes one trial. A laboratory produces many, and the quantity actually written in a table is a count. The bridge between them is the shortest useful formula in statistics:

    E = n × p E, expected count  ·  n, number of trials  ·  p, probability per trial

    Twenty rolls of two dice, with a sum of 8 arising in 5 of the 36 cells, predicts 20 × 5/36 = 2.78 rolls summing to eight. Nobody has ever observed 2.78 rolls of anything. The expected value is the average over many repetitions of the whole twenty-roll experiment, and its being fractional is a feature: rounding it to 3 would throw away the information that eights are slightly rarer than three-in-twenty, and would make the eleven expected counts stop adding to twenty.

    One property of expected values makes them far more useful than they look, and it is worth stating because it is used silently throughout this page. Expected values add. Always, whether or not the things being added have anything to do with one another. The expected total across the eleven categories is just the sum of the eleven expected counts.

    Here is that rule in its simplest form. Take one die on its own and ask what number it shows on average. The six faces are 1, 2, 3, 4, 5 and 6, each equally likely, so the average is (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 21 ÷ 6 = 3.5. No single roll ever shows 3.5, which is the point about expected values being allowed to be fractional, but across many rolls the average closes in on it.

    Now roll two dice and add them. Because expected values add, the average total is simply one die's average plus the other's: 3.5 + 3.5 = 7. That is where the 7 in the middle of the distribution comes from, and it is also the line the second graph in each of the first three experiments on the Roll Some Dice tab settles onto. The useful part is that no counting of the thirty-six cells was needed to get it. Adding the two averages was enough.

    Nothing comparable is true of variances, which add only when the things being added are independent. That asymmetry — averages add unconditionally, scatter does not — is why expectation is the easy half of statistics and variance the hard half.

    🎯 How Far from the Prediction Should the Observation Land?

    This is the question the last part of the laboratory is really asking, and it has an exact answer. Counting how many of n trials fall in a category with probability p is a binomial situation, and the scatter of that count is known:

    variance = np(1 − p)     SD = √np(1 − p) the typical distance between an observed count and its expected value

    For sums of 8 in twenty rolls: p = 5/36 = 0.139, E = 2.78, and the standard deviation is √(20 × 0.139 × 0.861) = 1.55. So an observed count anywhere from about 1 to about 4 is entirely ordinary, and a count of 7 is beginning to be interesting. Anyone who expected the observation to land near 2.78 has not appreciated how coarse a sample of twenty is.

    Where the n − 1 went. Anyone who has computed a variance in a statistics class will notice something missing. The usual recipe takes a set of measurements, subtracts their mean from each, squares, adds the squares, and divides — by n if the numbers are the whole population, by n − 1 if they are a sample. Nothing of that kind happens here. There is no mean subtracted, no squares added, no division, and no n − 1.

    The reason is that these are two different jobs. The usual recipe estimates a variance from data when the true one is unknown, and it has to estimate the mean from the same data first. That costs something: the squared departures come out slightly too small, because they are measured from the sample's own mean rather than from the true one, and dividing by n − 1 rather than n is the correction. The missing 1 is the one degree of freedom spent on the mean.

    np(1 − p) estimates nothing. It is the variance the model has, derived from p, which came from counting the sample space and not from any roll. Nothing was estimated from the data, so there is nothing to pay for, and no data are needed to compute it — the number is available before the first roll. That is what makes it a prediction rather than a summary. Use the general recipe when you have measurements and no model; use this one when you have a model, which here you do.

    The part that surprises people

    Notice where n sits in that formula. It is inside the square root, so the standard deviation of a count grows as √n. Rather than say what that means, here it is, worked out for a total of 7, where p = 6/36 = 1/6.

    Rolls, nExpected count of 7s
    n × 1/6
    Typical departure from it
    √(n × 1/6 × 5/6)
    That departure as a share of the expected count
    203.331.6750%
    20033.335.2716%
    2,000333.3316.675%

    Read the third column downwards: 1.67, then 5.27, then 16.67. The gap between what you predicted and what you got grows. Read the fourth column downwards: 50 percent, 16 percent, 5 percent. Measured against the size of the thing being counted, the same gap shrinks. Both columns describe one set of experiments, and neither is a trick.

    Note how fast each one moves. From the first row to the last the number of rolls is multiplied by 100, and the typical departure is multiplied by 10 — because 10 is √100. The share falls by the same factor of 10, in the other direction. That is what “grows as the square root” buys you: not no growth, and not growth in step with the experiment, but growth at a rate the experiment outpaces.

    One wrong way to picture this, worth naming because it is the natural guess. It is tempting to imagine the gap keeping pace with the experiment — getting 8 when 10 was expected, then 800 when 1,000 was expected, both of them 20 percent out. That is a reasonable thing to guess and it is not what happens. If the gap really did keep pace, the fourth column above would read 20 percent all the way down, large experiments would be no more trustworthy than small ones, and the law of large numbers would be false. What actually happens is slower: 100 times the rolls brings only 10 times the departure, which is why the share falls away and why pooling the class is worth the trouble.

    The proportion behaves in the opposite way. Dividing the count by n divides its standard deviation by n as well, and √n/n is 1/√n:

    SD of the count ∝ √n       SD of the proportion ∝ 1 / √n the same fact, stated about two different quantities, pointing in opposite directions

    Both statements are true at once and they are not in conflict. The law of large numbers is the second one. It promises that the observed fraction converges on the true probability; it says nothing about the count, which drifts steadily further from its expectation as the experiment grows. This is why the handout, when it compares twenty rolls with forty, divides the forty-roll total by two before comparing: without that division the larger experiment would look worse, and the wrong lesson would be learned from a correct calculation.

    This has a name, and in biology it has two. The gap between what a small sample shows and what the underlying probability is — the gap this whole section is about — is called sampling error. The word error is unfortunate, because nothing has gone wrong: nobody miscounted, no die was faulty, and the experiment was done correctly. It is the unavoidable consequence of looking at part of something rather than all of it, and the formulas above say exactly how big it should be.

    In population genetics the same phenomenon has its own name: genetic drift. An allele's frequency one generation later is a sample of its frequency in this one, drawn from however many offspring happen to be produced. In a large population the sample is large and the frequency barely moves. In a small one it wanders, and it can wander all the way to nought or to one and fix an allele that selection never favored at all. That is sampling error, operating on gene pools instead of on dice, and it is one of the reasons small populations lose variation. The arithmetic in this section is the arithmetic of drift; twenty rolls are a small population.

    It is worth knowing both names because the two literatures rarely cite each other, and a student who has met sampling error in a statistics course and drift in an evolution course is often surprised to learn they are the same idea. Doing Evolution runs it as jars of marbles, where the drifting is the point.
    Table T2. How the two kinds of deviation scale. Values are exact expectations for the total absolute deviation across all eleven sums, obtained by simulation over many replicate experiments, together with the same total expressed per roll. The left-hand column grows; the right-hand column shrinks; the ratio between successive rows in each is close to √2 and 1/√2 respectively for each doubling of n.

    ⚠️ A Warning About the Word “Due”

    If a fair die has failed to show a 6 in twenty rolls, it is not more likely to show one on the twenty-first. The die has no memory, no ledger, and no obligation. The convergence promised by the law of large numbers is achieved not by correction but by dilution: the early shortfall is not repaid, it is merely swamped by the volume of later rolls, and in the limit it becomes an ever-smaller share of an ever-larger total.

    The belief that chance keeps accounts is called the gambler's fallacy, and it has a mirror image that is just as wrong — the belief that a die which has thrown three sixes is somehow hot and will throw a fourth. Both errors come from treating independence as something that ought to be visible in a short run. It is not. What independence guarantees is that the mechanism does not change; it guarantees nothing whatever about streaks, which occur in random data far more often than intuition expects, and whose absence is in fact a reliable sign of data that a human being made up.

    Two more ways intuition goes wrong on dice. The gambler's fallacy is the famous one, but two others bite directly on this exercise.
    • Ranking a pair above the total that contains it. Asked which is more likely, a 3 and a 4 or a seven, a lot of people pick the pair, because it is more specific and therefore easier to picture. It cannot be. A seven happens on 3–4, 4–3, 2–5, 5–2, 1–6 and 6–1 — the pair is one of six ways of getting the total, so the total is at least as likely as the pair, always, and here six times as likely. Adding a detail to a description can never make it more probable, only less.
    • Treating a vivid run as evidence. Three sixes in a row feels like a loaded die, because it is memorable and a long dull stretch of ordinary rolls is not. Three sixes happen once in every 216 triples of rolls, which is to say constantly. The Roll Some Dice tab can actually load the dice in secret, and its statistics dialog shows how many rolls it takes before the arithmetic can tell — many more than the number that makes a run feel suspicious.
    Both are general failures of human reasoning rather than facts about dice, and they have names and histories: the first is the conjunction fallacy, the second availability. The Doing Science laboratory catalogs ten of them, Ferguson's list after Yudkowsky, with a table of how each one misleads in science and a quiz on naming the flaw in a study. Worth a visit; the gambler's fallacy above is the one that list does not have.

    🎥 Videos: The Two Rules

    Four short videos on the two rules this tab builds everything out of. None of them is required reading and nothing below depends on them, but if either rule has not yet clicked then watching somebody else say it differently is often the fastest fix. Start with the first one: it covers both rules and then shows what they are for, which is more than the other three do between them. Click a thumbnail to load the video; it plays here on the page.

    Probability in Genetics: Multiplication and Addition Rules
    Paul Andersen, Bozeman Science · start here
    If you watch only one of these, watch this one. It does both rules and then puts them to work, and it hands you the tip-off that makes the rest of this page easier: and means multiply, or means add.

    Three of its moments are this laboratory's own, in other clothes. It rolls snake eyes at 1/6 × 1/6 = 1/36 — the same 36 everything here runs on. It builds a heterozygote two ways, ¼ from one parent pairing and ¼ from the other, adding to ½: that is the factor of two in 2pq, and the same move as the six ways of making a seven. And its five-or-a-heart problem adds 4/52 to only 12 of the 13 hearts, because the five of hearts would otherwise be counted twice — exactly the distinction drawn above under The Addition Rule, and the reason at least one die shows a 6 is not 1/6 + 1/6. Note that it calls the addition rule a rule for mutually exclusive events and then works that case, which is not one. Where it says odds, read probability; the distinction has its own box on the Definitions tab.

    Doing Mendelian Genetics takes the same video from the genetics side, with its own questions to watch for and the three-locus cross worked out.
    The Multiplication Rule
    Independent and dependent events
    It covers more than the title promises. It sets up independence first — rolling a 5 then a 3, where the first roll changes nothing — then gives the rule behind 6 × 6 = 36, and then does the part the other videos leave out: the general multiplication rule, P(A and B) = P(A) × P(B | A), for events that are not independent. Its example is drawing a king and then a queen without putting the king back, where the second probability is 4/51 rather than 4/52 because the deck has been changed. That is the rule this page sets out under What to Do When Independence Fails above, and it is worth having: in biology dependence is the normal case.

    Check its last number yourself. (4/52) × (4/51) is 16/2652, which is 0.60 percent, not 6 percent. If you hear or read 6 percent, it is ten times too big — a king followed by a queen is a rare draw, not a one-in-seventeen one. Everything else in the video is correct; this is a dropped decimal, and catching it is better practice than taking it on trust.
    The Addition Rule
    Mutually exclusive, and not
    The companion to the video above, by the same presenter, and it does both halves. Mutually exclusive first, with Venn diagrams: heads and tails cannot both happen, so 50 percent plus 50 percent is 100 percent. That half is what this laboratory leans on — it is what lets the six ways of making a seven simply be added up.

    Then the half that catches people. A heart or a king can both happen, in the king of hearts, so plain addition counts that card twice. The repair is to subtract it: 13/52 + 4/52 − 1/52 = 16/52, about 30.8 percent. That is the general form of the rule, and it is the one the box above uses to get at least one die shows a 5 to 11/36: 6/36 + 6/36 − 1/36, where the subtracted term is the single cell (5, 5).

    Watch the two card problems side by side. The genetics video above asks for a five or a heart and adds 4/52 to only 12 of the 13 hearts. This one asks for a heart or a king and adds all 13 hearts to all four kings, then subtracts the one card counted twice. Both land on 16/52, and not by luck: any one rank or one suit question is 4 + 13 − 1 = 16. They are the same rule kept in two different books — trim the overlap out of one term before adding, or add everything and subtract the overlap at the end. Counting the thirty-six cells of the grid, which is what this laboratory does, is a third method, and the only one that never overcounts in the first place.
    The Addition Law and the Complement, with Dice
    Worked examples · all of them dice
    A bit dry, but every example is built on rolling dice, which makes it the closest thing here to a walkthrough of this laboratory's own arithmetic. It builds the frequency distribution table for the eleven sums, and then makes a point this page makes on the How to Graph tab: 4/36, 0.111 and 11.1 percent are three ways of writing one number, and whichever you choose, the column adds to 36/36, to 1, or to 100 percent. It works the addition rule as a 7 or an 11, 6/36 + 2/36 = 8/36, and then does the useful thing the other videos skip: the complement. Rather than adding up the nine other sums, it subtracts — 36/36 − 8/36 = 28/36, about 78 percent — for the chance of rolling anything else. That is the clean route to at least one die shows a 5, and it is why the complement is now the third rule listed under Rules on the Definitions tab.

    Two places to watch. It ends on history is the best indicator of the future. For the frequentist point it has just made — that a long run of observed frequencies estimates the underlying probability — that is fair. For the next roll it is false, and it is the gambler's fallacy stated as a maxim: see A Warning About the Word Due on the Theory tab. Also, it says there are four ways to make a five and its table shows four, but the list it reads aloud names only three, 1–4, 3–2 and 4–1. The missing one is 2–3, and four is the right count.

    📚 References

    • 1.Hardy, G.H. (1908). Mendelian proportions in a mixed population. Science 28:49–50. 10.1126/science.28.706.49
    • 2.Luria, S.E., Delbrück, M. (1943). Mutations of bacteria from virus sensitivity to virus resistance. Genetics 28:491–511. 10.1093/genetics/28.6.491
    • 3.Mendel, G. (1866). Versuche über Pflanzen-Hybriden. Verhandlungen des naturforschenden Vereines in Brünn 4:3–47.

    ✏️ Exercise 2, Worked

    These are the questions from the second exercise of the handout, in order. Each one has an answer that can be reached by counting cells in the grid on the Theory tab, and each answer here shows that counting rather than merely reporting a number. Work the question first on paper. The button is there for afterward.

    Two habits worth forming now. First, always say whether the number you have just written is a prediction or an observation; nearly every confusion in this laboratory dissolves once that label is attached. Second, always say whether order matters in the question you are answering, because the same words — “a 2 and a 5” — mean two different things depending on the answer, and the two answers differ by a factor of two.

    🧮 An Expectation Calculator

    Once a probability is in hand, turning it into a prediction for a given number of trials is one multiplication — and turning it into a statement about how far the observation should stray is one square root. This does both, and shows the arithmetic so that the result can be checked by hand.

    Expected count and its scatter
    Pick an event, or type a probability of your own, and a number of trials.

    🧭 A Rule Chooser

    Most errors in this material are not arithmetic errors. They are errors about which rule applies, and they happen at the moment a question in English is turned into a calculation. The panel below takes a question apart the way it should be taken apart: does this ask for and or for or, and is more than one path leading to the same place?

    Two events, combined
    Set two single-die events and ask what happens when they are joined. The panel names the rule, gives the arithmetic, and counts the cells of the sample space so that the two can be compared.

    🪢 Where the Handout Is Deliberately Loose

    Three places in the exercise use language that is fine for a first pass and would not survive a methods section. They are pointed out here not to find fault with the handout, which is doing the right thing for a first encounter, but because noticing the looseness is itself a skill the course is trying to build.

    • “Odds” is used to mean probability. Discussed on the Definitions tab. Everything the exercise calls odds is in fact a probability, and the arithmetic performed on it is the arithmetic of probabilities.
    • “Variance” is used for a sum of absolute differences. That sum is a perfectly respectable measure of scatter, and it is close kin to a quantity statisticians call the mean absolute deviation. It, however, is not the variance, which is built from squared rather than absolute differences and which is what gets reported in the literature. The Statistics tab computes the handout's quantity, the mean absolute deviation, and the variance side by side, and the three do not behave identically.
    • “What would you predict would be the number of times…” sometimes wants a probability and sometimes a count. Read each question for which one it wants. A probability is a number between 0 and 1 with no units; a count is a number of rolls, and it depends on how many rolls there were. If a question gives you an n, it wants a count.

    🎲 Table 1: The Rolls Themselves

    This is the raw record, and it is the only thing on this page that cannot be reconstructed from something else. Every table, every figure, and every test that follows is computed from these numbers, so they are worth entering carefully and checking once before moving on.

    The handout asks for twenty pairs of rolls in a first round and twenty more in a second, with each partner rolling one die. Enter what your dice actually did. If you are working through the material without dice in front of you — reviewing before an examination, say, or preparing to teach it — the buttons below will roll for you, and the analysis behaves identically either way.

    Rolling on your own behalf. A generated roll is drawn from the browser's cryptographic random number source, which is as fair as anything short of a well-made die and considerably fairer than most of them. It is not, however, the same experiment: a physical die can be loaded, dropped, or misread, and part of what the laboratory is teaching is that real data arrive imperfectly. Generate rolls freely for practice and for the simulations on the Statistics tab, and use your own dice for the exercise itself.
    A CSV file, which opens in Excel, Numbers or Google Sheets. Everything else on the page can be downloaded too, from Getting Data In and Out below.
    Table 1. Recording of rolls of pairs of dice and their sums. Enter values from 1 through 6. A row is counted as complete only when both dice have been entered; incomplete rows are ignored everywhere else on this page rather than being treated as zeros.

    🔄 Getting Data In and Out

    Rolls can be typed, pasted, or exported. Pasting is the fastest route when the rolls were recorded on paper and someone is reading them aloud, and exporting matters because everything on this page lives in one browser on one machine: a downloaded copy is the only version that survives a different computer. A spreadsheet version of the whole exercise sits below, for anyone who would rather work in Excel than in a browser.

    Paste rolls
    One pair per line, the two numbers separated by a space, comma, or tab — for example 5 6 then 2 2. Lines that do not parse are reported rather than silently dropped. Pasting replaces the rolls already entered.
    📊 The same exercise, built in Excel. Dice-Probability_Spreadsheet.xlsx, beside this page, is the laboratory worked as a spreadsheet rather than as a web page, and it is worth opening even if you never use it for your own data. All three exercises are there. Two columns of =RANDBETWEEN(1,6) make the dice; a =SUM() makes the total; a block of =IF($D25=F$24,1,0) puts a 1 under whichever of the eleven sums came up and a 0 under the rest, so that adding a column counts that sum. The second exercise runs the same machinery out to six hundred rolls, which is a quick way to watch the fractions settle while the counts drift further from expectation. The third builds the 6 × 6 grids, with every expected cell as =20*(1/6)*(1/6), and reduces the whole thing to a single row comparing twenty rolls against forty.

    Roll it again, and again. Near the top of every sheet there is a cell marked Roll the dice with a little arrow on it. Open the arrow, pick the other option, and every die in the workbook is thrown afresh — all three exercises, all six hundred rolls, the grids and the summary row with them. Pressing F9 does the same thing in one keystroke, and on a Mac it is Command and =. Changing any cell at all will do it, in fact, which is why the dropdown works: these dice are =RANDBETWEEN(), and Excel re-draws every one of those whenever anything in the workbook changes.

    Its four charts are the frequency polygons described under The Anatomy of a Graph on the How to Graph tab: expected and observed drawn as two lines on one pair of axes, in the rarest-first order, with open circles for the expectation and filled squares for the observation so that the eleven discrete values stay visible under the lines. Set one sheet's rolls high and another's low and the reason for drawing it this way is immediate — the high-n line hugs the expectation while the low-n line wanders all over it.

    Do it ten times and watch the summary row. That is the point of the file. Nothing on that row is a fact about dice; each number is one draw from a distribution, which is exactly what the Statistics tab is for. The author's own note beside that row reads Note stochasticity of result.

    ✅ What to Check Before Going On

    The handout puts this well: measure twice, cut once. Three checks take a few seconds each and between them catch nearly every recording error that matters.

    1. Does every row hold two numbers between 1 and 6? A blank or a 7 is flagged in red above. A 0 usually means a 6 was misread; a blank usually means a row was skipped while reading aloud, which shifts every subsequent pair by one and quietly ruins the second round.
    2. Do the counts add up to the number of rolls? On the Tables tab both the observed and the expected rows must total the number of complete pairs. If the observed row does not, a roll was recorded twice or not at all. If the expected row does not, something is wrong with the arithmetic and not with the dice.
    3. Is the spread plausible? Twenty rolls of two dice that produce no sum of 7 at all are unusual but not alarming; twenty rolls that produce ten of them are worth re-reading the sheet over. The Statistics tab will put a number on how unusual, which is better than a feeling, but the feeling comes first.

    🔍 Observed Against Expected

    Every table below is built from the rolls entered on the previous tab, and every one of them is the same comparison seen from a different angle: what the model said, what the dice did, and how far apart the two ended up. Nothing here is a result yet. Tables of this kind are the raw material a result is made from, and the discipline of laying them out before drawing conclusions is most of what separates an analysis from an impression.

    📋 Table 2: Sums, in Their Natural Order

    The eleven possible sums, from 2 through 12, with the number of times each was observed and the number of times each was expected. Expected is np, computed from the sample space and not rounded.

    Table 2. Observed against expected number of sums found rolling two dice. The final column is a check, not a result: both rows must total the number of complete pairs of rolls, and if either does not, something has gone wrong upstream.

    📋 Table 3: Sums, Sorted by How Likely They Are

    The same numbers, reordered so that the expected values increase from left to right: 2, 12, 3, 11, 4, 10, 5, 9, 6, 8, 7. This is the ordering the handout asks for, and the reason for it is worth stating plainly, because it is not obvious.

    Sorted this way, the expected values form a staircase that rises steadily from left to right, and the observed values are draped over it. The eye can then do something it cannot do with the natural ordering: judge, at a glance, whether the observations are tracking the prediction across the whole range of likelihood, or whether they are tracking it only where it is easy — near the peak — and wandering in the rare tails. That is a real diagnostic, and it is the first appearance in the course of a general principle: the order in which categories are plotted is a choice, and it is a choice that determines what a reader is able to see.

    Table 3. Observed against expected number of sums, sorted so that the expected likelihoods increase from left to right. Pairs of sums equidistant from 7 share an expected value, so the staircase rises in steps of two.
    Do not be thrown by the ties. A sum of 2 and a sum of 12 have exactly the same expected value, as do 3 and 11, and so on. Ties are perfectly legitimate and their order within the pair is arbitrary; this page places the smaller sum first for consistency. Notice also that sorting on the expected values, rather than on the observed ones, is the only defensible choice: sorting on the observed values would arrange the data by their own noise and manufacture a trend out of nothing.

    🔢 Tables 6 and 8: When Order Matters

    Sums throw away information. The pair (2, 6) and the pair (4, 4) both give eight, and once they have been added together nothing distinguishes them. The grid below keeps that information: each cell counts the times that student A rolled the row value in the same turn that student B rolled the column value. There are thirty-six cells and they are equally likely, so the expected count in every one of them is simply n/36 — which for twenty rolls is 0.56, and that number will become important on the Statistics tab.

    Reading the grid. The large number in each cell is what was observed; the small number beneath it, in parentheses, is what was expected. The two diagonals are worth attention. The main diagonal — the doubles — contains six cells, and all six have the same expectation as every other cell, which is the fact that makes doubles half as likely as they intuitively feel. The anti-diagonals are the sums: reading up and to the right along a constant sum recovers Table 2 from Table 6, by addition.

    📏 Tables 9 and 10: Absolute Departures, and the Comparison the Handout Wants

    The handout's final exercise asks for the sum of |observed − expected| over all thirty-six cells, computed once for the first round of rolls and once for both rounds together, with the second total halved before the two are compared. That comparison is set out below, together with an explanation of why it comes out the way it does — which is a slightly different question from what it comes out as.

    Tables 9 and 10 combined. Total absolute departure from expectation across the thirty-six ordered outcomes, for the first round alone and for all rounds together. The halved column applies the handout's correction, and the per roll column achieves the same thing in a way that generalizes to any number of rounds.
    Why the handout divides by two, and what to divide by instead. Doubling the rolls doubles the expected total departure only if departure grew in proportion to n, and it does not: for large samples it grows as √n. So the halved total for forty rolls is expected to come out smaller than the total for twenty, and that is what makes the comparison come out the way the exercise intends. Dividing by the number of rolls instead of by two says the same thing in a form that works for any sample size at all, and it is the form used everywhere else on this page.
    How much smaller, exactly. The familiar answer is a factor of 1/√2 = 0.707, and for this particular table that answer is wrong. The √n rule is a large-sample result, and this grid of thirty-six cells expects 0.56 rolls per cell at n = 20 and 1.11 at n = 40. When most cells are empty, the total is dominated by the shortfall in the empty ones rather than by ordinary sampling scatter, and the true factor works out nearer 0.63 — so pooling buys rather more than the square-root rule advertises. The exact expected totals are computed above from the binomial distribution rather than assumed, and if you add rounds until each cell expects several rolls you can watch the ratio climb toward 0.707. Note that the same comparison over the eleven sums, where expectations are larger, sits much closer to the square-root prediction from the start; the Theory tab shows that version.
    And one comparison settles nothing. A single pair of experiments is one comparison, and one comparison is thin evidence for a claim about scaling; the Statistics tab settles it properly by repeating the comparison thousands of times and reporting how often it comes out backward.

    📤 Exporting

    Tables can be downloaded as comma-separated values, which any spreadsheet program will open, and which is the format to hand in if the exercise is being submitted electronically.

    🏫 Table 4: Pooling the Whole Class

    One pair of students produces twenty rolls, which is not many. A class of thirty produces three hundred, and three hundred is a different kind of number: it is enough for the shape of the distribution to show through the noise rather than being buried in it. Pooling is the cheapest statistical improvement available to anyone, and it costs nothing but the willingness to write results on a board and add them up.

    Enter each group's eleven counts as they go up on the board. The order in which groups are entered does not matter. Every row must total the number of rolls that group made, and the page checks that for you: a row that does not add up is highlighted, because a transcription error caught now is a great deal cheaper than one found after the graph has been drawn.

    Table 4. Observed sums found by the various groups, with the pooled observed row and the expected row computed from the total number of rolls made by all groups together. The rightmost column is the row total and is a check on transcription: it must equal the number of rolls that group made.

    📋 Table 5: The Pooled Result, Sorted

    The pooled totals, reordered by expected likelihood exactly as in Table 3, with two further rows dividing each total by the number of groups. That division is what makes Figure 2 comparable with Figure 1: without it the pooled counts are fifteen or twenty times larger than one group's, the vertical axis has to be rescaled, and the two figures can no longer be flipped between and compared by eye.

    Table 5. Observed against expected number of sums for the pooled class data, sorted so that expected likelihood increases from left to right, with per-group values beneath. The per-group rows are the pooled rows divided by the number of participating groups, and they carry the same information on the scale of a single group's experiment.

    ⚖️ What Pooling Buys, and What It Does Not

    Comparing your own twenty rolls with the pooled class result is the moment this laboratory makes its central point, and the point is easy to state wrongly. Pooling does not make the observations land closer to the predictions. In absolute terms it makes them land further away: three hundred rolls will show a larger total departure from expectation than twenty did. What pooling buys is a smaller departure relative to the size of the experiment, and it is the relative departure that the eye reads off a graph once both figures have been put on the same scale.

    The comparison the class is being invited to make is therefore between two figures whose expected points are identical and whose observed points scatter by different amounts. That is the entire lesson, and it is worth insisting that the second figure is not “more accurate” in some vague sense. It is more precise: repeat the whole exercise and a pooled result will land near where the last pooled result landed, while a twenty-roll result will not. Accuracy is about being centered on the truth, and twenty rolls are already centered on the truth; they are simply centered on it very loosely.

    A limit worth knowing about. Pooling assumes the groups are doing the same experiment. If one pair is using a chipped die, or is recording the sum wrong, or has quietly decided that rolling again after a die falls off the table is optional, then the pooled total is contaminated and a larger sample makes matters worse rather than better: it buries the fault under volume while making the false answer look more certain. The technical name for this is that pooling reduces variance but does nothing for bias, and no sample size fixes a bias. When you see a class result that is way out, the first question is not what the statistics say but what the apparatus did.

    📤 Exporting

    📈 Why Bother Graphing at All

    A table of numbers records what happened. A graph shows what happened. The difference matters most when the point being made is about a shape, because a shape is something the eye reads instantly and the mind reads slowly from a row of digits. This exercise produces exactly such a shape: a staircase of predictions with a scatter of observations draped over it, tracking the staircase loosely when the sample is small and tightly when it is large.

    A graph is also a claim, and a badly built graph makes a claim its data do not support. Almost every rule below exists because breaking it lets a figure say something false while looking respectable. What follows is therefore not about neatness. It is about not lying, including not lying to yourself.

    Which data these examples use. This tab is a tutorial, so by default it runs on a made-up data set that behaves the way this exercise usually behaves. That lets faults be introduced deliberately without damaging anything real. Your own data are drawn, correctly and without sabotage, on the Graphs tab — though you can switch these examples over to your own rolls if you would rather see the faults applied to something familiar.

    🦴 The Anatomy of a Graph

    Below is a data set drawn as it ought to be drawn. Every labeled feature is there for a reason, and a reader who knows the conventions can extract the entire experiment from the figure without reading a word of the surrounding text.

    Figure H1. Observed and expected numbers of each sum in twenty rolls of two dice. Sums are arranged along the horizontal axis in order of increasing expected frequency. Open circles are expected values, computed as np from the sample space; filled circles are the counts observed. Points are not connected because nothing exists between one sum and the next.
    • The independent variable goes on the horizontal axis. The sum is what defines the category; the count is what came out. What you chose or what defines the case goes horizontal; what you measured goes vertical.
    Two different meanings of independent, and this page uses both. This is worth stopping on, because the collision is real and nobody warns students about it. On the Definitions tab, independent means that two events do not inform each other: knowing the first die showed a 5 tells you nothing about the second. Here, an independent variable means the thing you chose or the thing that defines the case, as against the thing you measured. The two senses have nothing to do with one another, and one word carrying both is simply an accident of vocabulary.

    The figures on this page show how far apart they are. The horizontal axis holds the sum, which is the independent variable — and a sum is about as far from an independent event as it is possible to get, since it is determined entirely by what the two dice did. The vertical axis holds the count, the dependent variable. Meanwhile the two dice themselves are independent events and appear nowhere on either axis. Same experiment, both senses, no contradiction.

    A rough test: if the word is describing events and whether one shifts the odds of another, it is the probability sense. If it is describing axes, a column of a data table, or what you varied against what you recorded, it is this sense.
    Two lines on one graph, and neither is the independent variable. This is the question students get stuck on hardest, and it is a reasonable place to get stuck. Figures 1 to 3 show expected and observed together, and since every graph is supposed to have an independent variable, one of those two looks as though it ought to be it — usually expected, because it came first and feels like the input.

    It is not. The independent variable is the sum, sitting on the horizontal axis, because the sum is what tells one case from another: eleven sums, eleven cases. Expected and observed are two readings taken on each case. They are the same quantity — a number of rolls out of twenty — arrived at two different ways, one from the sample space and one from the dice. Neither causes the other, and the dice certainly never consulted the expectation.

    A test that settles it in one look: can the two series share a single axis label? Expected rolls and observed rolls are both number of rolls, so yes — one axis, one label, two series, same variable measured twice. Compare Experiment 2 on the opening tab, which also draws two curves but puts a second axis on the right, because there the two quantities are a fraction and a count: different units, different scales, no shared label possible. Two series on one axis means one dependent variable, read twice. Two series needing two axes means two dependent variables. Neither case promotes anything to being the independent variable, which stays on the horizontal axis where it was.

    And the instinct is not wasted, because there is a figure in which the expectation is the horizontal variable: plot expected against observed, one point per sum, with a diagonal for perfect agreement. That is Figure 6 on the Your Figures tab. It is a legitimate and standard figure, and it answers a different question — not what shape did the sums make? but how well does the model predict? Worth looking at both and seeing that they are not rivals.
    • Both axes are labeled, and the label names the quantity. Not x, not y, not Series 1. Where a quantity has units the units belong in the label. A count of rolls has no units, but it does have an out of how many, and that belongs in the caption.
    • The vertical axis starts at zero. For counts this is not optional. Zero is a real and meaningful floor — it is possible to observe no sums of 12 — and cutting the axis above it exaggerates every difference on the figure.
    • The horizontal categories are evenly spaced. They are categories, not numbers, and their spacing carries no information; making it uneven implies a quantitative relationship that does not exist.
    • The data fill the plotting area. A graph whose points huddle in one corner is wasting the only resource a figure has.
    • The axes frame the part that matters. Where a curve runs flat and uninformative for most of its length, there is no obligation to plot all of it, and stopping shortly after the interesting part is a service to the reader. The honest version of this and the dishonest version look identical on the page, so the rule is: choose the range before you see which range flatters the result, and say in the caption what was left out.
    • Two data sets are distinguished by symbol as well as by color, because figures get photocopied, printed in grayscale, and read by people with color vision deficiencies.
    • Points are not joined by lines without a reason. A line asserts that intermediate values exist, and there is no sum of 7.5. Comparing two distributions is a reason; the box below says when and why.
    • There is a legend, and a caption below the figure. In biology the caption goes below a figure and above a table. The caption states what was plotted and what a reader needs in order to interpret it.
    • Nothing decorative is present. No shadows, no gradients, no third dimension, no background fill. Every mark carries information.
    When zero belongs on an axis, and when it does not. The rule above says a count axis starts at zero, and on this page it always will. But Graphing Data by Hand, among the videos below, says the opposite — its presenter says that since zero is not in his data he does not want zero on his graph, and he is right. The two rules are not in conflict; they apply to different figures, and the difference is worth having straight, because it is the one graphing question students most often get marked down for in both directions.

    Ask what is doing the encoding. In a bar chart, length encodes the value: a bar twice as tall says twice as much. Length is measured from the baseline, so if the baseline is not zero the lengths are lying about their ratios, and that is why cutting a count axis is a fault rather than a style. In the figures on this page the quantity is a count of rolls out of twenty, zero is reachable — some group really will see no 12s — and nothing is gained by hiding it.

    In a scatter plot, position encodes the value, and no mark claims a ratio. The presenter is plotting plant height from 18 to 98 centimeters against fertilizer from 2 to 12 grams. Neither quantity can be zero in any meaningful sense here, no reader will read a height as a multiple of anything, and dragging the axis down to zero would squeeze every point into the top corner and throw away the pattern. Framing the data is the right choice.

    So: length from a baseline needs the zero; position does not. If the axis is cut, say so on the figure — the Break the Graph Yourself switch below labels it that way deliberately.
    The one axis that cannot start at zero. There is a respectable exception to the rule above, and it is not a loophole but a different kind of axis. Log-transforming an axis replaces each value by its logarithm, so that equal distances along the axis are equal multiples rather than equal differences: a centimeter might mean ten times rather than plus ten. It is routine in microbiology, where a culture goes from a few hundred cells to a few billion and a plain axis shows the first nine tenths of the story as a flat line on the floor. Log the axis and the early history becomes readable; an exponential growth curve straightens into a line whose slope is the growth rate.

    A log axis cannot start at zero, and not by convention — the logarithm of nought is undefined, and on a log axis zero sits infinitely far down. So the two rules cannot both be obeyed, and the earlier one gives way. The reason it may is the same reason it existed: the objection to a cut baseline was that length would misreport ratios. On a log axis length reports ratios exactly, which is what it is for. Nothing is being hidden; the question being asked has changed from how much bigger? to how many times bigger?

    Do not do it to the figures on this page. A log axis earns its place when a quantity spans orders of magnitude and can never be nought. Counts out of twenty rolls do neither: they span a single order of magnitude, and zero is not only possible but expected for the rare sums — which would put those points nowhere at all. If you ever see dice counts on a log axis, something has gone wrong. The technique is here because you will meet it in the growth curves of the microbiology and ecology laboratories, not because it belongs to this one.

    The page does use log axes, three times, and each says (logarithmic) in the axis label so that nobody is misled: the figure showing departure against sample size on the Theory tab, which is logarithmic on both axes so that the square-root law comes out as a straight line; Figure 4, where the horizontal axis is logarithmic because the early wandering is the interesting part and would otherwise be crushed against the left edge; and the power curve on the Statistics tab. In all three the horizontal quantity is a number of rolls spanning several orders of magnitude and never zero — which is exactly the case the technique is for.
    When joining the points is right, and what it is called. The rule above says not to join points without a reason. Comparing two distributions is the reason, and it comes up constantly here: observed against expected, twenty rolls against forty, one group against the pooled class. Joining the tops of the bars of a distribution is a recognized graphic with its own name, the frequency polygon, and it exists for precisely this job, because two polygons can share one set of axes legibly where two sets of bars cannot.

    The justification is not the same for both series, which is worth noticing. The expected values are a real shape: a smooth, symmetric pyramid in the natural order, rising 1, 2, 3, 4, 5, 6 and falling again, computed from the grid and not from any roll. A line through those points traces something that genuinely exists. The observed values are not a shape — their wobble is noise — and joining them is a reading aid rather than a claim. That is still a good reason: the gap between the two lines is the thing the figure is about, and it is far easier to see one line wandering around another than to compare two clouds of dots.

    The test is whether the line is read as a path or as a shape. A line across time or dose says the quantity passed through those values on the way, and inventing that path is the real fault. A frequency polygon claims no path; it only guides the eye across categories that were already in order. Which gives the practical rule: keep the symbols visible. Markers under the line say eleven discrete values, joined for legibility; a line with the markers switched off starts to look like a continuous function of something, and that is when a reader can be misled.

    One caution specific to this laboratory. In the rarest-first ordering on the Two Orderings section below, the expected line climbs as a tidy staircase — but it climbs because the categories were sorted by expectation, so the rise is guaranteed by the sorting and is not a finding. There the expected line is a baseline and nothing more; everything informative is in how far the observed line strays from it.

    🔨 Break the Graph Yourself

    Each switch below introduces one common fault into the figure above. Turn them on one at a time and watch what the graph starts claiming. Turn several on at once for the full experience of a figure that has escaped supervision. The explanation of each fault appears once its switch is on.

    🔀 Two Orderings, Two Different Figures

    The handout asks for the sums to be arranged by increasing expected value rather than from 2 to 12, and the reason repays a moment's thought. Both orderings below plot identical data. Neither is wrong. But they answer different questions, and a figure that answers the wrong question is a figure that will be misread.

    Figure H2a. Sums in their natural order, 2 through 12. The expected values form a symmetric tent, and the figure is about the shape of the distribution: it shows that middling sums are common and extreme sums are rare, which is the fact the sample space explains.
    Figure H2b. The same data sorted by expected value. The expected values now form a rising staircase, and the figure is about agreement: it shows whether observation tracks prediction across the full range of likelihood, which is the question the exercise is asking.
    The general principle. Sorting categories by a predicted quantity is legitimate and often illuminating. Sorting them by the observed quantity is almost never legitimate, because it arranges the data by their own noise: any set of random counts, sorted by size, produces a smooth rising curve that looks like a finding and is not one. If you have ever seen a figure in which some ranked quantity declines beautifully from left to right, ask whether the ranking was done on the same numbers being plotted.

    📶 Putting the Uncertainty on the Figure

    The single most useful addition to a figure of this kind is a statement of how far the observations should have strayed. Without it a reader is left to judge the agreement by eye, and the eye is a poor judge: it treats a gap of two as small when the counts are large and as damning when they are small, with no reference to what chance alone would produce.

    For counts the relevant scatter is known exactly — √(np(1 − p)), from the Theory tab — so a band can be drawn around the prediction before any data are collected at all. Observations inside the band are unremarkable. Observations outside it are worth a second look, though with eleven categories one should expect roughly three of them to fall outside a one-standard-deviation band by chance alone, which is exactly why a proper test looks at all eleven together rather than at the worst one.

    Figure H3. The same data with a shaded band of one standard deviation on either side of each expected value. The band is a property of the prediction and the sample size; it is drawn without reference to what was observed.
    Error bars are not self-explanatory, and unlabeled ones are worse than none. A bar may be a standard deviation, a standard error, a ninety-five percent confidence interval, or a range, and these differ by factors of two or more. The caption must say which. In this figure the band is one standard deviation of the predicted count, not of a set of measurements, and that distinction matters: it describes how much the observation should wander, not how precisely anything was measured.

    ➗ Counts or Proportions?

    The same data can be plotted as counts of rolls or as fractions of the total, and the choice is not cosmetic. Counts keep the sample size visible, which matters because a reader must know whether a fraction of 0.15 came from three rolls out of twenty or from three hundred out of two thousand. Fractions make experiments of different sizes directly comparable, which is exactly what is needed when a single group's twenty rolls are set beside the pooled class total.

    Yes — dividing by the number of groups is the same move. It is worth being blunt about this, because the handout asks for the division without saying what it is for. Suppose two groups each roll twenty times. One group sees a seven four times; the other sees it six times. Pooled, that is ten sevens out of forty rolls. Those ten cannot be drawn beside the first group's four, because forty rolls had twice as many chances to produce a seven as twenty rolls did. Dividing the pooled ten by the two groups gives five, and five can sit beside four, because both are now sevens per twenty rolls. Dividing instead by the forty rolls gives 10/40 = 0.25, the fraction, and the first group's 4/20 = 0.20 sits beside it just as well. The two divisions are the same correction. They differ only in what the answer is measured in: one leaves it in rolls, the other turns it into a fraction. Note that 5/20 is also 0.25, which is the point — the division by groups is the division by rolls, scaled back up to one group's worth.

    The usual resolution for a figure is therefore to plot fractions and to state the sample size in the caption, in the axis label, or beside each series. Dividing by the number of groups is the cruder version of that resolution: it only works when every group rolled the same number of times, and it quietly hides the sample size, because a bar of height five no longer says whether it rests on twenty rolls or on forty. What it buys in return is that the numbers stay on the familiar scale of one group's experiment rather than becoming decimals, which for a first-year laboratory is the friendlier choice.

    ✅ The Short Checklist

    Before a figure leaves your hands, walk this list. It takes under a minute and catches nearly everything.

    1. Is the independent variable on the horizontal axis?
    2. Does every axis have a label naming the quantity, with units where units exist?
    3. Are the categories evenly spaced, and in a defensible order?
    4. Was the order chosen using something other than the data being plotted?
    5. Does a count axis start at zero?
    6. Do the data fill the plotting area rather than hiding in a corner?
    7. Are individual values visible as symbols rather than buried under a line?
    8. If points are joined, is the line read as a shape rather than as a path — and are the symbols still visible underneath it?
    9. If a line of fit is drawn, does it stop at the last data point rather than running on past it?
    10. Are two series distinguishable in grayscale?
    11. Is there a legend saying which series is which?
    12. If uncertainty is shown, does the caption say what kind it is?
    13. Is the sample size stated somewhere a reader will find it?
    14. Is there a caption, below the figure, that lets the figure stand on its own?
    15. Is there anything on the page that carries no information? Remove it.

    🎥 Videos: Graphing

    Four videos on the mechanics of a graph. The first two cover the vocabulary — which variable goes on which axis, and why that is not an arbitrary convention. The third is a start-to-finish demonstration of drawing one by hand, which is still the fastest way to learn what a graph is. The fourth is a song.

    Independent and Dependent Variables
    The vocabulary · MathHelp
    Very dry, two minutes, and it makes its one point well: the length of your hair depends on the days since your last haircut, so the days are the independent variable and the length is the dependent one. The thing you chose goes on the horizontal axis. The first twenty seconds are an advertisement for the site it comes from; skip them.

    One word of warning, because it calls this a dependency relationship. That is the right phrase for a math class and a trap for a biology class. Depends on here means that hair length is a function of time — the ordinary sense. It does not mean dependent in the probability sense this laboratory uses on the Definitions tab, where it describes two events that shift each other's odds. One word, two unrelated jobs. The box above, Two different meanings of independent, sorts them out, and the figures here contain both at once.
    Representing Relationships Graphically
    How to graph · the basics
    A plain description of how to graph. Very simple stuff, and — ironically — poor graphics, but it makes all of the right points: independent variable on the horizontal axis, dependent variable on the vertical. Marion the plumber earns 20 dollars an hour, so one hour pairs with 20 dollars, two with 40, three with 60, four with 80, and the points fall on a straight line through the origin.

    Notice how unlike this laboratory's figures that example is, because the difference explains two of the rules on this tab. Marion's pay is deterministic — a given number of hours yields exactly one dollar amount, every time — and continuous, since two and a half hours is a real quantity worth 50 dollars. So a line is honest there: the points between the points exist, and they are where the line says they are. Neither holds here. A sum of 7 does not yield one count; it yields a distribution of possible counts, which is why twenty rolls disagree with the prediction and why the whole Statistics tab exists. And there is no sum of 7.5 to plot. That is why the figures on this page use separated symbols with no line through them, and why a line here would be a claim rather than a convenience.
    Graphing Data by Hand
    Start to finish, with a pencil
    A nice walkthrough of actually making a graph, and the most practical of the four: fertilizer against plant height, on graph paper, decided one step at a time. Worth watching before the first figure on this page has to be drawn by hand.

    It is the only one that does the arithmetic of choosing a scale, which is the step that defeats people. Count the squares, divide the range by them, then round. Twenty-one squares across for a 10-gram range gives 0.48 grams per square, so he rounds to 0.5 and labels 2, 2.5, 3 and on. Fifteen squares up for an 80-centimeter range gives 5.33, and here the rounding has to go up to 6 — at 5 per square, fifteen squares reach only 75 and the tallest plant would not fit on the paper. It also puts the units in parentheses after each label, refuses to join the points because they are different plants, and stops its line of fit at the last data point rather than running on past it, which is the item added to the checklist below on its account.

    One place it appears to contradict this page, and the disagreement is worth understanding rather than ignoring. He declines to put zero on his axes, because zero is not in his data; the checklist below asks whether a count axis starts at zero. Both are right, for different figures. See When zero belongs on an axis, and when it does not under The Anatomy of a Graph above. The short version: length measured from a baseline needs the zero, position does not, and his is a scatter plot.

    Its one piece of advice this page does not follow is the title. He wants a title good enough that you could label both axes from it alone — a sharp test, and right for a graph in a notebook. This page uses captions below the figure instead, which is the convention in biology journals and carries more than a title can.
    The VARIABLES Song
    Mnemonic · three minutes
    Totally corny, but also totally worth watching. ☺ If the axes keep swapping places on you, a tune is a perfectly respectable way to pin them down for good.

    Two things in it earn their place beyond the mnemonic. It is the only one of these four that names constants — the things held the same so that any change you measure is a response to what you varied — and that is the idea the Doing Science laboratory builds experimental design out of. And its data-table rule is exactly the layout of Table 1 on the Roll Some Dice tab: the independent variable in the first column, what you measured in the columns after it, one row per trial. Getting that habit from a song is as good a way as any.

    One line to hold loosely. It insists that in every experiment there is only one independent variable. That is a good beginner's rule and it is how this laboratory works — the sum is varied, the count is recorded — but it is not a law. Real experiments routinely vary several variables at once and are designed specifically to measure how those variables interact, which is something a one-variable experiment cannot see at all.

    🖼️ Your Figures

    These are the two figures the handout asks you to draw by hand, drawn from your own numbers. Drawing them by hand is worth doing anyway — deciding where the axis should start and how wide to space eleven categories teaches something that watching a machine decide does not — but having the machine's version to compare against afterward turns a graded exercise into a check on your own work.

    🎲 Figure 1: Your Own Rolls

    🏫 Figure 2: The Pooled Class Result

    Except for the data plotted, Figures 1 and 2 are drawn identically, on the same axes and at the same scale. That is deliberate and it is the point of the exercise: the two can be flipped between, and what differs between them is nothing but the tightness with which the observations track the prediction.

    👥 Figure 3: The Two Together

    Flipping between two pages is how the handout arranges the comparison, because two pages is what a stapled packet offers. On a screen the two can simply be overlaid, and the effect is more direct: one prediction, two sets of observations, differing only in how far they wander from it.

    🎯 Figure 4: Convergence, Roll by Roll

    The two figures above compare a small experiment with a large one at a single instant. This one shows the transition happening. The trace is the running fraction of rolls so far that produced the chosen sum, recomputed after every roll, with the true probability drawn as a horizontal line. Early on the trace swings wildly, because a single roll is a large share of the total. As rolls accumulate the swings shrink, not because the dice change their behavior but because each new roll is a smaller share of what has already happened.

    Watch the horizontal axis, not just the trace. It is logarithmic, so each equal step to the right is a tenfold increase in the number of rolls. On a linear axis the first hundred rolls would be squeezed into invisibility and the interesting part of the story — the early wandering — would be lost. Choosing an axis that makes the phenomenon visible is a legitimate and necessary decision; choosing one that makes a phenomenon appear where none exists is not, and the difference between the two is whether the choice is stated.

    🔲 Figure 5: Departures, Cell by Cell

    The figures above concern sums, which throw away the identity of the individual dice. This one returns to the thirty-six ordered outcomes and plots the departure from expectation in each, so that a cell which is badly out can be found rather than merely suspected. With twenty rolls in thirty-six cells most of the grid is empty and the departures are small and negative; the interesting thing to look for is any cell that has been visited three or four times, since a cell expected 0.56 times has no business appearing four times — though with thirty-six cells, one of them behaving oddly is itself expected.

    📏 Figure 6: Observed Against Expected

    Every figure above puts the sum on the horizontal axis and both counts on the vertical one. This figure does the thing that seems as though it ought to be possible and usually is not: it puts expected on the horizontal axis and observed on the vertical. Each of the eleven points is one sum. The dashed diagonal is perfect agreement, where observed equals expected exactly.

    It answers a different question from the others, which is the whole reason it is here. Figures 1 to 3 ask what shape did the eleven sums make? This one asks how well does the model predict, and does it predict the common sums better than the rare ones? Points above the line came up more often than predicted and points below it less often; a miss of two rolls on an expectation of three is a different thing from a miss of two on an expectation of 0.6. With twenty rolls the points sit in a short, ragged cloud and that is the correct result — a tidy line would be the surprising outcome, and the Statistics tab says how ragged is too ragged.

    🧪 What a Statistical Test Is Actually For

    You have a prediction and an observation, and they disagree. They always disagree. The question is never whether they disagree but whether they disagree by more than chance alone would arrange, and that question has an answer only because the amount of disagreement chance produces is itself predictable. That is the whole idea. A statistical test computes how big the disagreement is, works out how big it would typically have been if nothing were wrong, and reports where the observed value falls in that distribution.

    The dull explanation being tested here — the null hypothesis — is that both dice are fair, that the two are independent of each other, and that successive rolls are independent of one another. If that is true, the eleven expected counts are exactly np and every departure from them is noise. The tests below all ask the same question of that hypothesis and differ only in how they measure departure and how they work out what departure to expect.

    📏 Four Ways of Measuring the Same Disagreement

    Before any test, the departure has to be reduced to a single number, and there is more than one defensible way to do that. The four below are computed from your data at once, because seeing them together makes clear what each one is throwing away.

    Summary M. Four summaries of the departure between observed and expected counts across the eleven sums.
    • Total absolute deviation, Σ|O − E|, is the handout's quantity. It is easy to compute by hand and easy to explain, and its weakness is that it treats a departure of two in a category expecting 0.6 as equivalent to a departure of two in a category expecting 3.3 — though the first is extraordinary and the second is routine.
    • Mean absolute deviation is the same quantity divided by the number of categories. It is the handout's number on a per-category scale, and it carries no additional information; it is reported because the phrase is standard and the handout's use of the word “variance” for this quantity is not.
    • Root mean squared deviation squares the departures before averaging and then takes the square root. Squaring gives large departures more weight than small ones, which is usually what is wanted: one category badly out is more informative than eleven categories slightly out.
    • Chi-square squares each departure and then divides by the expected count before adding, which fixes the flaw in all three of the others: a departure is judged against how large a departure that particular category should have produced. It is the quantity every test below is built on.

    📐 The Chi-Square Goodness-of-Fit Test

    This is the test a geneticist runs on a Mendelian ratio, and it is the standard tool for the question this laboratory asks. The statistic is a sum over categories:

    χ2 = Σ (O − E)2 E O, observed count in a category  ·  E, expected count in that category  ·  summed over all categories

    Division by E is what makes the statistic work, and it is worth pausing on. A departure of 2 where 0.56 was expected is a catastrophe; a departure of 2 where 33 was expected is nothing at all. Dividing by the expected count converts every departure into a comparable unit before adding, which is precisely what the handout's sum of absolute differences fails to do.

    Table S1. The chi-square calculation, category by category. The contribution column is each category's term in the sum, and reading it is usually more informative than reading the total: it says which sums are responsible for whatever discrepancy exists. The standardized residual is (O − E) / √(E(1 − p)), which is approximately a standard normal deviate: values beyond about ±2 are the ones worth looking at.

    Degrees of freedom, and why it is ten and not eleven

    Eleven categories do not supply eleven independent pieces of evidence, because their counts are forced to add up to the number of rolls. Fix any ten of them and the eleventh follows. So there are ten degrees of freedom, and the chi-square value has to be judged against the distribution for ten rather than eleven — a distinction that matters, since the two distributions have different means and different tails. The general rule for a goodness-of-fit test is k − 1 degrees of freedom for k categories, less one further degree of freedom for every parameter that had to be estimated from the same data. Here nothing was estimated: the expected values came from the sample space, not from the rolls.

    ⚠️ The Small-Expectation Problem, Which This Exercise Walks Straight Into

    The chi-square distribution is an approximation. The statistic is built from counts, which are lumpy and discrete, and it is being compared against a smooth continuous curve; the approximation is excellent when the expected counts are reasonably large and it degrades when they are not. The usual working rule, from Cochran (1954), is that no expected count should fall below 1 and that no more than a fifth of them should fall below 5.

    Twenty rolls of two dice fail that rule badly. The expected count for a sum of 2 is 20 × 1/36 = 0.56, and for eight of the eleven sums the expectation is under 5. The p-value from the chi-square distribution is therefore not to be trusted at this sample size, and reporting it without saying so would be exactly the sort of thing this page exists to avoid. There are three honest responses.

    1. Collect more data. Pooling the class raises every expectation by an order of magnitude and the problem simply goes away. This is the best answer, and it is why the laboratory pools.
    2. Pool the sparse categories. Combining the tails — treating “2 or 3” and “11 or 12” as single categories, and so on — raises the expectations at the cost of blurring the question. The pooled version is computed below alongside the unpooled one.
    3. Stop approximating and compute the answer directly. The chi-square distribution was invented because the exact calculation was impossible by hand. It is not impossible now.
    Table S2. The same test after pooling the tails so that the expected counts satisfy Cochran's rule. Fewer categories means fewer degrees of freedom, so the critical value falls as well; the two effects partly cancel, which is why a pooled test is not automatically more or less likely to reach significance.

    🎰 The Monte Carlo Test: Asking the Question Directly

    Here is the definition of a p-value again: the probability of a discrepancy at least as large as the one observed, if the null hypothesis is true. A computer can evaluate that definition literally. Simulate the same number of rolls with dice that are fair by construction, compute the chi-square statistic, and repeat some thousands of times. The fraction of simulated experiments whose statistic equals or exceeds yours is the p-value, with no approximation and no distributional assumption anywhere in it.

    This is worth appreciating rather than merely using. The chi-square distribution is a piece of nineteenth-century mathematics that exists to spare the analyst exactly this computation, and it does the job so well that it remained the only practical route for a century. It is now the more approximate of the two available answers.

    A Monte Carlo p-value has its own uncertainty. It is itself an observed proportion from a finite sample, so it carries a standard error of √(p(1 − p)/R) for R replicates. Ten thousand replicates give a p near 0.05 to about ±0.004, which is ample. The reported value uses the standard (hits + 1) / (R + 1) form, which cannot return a p-value of exactly zero — correctly, since no finite simulation can establish that something is impossible.

    🔀 The G-Test, and Why More Than One Test Exists

    The chi-square statistic is not the only way to measure how badly a set of counts fits a set of expectations. The likelihood-ratio statistic, usually called G, compares how probable the data are under the null hypothesis with how probable they are under the best possible alternative:

    G = 2 Σ O ln(O / E) terms with O = 0 contribute nothing  ·  compared against the same chi-square distribution

    G and χ2 are compared against the same distribution and usually give similar answers, and the case for preferring G is that it belongs to a general family — likelihood-ratio tests — that extends cleanly to complicated models where no chi-square analogue exists. The case for preferring χ2 is that it is what everyone reports and what everyone expects to read. Where the two disagree noticeably, the honest conclusion is not that one of them is right but that the sample is too small for either approximation, which is a useful thing for a pair of tests to be able to tell you.

    🧱 The Thirty-Six-Cell Test: Where Approximation Gives Up Entirely

    The exercise also asks about the full grid, in which order matters and there are thirty-six equally likely outcomes. Testing that grid is the same test with different numbers — thirty-five degrees of freedom, and an expected count of n/36 in every cell — and at twenty rolls every single one of those thirty-six expectations is 0.56. Not one of them satisfies Cochran's rule, and there is nothing sensible left to pool.

    This is not a defect in the exercise. It is the exercise's most valuable moment, because it demonstrates something no amount of being told will convey: an approximation has conditions, the conditions are checkable, and when they fail the number that comes out is not a slightly worse answer but a meaningless one. The Monte Carlo test has no such conditions and remains valid here, so the two can be run side by side and the size of the failure inspected directly.

    📌 How Precisely Do Twenty Rolls Pin Down a Probability?

    Testing asks whether the data are consistent with a stated model. Estimation asks a more useful question: given these data alone, and no prior claim about fairness, what range of probabilities would be consistent with what was seen? That range is a confidence interval, and it is often the more informative thing to report, because a test that fails to reject can mean either that the model is right or that the experiment was too small to notice anything — and an interval distinguishes the two immediately by being narrow or wide.

    Which interval, and why not the obvious one. The formula most introductory texts give — the observed proportion plus or minus 1.96 √(p̂(1 − p̂)/n) — behaves badly for small samples and for proportions near 0 or 1, which is exactly where this exercise lives: observe no sums of 12 in twenty rolls and it returns an interval of zero width, asserting with total confidence that the sum 12 is impossible. The interval computed here is Wilson's (1927), which does not collapse, is barely harder to compute, and is what a modern text recommends.

    🏁 The Handout's Final Exercise, Done Properly

    The exercise asks whether the departure from expectation is larger for twenty rolls than for forty, and it is a genuinely good question undercut by a genuinely small sample: with one experiment of each size, the comparison can easily come out backward, and a student who does the arithmetic correctly may be told their answer is wrong because the dice were uncooperative. Repeating the whole comparison thousands of times removes the complaint and reveals what the exercise was pointing at.

    Summary P. The handout's comparison, repeated many times. The column that matters is how often the comparison comes out in the direction the exercise predicts: frequently, but nowhere near always, which is the honest description of a real effect measured with one observation.

    🕵️ How Many Rolls Would It Take to Catch a Loaded Die?

    Everything above assumes the dice are fair and asks whether the data contradict that. Turn the question around. Suppose one die really is loaded. How large an experiment would be needed to notice? This is the question of statistical power, and it is the question that should be asked before an experiment rather than after, because it is the one that determines whether the experiment is worth doing at all.

    Power is the probability of detecting an effect that is really there. It rises with the size of the effect, with the sample size, and with a willingness to tolerate false alarms. A study with low power is not merely likely to miss things: when it does report something, the thing reported is disproportionately likely to be an exaggeration or an artifact, which is why underpowered studies do more damage than no study at all.

    🚫 What a p-Value Is Not

    Four misreadings account for nearly all of the trouble that p-values cause, and all four are worth being able to recognize in someone else's writing as well as your own.

    • It is not the probability that the null hypothesis is true. It is computed assuming the null hypothesis is true, so it cannot possibly be a statement about how likely that assumption is. Getting from one to the other requires knowing how plausible the hypothesis was beforehand, which the data do not contain.
    • It is not the probability that the result was due to chance. This is the previous error wearing a different coat.
    • A large p-value is not evidence that the null hypothesis is true. Failing to detect a difference is not the same as establishing that there is none, and with twenty rolls you would fail to detect a die loaded by fifty percent almost every time. Absence of evidence is evidence of absence only when the experiment had the power to find what it was looking for — which is what the previous section is for.
    • The threshold is a convention, not a law of nature. There is no sense in which 0.049 is a discovery and 0.051 is nothing. Report the value, report the size of the effect, report the sample size, and let a reader judge. And note what happens if you run eleven tests, one per sum, and keep the interesting one: at a threshold of 0.05 you should expect one of them to look significant even when every die in the room is perfect. That is why the goodness-of-fit test looks at all eleven categories together in a single statistic.

    🎥 A Video on Variance

    A brief introduction to variance, the quantity the standard deviation is the square root of. One warning before watching: the video computes the variance of a set of measurements, which is the general recipe. This page mostly uses the special case for counting, where the variance of a count is np(1 − p) and no averaging of squared departures is needed. The general recipe is more work and more correct; the special case is the one that applies here.

    Computing the Variance of a Data Set
    My Secret Math Tutor · the general recipe, worked
    It works 1, 1, 2, 5, 6 all the way through: mean 3, then the five departures −2, −2, −1, 2, 3, then their squares 4, 4, 1, 4, 9, which sum to 22. Divide by 4 and the variance is 5.5. That is the recipe behind the word variance everywhere it appears.

    Most of the video is about which denominator to use — 22/4 or 22/5, n − 1 or n, sample or population — and that is worth watching carefully, because this page's variance, np(1 − p), has no denominator at all. It is not being evasive: see Where the n Minus 1 Went under How Far from the Prediction Should the Observation Land? on the Theory tab. The short version is that the video estimates a mean from the data and must pay for it, while this page gets its mean from the model and pays nothing.

    📚 References

    • 1.Agresti, A., Coull, B.A. (1998). Approximate is better than “exact” for interval estimation of binomial proportions. The American Statistician 52:119–126. 10.1080/00031305.1998.10480550
    • 2.Cochran, W.G. (1954). Some methods for strengthening the common χ2 tests. Biometrics 10:417–451. 10.2307/3001616
    • 3.Fisher, R.A. (1922). On the interpretation of χ2 from contingency tables, and the calculation of P. Journal of the Royal Statistical Society 85:87–94. 10.2307/2340521
    • 4.Hardy, G.H. (1908). Mendelian proportions in a mixed population. Science 28:49–50. 10.1126/science.28.706.49
    • 5.Luria, S.E., Delbrück, M. (1943). Mutations of bacteria from virus sensitivity to virus resistance. Genetics 28:491–511. 10.1093/genetics/28.6.491
    • 6.Pearson, K. (1900). On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling. Philosophical Magazine 50:157–175. 10.1080/14786440009463897
    • 7.Wilson, E.B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 22:209–212. 10.1080/01621459.1927.10502953
    • 8.Yates, F. (1934). Contingency tables involving small numbers and the χ2 test. Supplement to the Journal of the Royal Statistical Society 1:217–235. 10.2307/2983604

    ❓ Check Yourself

    The questions below are the ones this laboratory is actually about, as opposed to the ones it asks you to compute. Answer each before revealing the response; a wrong answer you committed to teaches considerably more than a right answer you read.

    ✍️ Questions Worth Writing Out

    These have no multiple-choice version because the answer is a paragraph. They are the questions the handout ends on, and they are the ones most likely to appear on an examination.

    📌 If You Take Only One Thing Away

    A prediction and an observation are different kinds of statement, and the gap between them is not a mistake. Its size is itself predictable: the gap grows as the square root of the sample size while the gap per trial shrinks at the same rate. Every statistical test in biology is a way of comparing an observed gap against the gap that chance alone would have supplied.

    Everything else on this page — the multiplication rule, the addition rule, the sorted tables, the chi-square statistic, the simulations — is machinery in service of that one sentence.

    Starting Over

    Everything entered on this page is stored in this browser and nowhere else. Clearing it is permanent, so export anything worth keeping first.