← IB Mathematics: Analysis & Approaches · HL · IB Maths AA revision
⭐ 0
IB Diploma Mathematics: Analysis & Approaches HL · Statistics & Probability
Mini-Lesson

Statistics & Probability

7 missions. Guess, learn, then check. Your place is saved.

  1. Mission 1A gym survey finds 90% of people exercise daily. What went wrong?
  2. Mission 2Give everyone a £100 pay rise. What happens to the standard deviation?
  3. Mission 3Ice-cream sales and drownings rise together. Does one cause the other?
  4. Mission 4In a class of 30, how likely is it that two share a birthday?
  5. Mission 5A £1 dice game pays out £5 if you roll a six. Is the game fair?
  6. Mission 6Heights average 170 cm. How rare is someone over 2 metres tall?
  7. Mission 7A 95% accurate test says you have a rare disease. Are you likely ill?
Mission 1

A gym survey finds 90% of people exercise daily. What went wrong?

Make a guess: A gym survey finds 90% of people exercise daily. What went wrong?

Statistics and probability · collecting and presenting data

Population, sample and types of data

  • The population is the whole group you want to know about. A sample is the part you collect data from.
  • In a random sample every member of the population has an equal chance of being chosen.
  • A sample that over- or under-represents part of the population is biased.
  • Discrete data are counted (goals, siblings). Continuous data are measured and can take any value in a range (time, mass).
  • Check reliability: deal with missing values and recording errors first.
Statistics and probability · collecting and presenting data

Sampling techniques

TechniqueHow it worksRandom?
Simple randomEvery member has an equal chance (number everyone, use random numbers)Yes
SystematicPick a random start, then every kth member from a listYes, if the list has no pattern
StratifiedSplit into groups (strata); sample each group in proportion to its size, at randomYes
QuotaFill a fixed number from each group, choosing whoever is availableNo
ConvenienceAsk whoever is easiest to reachNo
  • Non-random methods are quicker but more likely to be biased.
Quick check
?A researcher stands in a shopping centre and interviews shoppers until she has spoken to 20 men and 20 women. Which sampling technique is this?
Worked example Statistics and probability · collecting and presenting data

Choosing a stratified sample

Question
A company employs 180 office staff, 120 warehouse staff and 60 drivers. A stratified sample of 30 employees is chosen. How many should be drivers?
  1. 1
    Find the population size: 180 + 120 + 60 = 360
  2. 2
    Write the drivers' share of the population: 60/360 = 1/6
  3. 3
    Take the same share of the sample: 1/6 × 30 = 5
  4. 4
    Check the other strata add up: office 180/360 × 30 = 15, warehouse 120/360 × 30 = 10, and 15 + 10 + 5 = 30
Answer
5 drivers
⚠️ Watch out
splitting the sample equally (10 from each group) ignores the group sizes. Stratified samples are proportional.
Calculate
?A tennis club has 84 junior, 126 senior and 70 veteran members. The coach chooses a stratified sample of 40 members to survey about new court times. How many senior members should be in the sample?
Statistics and probability · collecting and presenting data

Cumulative frequency, box plots and outliers

  • Classes are inequalities with no gaps (10 ≤ t < 20). A histogram uses equal class widths, frequency upwards.
  • Cumulative frequency: plot running totals at upper class ends. Read the median at n/2, Q₁ at n/4, Q₃ at 3n/4, the pth percentile at p% of n. IQR = Q₃ − Q₁.
  • An outlier is over 1.5 × IQR from the nearest quartile: mark it with a cross. A symmetric box plot suggests possible normality.
  • Compare box plots by median (average) and IQR or range (spread).
Worked example Statistics and probability · collecting and presenting data

Checking for outliers

Box and whisker diagram with an outlier2030405060708090100lower boundary 28upper boundary 9225
Question
Test scores have Q₁ = 52 and Q₃ = 68. The lowest score is 25 and the highest is 90. Is either an outlier?
  1. 1
    Find the IQR: 68 − 52 = 16
  2. 2
    Find 1.5 × IQR: 1.5 × 16 = 24
  3. 3
    Lower boundary: 52 − 24 = 28. Since 25 < 28, the score 25 is an outlier
  4. 4
    Upper boundary: 68 + 24 = 92. Since 90 < 92, the score 90 is not
