Chapter 11 · Probability

Probability Models from Data: Build and Predict

Turn the results of many trials into a probability model, then use the model to predict about how often an outcome will happen in future trials.

20 min read

Toss a paper cup and it can land in three ways: on its side, with its open end down, or with its open end up. Each possible result is called an outcome. What is the probability of each one?

A probability model is a list of every outcome together with its probability. In the last lesson your models were uniform: every outcome was equally likely, so a probability was the number of favourable outcomes (the ones you want) over the total number of outcomes. That fraction is a probability only when the outcomes are equally likely. A cup is lopsided, and nothing tells you that its three landings are equally likely, so counting outcomes cannot give you their probabilities.

What you can do is toss the cup many times and count what happens. In this lesson you will turn counts like these into a probability model, and then use the model to predict future results.

Three terms describe the counting.

  • A trial is one run of a chance process (an action whose result depends on chance), such as one toss of the cup. You must run every trial the same way, so that the probabilities stay the same from trial to trial.
  • The observed frequency of an outcome is the number of trials in which that outcome happened.
  • The relative frequency of an outcome is its observed frequency divided by the total number of trials. It tells you what fraction of the trials gave that outcome.

Why does relative frequency help? A probability describes the long run. If an outcome has probability 0.30.3, then over many trials it happens in about 0.30.3 of them. So you can reason backwards: if an outcome happened in about 0.30.3 of a large number of trials, then 0.30.3 is a sensible estimate of its probability.

The words many trials matter. The record below shows why.

Running record for one cup: side landings as the tosses add up
Tosses so farSide landings so farRelative frequency of a side landing
1010
99
910=0.90\frac{9}{10} = 0.90
5050
3333
3350=0.66\frac{33}{50} = 0.66
100100
7474
74100=0.74\frac{74}{100} = 0.74
200200
144144
144200=0.72\frac{144}{200} = 0.72

After only 1010 tosses, the relative frequency of a side landing was 0.900.90. After 5050 tosses it was 0.660.66. With few trials, each toss is a large share of the record, so a lucky or unlucky run moves the value a lot. With many trials, each toss is a small share, and the value tends to settle: 0.740.74 after 100100 tosses and 0.720.72 after 200200.

So a relative frequency is a good estimate of a probability only when it comes from many trials. No fixed number counts as many, but in general more trials make the estimate more trustworthy. Even then it is an estimate, not the exact probability.

You show this with the sign ≈\approx, which means is approximately equal to. Writing P(side)P(\text{side}) for the probability that the cup lands on its side, the record gives P(side)≈0.72P(\text{side}) \approx 0.72.

Key concept

Counts build the model; the model predicts counts

When you cannot assume equally likely outcomes, build the probability model from data: estimate each outcome's probability by its relative frequency over many trials run the same way.

Every probability model has these properties, so use them as checks:

  • each probability PP is at least 00 and at most 11, so 0≤P≤10 \le P \le 1;
  • the probabilities of all the outcomes add to 11;
  • for any event AA (one outcome or a group of outcomes), the probability that AA does not happen is P(not A)=1−P(A)P(\text{not } A) = 1 - P(A), because in each trial AA either happens or does not.

The model also predicts. In new trials run the same way, an outcome should happen in about the same fraction of the trials. That prediction is an approximate count, not a guarantee.

P(outcome)≈number of trials with that outcometotal number of trialsP(\text{outcome}) \approx \frac{\text{number of trials with that outcome}}{\text{total number of trials}}
How the same cup landed in all 200 tosses
OutcomeObserved frequency
Lands on its side
144144
Lands with its open end down
3636
Lands with its open end up
2020

Worked example

Developing a model from 200 tosses

The table above records 200200 tosses of one paper cup: 144144 landed on its side, 3636 open end down and 2020 open end up. Develop a probability model for one toss of this cup.

  1. Add the observed frequencies to confirm the total number of trials. Each toss landed in exactly one of the three ways, so the three counts together must cover all 200 tosses.

    144+36+20=200144 + 36 + 20 = 200
  2. Find the relative frequency of a side landing, which estimates its probability: divide its observed frequency by the total number of trials. Dividing the numerator and the denominator by 2 gives an equivalent fraction out of 100, which is easy to write as a decimal.

    144200=72100=0.72\frac{144}{200} = \frac{72}{100} = 0.72
  3. Do the same for the other two outcomes, because the same reasoning applies to each: open end down first, then open end up.

    36200=18100=0.1820200=10100=0.10\frac{36}{200} = \frac{18}{100} = 0.18 \qquad \frac{20}{200} = \frac{10}{100} = 0.10
  4. Check the model. Each value is at least 0 and at most 1. The three outcomes cover every way the cup can land, and no toss lands two ways at once, so the three probabilities must add to 1.

    0.72+0.18+0.10=1.000.72 + 0.18 + 0.10 = 1.00

Answer

A probability model for one toss of this cup is P(side)≈0.72P(\text{side}) \approx 0.72, P(open end down)≈0.18P(\text{open end down}) \approx 0.18 and P(open end up)≈0.10P(\text{open end up}) \approx 0.10. These values are estimates based on 200200 tosses, not exact probabilities.

