Chapter 11 · Probability

Probability Models: Compare with Data and Fix Errors

Compare what a probability model predicts with what actually happened, explain the gaps, and find and fix common errors in models.

20 min read

A probability model lists every outcome (possible result) of a chance process and gives each outcome a probability: a number from 00 to 11 that tells how likely it is. The full list of outcomes is the sample space. Outcomes are equally likely when they all have the same probability. You write the probability of an outcome such as red as P(red)P(\text{red}).

A model is a claim about how often each outcome should happen over many trials. Data show what did happen. In this lesson you set the two side by side and judge whether they agree. Three terms describe the data:

  • A trial is one run of the chance process, such as one spin or one draw.
  • The observed frequency of an outcome is the number of trials in which it happened.
  • The relative frequency of an outcome is its observed frequency divided by the total number of trials. For example, 3030 reds in 120120 draws give a relative frequency of 30120=0.25\frac{30}{120} = 0.25.

You already know how to build a model and predict with it. Today you ask two new questions: does the model agree with the data, and if not, why not?

A probability and a count are different kinds of number, so put them in the same form before you compare. There are two ways:

  • Compare rates. Set each model probability beside the relative frequency of the same outcome.
  • Compare counts. Multiply each model probability by the number of trials to get the expected count, then set it beside the observed frequency.

The expected count is the number of times the model predicts the outcome. It is proportional to the number of trials: a probability of 0.250.25 predicts 3030 in 120120 trials and 6060 in 240240 trials. It is an approximate prediction, not a guarantee, and it does not have to be a whole number. Real counts usually land somewhat above or below it. These natural ups and downs are called chance variation.

Why should a model and data ever match? When a model fits the chance process, the relative frequency of each outcome tends to settle close to its probability over many trials. Over only a few trials, chance alone can leave a relative frequency far from the probability, even when the model is right.

Key concept

A model that fits stays close to the data over many trials

If a model fits a chance process, then over many trials each relative frequency tends to be close to the model's probability. Small gaps are normal, because a model's predictions are approximate expected counts, never guarantees.

A large gap needs an explanation. Ask three questions: Were there too few trials? Does the model rest on a wrong assumption, such as equally likely outcomes, or contain a slip? Were the trials run differently from what the model describes?

observed frequencynumber of trials≈P(outcome)over many trials, when the model fits\dfrac{\text{observed frequency}}{\text{number of trials}} \approx P(\text{outcome}) \quad \text{over many trials, when the model fits}

Worked example

A model that fits

A spinner has 55 equal sections labelled A, B, C, D and E. You spin it 500500 times and record these observed frequencies: A 104104, B 9797, C 9595, D 108108, E 9696. Does a model that gives every letter the same probability agree with the data?

  1. Write the model. The 5 sections are equal in size, so the 5 outcomes are equally likely. Only then can you find a probability as favourable over total: the number of outcomes that give the result, divided by the number of all outcomes. Each letter is 1 section out of 5.

    P(A)=P(B)=P(C)=P(D)=P(E)=15=0.2P(\text{A}) = P(\text{B}) = P(\text{C}) = P(\text{D}) = P(\text{E}) = \dfrac{1}{5} = 0.2
  2. Check the model before you use it. Each probability is between 0 and 1, and the five probabilities add to 1, so every outcome is accounted for.

    0.2+0.2+0.2+0.2+0.2=10.2 + 0.2 + 0.2 + 0.2 + 0.2 = 1
  3. Find the expected count for each letter. Multiply its probability by the 500 spins, because the model predicts that share of the trials. The result is an approximate prediction, not a guarantee.

    0.2×500=100 spins0.2 \times 500 = 100 \text{ spins}
  4. Compare counts. Subtract the expected count from each observed frequency. A positive gap means the letter came up more often than predicted, and a negative gap means less often.

    104−100=4,97−100=−3,95−100=−5,108−100=8,96−100=−4104 - 100 = 4, \quad 97 - 100 = -3, \quad 95 - 100 = -5, \quad 108 - 100 = 8, \quad 96 - 100 = -4
  5. Compare rates for the two letters farthest from 100. Divide each observed frequency by 500. The other three relative frequencies lie between these two, so all five are close to 0.2.

    108500=0.216,95500=0.19\dfrac{108}{500} = 0.216, \qquad \dfrac{95}{500} = 0.19
  6. Decide. There are many trials, and the largest gap is 8 spins against an expected count of 100. Gaps this small are what chance variation looks like, so nothing here needs explaining.