Answer
25 is an outlier (marked with a cross); 90 is not.
⚠️ Watch out
measure from the nearest quartile, not from the median. Then decide in context: 25 may be a genuine low score, or a recording error.
Calculate
?The cumulative frequency graph shows the weekly revision times of 80 students. Use it to find the interquartile range.
Cumulative frequency curve of revision time010203040506001020304050607080Revision time, t (hours)Cumulative frequency
hours
Quick check
?The box plots show the test scores of two classes, Ash and Birch. Which comparison is correct?
Box plots for Ash and BirchAshBirch2030405060708090Test score
Mission check

?A survey at a gym finds 90% of the people asked exercise daily. Why can't you conclude that 90% of all adults do?
Mission 2

Give everyone a £100 pay rise. What happens to the standard deviation?

Make a guess: Give everyone a £100 pay rise. What happens to the standard deviation?

Statistics and probability · averages and spread

Mean, median and mode

  • Mean: add the values and divide by how many there are.
x̄ = (Σ x)/n or, from a frequency table, x̄ = (Σ fx)/(Σ f)
  • Median: the middle value when the data are in order, at position (n+1)/2.
  • Mode: the most frequent value.
  • In IB SL questions the data set is treated as the whole population unless the question says otherwise.
Calculate
?The table shows the number of goals a team scored in each of 20 matches. Find the mean number of goals per match. Give your answer as a decimal.
Goals, x01234
Frequency, f47531
Statistics and probability · averages and spread

Grouped data

  • When data are grouped you don't know the exact values, so use each class's mid-interval value as x.
  • Estimated mean = (Σ fx)/(Σ f) with x the mid-interval values. It is an estimate, not exact.
  • The modal class is the class with the highest frequency (equal class widths only).
Worked example Statistics and probability · averages and spread

Estimating a mean from grouped data

Question
The times, t minutes, that 40 people waited at a clinic are grouped below. Estimate the mean waiting time and state the modal class. 0 ≤ t < 10: 5 people; 10 ≤ t < 20: 12; 20 ≤ t < 30: 15; 30 ≤ t < 40: 8.
  1. 1
    Write the mid-interval values: 5, 15, 25, 35
  2. 2
    Multiply by the frequencies: 5 × 5 + 15 × 12 + 25 × 15 + 35 × 8 = 25 + 180 + 375 + 280 = 860
  3. 3
    Divide by the total frequency: 860/40 = 21.5
  4. 4
    Pick the class with the highest frequency (15): 20 ≤ t < 30
Answer
estimated mean 21.5 minutes; modal class 20 ≤ t < 30
⚠️ Watch out
using the lower class boundaries (0, 10, 20, 30) gives 16.5, an underestimate. Use the midpoints.
Statistics and probability · averages and spread

Measuring spread

  • Range = largest − smallest. IQR = Q₃ − Q₁, the spread of the middle half; outliers do not affect it.
  • Standard deviation σ measures the typical distance of the values from the mean. Variance = σ².
  • Find σ with your GDC's one-variable statistics. Treat the data as the population and use σ_x, not the sample value s_x.
  • Find quartiles of discrete data on your GDC too. Methods differ, so a hand answer may not match exactly.
Calculate
?Use your GDC to find the standard deviation of the data 4, 7, 7, 9, 13. Give your answer to 3 significant figures.
Statistics and probability · averages and spread

Changing every value

Adding 4 to every value02468101214161820mean 6mean 10range 5range 5originaladd 4
  • Add or subtract a constant c: the mean, median and quartiles move by c. The standard deviation, IQR and range do not change, because every gap stays the same.
  • Multiply by a positive constant k: the mean and the standard deviation are both multiplied by k. The variance is multiplied by k².
  • Do multiplication and addition in the order the question gives them.
Quick check
?A data set has mean 40 and standard deviation 6. Every value is multiplied by 3 and then 5 is subtracted. What are the new mean and standard deviation?
Calculate
?The mean mass of 12 parcels is 15 kg. When one more parcel is added, the mean mass of the 13 parcels is 16 kg. Find the mass of the extra parcel.
kg
Mission check

?Salaries at a firm have mean £2,400 and standard deviation £300. Everyone gets a £100 rise. What are the new mean and standard deviation?
Mission 3

Ice-cream sales and drownings rise together. Does one cause the other?

Make a guess: Ice-cream sales and drownings rise together. Does one cause the other?

