These are selected topics, not the whole syllabus, and every example is fictional. Compare an average and a spread, and remember a histogram shows frequency as…
English narration · English + 中文 subtitles burned in
4.1
Scope and prerequisites
This handout teaches topic 4, Statistics and probability, of Mathematics: Analysis and Approaches, the course first assessed in 2021: sampling and bias, summarising and presenting data, correlation and regression, probability with Venn and tree diagrams, conditional probability and independence, discrete random variables, the binomial distribution and the normal distribution, and, for HL, Bayes' theorem and continuous random variables. It is written for both SL and HL students. HL students also apply the further results in the sections marked AHL.
Prerequisites: fractions, decimals and percentages; substitution into formulae; integration (topic 5) for the HL continuous random variables.
4.2
Sampling and data
The biggest poll that failed
In 1936 the American magazine Literary Digest mailed about 10 million ballots and received about 2.4 million replies. Its poll predicted that Alf Landon would beat President Franklin Roosevelt easily. Roosevelt won in a landslide, with about 61 % of the vote. A young pollster, George Gallup, predicted the right winner with a sample of only about 50 000. The Digest had taken its names from telephone directories and car registrations, which in 1936 over-represented richer voters, and only the people who chose to reply were counted. A huge biased sample is worse than a small fair one.
Statistics studies a sample to learn about a whole population.
Populations and samples
The population 总体 is every member of the group being studied; a sample 样本 is the part actually measured.
A sample is biased when some members of the population are more likely to be included, so the sample does not represent the population.
Discrete data 离散数据 can take only separate values (number of siblings); continuous data 连续数据 can take any value in a range (height, time).
Sampling techniques
Technique
How
Strength
Weakness
Simple random
Every member equally likely, such as random numbers
No selection bias
Needs a full list
Systematic
Every $k$th member from a list
Quick, spread out
Biased if the list has a pattern
Stratified
Random samples from each group in proportion
Represents every group
Needs group sizes
Quota
Fixed numbers from each group, not random
Quick, cheap
Interviewer chooses: bias
Convenience
Whoever is easy to reach
Easiest
Rarely representative
Four random sampling designs: who gets selected, and how
Worked example. A school has 300 students in Year 10 and 200 in Year 11. A stratified sample of 50 takes $\frac{300}{500} \times 50 = 30$ from Year 10 and 20 from Year 11.
Outliers
An outlier 异常值 is a value far from the rest. A common rule: a value is an outlier if it is more than $1.5 \times \text{IQR}$ below $Q_1$ or above $Q_3$. Outliers should be checked, not simply deleted: a recording error can be corrected, but a genuine extreme value is part of the data.
For the data $3, 5, 7, 7, 8, 10, 12, 20$ ($n = 8$):
Mean, median, mode and range of a small data set
mean 平均数$\bar{x} = \dfrac{\sum x}{n} = \dfrac{72}{8} = 9$;
median 中位数$= \dfrac{7 + 8}{2} = 7.5$, the middle value of the ordered data;
mode 众数$= 7$, the most frequent value.
Spread:
Quartiles 四分位数: $Q_1 = 6$ (the median of $3, 5, 7, 7$) and $Q_3 = 11$ (the median of $8, 10, 12, 20$). Technology may use a slightly different method; follow your calculator.
Interquartile range 四分位距$\text{IQR} = Q_3 - Q_1 = 5$. Since $11 + 1.5 \times 5 = 18.5$, the value 20 is an outlier.
Standard deviation 标准差$\sigma = \sqrt{\dfrac{\sum(x - \bar{x})^2}{n}}$. The squared deviations from 9 add to 192, so the variance 方差 is $\sigma^2 = 24$ and $\sigma \approx 4.90$.
The median and IQR resist outliers; the mean and standard deviation are pulled by them. Here the outlier 20 pulls the mean (9) above the median (7.5).
Effect of a change of scale. If every value is multiplied by $a$ and then $b$ is added, the mean and median become $a(\cdot) + b$. Quartiles follow the same rule for $a > 0$; for $a < 0$, the lower and upper quartiles swap, so $Q_1$ becomes $aQ_3+b$ and $Q_3$ becomes $aQ_1+b$. Meanwhile, the standard deviation and IQR are multiplied by $|a|$ and are not changed by $b$. Doubling the data above and adding 3 gives mean 21 and standard deviation 9.80.
Grouped data
For grouped data, use the mid-interval values$x$ and frequencies $f$: $\bar{x} \approx \dfrac{\sum fx}{\sum f}$.
Time (min)
$0 \le t < 10$
$10 \le t < 20$
$20 \le t < 30$
$30 \le t < 40$
Frequency
4
10
16
10
$\sum fx = 4(5) + 10(15) + 16(25) + 10(35) = 920$, so $\bar{x} \approx \frac{920}{40} = 23$ minutes. The modal class is $20 \le t < 30$. The value is an estimate because the exact data are not known.
Cumulative frequency and box plots
A cumulative frequency 累积频率 graph plots the running total against the upper class boundary. Reading across at $\frac{n}{4}$, $\frac{n}{2}$ and $\frac{3n}{4}$ gives estimates of $Q_1$, the median and $Q_3$. A box plot 箱线图 shows the minimum, $Q_1$, median, $Q_3$ and maximum, with outliers marked separately.
Quartiles from a cumulative frequency curve, and the matching box plot
For the 80 students above, the upper fence is $40 + 1.5 \times 15 = 62.5$ minutes, so the 70-minute time is an outlier and the whisker stops at the largest value inside the fence, 58 minutes. When comparing two box plots, compare a measure of centre (median) and a measure of spread (IQR) in context.
A scatter diagram 散点图 shows paired data $(x, y)$. The correlation coefficient 相关系数$r$ (Pearson's product-moment correlation coefficient), found with technology, measures the strength of the linear relationship: $-1 \le r \le 1$.
$r$ close to $1$: strong positive linear correlation; close to $-1$: strong negative; close to $0$: little linear correlation.
Correlation is not causation: ice-cream sales and drowning both rise in hot weather.
A strong non-linear pattern can still have $r$ close to 0.
Regression line of y on x through the mean point
Regression lines
The regression line 回归直线 of $y$ on $x$, found with technology, minimises the squared vertical distances and always passes through the mean point $(\bar{x}, \bar{y})$. Use it to predict $y$ from $x$. To predict $x$ from $y$, use the regression line of $x$ on $y$, which is a different line unless $r = \pm 1$.
Linear regression fits the line that makes the total squared error (the dashed gaps) as small as possible
Worked example. For the 12 students: $r = 0.974$, $y = 39.3 + 4.87x$.
Prediction for 5.5 hours: $y = 39.3 + 4.87 \times 5.5 \approx 66$. Reliable: $r$ is strong and 5.5 is within the data (interpolation 内插).
The gradient means each extra hour of revision is associated with about 4.9 more marks.
A prediction for 15 hours gives 112, more than the maximum mark: extrapolation 外推 beyond the data is unreliable.
To estimate hours from a score of 65, use the $x$ on $y$ line, $x = -7.40 + 0.195y$, giving about 5.3 hours.
For equally likely outcomes, the probability 概率 of event $A$ is $P(A) = \dfrac{n(A)}{n(U)}$, where $U$ is the sample space 样本空间. Complementary events: $P(A') = 1 - P(A)$. The expected number of times $A$ happens in $n$ trials is $nP(A)$: in 120 rolls of a fair die, expect $120 \times \frac{1}{6} = 20$ sixes.
Dice: a familiar starting point for probability.
Combined events and Venn diagrams
$$P(A \cup B) = P(A) + P(B) - P(A \cap B)$$
Mutually exclusive 互斥 events cannot both happen: $P(A \cap B) = 0$.
Fill a Venn diagram from the overlap outwards
Worked example. In a class of 30, 18 play football ($F$), 12 basketball ($B$) and 5 both.
Start with the overlap, 5; then $F$ only $= 13$, $B$ only $= 7$; neither $= 30 - 25 = 5$.
The conditional probability 条件概率 of $A$ given $B$ is
$$P(A \mid B) = \frac{P(A \cap B)}{P(B)}$$
Given that a student plays basketball, the chance they also play football is $P(F \mid B) = \frac{5}{12}$: the sample space shrinks to the 12 basketball players.
Events are independent 独立 if one does not change the probability of the other:
$$P(A \cap B) = P(A)P(B) \quad\text{or equivalently}\quad P(A \mid B) = P(A)$$
Here $P(F)P(B) = 0.6 \times 0.4 = 0.24$, but $P(F \cap B) = \frac{5}{30} \approx 0.167$, so playing football and playing basketball are not independent.
Tree diagrams
A tree diagram 树状图 multiplies along branches and adds between branches. Without replacement, the probabilities on the second branches change.
Two draws without replacement from 3 red and 2 blue counters
Worked example. Two counters are taken without replacement from a bag of 3 red and 2 blue.
discrete random variable/dɪˈskriːt ˈrændəm ˈveərɪəbl/
expected value/ekˈspektɪd ˈvæljuː/
4.7
The normal distribution
Properties
Many measurements, such as heights and measurement errors, follow a normal distribution 正态分布$X \sim N(\mu, \sigma^2)$: a symmetric bell-shaped curve centred on the mean $\mu$, with total area 1. About 68 % of values lie within $1\sigma$ of the mean, 95 % within $2\sigma$ and 99.7 % within $3\sigma$. For a continuous variable, $P(X = a) = 0$, so $P(X < a) = P(X \le a)$.
A Galton board: balls falling through pins pile up into the bell-shaped normal distribution.Probability is area under the curve; z counts standard deviations from the mean
Calculations and standardising
The standardised value 标准分数
$$z = \frac{x - \mu}{\sigma}$$
counts how many standard deviations $x$ is from the mean. $Z = \dfrac{X - \mu}{\sigma}$ follows $N(0, 1)$.
Worked example. Heights $X \sim N(170, 8^2)$ cm.
$P(X < 180) = 0.894$ (by calculator; $z = 1.25$).
$P(160 < X < 180) = 0.789$.
The height exceeded by only 10 % of people: inverse normal, $P(X < h) = 0.9$, gives $h \approx 180.3$ cm.
Unknown mean or standard deviation
Use the inverse normal on $Z$ to find $z$, then solve $z = \dfrac{x - \mu}{\sigma}$.
Worked example.$X \sim N(\mu, 4^2)$ and $P(X > 50) = 0.05$. Then $P(Z > z) = 0.05$ gives $z = 1.645$, so $\dfrac{50 - \mu}{4} = 1.645$ and $\mu \approx 43.4$.
Worked example.$X \sim N(25, \sigma^2)$ and $P(X < 20) = 0.2$. Then $z = -0.8416$, so $\dfrac{20 - 25}{\sigma} = -0.8416$ and $\sigma \approx 5.94$.
When the probability we know runs the wrong way round, Bayes' theorem 贝叶斯定理 turns it round:
Most positive results come from the large group without the disease
$$P(A \mid B) = \frac{P(A)P(B \mid A)}{P(A)P(B \mid A) + P(A')P(B \mid A')}$$
With more than two possible causes $A_1, A_2, A_3$, the denominator adds $P(A_i)P(B \mid A_i)$ over all of them.
Worked example. A disease affects 1 % of people. A test is positive for 95 % of people with the disease and for 5 % of people without it. Find the probability that a person with a positive test has the disease.
Only about 16 % of positive results are true positives, because the disease is rare and false positives from the 99 % without it outnumber the true ones. A tree diagram makes this clear.
Median: $\dfrac{m^2}{16} = \dfrac{1}{2}$, so $m = \sqrt{8} \approx 2.83$. Mode $= 4$, where $f$ is largest.
Variance of a discrete random variable and linear changes
$$\text{Var}(X) = E(X^2) - [E(X)]^2 \qquad E(aX + b) = aE(X) + b \qquad \text{Var}(aX + b) = a^2\,\text{Var}(X)$$
A discrete probability distribution with its mean and standard deviation
For the game above, $E(X^2) = 4(0.3) + 100(0.2) = 21.2$, so $\text{Var}(X) = 21.2 - 2.6^2 = 14.44$ and the standard deviation is 3.8 yuan. If the prizes are doubled and ¥1 added to each, the mean becomes $2(2.6) + 1 = 6.2$ and the variance $4 \times 14.44 = 57.76$.
Common mistakes.
Predicting $x$ from the regression line of $y$ on $x$. That line is built to predict $y$ only.
Extrapolating far outside the data, or reading a strong correlation as proof of cause.
Using $P(A \cap B) = P(A)P(B)$ without knowing the events are independent.
Dividing by the wrong probability: $P(A \mid B) = \dfrac{P(A \cap B)}{P(B)}$, not over $P(A)$.
Writing $P(X \ge 3) = 1 - P(X \le 3)$. For a discrete variable it is $1 - P(X \le 2)$.
Reading the variance as the standard deviation: $X \sim N(50, 16)$ has $\sigma = 4$.
Using the expected value as a value that must occur: $E(X) = 2.5$ for a count is a long-run mean.
HL: leaving the false positives out of the denominator in Bayes' theorem.
HL: forgetting that the area under a probability density function is 1 when finding a constant $k$.
HL: writing $\operatorname{Var}(aX+b) = a\operatorname{Var}(X) + b$. It is $a^2\operatorname{Var}(X)$.
continuous random variable/kənˈtɪnjuːəs ˈrændəm ˈveərɪəbl/
probability density function/ˌprɒbəˈbɪlɪti ˈdensɪti ˈfʌŋkʃn/
4.10
Practice
Name each sampling technique and give one weakness: (a) every 10th name on a list; (b) random samples from each year group in proportion to its size; (c) the first 20 people through the gate.
For $4, 7, 7, 9, 12, 15, 18, 40$, find the mean, median, quartiles and IQR, and decide whether 40 is an outlier.
A data set has mean 20 and standard deviation 3. Each value is multiplied by 3 and then 5 is subtracted. Find the new mean and standard deviation.
Estimate the mean height and state the modal class: $150 \le h < 160$: 6; $160 \le h < 170$: 14; $170 \le h < 180$: 15; $180 \le h < 190$: 5.
For data with $x$ from 5 to 20, the regression line is $y = 2.4x + 11$ with $r = 0.91$. Predict $y$ when $x = 12$, and comment on using the line when $x = 50$.
A study finds $r = -0.35$ between hours of screen time and sleep. Interpret this, and explain why it does not show that screen time causes less sleep.
$P(A) = 0.5$, $P(B) = 0.4$ and $P(A \cup B) = 0.7$. Find $P(A \cap B)$ and $P(A \mid B)$, and decide whether $A$ and $B$ are independent.
Two fair dice are rolled. Find the probability that the total is 8, and that at least one die shows 6.
A bag has 4 green and 6 yellow counters. Two are taken without replacement. Find the probability that both are green, and that they are different colours.
$P(X = x) = k(x + 1)$ for $x = 0, 1, 2, 3$. Find $k$ and $E(X)$.
A game costs ¥5. A player wins ¥20 with probability 0.1 and ¥5 with probability 0.3, and otherwise nothing. Find the expected gain and decide whether the game is fair.
AHL. Machine A makes 60 % of a factory's items, of which 2 % are faulty; machine B makes 40 %, of which 5 % are faulty. An item is faulty. Find the probability it came from machine A.
AHL.$f(x) = kx^2$ for $0 \le x \le 3$. Find $k$, $E(X)$, the median and the mode.
AHL. For the distribution in question 10, find $\text{Var}(X)$ and $\text{Var}(3X - 2)$.
AHL.$E(X) = 4$ and $\text{Var}(X) = 2$. Find $E(5 - 2X)$ and $\text{Var}(5 - 2X)$.
Answers.
(a) Systematic: biased if the list has a repeating pattern. (b) Stratified: needs the size of each group. (c) Convenience: those arriving first may differ from the rest, so it is rarely representative.
Mean $= \frac{112}{8} = 14$; median $= \frac{9 + 12}{2} = 10.5$; $Q_1 = 7$, $Q_3 = 16.5$; IQR $= 9.5$. Upper fence $16.5 + 14.25 = 30.75$, so 40 is an outlier.
Mean $3(20) - 5 = 55$; standard deviation $3 \times 3 = 9$.
$\sum fx = 6(155) + 14(165) + 15(175) + 5(185) = 6790$, so $\bar{x} \approx \frac{6790}{40} = 169.75$ cm. Modal class $170 \le h < 180$.
$y = 2.4(12) + 11 = 39.8$, reliable since $r$ is strong and 12 is within the data. $x = 50$ is far outside the data, so the prediction is extrapolation and unreliable.
A weak negative linear correlation: more screen time tends to go with slightly less sleep. Correlation does not show cause: another factor, such as stress, could affect both, and the relationship is weak.
$P(A \cap B) = 0.5 + 0.4 - 0.7 = 0.2$; $P(A \mid B) = \frac{0.2}{0.4} = 0.5$. Since $P(A)P(B) = 0.2 = P(A \cap B)$, they are independent.
Totals of 8: $(2,6), (3,5), (4,4), (5,3), (6,2)$, so $\frac{5}{36}$. At least one 6: $1 - \left(\frac{5}{6}\right)^2 = \frac{11}{36}$.