Answer

Yes. Over 500500 spins every relative frequency is within 0.0160.016 of the model's 0.20.2, so the model with equal probabilities agrees well with the data.

Now suppose a model and the data are far apart. Do not throw the model away yet. At this level there is no exact cut-off for close, so you judge it from two things: how big the gap is compared with the expected count, and how many trials stand behind the data.

A large gap does not tell you by itself what went wrong. It has several possible sources, and your job is to find the one that fits the evidence. The table lists the main ones.

Possible sources of a gap between a model and data
Possible sourceWhat you might seeWhat to do next
Too few trials
77 heads in 1010 flips of a coin: a relative frequency of 0.70.7 against a model probability of 0.50.5
Run many more trials before you judge the model
Outcomes that are not equally likely
The model gives every outcome the same probability, but over many trials one outcome happens far more often
List the sample space again, or build the model from the observed frequencies
A slip in the model
The probabilities do not add to 11, or an outcome is missing from the list
Correct the model, then compare again
Trials that do not match the model
The model has each tile put back and mixed in, but some tiles were kept out of the bag
Run the trials as the model describes, or change the model to match the trials

Worked example

A gap that points to the model

One trial is a flip of two fair coins, Coin 1 and Coin 2. In 400400 trials the results are: two heads 9696 times, one head and one tail 207207 times, two tails 9797 times. A student's model gives each of these three results a probability of 13\frac{1}{3}. Compare the model with the data and explain any gap.

  1. Find the student's expected count. Every result has the same probability in this model, so multiply one third by the 400 trials. The answer is not a whole number, which is fine for a prediction.

    13×400=4003≈133.3\dfrac{1}{3} \times 400 = \dfrac{400}{3} \approx 133.3
  2. Compare counts by subtracting the expected count from each observed frequency. One head and one tail is about 74 over, and the other two results are about 37 and 36 under. Over 400 trials, gaps this large are very unlikely to be chance alone, so test the model's assumption.

    207−133.3=73.7,96−133.3=−37.3,97−133.3=−36.3207 - 133.3 = 73.7, \quad 96 - 133.3 = -37.3, \quad 97 - 133.3 = -36.3
  3. The student used favourable over total, which needs equally likely outcomes. List every ordered outcome, Coin 1 first and Coin 2 second, with H for heads and T for tails. Each coin is fair and neither coin affects the other, so these 4 ordered outcomes are equally likely.

    (H,H),(H,T),(T,H),(T,T)(\text{H}, \text{H}), \quad (\text{H}, \text{T}), \quad (\text{T}, \text{H}), \quad (\text{T}, \text{T})
  4. Count the ordered outcomes for each result. Two heads is 1 of the 4 outcomes, and so is two tails. One head and one tail is 2 of the 4, (H, T) and (T, H), so it is twice as likely as two heads. The three results are not equally likely. That is the error.

    P(two heads)=14,P(one head, one tail)=24=12,P(two tails)=14P(\text{two heads}) = \dfrac{1}{4}, \quad P(\text{one head, one tail}) = \dfrac{2}{4} = \dfrac{1}{2}, \quad P(\text{two tails}) = \dfrac{1}{4}
  5. Check the corrected model: its probabilities add to 1. Then find the new expected counts by multiplying each probability by the 400 trials.

    14+12+14=1,14×400=100,12×400=200\dfrac{1}{4} + \dfrac{1}{2} + \dfrac{1}{4} = 1, \qquad \dfrac{1}{4} \times 400 = 100, \qquad \dfrac{1}{2} \times 400 = 200
  6. Compare again. Each observed frequency is now within 7 of its expected count, which is a small gap for 400 trials.

    96−100=−4,207−200=7,97−100=−396 - 100 = -4, \quad 207 - 200 = 7, \quad 97 - 100 = -3

Answer

The student's model disagrees with the data because it treats three results as equally likely when they are not. The corrected model, with probabilities 14\frac{1}{4}, 12\frac{1}{2} and 14\frac{1}{4}, agrees well with the 400400 trials.

That example was error analysis: you read a piece of work, found where it went wrong, explained why, and fixed it. Many errors in probability models come from using a rule outside the conditions that make it true, so check those conditions before you trust any model, including your own.