Statistics and probability · correlation and regression

Scatter diagrams and correlation

Three scatter diagrams: strong positive, weak negative and no correlationstrong positiveweak negativeno linear correlation
  • A scatter diagram shows bivariate data. Describe the pattern as positive, negative or no correlation, and as strong or weak.
  • Pearson's product-moment correlation coefficient r measures linear correlation: −1 ≤ r ≤ 1. Find it with your GDC.
  • r near 1 or −1: strong linear correlation. r near 0: no linear correlation (there may still be a curved relationship).
  • Correlation does not imply causation. A third variable may drive both.
Sort it
?True or false?

Tap a statement, then tap the group it belongs in. Then press Check.

Statistics and probability · correlation and regression

The regression line of y on x

  • Your GDC gives the regression line of y on x, y = ax + b. It always passes through (x̄, ȳ).
  • a is the gradient: the change in y for each increase of 1 in x. b is the value of y when x = 0, which may have no meaning in context.
  • Use it to predict y from a given x inside the data range. Predicting outside it is extrapolation and may be unreliable.
  • Don't rearrange a y on x line to predict x from y.
Worked example Statistics and probability · correlation and regression

Making a prediction

Question
Six students recorded weekly revision time, x hours, and test score, y. The data are (1, 42), (3, 50), (4, 57), (6, 61), (8, 70), (10, 78). Use your GDC to find r and the regression line of y on x. Hence predict the score for 7 hours.
  1. 1
    Enter x and y in two lists and run linear regression: r = 0.995 (3 sf)
  2. 2
    Read off the line: y = 3.92x + 38.8 (3 sf)
  3. 3
    Interpret: r is close to 1, so strong positive linear correlation; prediction is reasonable
  4. 4
    Check 7 is inside the data range (1 to 10), then substitute: y = 3.92 × 7 + 38.8 ≈ 66.2
Answer
r = 0.995, y = 3.92x + 38.8, predicted score 66.2
⚠️ Watch out
use the unrounded values stored in your GDC for the prediction. Here both give 66.2, but rounding early can change the third significant figure.
Calculate
?The age of a car, x years, and its value, y thousand pounds, are (2, 9), (4, 8), (6, 6), (8, 5), (10, 2). Use your GDC to find Pearson's correlation coefficient r. Give your answer to 3 significant figures.
Quick check
?For puppies aged 2 to 16 weeks, the regression line of mass m kg on age w weeks is m = 0.42w + 1.3. Which statement is valid?
Calculate
?On 14 summer days a kiosk recorded the maximum temperature, x °C, and the number of cold drinks sold, y. The regression line of y on x is y = 1.85x + 12.4. The mean temperature was 20 °C. Find the mean number of drinks sold per day.
Statistics and probability · correlation and regression

The regression line of x on y

  • To predict x from a known y, use the regression line of x on y, x = cy + d. Your GDC finds it if you swap the lists (put y as the independent variable).
  • Both lines pass through (x̄, ȳ). They are different lines unless r = ± 1.
  • An x on y line cannot reliably predict y from x: use y on x for that.
Calculate
?Six students' marks on paper 1, x, and paper 2, y, are (35, 40), (42, 38), (48, 52), (55, 47), (60, 63), (68, 58). Another student missed paper 1 but scored 45 on paper 2. Use the regression line of x on y to estimate their paper 1 mark. Give your answer to 3 significant figures.
Mission check

?In a seaside town, monthly ice-cream sales and drownings have r = 0.87. Does buying ice cream cause drownings?
Mission 4

In a class of 30, how likely is it that two share a birthday?

Make a guess: In a class of 30, how likely is it that two share a birthday?

Statistics and probability · probability

Sample spaces and events

  • A trial has outcomes; the set of all outcomes is the sample space U; an event is a set of outcomes.
  • For equally likely outcomes:
P(A) = (n(A))/(n(U))
  • The complement A' means "not A": P(A') = 1 − P(A).
  • Relative frequency (successes ÷ trials) estimates a probability from an experiment.
  • Expected number of occurrences in n trials = n × P(A).
Calculate
?Two fair six-sided dice are rolled together 180 times. Find the expected number of times the total is 8.
Statistics and probability · probability

Combined and conditional probability

  • "A or B" includes both, so subtract the overlap once:
