Educerie

Educerie · IB Diploma · Mathematics: analysis and approaches

IB Mathematics AA 4.5 · SL and HL

Sample spaces and probability

How do you put a number on how likely something is, either by counting what could happen or by watching what did happen, and what does that number let you predict?

What you will learn

  • Know the meaning of trial, outcome, equally likely outcomes, sample space and event.
  • Understand how a probability is found by counting equally likely outcomes, and when that is valid.
  • Understand complementary events, and that P(A) and P(A') add to 1.
  • Understand relative frequency as an estimate of probability, and the expected number of occurrences as n times p.

You must be able to

  1. Calculate a probability by counting outcomes in a list, table or sample space diagram.
  2. Calculate the probability of "at least one" using the complement.
  3. Draw a sample space diagram for two combined trials.
  4. Calculate an expected number of occurrences from a probability and a number of trials.
  5. Estimate a probability from experimental data, pooling sets of trials correctly.
  6. Comment on whether experimental results fit a theoretical probability.

In the exam. Paper 1 and Paper 2, usually as the opening parts of a probability question: list or draw a sample space (1 to 2 marks), find a probability by counting (2 marks), use P(A′)=1−P(A)P(A') = 1 - P(A) (1 to 2 marks), estimate a probability from experimental data (1 to 2 marks), and find an expected number of occurrences (2 marks). Answers must be exact or correct to 3 significant figures; without a calculator on Paper 1 that usually means a fraction such as 1136\frac{11}{36}. Everything in 4.6, 4.7 and 4.8 is built on the words and rules on this page.

1The vocabulary: trial, outcome, sample space, event

Every probability question uses the same few words, and marks depend on using them precisely. Figure 1 shows four of them for one roll of a die.

Figure 1 · From a trial to an event trial roll one fair die sample space U, n(U) = 6 event A: an even score 1 3 5 2 4 6 each circle is one outcome A = {2, 4, 6}, n(A) = 3, so P(A) = 3/6 = 1/2 The sample space U lists every outcome once. An event is any collection of those outcomes.
Figure 1 · From a trial to an event
  • A trial is one performance of an experiment with an uncertain result: one roll of a die, one toss of a coin, one patient tested, one day's weather.
  • An outcome is one possible result of a trial. Rolling a die has six outcomes: 1, 2, 3, 4, 5, 6.
  • The sample space, written UU, is the set of all possible outcomes, each listed once. For the die, U={1,2,3,4,5,6}U = \{1, 2, 3, 4, 5, 6\}, so n(U)=6n(U) = 6.
  • An event is any collection of outcomes, a subset of UU. "An even score" is the event A={2,4,6}A = \{2, 4, 6\}. An event can be a single outcome ("a 5"). It can even be every outcome ("a score below 7", which is certain).
  • Outcomes are equally likely when each has the same chance. A fair die makes the six scores equally likely. A loaded die does not.
  • The frequency of an event is the number of times it happened in a set of trials. Its relative frequency is that frequency divided by the number of trials, as a fraction, decimal or percentage.

Say the event in words and in set notation. "The score is prime" is B={2,3,5}B = \{2, 3, 5\}. Writing it out settles whether 1 counts. It does not; 1 is not prime.

Represent a sample space in whatever form fits the trial.

  • A list works for one simple trial. Examples: U={H,T}U = \{\mathrm{H}, \mathrm{T}\} for a coin, the 52 cards of a standard pack, or the register numbers 1 to 24 of a class.
  • A Venn diagram or a two-way table works when the outcomes are counted items sorted by properties (see below).
  • A table or grid, the sample space diagram, works for two trials together. Put the outcomes of the first along the top and the second down the side. Fill each cell with the combined result.

Figure 2 does this for two dice, with the total in each cell. There are 6×6=366 \times 6 = 36 cells. Each die is fair and the dice do not affect each other, so the 36 cells are equally likely.

Figure 2 · The sample space for two dice (a) The event “total is 7” 6 cells, so P(total 7) = 6/36 = 1/6 1 1 2 2 3 3 4 4 5 5 6 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 first die second die (b) “At least one six” and its complement 11 amber cells; the other 25 have no six 1 1 2 2 3 3 4 4 5 5 6 6 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 5 6 7 8 9 10 6 7 8 9 10 11 7 8 9 10 11 12 first die second die 36 equally likely outcomes. Each cell shows the total of the two scores.
Figure 2 · The sample space for two dice

A two-way list such as {HH,HT,TH,TT}\{\mathrm{HH}, \mathrm{HT}, \mathrm{TH}, \mathrm{TT}\} for two coins is a sample space too.

HT and TH are different outcomes: heads then tails, or tails then heads. Treating "one head and one tail" as a single outcome is the error that section 2 warns against.

When the trial is "pick one item at random from a group", the sample space is the whole group. n(U)n(U) is its size. A rectangle for UU with a circle for an event, or a two-way table, shows how the group splits.

Example: a school records how 60 pupils travel in.

BusWalk
Year 71812
Year 81416

Here n(U)=60n(U) = 60, and each pupil is equally likely to be picked.

  • P(walks)=12+1660=715P(\text{walks}) = \frac{12 + 16}{60} = \frac{7}{15}
  • P(Year 8 and bus)=1460=730P(\text{Year 8 and bus}) = \frac{14}{60} = \frac{7}{30}

Read the cell, or add the cells the event covers. Then divide by the grand total, not by a row total.

All the probabilities of a complete set of outcomes add to 1. Here 18+12+14+1660=1\frac{18 + 12 + 14 + 16}{60} = 1. Combining events with "or" and "given that" belongs to 4.6.

2Probability by counting

When all outcomes in UU are equally likely, the probability of AA is the fraction of them that belong to AA.

P(A)=n(A)n(U)P(A) = \dfrac{n(A)}{n(U)}, valid only when every outcome in UU is equally likely. Every probability satisfies 0≤P(A)≤10 \le P(A) \le 1.

Example: a class of 24 has register numbers 1 to 24. The teacher picks one at random. "At random" means every number is equally likely, so the formula applies.

For a card from a standard pack, the same rule gives P(heart)=1352=14P(\text{heart}) = \frac{13}{52} = \frac{1}{4}.

U={1,2,…,24},n(U)=24U = \{1, 2, \ldots, 24\}, \quad n(U) = 24A=multiple of 5={5,10,15,20},n(A)=4A = \text{multiple of 5} = \{5, 10, 15, 20\}, \quad n(A) = 4P(A)=424=16P(A) = \frac{4}{24} = \frac{1}{6}B=factor of 24={1,2,3,4,6,8,12,24},n(B)=8B = \text{factor of 24} = \{1, 2, 3, 4, 6, 8, 12, 24\}, \quad n(B) = 8P(B)=824=13P(B) = \frac{8}{24} = \frac{1}{3}

With two dice, read the answer off Figure 2.

  • In panel (a) the total is 7 in six cells, so P(total is 7)=636=16P(\text{total is } 7) = \frac{6}{36} = \frac{1}{6}.
  • For "total is at least 10", count the cells showing 10, 11 or 12: 3+2+1=63 + 2 + 1 = 6. The probability is again 636=16\frac{6}{36} = \frac{1}{6}.
  • Only one cell shows 12, so P(total is 12)=136P(\text{total is } 12) = \frac{1}{36}.

The equally-likely trap

  • The possible totals of two dice are 2,3,…,122, 3, \ldots, 12, which is eleven values. It is tempting to say P(total is 7)=111P(\text{total is } 7) = \frac{1}{11}.
  • That is wrong, because the eleven totals are not equally likely. A total of 7 can happen six ways and a total of 2 only one way.
  • The formula counts equally likely outcomes. Count cells in the grid, not values in a list of totals.

Figure 3 places these probabilities on the probability scale. An impossible event (a total of 13) has probability 0. A certain event (a total of at least 2) has probability 1.

An answer outside 0 to 1 is always a mistake. Usually it is a swapped fraction or a complement taken the wrong way round.

Figure 3 · Every probability lies between 0 and 1 0 0.25 0.5 0.75 1 impossible certain evens total 12: 1/36 total 7: 1/6 even score: 1/2 no six in two rolls: 25/36 at least one six: 11/36 Probabilities from this page, placed on the scale. Nothing can go below 0 or above 1.
Figure 3 · Every probability lies between 0 and 1

Give a probability exactly or to 3 s.f.

  • Paper 1: a fraction, simplified if you can. 636\frac{6}{36} is correct and 16\frac{1}{6} is neater.
  • Paper 2: a decimal to 3 significant figures is fine: 0.167.
  • A probability may also be written as a percentage (16.7%16.7\%), which is how some questions ask for it.

3Complementary events

The complement of AA, written A′A' (read "not AA"), is the event that AA does not happen. It is every outcome in UU not in AA.

AA and A′A' cannot both happen, and one of them must happen, so their probabilities add to 1. Figure 4 draws this. AA is a region inside the rectangle UU. A′A' is everything else in it.

Figure 4 · An event and its complement U A at least one six 11 outcomes A′ no six 25 outcomes P(A) = 1 − P(A′) = 1 − 25/36 = 11/36 A and A′ do not overlap and together fill U, so P(A) + P(A′) = 1.
Figure 4 · An event and its complement

P(A)+P(A′)=1P(A) + P(A') = 1, so P(A′)=1−P(A)P(A') = 1 - P(A).

It is often the fastest route to an answer, because the complement of an awkward event is frequently simple. The classic case is "at least one".

  • Example: two dice are rolled. Find the probability that at least one of them shows a six.
    • "At least one six" is several cases: one six or two. Its complement, "no six at all", is one clean case. Each die shows 1 to 5, so there are 5×5=255 \times 5 = 25 cells with no six.
P(no six)=2536P(\text{no six}) = \frac{25}{36}P(at least one six)=1−2536=1136P(\text{at least one six}) = 1 - \frac{25}{36} = \frac{11}{36}
  • Check against panel (b) of Figure 2: 6 cells in the last column plus 6 in the last row, minus the (6,6)(6, 6) cell counted twice, gives 11.
  • The complement route also works when the sample space is far too big to draw. A coin tossed five times has 25=322^5 = 32 equally likely ordered results. "No head" is one result (TTTTT). So P(at least one head)=1−132=3132P(\text{at least one head}) = 1 - \frac{1}{32} = \frac{31}{32}.
  • The complement also checks work. P(A)P(A) and P(A′)P(A') must add to exactly 1.

4Relative frequency: probability from experiment

Some probabilities cannot be found by counting. The outcomes are not equally likely, with no symmetry to lean on.

Example: what is the probability that a wooden clothes peg lands on its edge when dropped? The two outcomes, on its edge and flat, are not equally likely. The shape decides. You have to toss it and see.

The relative frequency of an event is

relative frequency=number of times the event happenednumber of trials\text{relative frequency} = \dfrac{\text{number of times the event happened}}{\text{number of trials}}

and it is used as an estimate of the probability. This estimate is called an experimental probability. A probability found by counting equally likely outcomes, as in section 2, is a theoretical probability.

Example: a student drops a clothes peg 160 times and it lands on its edge 52 times.

relative frequency=52160=0.325\text{relative frequency} = \frac{52}{160} = 0.325estimate: P(edge)≈0.325\text{estimate: } P(\text{edge}) \approx 0.325P(flat)≈1−0.325=0.675P(\text{flat}) \approx 1 - 0.325 = 0.675

Combining data

  • Combining data = pooling the results of more than one set of trials. Add the frequencies, add the numbers of trials, then divide.
  • Do not average the relative frequencies. That gives a small set of trials the same weight as a large one.
  • Example: a first set shows 9 successes in 12 trials and a second shows 51 in 108. The pooled estimate is 9+5112+108=60120=0.5\frac{9 + 51}{12 + 108} = \frac{60}{120} = 0.5. The average of 0.750.75 and 0.4720.472 is 0.6110.611. That is too high, because it over-trusts the 12 trials.

A frequency table gives a relative frequency for each outcome in the same way: divide that outcome's frequency by the total. Q5 practises this, and Q6 practises pooling.

How good is the estimate? Figure 5 answers this with a simulation. A computer rolled a fair die 1000 times. After each roll it recorded the fraction of rolls so far that were sixes.

Figure 5 · Relative frequency settles as the trials pile up 0.05 0.1 0.15 0.2 0.25 0.3 0 200 400 600 800 1000 number of rolls, n relative frequency of a six theoretical P(six) = 1/6 ≈ 0.167 after 1000 rolls: 157/1000 = 0.157 in the first few dozen rolls it jumps about 1000 simulated rolls of a fair die. After each roll: sixes so far ÷ rolls so far.
Figure 5 · Relative frequency settles as the trials pile up

Three things are worth reading off it.

  • After 10 rolls there had been no sixes at all, so the relative frequency was 0, wildly wrong.
  • After 100 rolls it was 0.14.
  • After 1000 rolls it was 1571000=0.157\frac{157}{1000} = 0.157, close to the true 16≈0.167\frac{1}{6} \approx 0.167 but still not equal to it.

So:

  • A relative frequency from a few trials is unreliable. Its value depends heavily on luck.
  • As the number of trials grows, the relative frequency tends to settle close to the true probability. More trials give a better estimate.
  • It never becomes a guarantee. Even after many trials the relative frequency will usually differ a little from the probability.

This is how the two kinds of probability are linked. A theoretical probability predicts what the relative frequency will approach in the long run. A relative frequency from many trials estimates the probability when no theory is available.

Simulation

  • A simulation does the same by computer. It imitates the trial thousands of times (the idea behind Monte Carlo methods). So it can estimate a probability that nobody knows how to calculate.
  • Comparing the two tells you whether a theoretical model fits.
  • Example: a fair spinner with six equal sectors gives each number probability 16≈0.167\frac{1}{6} \approx 0.167.
    • Spun 600 times, a relative frequency of 0.185 for one number is higher. Chance alone can produce that gap, so it is not proof of bias.
    • A relative frequency of 0.3 after 600 spins would be strong evidence.
  • In this course you are asked to comment, not to test formally. Say what the model predicts, what the data show, and whether the gap is large compared with the number of trials.

5Expected number of occurrences

An event with probability pp in each of nn trials is expected to happen about

expected number of occurrences=n×p\text{expected number of occurrences} = n \times p

times. This follows from section 4 read backwards. In the long run the relative frequency is close to pp, so the number of occurrences is close to n×pn \times p.

  • Example: roll two dice 240 times. P(total is 7)=16P(\text{total is } 7) = \frac{1}{6}, so you expect a total of 7 about 240×16=40240 \times \frac{1}{6} = \mathbf{40} times.
  • Example: take the clothes peg. Using the estimate from section 4, in 400 more drops you expect about 400×0.325=130400 \times 0.325 = \mathbf{130} edge landings. The answer inherits the uncertainty of the estimate. It is only as good as the 160 drops behind it.
  • The answer need not be a whole number.
    • Example: a clinic finds that a patient misses an appointment with probability 0.12. Of 35 appointments booked for one day, the expected number missed is 35×0.12=4.235 \times 0.12 = \mathbf{4.2}.
    • You cannot have 4.2 patients, and nobody claims you will. Over many days the average is 4.2 per day. Do not round an expected number unless told to.
  • Example (invented): a bike-hire firm has 2400 bikes, and each needs a repair in a given week with probability 0.03. The expected number of repairs is 2400×0.03=722400 \times 0.03 = \mathbf{72}. At €15 a repair, that is about €1080 a week.

In 4.7 this idea becomes the expected value of a random variable. In 4.8 it becomes the mean npnp of the binomial distribution. Same formula, same meaning: the long-run average.

Practice questions

33 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.