The table lists the checks. In it, AA stands for any event, which is one outcome or a group of outcomes, and "not AA" is the event that AA does not happen. Notice that the student's model passed one check, because three thirds add to 11, and was still wrong. No single check is enough, so run them all.

Checks to run on a probability model
CheckWhy, and when it holdsAn error to catch
Each probability is from 00 to 11
00 means impossible and 11 means certain; nothing is less likely than impossible or more likely than certain
P(blue)=1.2P(\text{blue}) = 1.2
The probabilities add to 11
The model lists every outcome, and exactly one outcome happens on each trial
Probabilities 0.50.5, 0.30.3 and 0.30.3, which add to 1.11.1
P(not A)=1−P(A)P(\text{not } A) = 1 - P(A)
On each trial either AA happens or it does not, never both, so the two probabilities add to 11
P(A)=0.35P(A) = 0.35 with P(not A)=0.75P(\text{not } A) = 0.75; it should be 0.650.65
Favourable over total
Only when the outcomes you count are equally likely; if a trial has two parts, count ordered outcomes
Giving three results 13\frac{1}{3} each just because there are three of them
The same outcomes on every draw
Only if each item is put back and mixed in; if items are kept out, the outcomes left for later draws change
In a bag of 1010 tiles with 44 red, using 410\frac{4}{10} for red after a red tile is kept out
Predictions from a model
An expected count is approximate, and a relative frequency is close to the probability only over many trials
Saying exactly 1010 green tiles in the next 5050 draws

Worked example

Find and fix the errors

A bag holds red, blue and green tiles of the same size, but the number of each colour is unknown. Sam draws one tile without looking, records its colour, puts it back and mixes the bag. After 200200 draws: red 9090, blue 7070, green 4040. Sam writes: (1) P(red)=13P(\text{red}) = \frac{1}{3} because there are 33 colours. (2) P(not green)=1−0.2=0.8P(\text{not green}) = 1 - 0.2 = 0.8. (3) Exactly 1010 of the next 5050 draws will be green. Judge each line and fix any error.

  1. Build a model from the data, because nothing says the colours are equally likely. Divide each observed frequency by the 200 draws. Each tile goes back before the next draw, so every draw has the same tiles to choose from, and 200 trials is enough for useful estimates.

    P(red)≈90200=0.45,P(blue)≈70200=0.35,P(green)≈40200=0.2P(\text{red}) \approx \dfrac{90}{200} = 0.45, \quad P(\text{blue}) \approx \dfrac{70}{200} = 0.35, \quad P(\text{green}) \approx \dfrac{40}{200} = 0.2
  2. Check the model. Each value is between 0 and 1, and the three values add to 1.

    0.45+0.35+0.2=10.45 + 0.35 + 0.2 = 1
  3. Line 1 is wrong. Counting 1 colour out of 3 is favourable over total, which needs equally likely colours. Each tile is equally likely, but a colour with more tiles is more likely to be drawn. The data show it too: one third of 200 is about 67, far from the 90 red and 40 green that Sam saw. Use about 0.45.

    13×200=2003≈66.7\dfrac{1}{3} \times 200 = \dfrac{200}{3} \approx 66.7
  4. Line 2 is correct. Not green means red or blue. Subtracting the probability of green from 1 gives the same value as adding the probabilities of red and blue.

    1−0.2=0.8and0.45+0.35=0.81 - 0.2 = 0.8 \quad \text{and} \quad 0.45 + 0.35 = 0.8
  5. Line 3 has the right number but the wrong word. The expected count is 0.2 times 50, but it is an approximate prediction, and 50 draws is a small number of trials. Replace "exactly" with "about".

    0.2×50=10 draws0.2 \times 50 = 10 \text{ draws}

Answer

Line 1 is wrong: nothing makes the colours equally likely, and the data give P(red)≈0.45P(\text{red}) \approx 0.45. Line 2 is correct. Line 3 should say that about 1010 of the next 5050 draws are expected to be green, not exactly 1010.

The takeaway. A probability model is a claim, and data test it. Put both in the same form, as rates or as counts, and look at the gaps. Over many trials, a model that fits stays close to the data, and small gaps are ordinary chance variation. When a gap is large, look for its source: too few trials, outcomes that are not equally likely, a slip in the model, or trials that do not match it. Check each rule against its conditions before you trust a model, and treat every expected count as an approximate prediction, never a guarantee.