P(A ∪ B) = P(A) + P(B) − P(A ∩ B)
  • Mutually exclusive events cannot happen together: P(A ∩ B) = 0.
  • Conditional probability ("A given B") restricts you to B: P(A | B) = (P(A ∩ B))/(P(B)).
  • Independent events don't affect each other: P(A ∩ B) = P(A) P(B).
Worked example Statistics and probability · probability

Using a Venn diagram

Venn diagram of Biology and Chemistry studentsUBC148711Biology (B), Chemistry(C); n(U)=40
Question
In a group of 40 students, 22 study Biology (B), 15 study Chemistry (C) and 8 study both. A student is chosen at random. Find P(B ∪ C) and P(C | B).
  1. 1
    Fill the overlap first: n(B ∩ C) = 8
  2. 2
    Biology only: 22 − 8 = 14; Chemistry only: 15 − 8 = 7
  3. 3
    Neither: 40 − (14 + 8 + 7) = 11
  4. 4
    P(B ∪ C) = (14 + 8 + 7)/40 = 29/40 = 0.725
  5. 5
    Given Biology, only the 22 Biology students count: P(C | B) = 8/22 = 4/11 ≈ 0.364
Answer
P(B ∪ C) = 0.725; P(C | B) = 4/11 ≈ 0.364
⚠️ Watch out
22 + 15 = 37 counts the 8 students who study both twice.
Quick check
?P(A) = 0.5, P(B) = 0.4 and P(A ∩ B) = 0.2. Find P(A | B).
Statistics and probability · probability

Tree diagrams and "without replacement"

  • On a tree diagram, multiply along the branches for "this and then that", and add the end results for "either path".
  • Each set of branches from one point adds to 1.
  • Without replacement, the second-stage probabilities change: there is one fewer item, and one fewer of the kind you took.
  • For "at least one", it is often quicker to use 1 − P(none).
Worked example Statistics and probability · probability

Two picks without replacement

Two draws without replacementFirst drawSecond drawOutcome58Red47Red37Blue38Blue57Red27BlueRRRBBRBB
Question
A bag holds 5 red and 3 blue counters. Two counters are taken at random without replacement. Find the probability that they are different colours.
  1. 1
    Red then blue: 5/8 × 3/7 = 15/56
  2. 2
    Blue then red: 3/8 × 5/7 = 15/56
  3. 3
    Add the two paths: 15/56 + 15/56 = 30/56 = 15/28
Answer
15/28 ≈ 0.536
⚠️ Watch out
with replacement the answer would be 2 × 5/8 × 3/8 = 0.469. Read the question to see which applies.
Calculate
?A box contains 10 batteries, 3 of which are flat. A torch needs 2 batteries, chosen at random without replacement. Find the probability that at least one of them is flat. Give your answer to 3 significant figures.
Worked example Statistics and probability · probability

Testing for independence

Question
P(A) = 0.6, P(B) = 0.35 and P(A ∩ B) = 0.21. Determine whether A and B are independent.
  1. 1
    State the formal test: A and B are independent if P(A | B) = P(A) = P(A | B')
  2. 2
    Find P(A | B) = 0.21/0.35 = 0.6, which equals P(A)
  3. 3
    Confirm with B': P(A | B') = (P(A) − P(A ∩ B))/(1 − P(B)) = 0.39/0.65 = 0.6
  4. 4
    Equivalently, P(A) P(B) = 0.6 × 0.35 = 0.21 = P(A ∩ B)
Answer
A and B are independent: knowing B happened does not change the probability of A.
⚠️ Watch out
independent is not the same as mutually exclusive. Here P(A ∩ B) = 0.21 ≠ 0, so they can happen together.
Mission check

?Assume 365 equally likely birthdays. Find the probability that at least two of 30 people share a birthday.
Mission 5

A £1 dice game pays out £5 if you roll a six. Is the game fair?

Make a guess: A £1 dice game pays out £5 if you roll a six. Is the game fair?

Statistics and probability · discrete random variables

Discrete random variables

Probability distribution P(X = x)1230.00.10.20.30.40.5P(X=x)518618718x
  • A discrete random variable X takes separate values, each with a probability. Write a value as x and its probability as P(X=x).
  • The probability distribution lists every value with its probability, in a table or by a formula, e.g. P(X=x) = 1/18(4+x) for x ∈ {1, 2, 3}.
  • The probabilities are all between 0 and 1 and sum to 1: 5/18 + 6/18 + 7/18 = 1. Use this to find an unknown probability.
