This handout teaches topic 4, Statistics and probability, of Mathematics: Applications and Interpretation, the course first assessed in 2021: sampling, presenting and summarising data, correlation and regression, Spearman's rank correlation, probability, discrete random variables, the binomial and normal distributions, and hypothesis testing with the chi-squared and t-tests, and, for HL, reliability and validity, non-linear regression, linear combinations of random variables, the central limit theorem, confidence intervals, the Poisson distribution, critical regions and errors, and Markov chains.
Prerequisites: fractions, decimals and percentages, substitution into formulae, and matrices (topic 1) for the HL Markov chains.
4.2
抽样与数据
English
The lady tasting tea
In the 1920s, at an agricultural research station north of London, the biologist Muriel Bristol said she could taste whether the milk or the tea had been poured into a cup first. The statistician Ronald Fisher designed a test: eight cups, four of each kind, in a random order. If she were only guessing, the chance of picking the right four is $\frac{1}{70} \approx 0.014$, so a perfect score would be strong evidence that she was not guessing. According to one of those present, she identified them all. Fisher used the story to open his book on the design of experiments in 1935. Every hypothesis test in this topic asks his question: could the result have happened by chance alone?
A crowd is a population: a well-chosen sample tells you about it without asking everyoneFisher's eight cups
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.
An outlier 异常值 is a value far from the rest: more than $1.5 \times \text{IQR}$ below $Q_1$ or above $Q_3$. Check an outlier before removing it: 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;
quartiles 四分位数$Q_1 = 6$ and $Q_3 = 11$, so the interquartile range 四分位距 is $\text{IQR} = 5$. Since $11 + 1.5 \times 5 = 18.5$, the value 20 is an outlier;
standard deviation 标准差$\sigma \approx 4.90$, from the GDC.
The median and IQR resist outliers; the mean and standard deviation are pulled by them. If every value is multiplied by $a$ and then $b$ is added, the mean and median become $a(\cdot) + b$, while the standard deviation and IQR are multiplied by $|a|$ and not changed by $b$. For $a \ge 0$, quartiles also become $a(\cdot) + b$; for $a < 0$, their order reverses, so the new $Q_1$ is $aQ_3+b$ and the new $Q_3$ is $aQ_1+b$.
For grouped data, use the mid-interval values: $\bar{x} \approx \dfrac{\sum fx}{\sum f}$. The result 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, 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)$. Pearson's product-moment correlation coefficient$r$, found with technology, measures the strength of the linear relationship: $-1 \le r \le 1$. A common guide to describing it:
$\lvert r\rvert$
Strength of linear correlation
$0 < \lvert r\rvert \le 0.25$
very weak
$0.25 < \lvert r\rvert \le 0.5$
weak
$0.5 < \lvert r\rvert \le 0.75$
moderate
$0.75 < \lvert r\rvert \le 1$
strong
Correlation is not causation: ice-cream sales and drownings both rise in hot weather, because a third variable, temperature, drives both.
The regression line
The regression line 回归直线 of $y$ on $x$, found with technology, minimises the squared vertical distances and passes through the mean point $(\bar{x}, \bar{y})$.
Regression line of y on x through the mean point
Worked example. For 12 students, hours of revision $x$ and score $y$ give $r = 0.974$ and $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 外推 is unreliable.
Use this line only to predict $y$ from $x$.
Spearman's rank correlation
Spearman's rank correlation coefficient 斯皮尔曼等级相关系数$r_s$ is Pearson's $r$ applied to the ranks of the data. It measures how well the relationship is monotonic: whether $y$ always increases (or always decreases) as $x$ increases, even if not in a straight line. Equal values share the mean of their ranks.
Two rankings in strong agreement
Worked example. Six students are ranked in mathematics (1 to 6) and in physics as 2, 1, 4, 3, 6, 5. Pearson's $r$ on the ranks, by GDC, gives $r_s \approx 0.829$: a strong positive agreement between the two rankings.
Use $r_s$ when the data are ranks, when there are outliers, or when the pattern is a curve that keeps rising. For data that rise and then fall, neither coefficient describes the relationship.
For equally likely outcomes, the probability 概率 of event $A$ is $P(A) = \dfrac{n(A)}{n(U)}$, where $U$ is the sample space 样本空间. $P(A') = 1 - P(A)$, and the expected number of times $A$ happens in $n$ trials is $nP(A)$.
Fair dice: each face is equally likely, the simplest probability model
$$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. Then $F$ only $= 13$, $B$ only $= 7$, neither $= 5$, and $P(F \cup B) = \frac{25}{30} = \frac{5}{6}$.
Conditional probability and independence
$$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 $P(A \cap B) = P(A)P(B)$. Here $0.6 \times 0.4 = 0.24 \ne \frac{5}{30}$, so the two sports are not independent.
Worked example. Two counters are taken without replacement from a bag of 3 red and 2 blue. A tree diagram 树状图 gives $P(RR) = \frac{3}{5} \times \frac{2}{4} = 0.3$ and $P(BB) = \frac{2}{5} \times \frac{1}{4} = 0.1$, so $P(\text{same colour}) = 0.4$. Multiply along branches, add between them.
A discrete random variable 离散随机变量$X$ takes separate values with probabilities that add to 1. Its expected value 期望值 is $E(X) = \sum x\,P(X = x)$.
Worked example. A game costs ¥3. The prize is ¥0, ¥2 or ¥10 with probabilities 0.5, 0.3 and 0.2. $E(X) = 0 + 0.6 + 2 = 2.6$, so the expected gain is $-0.4$ yuan per game. A game is fair if the expected gain is 0.
The binomial distribution
$X \sim B(n, p)$ counts the successes in $n$ independent trials, each with the same probability of success $p$. $E(X) = np$ and $\text{Var}(X) = np(1 - p)$. Use the GDC's binomial pdf for $P(X = r)$ and cdf for $P(X \le r)$.
Worked example. 20 % of seeds fail to grow. Five are planted, $X \sim B(5, 0.2)$. $P(X = 1) = 0.4096$, $P(X \ge 1) = 1 - 0.8^5 \approx 0.672$, and $E(X) = 1$.
discrete random variable/dɪˈskriːt ˈrændəm ˈveərɪəbl/
离散随机变量
lí sàn suí jī biàn liàng
expected value/ekˈspektɪd ˈvæljuː/
期望值
qī wàng zhí
4.7
正态分布
English
Many measurements follow a normal distribution 正态分布$X \sim N(\mu, \sigma^2)$: a symmetric bell-shaped curve centred on the mean $\mu$. About 68 % of values lie within $1\sigma$ of the mean, 95 % within $2\sigma$ and 99.7 % within $3\sigma$.
A Galton board: balls falling through pins pile up into the bell-shaped normal curveProbability is area under the curve; z counts standard deviations from the mean
The null hypothesis 原假设$H_0$ says there is no effect or no association. The alternative hypothesis 备择假设$H_1$ says there is.
Choose a significance level 显著性水平, usually 5 %.
Calculate the p-value: the probability, if $H_0$ were true, of a result at least as extreme as the one observed.
If the p-value is less than the significance level, reject $H_0$. Otherwise there is not enough evidence to reject it. A test never proves $H_0$.
The chi-squared test for independence
The chi-squared test 卡方检验 for independence uses a contingency table 列联表 of observed frequencies. The expected frequency of each cell, if the variables were independent, is
with degrees of freedom 自由度$(\text{rows} - 1)(\text{columns} - 1)$. All expected frequencies must be at least 5.
Worked example. 100 people at a school were asked their favourite drink.
Observed
Tea
Coffee
Juice
Total
Students
20
18
22
60
Teachers
20
17
3
40
Total
40
35
25
100
$H_0$: favourite drink is independent of being a student or a teacher.
Expected: students 24, 21, 15; teachers 16, 14, 10. All are at least 5.
GDC: $\chi^2_{\text{calc}} \approx 10.9$, with $(2 - 1)(3 - 1) = 2$ degrees of freedom, p-value $\approx 0.0043$.
$0.0043 < 0.05$, so reject $H_0$: there is evidence that favourite drink depends on the group. The largest contribution comes from teachers and juice: 3 observed, 10 expected.
You may instead compare $\chi^2_{\text{calc}}$ with the critical value 临界值, given in the question: here 5.991. Since $10.9 > 5.991$, reject $H_0$.
Reject $H_0$ when the statistic falls in the 5 % tail
The chi-squared goodness of fit test
A goodness of fit test 拟合优度检验 asks whether data follow a given distribution. The degrees of freedom are the number of classes minus 1.
Worked example. A die is rolled 60 times, giving 8, 9, 12, 7, 10 and 14 for the faces 1 to 6. $H_0$: the die is fair, so each expected frequency is 10. $\chi^2_{\text{calc}} = \frac{4 + 1 + 4 + 9 + 0 + 16}{10} = 3.4$, with 5 degrees of freedom and p-value 0.639. Since $0.639 > 0.05$, there is not enough evidence that the die is biased.
The t-test
The t-test compares the means of two independent samples from normal populations with equal variances (a pooled two-sample t-test). It can be one-tailed 单尾 ($H_1: \mu_1 < \mu_2$) or two-tailed 双尾 ($H_1: \mu_1 \ne \mu_2$). Decide which before looking at the data.
The two samples in the t-test
Worked example. Reaction times in seconds for six students who drank coffee, $A$, and six who did not, $B$:
$A$
0.32
0.29
0.35
0.30
0.33
0.31
$B$
0.36
0.34
0.38
0.33
0.37
0.35
$H_0: \mu_A = \mu_B$; $H_1: \mu_A < \mu_B$, at the 5 % level.
$0.0041 < 0.05$, so reject $H_0$: there is evidence that the coffee group reacts faster. With only six in each group, a larger study would be needed before drawing firm conclusions.
Common mistakes.
Reading a strong correlation as proof of cause.
Predicting $x$ from the regression line of $y$ on $x$, or extrapolating far beyond the data.
Writing accept $H_0$ or $H_0$ is true. Say: there is not enough evidence to reject $H_0$.
Comparing the $p$-value the wrong way: reject $H_0$ when $p$ is less than the significance level.
Using the wrong degrees of freedom: a $\chi^2$ test for independence on an $r \times c$ table has $(r-1)(c-1)$.
Writing $P(X \ge 3) = 1 - P(X \le 3)$ for a binomial variable. It is $1 - P(X \le 2)$.
Reading the variance as the standard deviation: $X \sim N(50, 16)$ has $\sigma = 4$.
A school has 300 students in Year 10 and 200 in Year 11. How many from each year are in a stratified sample of 50?
For $3, 5, 7, 7, 8, 10, 12, 20$, find the median and IQR, and show that 20 is an outlier.
Each value in a data set with mean 9 and standard deviation 4.90 is doubled and then 3 is added. Find the new mean and standard deviation.
The regression line of score on hours is $y = 39.3 + 4.87x$ with $r = 0.974$, for 0 to 9 hours. Predict the score for 5.5 hours, and comment on a prediction for 15 hours.
Six students are ranked $1, 2, 3, 4, 5, 6$ in mathematics and $2, 1, 4, 3, 6, 5$ in physics. Find Spearman's rank correlation coefficient and interpret it.
In a class of 30, 18 play football, 12 basketball and 5 both. Find $P(F \cup B)$ and $P(F \mid B)$.
Show that playing football and playing basketball are not independent in question 6.
Two counters are taken without replacement from 3 red and 2 blue. Find the probability that they are the same colour.
A game costs ¥3, with prizes ¥0, ¥2, ¥10 with probabilities 0.5, 0.3, 0.2. Find the expected gain.