Now run the idea forwards. The model says a side landing happens in about 0.720.72 of the tosses in the long run, which is about 7272 in every 100100. So if you toss the same cup the same way again, you can predict roughly how many side landings to expect.

The expected count of an outcome is the model's prediction of how many times the outcome will happen in a given number of trials. A probability is the fraction of trials you expect the outcome to take up, so the expected count is the probability multiplied by the number of trials.

Two conditions come with every prediction. First, you must run the new trials the same way as the trials that built the model. Second, an expected count is an approximate prediction, not a guarantee. The probability in the model is itself an estimate, and chance still decides each trial, so the actual count may come out above or below the expected count.

expected count=P(outcome)×number of trials\text{expected count} = P(\text{outcome}) \times \text{number of trials}

Worked example

Predicting with the cup model

The model from 200200 tosses gives P(side)≈0.72P(\text{side}) \approx 0.72. You plan to toss the same cup the same way 300300 more times. About how many times should you expect the cup to land on its side? About how many times should you expect it not to land on its side?

  1. Multiply the probability of a side landing by the number of new tosses, because a side landing should happen in about 0.72 of them. Since 0.72 is 72 hundredths and 300 divided by 100 is 3, the product is 72 times 3.

    0.72×300=72100×300=72×3=2160.72 \times 300 = \frac{72}{100} \times 300 = 72 \times 3 = 216
  2. Find the probability that the cup does not land on its side. Each toss either lands on its side or does not, never both, so the two probabilities add to 1. Subtract the probability of a side landing from 1.

    P(not side)≈1−0.72=0.28P(\text{not side}) \approx 1 - 0.72 = 0.28
  3. Multiply this probability by the number of new tosses, because tosses that do not land on the side should make up about 0.28 of them. The arithmetic follows the same pattern as before.

    0.28×300=28100×300=28×3=840.28 \times 300 = \frac{28}{100} \times 300 = 28 \times 3 = 84
  4. Check the two expected counts. Each toss belongs to exactly one of the two groups, so the counts must add to the number of tosses.

    216+84=300216 + 84 = 300

Answer

In 300300 tosses you should expect about 216216 side landings and about 8484 landings that are not on the side. These are approximate predictions, so the actual counts may come out somewhat higher or lower.

Worked example

From draws to a model to a prediction

A bag holds red, blue and green tiles. You do not know how many of each colour it holds. A class draws one tile without looking, records its colour and puts the tile back, 250250 times in all. The results are red 115115, blue 8585 and green 5050. Develop a probability model for one draw. Then predict about how many of the next 450450 draws, made the same way, will not be green.

  1. Check the conditions first. The tile goes back each time, so every draw starts with the same tiles in the bag and is a repeat of the same trial. If drawn tiles were kept out, the tiles available for later draws would change, and the draws would not be repeats of one trial. With 250 draws, there are also enough trials for relative frequencies to give reasonable estimates.

  2. The three counts, 115, 85 and 50, add to 250, so every draw is included. Divide the observed frequency of red by 250. Multiplying the numerator and the denominator by 4 gives an equivalent fraction out of 1000.

    115250=4601000=0.46\frac{115}{250} = \frac{460}{1000} = 0.46
  3. Find the relative frequencies of blue and green the same way.

    85250=3401000=0.3450250=2001000=0.20\frac{85}{250} = \frac{340}{1000} = 0.34 \qquad \frac{50}{250} = \frac{200}{1000} = 0.20
  4. Check the model. Each value is at least 0 and at most 1, and every draw gives exactly one of the three colours, so the three values must add to 1.

    0.46+0.34+0.20=1.000.46 + 0.34 + 0.20 = 1.00
  5. A tile that is not green is red or blue. Each draw is either green or not green, never both, so subtract the probability of green from 1.

    P(not green)≈1−0.20=0.80P(\text{not green}) \approx 1 - 0.20 = 0.80
  6. Multiply by the number of new draws to get the expected count. Since 0.80 is 8 tenths and 450 divided by 10 is 45, the product is 8 times 45.

    0.80×450=810×450=8×45=3600.80 \times 450 = \frac{8}{10} \times 450 = 8 \times 45 = 360

Answer

A model for one draw is P(red)≈0.46P(\text{red}) \approx 0.46, P(blue)≈0.34P(\text{blue}) \approx 0.34 and P(green)≈0.20P(\text{green}) \approx 0.20. Of the next 450450 draws, you should expect about 360360 not to be green, though the actual count may come out somewhat higher or lower.

Takeaway. When you cannot assume equally likely outcomes, let data build the probability model: over many trials run the same way, each outcome's relative frequency estimates its probability. Check that every probability is at least 00 and at most 11 and that together they add to 11.

Then let the model predict: multiply a probability by a number of new trials to get an expected count. When you need the probability that an event AA does not happen, use P(not A)=1−P(A)P(\text{not } A) = 1 - P(A). An expected count is an approximate guide, not a guarantee.

Predictions and real results will not always agree. Next, you will compare the probabilities from a model with observed frequencies and explain the differences between them.