Calculate
?The random variable X has this probability distribution.
x0123
P(X=x)0.2k0.30.1

Find E(X). Give your answer as a decimal.

Statistics and probability · discrete random variables

Expected value and fair games

  • The expected value (mean) is the long-run average value of X:
E(X) = Σ x P(X=x)
  • E(X) need not be a value X can take. The expected number of occurrences in n trials is np: 128 students each absent with probability 0.1 gives 12.8 absent on average.
  • In a game, let X be the player's gain (winnings minus the cost to play). The game is fair when E(X) = 0.
Worked example Statistics and probability · discrete random variables

Is the counter game fair?

Question
A bag holds 10 counters: 1 gold, 3 silver and 6 red. It costs £2 to draw one counter at random. Gold wins £10, silver wins £3 and red wins nothing. The £2 is not returned. Is the game fair?
  1. 1
    Define the gain X in pounds as prize minus £2: gold 8, silver 1, red −2
  2. 2
    Write the distribution: P(X=8) = 0.1, P(X=1) = 0.3, P(X=−2) = 0.6
  3. 3
    Find the expected gain: E(X) = 8(0.1) + 1(0.3) + (−2)(0.6) = 0.8 + 0.3 − 1.2 = −0.1
Answer
E(X) = −0.1 ≠ 0, so the game is not fair. A player loses 10p per game on average.
⚠️ Watch out
using the prizes £10 and £3 as the gains while still counting −2 for red gives 0.7. Take the cost off every outcome, wins included.
Calculate
?The organiser of the counter game in the example wants it to be fair. The silver prize stays at £3 and red still wins nothing. Find the prize, in pounds, that gold should win.
£
Statistics and probability · discrete random variables

The binomial distribution

Binomial distribution B(10, 1/6)0123456789100.00.10.20.3rP(X=r)mean =npX∼B(10,16)
  • Use X ~ B(n, p) when there is a fixed number n of trials, each with two outcomes (success or failure), the trials are independent, and the probability of success p is constant. X counts the successes.
  • P(X = r) = C(n, r)p^r(1−p)^(n−r). Find probabilities with your GDC: binomial pdf gives P(X = r), binomial cdf gives P(X ≤ r).
  • Mean E(X) = np and variance Var(X) = np(1−p).
Worked example Statistics and probability · discrete random variables

Sixes in ten rolls

Question
A fair six-sided die is rolled 10 times. X is the number of sixes. Find E(X), Var(X), P(X = 2) and P(X ≥ 3).
  1. 1
    Check the conditions: 10 independent rolls, six or not, p = 1/6 each time, so X ~ B(10, 1/6)
  2. 2
    Mean and variance: E(X) = 10 × 1/6 = 1.67 and Var(X) = 10 × 1/6 × 5/6 = 1.39 (3 sf)
  3. 3
    Use binomial pdf with n = 10, p = 1/6, r = 2: P(X = 2) = 0.291
  4. 4
    Use the complement with binomial cdf: P(X ≥ 3) = 1 − P(X ≤ 2) = 0.225
Answer
E(X) = 1.67, Var(X) = 1.39, P(X = 2) = 0.291, P(X ≥ 3) = 0.225
⚠️ Watch out
P(X ≥ 3) = 1 − P(X ≤ 2). Writing 1 − P(X ≤ 3) gives 0.0697, which is P(X ≥ 4).
Sort it
?Can X be modelled by a binomial distribution?

Tap a statement, then tap the group it belongs in. Then press Check.

Calculate
?A quiz has 20 multiple-choice questions, each with 4 options and one correct answer. Noor guesses every answer at random. The pass mark is 8 correct answers. Use your GDC to find the probability that Noor passes. Give your answer to 3 significant figures.
Mission check

?A game costs £1 a go. Roll a fair die: a six wins £5 and the £1 is not returned. Is the game fair?
Mission 6

Heights average 170 cm. How rare is someone over 2 metres tall?

Make a guess: Heights average 170 cm. How rare is someone over 2 metres tall?

Statistics and probability · the normal distribution

The normal curve

The normal curve and the 68, 95, 99.7 rule68%μ−3σμ−2σμ−σμμ+σμ+2σμ+3σ95%99.7%
  • X ~ N(μ, σ²) has a bell-shaped curve, symmetric about the mean μ, so mean, median and mode are equal. The second parameter is the variance σ².
  • Probabilities are areas under the curve; the total area is 1. Many measurements (lengths, masses, times) are close to normal.
  • About 68% of values lie within μ ± σ, 95% within μ ± 2σ and 99.7% within μ ± 3σ.
Quick check
?X ~ N(50, 4²). Use the 68–95–99.7 rule to estimate P(X > 58).
Statistics and probability · the normal distribution

Probabilities and inverse normal on your GDC

  • Sketch first: draw the curve, mark μ and shade the area you want.
  • Normal cdf needs a lower bound, an upper bound, μ and σ. With no lower limit enter a huge negative number such as −10⁹⁹; with no upper limit, 10⁹⁹.
  • Inverse normal takes an area and returns the value x with that area to its left (unless you set the tail). For the top 5%, enter 0.95.
  • P(X = a) = 0 for a continuous variable, so P(X < a) = P(X ≤ a).
Worked example Statistics and probability · the normal distribution

Cereal boxes

Normal curve for mass N(505, 4²)493497501505509513517P(X<500)500mass (g)X∼N(505,42)
Question
The mass of cereal in a box is X grams, where X ~ N(505, 4²). Find P(X < 500) and P(500 < X < 510). The heaviest 5% of boxes are checked by hand. Find the lightest mass that is checked.
  1. 1
    Use normal cdf from −10⁹⁹ to 500 with μ = 505, σ = 4: P(X < 500) = 0.106
  2. 2
    Use normal cdf from 500 to 510: P(500 < X < 510) = 0.789
  3. 3
    The heaviest 5% have 0.95 of the area to their left. Use inverse normal with area 0.95: m = 511.58…
Answer
P(X < 500) = 0.106, P(500 < X < 510) = 0.789, and the lightest mass checked is 512 g (3 sf).
⚠️ Watch out
entering 0.05 in inverse normal gives 498 g, the cut-off for the lightest 5%.
Calculate
?The journey time of a bus, T minutes, is modelled by T ~ N(42, 5²). Use your GDC to find the probability that a journey takes more than 50 minutes. Give your answer to 3 significant figures.
Calculate
?For the same bus, T ~ N(42, 5²). The company says that 90% of journeys take less than a minutes. Find a. Give your answer to 3 significant figures.
minutes
Statistics and probability · the normal distribution

Standardizing: z-values

  • The standardized value z = (x − μ)/σ is the number of standard deviations x lies from the mean. A 512 g box has z = (512 − 505)/4 = 1.75.
  • If X ~ N(μ, σ²) then Z = (X − μ)/σ ~ N(0, 1), so P(X < x) = P(Z < z).
  • Unknown μ or σ: find z with inverse normal on N(0, 1), then solve (x − μ)/σ = z.
Worked example Statistics and probability · the normal distribution

Finding an unknown standard deviation

Question
X ~ N(80, σ²) and P(X > 95) = 0.1. Find σ.
  1. 1
    Change to an area on the left: P(X < 95) = 0.9
  2. 2
    Use inverse normal on N(0, 1) with area 0.9: z = 1.2816
  3. 3
    Standardize 95 and set equal: (95 − 80)/σ = 1.2816
  4. 4
    Solve: σ = 15/1.2816 = 11.7 (3 sf)
Answer
σ = 11.7
⚠️ Watch out
using area 0.1 gives z = −1.2816 and a negative σ. A standard deviation can never be negative, so check which tail you used.
Calculate
?The heights of seedlings, X cm, are modelled by X ~ N(μ, 6²). 20% of seedlings are shorter than 40 cm. Find μ. Give your answer to 3 significant figures.
cm
Mission check

?Adult heights in a town are modelled by N(170, 7.5²) in cm. How rare is someone over 2 m (200 cm) tall?
Mission 7

A 95% accurate test says you have a rare disease. Are you likely ill?

Make a guess: A 95% accurate test says you have a rare disease. Are you likely ill?

Statistics and probability · Bayes' theorem and random variables

Bayes' theorem

Two-stage probability tree for Bayes' theoremFirstSecondOutcomeP(B)BP(A∣B)AP(A′∣B)A′P(B′)B′P(A∣B′)AP(A′∣B′)A′B∩AB∩A′B′∩AB′∩A′Numerator: the path B∩A. Denominator P(A): add bothhighlighted paths.
  • Bayes' theorem reverses a conditional probability: from P(A | B) to P(B | A).
P(B | A) = (P(B)P(A | B))/(P(B)P(A | B) + P(B')P(A | B'))
  • The denominator is P(A): add every branch of the tree that ends in A.
  • With three exclusive, exhaustive events B₁, B₂, B₃:
P(Bᵢ | A) = (P(Bᵢ)P(A | Bᵢ))/(P(B₁)P(A | B₁) + P(B₂)P(A | B₂) + P(B₃)P(A | B₃))
Worked example Statistics and probability · Bayes' theorem and random variables

Which machine made the faulty item?

Question
Machines A, B and C make 50%, 30% and 20% of a factory's items. Of their items, 2%, 3% and 5% are faulty. An item chosen at random is faulty. Find the probability that it was made by machine C.
  1. 1
    Multiply along each branch ending in "faulty": 0.5 × 0.02 = 0.010, 0.3 × 0.03 = 0.009, 0.2 × 0.05 = 0.010
  2. 2
    Add to get P(F): 0.010 + 0.009 + 0.010 = 0.029
  3. 3
    Divide the C branch by the total: P(C | F) = 0.010/0.029 = 0.345 (3 sf)
Answer
P(C | F) = 10/29 ≈ 0.345
⚠️ Watch out
P(F | C) = 0.05 is the given rate for machine C; it is not P(C | F).
Calculate
?On a school day it rains with probability 0.3. If it rains, the bus is late with probability 0.4; if not, the bus is late with probability 0.1. Given that the bus is late, find the probability that it rained. Give your answer to 3 significant figures.
Statistics and probability · Bayes' theorem and random variables

Variance and linear transformations

  • For a discrete random variable X, E(X²) = Σ x² P(X = x) and
Var(X) = E(X²) − [E(X)]²
  • The standard deviation is √(Var(X)).
  • Linear transformations: E(aX + b) = aE(X) + b and Var(aX + b) = a²Var(X). Adding a constant shifts the mean but not the spread.
Calculate
?X has this probability distribution.
x0123
P(X=x)0.20.40.30.1

Find Var(2X + 5). Give your answer as a decimal.

Statistics and probability · Bayes' theorem and random variables

Continuous random variables

A probability density function that is zero after x = 30.511.522.530.51OxyP(1<X<2)=∫21f(x)dx
  • A probability density function has f(x) ≥ 0 and ∫_(−∞)^(∞) f(x) dx = 1; it may be piecewise and is 0 outside its domain. P(a < X < b) = ∫_a^b f(x) dx.
  • Mode: where f(x) is greatest. Median m: ∫_(−∞)^m f(x) dx = 1/2.
  • E(X) = ∫ x f(x) dx, E(X²) = ∫ x² f(x) dx and Var(X) = E(X²) − [E(X)]².
Worked example Statistics and probability · Bayes' theorem and random variables

A pdf from start to finish

Question
X has pdf f(x) = kx² for 0 ≤ x ≤ 3, and f(x) = 0 otherwise. Find k, the mode, the median, E(X) and Var(X).
  1. 1
    Total area is 1: ∫₀³ kx² dx = 9k = 1, so k = 1/9
  2. 2
    Mode: f increases on [0, 3], so its maximum is at x = 3
  3. 3
    Median: ∫₀^m x²/9 dx = m³/27 = 1/2, so m = 3/(∛2) = 2.38
  4. 4
    Mean: E(X) = ∫₀³ x³/9 dx = 81/36 = 2.25
  5. 5
    Variance: E(X²) = ∫₀³ x⁴/9 dx = 5.4, so Var(X) = 5.4 − 2.25² = 0.3375
Answer
k = 1/9, mode 3, median 2.38, E(X) = 2.25, Var(X) = 0.338 (3 sf)
⚠️ Watch out
the median is not halfway along the domain. Only 1/8 of the probability lies below 1.5.
Calculate
?X has pdf f(x) = k(4 − x) for 0 ≤ x ≤ 4, and f(x) = 0 otherwise. Find the median of X. Give your answer to 3 significant figures.
Quick check
?Which function is a valid probability density function on 0 ≤ x ≤ 2 (and 0 elsewhere)?
Mission check

?1 in 100 people have a disease. The test is positive for 95% of people with it and negative for 95% of people without it. You test positive. How likely is it that you have the disease?
Recap

Big ideas

  • A sample should represent its population: random and stratified samples reduce bias; convenience and quota samples risk it.
  • On a cumulative frequency graph read the median at n/2 and the quartiles at n/4 and 3n/4; IQR = Q₃ − Q₁.
  • An outlier is more than 1.5 × IQR from the nearest quartile; mark it with a cross on a box plot and decide in context whether it is genuine.
  • Mean x̄ = (Σ fx)/(Σ f); for grouped data use mid-interval values to estimate it.
  • Standard deviation measures typical distance from the mean; find it on your GDC using the population value σ_x; variance = σ².
  • Adding a constant shifts the mean but leaves the standard deviation alone; multiplying by k multiplies both by k.
  • Pearson's r measures linear correlation, −1 ≤ r ≤ 1; correlation does not imply causation.
  • The regression line of y on x passes through (x̄, ȳ); use it to predict y from x within the data range, and interpret a as the change in y per unit of x.
  • To predict x from y, use the regression line of x on y.
  • P(A ∪ B) = P(A) + P(B) − P(A ∩ B) and P(A | B) = (P(A ∩ B))/(P(B)); Venn diagrams and trees do the bookkeeping.
  • For "at least one", find 1 − P(none). Without replacement, later probabilities change: multiply along branches, add between paths.
  • A and B are independent exactly when P(A | B) = P(A) = P(A | B').
  • A discrete random variable has a distribution whose probabilities sum to 1; E(X) = Σ x P(X=x) is its long-run mean.
  • With X as the player's gain (prize minus cost), a game is fair when E(X) = 0.
  • X ~ B(n, p) needs a fixed number of independent success-or-failure trials with constant p; E(X) = np, Var(X) = np(1−p), and probabilities come from your GDC.
  • X ~ N(μ, σ²) is symmetric about μ; about 68%, 95% and 99.7% of values lie within 1, 2 and 3 standard deviations of the mean.
  • Sketch and shade, then use normal cdf for a probability and inverse normal (area to the left) for a value.
  • z = (x − μ)/σ counts standard deviations from the mean; use it with inverse normal on N(0, 1) to find an unknown μ or σ.
  • Bayes' theorem: P(B | A) is the branch through B ending in A, divided by all branches ending in A; with a rare condition, false positives can dominate.
  • Var(X) = E(X²) − [E(X)]², E(aX+b) = aE(X) + b, Var(aX+b) = a²Var(X).
  • A pdf has f(x) ≥ 0 and total area 1; integrate for probabilities, the median (area 1/2), E(X) and E(X²); the mode is where f is greatest.
🏆

Mini-lesson complete!

⭐⭐⭐

You've worked through Statistics & Probability for IB Diploma Mathematics: Analysis & Approaches HL. 🎉

  1. Mission 1A gym survey finds 90% of people exercise daily. What went wrong?
  2. Mission 2Give everyone a £100 pay rise. What happens to the standard deviation?
  3. Mission 3Ice-cream sales and drownings rise together. Does one cause the other?
  4. Mission 4In a class of 30, how likely is it that two share a birthday?
  5. Mission 5A £1 dice game pays out £5 if you roll a six. Is the game fair?
  6. Mission 6Heights average 170 cm. How rare is someone over 2 metres tall?
  7. Mission 7A 95% accurate test says you have a rare disease. Are you likely ill?

Your stars: 0 / 0

Next: more IB Mathematics: Analysis & Approaches · HL lessons and games on the IB Mathematics: Analysis & Approaches · HL page.

📣 Smashed it? Share your score

Challenge a mate to beat your stars, or show a parent how you got on.

→ Back to IB Mathematics: Analysis & Approaches · HL

Specification points and sources for this lesson are listed at the bottom of the page.

Sources (7)

The specification points and sources behind this lesson.

  1. 1 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.1, SL 4.2
  2. 2 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.3
  3. 3 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.4, SL 4.10
  4. 4 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.5, SL 4.6, SL 4.11
  5. 5 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.5 (expected number example), SL 4.7, SL 4.8
  6. 6 IB Mathematics: analysis and approaches guide (first assessment 2021), SL 4.9 and SL 4.12
  7. 7 IB Mathematics: analysis and approaches guide (first assessment 2021), AHL 4.13 and AHL 4.14