Chapter 1

The Normal Distribution and the Central Limit Theorem

By the end of this chapter you can turn any normal question into a Z-score, read the answer off a table, work the table backwards, and explain why sample averages behave so much better than single measurements.

Almost everything in this course rests on one curve. Heights, exam marks, manufacturing errors, pizza diameters — measure enough of them and they pile up in the same humped shape, thick in the middle and thin at both ends. This chapter is about that shape, the one table that unlocks it, and the theorem that quietly makes the rest of the syllabus possible.

1.1 · What the normal curve actually is

With a coin you can count outcomes: heads, tails. With a measurement like a pizza's diameter you cannot count — between 15.5 and 15.6 inches there are infinitely many possible values. So instead of asking "what is the probability of exactly 15.5 inches?" (which is zero, always), we describe the variable with a density curve and ask about ranges.

In plain English The height of the curve is not a probability. Area under the curve is the probability. Think of the curve as a hill of soil: the question "how likely is a value between 15 and 16?" means "what fraction of the soil sits between 15 and 16?" The whole hill always contains exactly 1 unit of soil.

A continuous random variable $X$ is said to follow a normal distribution with mean $\mu$ and variance $\sigma^2$ if its probability density function is:

The normal probability density function
$$ f(x;\mu,\sigma) = \frac{1}{\sigma\sqrt{2\pi}}\; e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^{2}} $$
x the value you are asking about · μ the population mean, which sets where the peak sits · σ the population standard deviation, which sets how wide the hill is · π 3.14159… · e 2.71828…

We write this as $X \sim N(\mu, \sigma^2)$, read aloud as "X is normally distributed with mean mu and variance sigma squared".

Conditions
  • $-\infty < x < \infty$ — the curve never actually touches zero, it just gets vanishingly thin
  • $-\infty < \mu < \infty$ — the mean can be any number
  • $0 < \sigma$ — the standard deviation must be positive
You will never integrate this That formula looks frightening and you will almost certainly never plug numbers into it. It has no clean antiderivative, which is precisely why statistical tables exist. Somebody did the hard integration once, for one standard curve, and printed the answers. Your job is to reshape your problem until it fits that printed table.

What μ and σ each do

Only two numbers control the entire curve. $\mu$ slides it left and right without changing its shape. $\sigma$ changes how spread out it is: a small $\sigma$ gives a tall narrow spike, a large $\sigma$ gives a low wide mound. In both cases the total area stays pinned at exactly 1 — so if the curve gets wider it must also get shorter.

1.2 · The standard normal variable Z

There are infinitely many normal curves, one for every pair of $\mu$ and $\sigma$. Nobody could print a table for each. So we convert every normal problem into one reference curve: the one with mean 0 and standard deviation 1.

Standardising — the single most used formula in this course
$$ Z = \frac{X - \mu}{\sigma} $$
X your actual value · μ the mean · σ the standard deviation · Z how many standard deviations your value sits above (+) or below (−) the mean
In plain English $X - \mu$ asks "how far am I from average?" Dividing by $\sigma$ converts that distance from its original units (inches, kilos, marks) into a universal unit: numbers of standard deviations. A Z of 2 means "two standard deviations above the mean" whether we are talking about pizzas or battery life.

If $X \sim N(\mu, \sigma^2)$ then $Z \sim N(0,1)$, with $E(Z) = 0$ and $Var(Z) = 1$. Its density is the same formula with $\mu=0$ and $\sigma=1$ substituted in:

Standard normal density
$$ f(z) = \frac{1}{\sqrt{2\pi}}\, e^{-\frac{z^{2}}{2}} \qquad\text{and}\qquad F(x) = P(X \le x) = \int_{-\infty}^{x} \frac{1}{\sqrt{2\pi}} e^{-\frac{u^{2}}{2}}\,du $$
f(z) the height of the standard curve at z · F(x) the cumulative probability, i.e. the area to the LEFT of x · u a dummy variable used only inside the integral

Symmetry — the property that saves you constantly

The normal curve is a mirror image about its mean: $f(\mu + a) = f(\mu - a)$ for any $a$.

Note from the slides
  • The normal curve is symmetric about $\mu$; $a$ can take any value.
  • mean = median (and, in fact, the mode too — all three sit at the peak).

For the standard curve this means $P(Z < -a) = P(Z > a)$. That is why tables only ever print the positive half: the negative half is the same numbers, flipped.

The Empirical Rule

Before doing any arithmetic, you should know roughly where the answer must land.

Sanity check If you calculate $P(X > \mu + 3\sigma)$ and get something like 0.4, you have made an arithmetic error — beyond 3σ there is only about 0.15% of the curve left on each side. Always ask "does this answer look right on the picture?" before writing it down.

1.3 · Reading the Z-table (do this slowly, once)

There are two kinds of Z-table — know which one you have

Type A — "area from 0 to z". The cell gives $P(0 \le Z \le z)$, the area between the middle and your z. The biggest number in this table is about 0.5.

Type B — cumulative. The cell gives $P(Z \le z) = \Phi(z)$, all the area to the left. The biggest number in this table is about 1.0.

Your lecture slides use Type A. That is why their solutions constantly add or subtract 0.5. The table in the appendix of this book is Type B (cumulative) and Type A, side by side, so you can use whichever your exam gives you. Converting between them is easy: $\Phi(z) = 0.5 + P(0 \le Z \le z)$ for positive z.

A worked lookup, step by step

Say you want $P(0 \le Z \le 1.56)$ using a Type A table.

  1. Split your z at the decimal: $1.56 \rightarrow 1.5$ and $0.06$.
  2. Go down the left-hand column to the row labelled 1.5.
  3. Go across the top to the column labelled .06.
  4. Where they meet: 0.4406. That is your area.

The four situations you will meet

Every normal probability question is one of these four shapes. Learn to convert on sight, using a Type A table:

You wantDo thisWhy
$P(0 \le Z \le a)$read the table directlythis is exactly what Type A prints
$P(Z > a)$, $a$ positive$0.5 - \text{table}(a)$the whole right half is 0.5; chop off the bit before $a$
$P(Z < -a)$$0.5 - \text{table}(a)$symmetry: it mirrors $P(Z > a)$
$P(-a \le Z \le b)$$\text{table}(a) + \text{table}(b)$you are adding two pieces that meet at the middle
$P(a \le Z \le b)$, both positive$\text{table}(b) - \text{table}(a)$big slice minus the small slice inside it
Always draw the curve first Sketch a bell, mark the mean, mark your z values, and shade what you want. Then it is obvious whether you should add, subtract, or take it from 0.5. Students who skip the sketch are the ones who write $0.5 + $ when they meant $0.5 -$.

Now try it live. Drag the sliders below and watch the shaded area — this widget is doing exactly what the table does.

1.4 · Combining independent normal variables

If $X_1 \sim N(\mu_1, \sigma_1^2)$ and $X_2 \sim N(\mu_2, \sigma_2^2)$ are independent, then:

Sum and difference of independent normals
$$ X_1 + X_2 \sim N\!\left(\mu_1 + \mu_2,\; \sigma_1^2 + \sigma_2^2\right) $$ $$ X_1 - X_2 \sim N\!\left(\mu_1 - \mu_2,\; \sigma_1^2 + \sigma_2^2\right) $$
μ₁, μ₂ the two means · σ₁², σ₂² the two variances — note these are variances, not standard deviations
The trap For the difference, the means subtract but the variances still add. Uncertainty never cancels out — combining two noisy things always gives you something noisier than either one. And you must add variances ($\sigma^2$), never standard deviations. If $\sigma_1 = 3$ and $\sigma_2 = 4$, the combined $\sigma$ is $\sqrt{9+16} = 5$, not 7.

1.5 · Sampling distributions

Definition A sampling distribution is the probability distribution of a sample statistic, formed when samples of size $n$ are repeatedly taken from a population.

Read that again slowly, because it is the idea students most often skate past. We are no longer talking about the distribution of individual values. We are talking about the distribution of a summary number — like $\bar{x}$ — computed fresh from each of many different samples.

In plain English Walk into a crowd, grab 30 people, measure their average height, write it down. Send them back. Do it again with a different 30. And again, a thousand times. You now have a thousand averages. Those averages have their own mean, their own spread, and their own shape. That collection is the sampling distribution of the mean.
Notes from the slides
  • Three characteristics about the sampling distribution of a statistic: its mean, its variance, its shape.
  • Due to random variation, different samples from the same population will have different sample means.
  • If we repeatedly take samples of the same size $n$ from a population, the means of the samples form a sampling distribution of means, and its mean is equal to the population mean.
  • In practice we do not take repeated samples from a population — we do not encounter sampling distributions empirically — but it is necessary to know their properties in order to draw statistical inferences.

That last note matters. You will never actually build a sampling distribution in real life. You take one sample. The sampling distribution is the imagined population of all the samples you could have taken, and it is what lets you say how much to trust the one sample you got.

Standard deviation versus standard error

Standard error of the mean
$$ \sigma_{\bar{x}} = \frac{\sigma}{\sqrt{n}} $$
σ how much individual observations vary · n the sample size · σx̄ how much sample means vary from sample to sample
σ and σ/√n are not the same thing — this costs marks constantly

$\sigma$ describes how much one individual differs from average. One pizza can easily be half an inch off.

$\sigma/\sqrt{n}$ describes how much the average of n things differs from average. For four pizzas to average half an inch small, all four have to be small together — much rarer.

Ask yourself one question every time: is this question about a single item, or about an average? Single item → divide by $\sigma$. Average of $n$ → divide by $\sigma/\sqrt{n}$. This is the entire difference between parts (a), (b) and (c) of the pizza example below.

Notes from the slides
  • Standard deviation is a measure of variability between individual observations (a descriptive index relevant to the mean).
  • Standard error refers to the variability of summary statistics (e.g. the variability of the sample mean or a sample proportion).
  • Standard error is a measure of uncertainty in a sample statistic, i.e. the precision of the estimate of the estimator.

1.6 · The Central Limit Theorem

Here is the theorem that makes statistics work at all.

Central Limit Theorem
$$ Z = \frac{\bar{x} - \mu}{\sigma / \sqrt{n}} \;\xrightarrow[n \to \infty]{}\; N(0,1) $$
x̄ the sample mean · μ the population mean · σ the population standard deviation · n the sample size
Note from the slides Even if $X$ may or may not follow a normal distribution, when $n$ is sufficiently large ($n \ge 30$), then $\bar{x}$ approximately follows a normal distribution with mean $\mu$ and variance $\frac{\sigma^2}{n}$: $$\bar{x} \sim N\!\left(\mu, \frac{\sigma^2}{n}\right)$$
Why this is remarkable The population can be any shape at all — skewed, lumpy, two-humped, nothing like a bell. It does not matter. Average enough of it together and the averages come out normal. This is why one printed Z-table is enough for a whole course: whatever messy thing you sampled, the mean of your sample lands back on familiar ground.

Do not take that on faith — go and break it. In the widget below, pick the most lopsided population you can (Exponential), set $n$ to 1, and press Draw 100 samples a few times: the right-hand histogram is as skewed as the population. Now drag $n$ up to 30 and press Reset, then draw again. Watch the skew vanish and the orange predicted curve snap into place. Also watch the observed spread readout shrink and track $\sigma/\sqrt{n}$.

When may I use the normal for x̄?
  • Population is already normal → $\bar{x}$ is exactly normal for any $n$, even $n = 2$.
  • Population is not normal (or unknown) → you need $n \ge 30$ before you may treat $\bar{x}$ as normal.
In the pizza example below the population is stated to be normal, which is why parts (b) and (c) are legitimate with $n = 2$ and $n = 4$.

Joint distribution of a random sample

If $x_1, x_2, \dots, x_n$ are $n$ independent observations from the same distribution $f(x)$, their joint density is simply the product:

Joint distribution of independent observations
$$ f(x_1, x_2, \dots, x_n) = f(x_1)\,f(x_2)\cdots f(x_n) = \prod_{i=1}^{n} f(x_i) $$
f(xi) the density of one observation · the product form is allowed only because the observations are independent

1.7 · Worked example from the slides

Worked example 1 — single value vs average of n (the pizza problem)

The chefs at a local pizza chain in Bengaluru strive to maintain the suggested size of their 16-inch pizzas. Despite their best efforts, they are unable to make every pizza exactly 16 inches in diameter. The manager has determined that the size of the pizzas is normally distributed with a mean of 16 inches and a standard deviation of 0.8 inches.

a) What is the probability that a randomly selected pizza is less than 15.5 inches?
b) What is the probability that two randomly selected pizzas average less than 15.5 inches?
c) What is the probability that four randomly selected pizzas average less than 15.5 inches?

Given μ = 16 inches · σ = 0.8 inches · $X \sim N(16, 0.8^2)$ · population is normal, so any $n$ is allowed

Part (a) — one single pizza

  1. Name the tool. This is about one individual pizza, so we divide by $\sigma$ itself, not by the standard error.
  2. Standardise: $Z = \dfrac{15.5 - 16}{0.8} = \dfrac{-0.5}{0.8} = -0.625$
  3. Table lookup: $P(Z < -0.62) = 0.2676$ and $P(Z < -0.63) = 0.2643$. Interpolating at the midpoint $-0.625$ gives $0.2660$.
  4. So $P(X < 15.5) = 0.2660$.
P(X < 15.5) = 0.2660 (0.2643 if you round z to −0.63)

Part (b) — the average of two pizzas

  1. Name the tool. Now it is an average, so the spread we need is the standard error, not σ.
  2. Standard error: $\sigma_{\bar{x}} = \dfrac{0.8}{\sqrt{2}} = 0.565685$
  3. Standardise: $Z = \dfrac{15.5 - 16}{0.565685} = -0.8839$
  4. Table lookup: $P(Z < -0.88) = 0.1894$, $P(Z < -0.89) = 0.1867$; interpolated at $-0.8839$ gives $0.1884$.
P(x̄ < 15.5) = 0.1884 (0.1894 if you round z to −0.88)

Part (c) — the average of four pizzas

  1. Standard error: $\sigma_{\bar{x}} = \dfrac{0.8}{\sqrt{4}} = \dfrac{0.8}{2} = 0.4$
  2. Standardise: $Z = \dfrac{15.5 - 16}{0.4} = -1.25$
  3. Table lookup: $P(Z < -1.25) = 0.1056$.
P(x̄ < 15.5) = 0.1056
Read the three answers together 0.2660 → 0.1884 → 0.1056. Same threshold, same population, but the probability keeps falling as the sample grows. One undersized pizza is unremarkable; four undersized pizzas in a row is a real signal. Averaging kills noise — and that single fact is the engine behind confidence intervals in Chapter 3 and hypothesis tests in Chapter 4.

1.8 · Practice questions

These are the questions from your slides, with nothing added and nothing removed. Try each one on paper first — sketch the curve, shade the region, then compute. Only then open the solution.

Question 1

Finding probabilities using the standard normal distribution: find $P(0 < Z < 1.56)$.

Given $Z \sim N(0,1)$ · target range $0 < Z < 1.56$

Hint: this is the plain Type A table lookup — no conversion needed at all.

  1. Identify the Z-score: $z = 1.56$.
  2. Split it: row $1.5$, column $.06$.
  3. Read the area straight off the table: $P(0 \le Z \le 1.56) = 0.4406$.
0.4406
Question 2

Find the area under the standard normal distribution which lies:

a) Between $Z = 0$ and $Z = 0.96$
b) $Z = -1.45$ and $Z = 0$
c) To the right of $Z = -0.35$
d) To the left of $Z = -0.35$
e) Between $Z = -0.67$ and $Z = 0.75$

Table values $P(0 \le Z \le 0.96) = 0.3315$ · $P(0 \le Z \le 1.45) = 0.4265$ · $P(0 \le Z \le 0.35) = 0.1368$ · $P(0 \le Z \le 0.67) = 0.2486$ · $P(0 \le Z \le 0.75) = 0.2734$

Hint: for (c) and (d), remember the whole right half of the curve is 0.5. Sketch each one before computing.

  1. (a) Straight lookup: $P(0 < Z < 0.96) = 0.3315$.
  2. (b) By symmetry $P(-1.45 < Z < 0) = P(0 < Z < 1.45) = 0.4265$.
  3. (c) Split at the middle: $P(Z > -0.35) = P(-0.35 < Z < 0) + P(Z > 0) = 0.1368 + 0.5 = 0.6368$.
  4. (d) The complement of (c): $P(Z < -0.35) = 1 - 0.6368 = 0.3632$.
  5. (e) The range straddles zero, so add the two halves: $P(0 < Z < 0.67) + P(0 < Z < 0.75) = 0.2486 + 0.2734 = 0.5220$.
a) 0.3315 · b) 0.4265 · c) 0.6368 · d) 0.3632 · e) 0.52
Question 3

If $X$ is a normally distributed random variable with mean 12 and standard deviation 4, find the probability of the following:

i) $X \ge 20$    ii) $P(0 \le X \le 12)$

Given μ = 12 · σ = 4 · $X \sim N(12, 16)$

Hint: convert each X to a Z first, then decide which of the four table situations you are in.

  1. (i) At $X = 20$: $Z = \dfrac{20-12}{4} = 2$.
  2. $P(X \ge 20) = P(Z \ge 2) = 0.5 - P(0 \le Z \le 2) = 0.5 - 0.4772 = 0.0228$. Table value used: $P(0 \le Z \le 2) = 0.4772$.
  3. (ii) At $X = 0$: $Z = \dfrac{0-12}{4} = -3$. At $X = 12$: $Z = \dfrac{12-12}{4} = 0$.
  4. $P(0 \le X \le 12) = P(-3 \le Z \le 0) = P(0 \le Z \le 3) = 0.4986$ by symmetry.
(i) 0.0228 · (ii) 0.4986
Question 4

If $X$ is a normally distributed random variable with mean 30 and standard deviation 5, find the probabilities that:

(i) $26 \le X \le 40$    (ii) $X \ge 45$    (iii) $|X - 30| > 5$

Given μ = 30 · σ = 5 · $X \sim N(30, 25)$

Hint for (iii): $|X - 30| > 5$ means "further than 5 from the mean in either direction". Find the probability of being within 5 first, then subtract from 1.

  1. (i) $Z_1 = \dfrac{26-30}{5} = -0.8$, $Z_2 = \dfrac{40-30}{5} = 2$. The range straddles zero, so add: $P(0 \le Z \le 0.8) + P(0 \le Z \le 2) = 0.2881 + 0.4772 = 0.7653$.
  2. (ii) $Z = \dfrac{45-30}{5} = 3$, so $P(X \ge 45) = 0.5 - 0.49865 = 0.0013$.
  3. (iii) Rewrite it: $P(|X-30| \le 5) = P(25 \le X \le 35)$, which in Z terms is $P(-1 \le Z \le 1)$.
  4. By symmetry that is $2 \times P(0 \le Z \le 1) = 2 \times 0.3413 = 0.6826$.
  5. Therefore $P(|X-30| > 5) = 1 - 0.6826 = 0.3174$.
(i) 0.7653 · (ii) 0.0013 · (iii) 0.3174
Question 5 — working the table backwards

The random variable $X$ is normally distributed with mean 12 and variance 16.

i. Find $x_1$ such that $P(X > x_1) = 0.2296$
ii. Find $x_2$ such that $P(X < x_2) = 0.6700$
iii. Find $x_3$ such that $P(X > x_3) = 0.9123$

Given μ = 12 · $\sigma^2 = 16 \Rightarrow \sigma = 4$

Hint: here you are given the area and must hunt inside the table for it, then read the z off the edges. For (iii), a probability above 0.5 to the right means the value sits below the mean, so z is negative.

Rearranging the standardising formula gives the tool for all three parts: $x = \mu + z\sigma = 12 + 4z$.

  1. (i) $P(Z > z_1) = 0.2296 \Rightarrow P(0 \le Z \le z_1) = 0.5 - 0.2296 = 0.2704$. Searching the table body for 0.2704 gives $z_1 = 0.74$. So $x_1 = 12 + 4(0.74) = 14.96$.
  2. (ii) $P(Z < z_2) = 0.6700 \Rightarrow P(0 \le Z \le z_2) = 0.6700 - 0.5 = 0.1700$. The table gives $z_2 = 0.44$. So $x_2 = 12 + 4(0.44) = 13.76$.
  3. (iii) $P(Z > z_3) = 0.9123$ is more than half, so $z_3$ is negative. Write $z_3 = -z_0$: then $0.5 + P(0 \le Z \le z_0) = 0.9123$, giving $P(0 \le Z \le z_0) = 0.4123$ and $z_0 = 1.36$.
  4. So $z_3 = -1.36$ and $x_3 = 12 + 4(-1.36) = 6.56$.
i) x₁ = 14.96 · ii) x₂ = 13.76 · iii) x₃ = 6.56
Question 6

The mean yield for a one-acre plot is 662 kilos with a standard deviation of 32 kilos. Assuming a normal distribution, how many one-acre plots in a batch of 1,000 plots would you expect to have a yield (i) over 700 kilos, (ii) below 650 kilos, and (iii) what is the lowest yield of the best 100 plots?

Given μ = 662 kilos · σ = 32 kilos · N = 1000 plots

Hint: "how many plots" means multiply the probability by 1000. Part (iii) runs the table backwards — "the best 100 of 1000" is the top 10%.

  1. (i) $Z = \dfrac{700-662}{32} = 1.19$. Then $P(X > 700) = 0.5 - 0.3830 = 0.117$. Expected plots $= 1000 \times 0.117 = 117$.
  2. (ii) $Z = \dfrac{650-662}{32} = -0.38$. Then $P(X < 650) = 0.5 - 0.148 = 0.352$. Expected plots $= 1000 \times 0.352 = 352$.
  3. (iii) The best 100 out of 1000 is the top $\frac{100}{1000} = 0.1$ of the distribution, so we need $x_1$ with $P(X > x_1) = 0.1$.
  4. $P(0 \le Z \le z_1) = 0.5 - 0.1 = 0.4$, and the table gives $z_1 \approx 1.28$ (table value $0.3997 \approx 0.40$).
  5. $x_1 = 662 + 1.28(32) = 662 + 40.96 = 702.96$ kilos.
(i) 117 plots · (ii) 352 plots · (iii) 702.96 kilos
Question 7 — normal feeding into binomial

The marks obtained by a number of students for a certain subject are assumed to be approximately normally distributed with mean value 65 and with a standard deviation of 5. If 3 students are taken at random from the set, what is the probability that exactly 2 of them will have marks over 70?

Given μ = 65 · σ = 5 · n = 3 students · we want exactly k = 2 above 70

Hint: two-stage question. First use the normal curve to find $p$, the chance that one student beats 70. Then "exactly 2 out of 3" is a binomial question with that $p$.

  1. Stage 1 — find p. At $X = 70$: $Z = \dfrac{70-65}{5} = 1.0$.
  2. $p = P(X > 70) = 0.5 - P(0 \le Z \le 1.0) = 0.5 - 0.3413 = 0.1587$.
  3. Stage 2 — binomial. Each of the 3 students independently either beats 70 or does not, so $P(Y = k) = \binom{n}{k}p^k(1-p)^{n-k}$.
  4. $P(Y=2) = \binom{3}{2}(0.1587)^2(0.8413)^{1} = 3 \times 0.025186 \times 0.8413$
  5. $= 0.06356 \approx 0.0635$.
0.0635
Question 8

The effective life of dry battery cells is considered to be normally distributed with mean 20 hours and standard deviation 5 hours. In a consignment of 100 battery cells, how many cells are expected to have life: (i) less than 15 hours, (ii) between 8 and 16 hours, (iii) more than 15 hours, (iv) between 15 and 25 hours, (v) more than 30 hours?

Given μ = 20 hours · σ = 5 hours · N = 100 cells

Hint: (iii) is the complement of (i) — you should not need a second lookup. And (iv) is the 1σ band, so you already know roughly what it must be.

  1. (i) $Z = \dfrac{15-20}{5} = -1.0$. $P(X<15) = 0.5 - 0.3413 = 0.1587$ → $100 \times 0.1587 = 15.87$ cells.
  2. (ii) $Z_1 = \dfrac{8-20}{5} = -2.4$, $Z_2 = \dfrac{16-20}{5} = -0.8$. Both negative, so subtract: $0.4918 - 0.2881 = 0.2037 \approx 0.2036$ → $20.36$ cells.
  3. (iii) $P(X > 15) = 0.5 + 0.3413 = 0.8413$ → $84.13$ cells. Notice this is just $100 - 15.87$.
  4. (iv) $Z_1 = -1.0$, $Z_2 = +1.0$: $2 \times 0.3413 = 0.6826$ → $68.26$ cells. This is the Empirical Rule's 68% appearing exactly where it should.
  5. (v) $Z = \dfrac{30-20}{5} = 2.0$. $P(X>30) = 0.5 - 0.4772 = 0.0228 \approx 0.0227$ → $2.27$ cells.
(i) 15.87 · (ii) 20.36 · (iii) 84.13 · (iv) 68.26 · (v) 2.27 cells

Chapter recap

  • Area is probability. The height of the curve means nothing on its own; the shaded area is the answer.
  • $Z = \frac{X-\mu}{\sigma}$ converts any normal problem onto the one curve that has a printed table.
  • Know your table type. Your slides use the "area from 0 to z" table, which is why solutions keep adding or subtracting 0.5.
  • Sketch, shade, then compute. The picture tells you whether to add, subtract, or take from 0.5.
  • Single value → use σ. Average of n → use $\sigma/\sqrt{n}$. Confusing these two is the most expensive mistake in this chapter.
  • Backwards questions give you the area and want the x: find z inside the table body, then $x = \mu + z\sigma$.
  • The CLT says sample means go normal no matter what the population looks like, once $n \ge 30$ — and that is what licenses everything in Chapters 3 and 4.
Chapter 2

Uniform, Exponential, and the Probability Inequalities

By the end of this chapter you can handle waiting-time problems with one exponential formula, spot when the memoryless property collapses a hard conditional question into an easy one, and put bounds on a distribution you know almost nothing about.

Chapter 1 gave you the bell. But not everything is a bell. Waiting for a bus, a machine breaking down, a customer reaching the counter — these follow a curve that starts high and slides downwards. And sometimes you are handed a mean and a variance with no idea of the shape at all. This chapter covers both situations: the two named curves, and the two inequalities that work when you are flying blind.

2.1 · The Uniform distribution

The simplest continuous distribution there is: every value in a range is equally likely, and nothing outside the range can happen. A bus arrives at some point in the next 10 minutes, all moments equally likely — that is uniform.

Definition A continuous random variable $X$ follows a uniform distribution on the interval $[a, b]$ if its probability density function is constant across that interval and zero everywhere else.
Uniform density and cumulative functions
$$ f(x) = \begin{cases} \dfrac{1}{b-a} & ;\ x \in [a,b] \\[6pt] 0 & ;\ \text{otherwise} \end{cases} \qquad F(x) = \begin{cases} 0 & ;\ x < a \\[4pt] \dfrac{x-a}{b-a} & ;\ x \in [a,b] \\[4pt] 1 & ;\ x > b \end{cases} $$
a the lower end of the range · b the upper end · f(x) the flat height of the rectangle · F(x) the area accumulated up to x, i.e. $P(X \le x)$
In plain English The density is a rectangle. Its width is $b - a$, and since the total area must be 1, its height has to be $\frac{1}{b-a}$. That is the whole distribution. Any probability is just width of the slice you want ÷ total width — no integration, no tables.
Mean and variance of the uniform
$$ E(X) = \frac{a+b}{2} \qquad\qquad Var(X) = \frac{(b-a)^{2}}{12} $$
E(X) the mean, which is simply the midpoint of the interval · Var(X) the variance, which depends only on how wide the interval is
Both are worth a second's thought The mean sitting at the midpoint is obvious — the shape is symmetric. The variance formula is worth memorising because it is easy to state and easy to be asked. Note it grows with the square of the width: double the interval and the variance quadruples.

2.2 · The Exponential distribution

This is the distribution of waiting time: how long until the next customer, the next breakdown, the next phone call. Its defining feature is that short waits are the most likely and the probability drops away smoothly as the wait gets longer.

Definition A continuous random variable $X$ follows an exponential distribution with parameter $\lambda > 0$ if its density is $f(x) = \lambda e^{-\lambda x}$ for $x \ge 0$.
Exponential density, CDF, and tail
$$ f(x) = \lambda e^{-\lambda x},\ x \ge 0 $$ $$ F(x) = P(X \le x) = \int_0^x \lambda e^{-\lambda t}\,dt = 1 - e^{-\lambda x} $$ $$ P(X \ge x) = 1 - F(x) = e^{-\lambda x} $$
λ the rate — how many events happen per unit of time · x the amount of time you are asking about · F(x) probability the event has happened by time x · P(X ≥ x) probability you are still waiting at time x
Note from the slides The tail probability $P(X \ge x) = e^{-\lambda x}$ is the opposite of $F(x)$.
This is the only formula you actually need

Almost every exponential question in your deck reduces to one of these two lines:

  • "still waiting / survives / exceeds / more than" $\rightarrow\ e^{-\lambda x}$
  • "happens by / fails within / less than" $\rightarrow\ 1 - e^{-\lambda x}$

The integrals in the slides all collapse to these. You may quote them directly — but be ready to show the integration if the question says "derive".

Mean and variance of the exponential
$$ E(X) = \frac{1}{\lambda} \qquad\qquad Var(X) = \frac{1}{\lambda^{2}} $$
λ the rate (events per unit time) · 1/λ the average waiting time between events
λ and the mean are reciprocals — this is where marks are lost

Questions almost never hand you $\lambda$. They hand you an average: "average waiting time is 45 seconds", "mean life 10,000 hours", "mean 100,000 miles". You must flip it:

$$ \lambda = \frac{1}{E(X)} $$

And watch the units. If the mean is given in seconds but the question asks about minutes, convert before computing $\lambda$. In the burger-chain question below, 45 seconds becomes 0.75 minutes, so $\lambda = \frac{1}{0.75} = \frac{4}{3}$ per minute. Getting this backwards ($\lambda = 0.75$) silently produces a completely wrong answer.

2.3 · The memoryless property

This is the strangest and most useful fact in the chapter.

Memorylessness
$$ P(X > s + t \mid X > s) = P(X > t) \qquad \text{for any } s, t > 0 $$
s time you have already waited · t further time you are asking about · the left side reads "given I've already waited s, what's the chance I wait t more?"
Note from the slides This property is unique to the exponential distribution. The converse is also true: if $P(X > s+t \mid X > s) = P(X > t)$, then $X$ follows an exponential distribution.
In plain English The waiting time has no memory of how long you have already waited. A component that has run for 10,000 hours is exactly as likely to survive the next 5,000 as a brand-new one. It does not age, it does not wear out — it just fails at random. That is unrealistic for car tyres and quite realistic for radioactive decay or a call arriving at a switchboard.

The proof from your slides

Worth reading once, because it is short and it may be asked directly.

Proof

If $X \sim Exp(\lambda)$ then $f(x) = \lambda e^{-\lambda x}$ for $x \ge 0$, and $F(x) = \int_0^x \lambda e^{-\lambda t}dt = 1 - e^{-\lambda x}$.

First, the survival probability past any threshold $k$:

$$ P(X > k) = \int_k^\infty \lambda e^{-\lambda x}dx = e^{-\lambda k} $$

Now apply the definition of conditional probability. Note that if $X > s+t$ then automatically $X > s$, so the intersection is just the event $X > s+t$:

$$ P(X > s+t \mid X > s) = \frac{P(X > s+t \ \text{and}\ X > s)}{P(X > s)} = \frac{P(X > s+t)}{P(X > s)} = \frac{e^{-\lambda(s+t)}}{e^{-\lambda s}} = e^{-\lambda t} $$

And separately, $P(X > t) = e^{-\lambda t}$. The two are equal, therefore $P(X > s+t \mid X > s) = P(X > t)$. $\blacksquare$

How to use it in an exam When you see the words "given that it has already…" in an exponential question, do not set up a conditional probability. Just subtract to find the extra time being asked about, and compute the plain unconditional probability for that extra time. "More than 5 given already 2" becomes simply $P(X > 3)$. That is the whole trick, and it turns a two-line problem into a one-liner.
Worked example 1 — exponential and memorylessness together

The time (in hours) required to repair a machine is exponentially distributed with parameter $\lambda = 1/2$.

(i) What is the probability that the repair time exceeds 2 h?
(ii) What is the conditional probability that a repair takes at least 10 h given that its duration exceeds 9 h?

Given $\lambda = 1/2 = 0.5$ per hour · $X \sim Exp(0.5)$ · so $f(x) = \frac{1}{2}e^{-x/2}$
  1. Part (i) — name the tool. "Exceeds" means a tail probability, so we want $P(X > 2) = e^{-\lambda x}$.
  2. Shown as the full integral, as the slides do: $P(X>2) = \int_2^\infty \frac{1}{2}e^{-x/2}dx = \left[-e^{-x/2}\right]_2^\infty = 0 - (-e^{-1}) = e^{-1}$
  3. $e^{-1} = 0.3679$
  4. Part (ii) — spot the memoryless cue. "At least 10 given it exceeds 9" is a conditional. Subtract: the extra time asked about is $10 - 9 = 1$ hour.
  5. By memorylessness, $P(X \ge 10 \mid X > 9) = P(X \ge 9+1 \mid X>9) = P(X \ge 1)$.
  6. $P(X \ge 1) = \int_1^\infty \frac{1}{2}e^{-x/2}dx = e^{-0.5} = 0.6065$
(i) 0.3679  ·  (ii) 0.6065
Notice Part (ii) never used the number 9 or the number 10 in the final computation — only their difference. That is memorylessness doing the work.

2.4 · When you don't know the distribution: Markov and Chebyshev

Everything so far assumed you knew the shape of the curve. But suppose someone tells you only "the mean is 8 and the variance is 9" and refuses to say anything more. You cannot compute an exact probability. But you can still put a ceiling on it — and that ceiling holds for every possible distribution.

Markov's inequality — needs only the mean

Markov's inequality
$$ P(X \ge k) \le \frac{E(X)}{k} $$
X a random variable that can never be negative · E(X) its mean · k any positive threshold you choose · the result is an upper bound, not an exact answer
Conditions (i) $X \ge 0$ — the variable must be non-negative  ·  (ii) $k > 0$
In plain English If the class average is 70, there cannot be very many students scoring 90 or above — because too many high scores would drag the average up past 70. Markov turns that common-sense argument into a number. It is crude, but it needs nothing except the mean.

Chebyshev's inequality — uses the variance too

Chebyshev's inequality, both forms
$$ P(|X - \mu| \ge k\sigma) \le \frac{1}{k^{2}} \qquad\text{equivalently}\qquad P(|X - \mu| < k\sigma) \ge 1 - \frac{1}{k^{2}} $$
μ the mean · σ the standard deviation · k how many standard deviations out you are asking about · left form bounds the tails from above, right form bounds the middle from below
Conditions $E(X) = \mu$ and $Var(X) = \sigma^2$ must both exist, and $k > 0$.
Note from the slides If the variance is small, then $X$ is unlikely to be too far from the mean.
Which form do I use?

Read the question's inequality and match it:

  • Asked for a probability of being far away ($\ge$, "at least", "differs by more than") → use $\le \frac{1}{k^2}$, and your answer is a maximum.
  • Asked for a probability of being close in ($<$, "between", "within") → use $\ge 1 - \frac{1}{k^2}$, and your answer is a minimum.

Then write the answer with the inequality sign, not as an equals. "$P \le 0.25$", never "$P = 0.25$" — you were only ever given a bound.

Finding k — the step people fumble You are never given $k$ directly. You are given a distance, and you must ask how many standard deviations is that? Set $k\sigma = \text{distance}$ and divide. If $\sigma = 3$ and the distance is 12, then $k = 12/3 = 4$. If the range is written as $-4 < X < 20$, first re-centre it on the mean: subtract 8 throughout to get $-12 < X - 8 < 12$, which is $|X - 8| < 12$, so the distance is 12.
Worked example 2 — a Markov bound

Suppose that the average grade of students in the upcoming statistics exam is 70%. Give an upper bound on the proportion of students who score at least 90%.

Given $E(X) = 70$ · $X \ge 0$ (a grade cannot be negative) · threshold $k = 90$
  1. Name the tool. We know only the mean, and the variable is non-negative — that is exactly Markov's situation.
  2. $P(X \ge k) \le \frac{E(X)}{k}$
  3. Substitute: $P(X \ge 90) \le \frac{70}{90} = \frac{7}{9}$
  4. $= 0.7778$
P(X ≥ 90) ≤ 0.7778, i.e. at most 7/9 of students
Is that a useful answer? Barely — it says "at most 78% of students got 90+", which we could almost have guessed. That is the honest character of Markov: it asks for almost no information, and gives back a very loose bound in return. Chebyshev asks for the variance as well, and pays you back with a much tighter one, as Question 4 below shows dramatically.

2.5 · Practice questions

These are the remaining problems from your slides. For each exponential one, your first move should be to find $\lambda$ from the mean and check the units. For each inequality one, your first move is to find $k$.

Question 1 — units matter

A burger chain observes that the average waiting time per customer is 45 seconds to get the service. Assuming the waiting time is an exponential random variable, what is the probability that a customer will have to wait more than 5 minutes given that he has already waited for 2 minutes?

Given average waiting time = 45 seconds · question is asked in minutes

Hint: convert to minutes before you compute λ. Then notice "given he has already waited" — that is the memoryless cue.

  1. Convert units first. $E(X) = 45$ seconds $= \frac{45}{60} = 0.75$ minutes.
  2. Find λ. $\lambda = \frac{1}{E(X)} = \frac{1}{0.75} = \frac{4}{3}$ per minute.
  3. Apply memorylessness. We want $P(X > 5 \mid X > 2)$. The extra time is $5 - 2 = 3$ minutes, so this equals $P(X > 3)$.
  4. $P(X > 3) = e^{-\lambda x} = e^{-\frac{4}{3}(3)} = e^{-4}$
  5. $e^{-4} = 0.0183156 \approx 0.0183$
0.0183
Question 2

The number of miles travelled by a given car before its transmission ceases to function is governed by the exponential distribution with mean 100,000 miles. What is the probability that a car's transmission will fail during its first 50,000 miles of operation?

Given $E(X) = 100{,}000$ miles

Hint: "fail during its first 50,000" means it happens by 50,000 — that is the CDF, not the tail.

  1. Find λ. $E(X) = \frac{1}{\lambda} = 100000 \implies \lambda = \frac{1}{100000}$.
  2. Name the tool. "Fails during the first 50,000" is $P(X \le 50000)$, so use $F(x) = 1 - e^{-\lambda x}$.
  3. $P(X \le 50000) = \int_0^{50000}\frac{1}{100000}e^{-x/100000}dx = 1 - e^{-\frac{50000}{100000}} = 1 - e^{-0.5}$
  4. $= 1 - 0.60653 = 0.39347 \approx 0.3935$
0.3935
Question 3 — two memoryless parts

A component has an exponential time-to-failure distribution with mean of 10,000 hours.

(i) The component has already been in operation for its mean life. What is the probability that it will fail by 15,000 hours?
(ii) At 15,000 hours the component is still in operation. What is the probability that it operates for another 5,000 hours?

Given $E(X) = 10{,}000$ hours $\implies \lambda = \frac{1}{10000}$

Hint: both parts are conditionals with an extra time of 5,000 hours. Part (i) asks for failure, so take the complement at the end.

  1. (i) "Already in operation for its mean life" means it has survived 10,000 hours. We want $P(X \le 15000 \mid X > 10000)$.
  2. Work with survival first: $P(X > 10000+5000 \mid X > 10000) = P(X > 5000)$ by memorylessness.
  3. $P(X > 5000) = e^{-5000/10000} = e^{-0.5} = 0.6065$
  4. Failing is the complement: $P(X \le 15000 \mid X>10000) = 1 - 0.6065 = 0.3935$.
  5. (ii) $P(X > 15000+5000 \mid X > 15000) = P(X > 5000) = e^{-0.5} = 0.6065$.
(i) 0.3935  ·  (ii) 0.6065
Look at what just happened Parts (i) and (ii) start from completely different ages — 10,000 hours and 15,000 hours — and give the identical answer, because both ask about the same extra 5,000 hours. That is the memoryless property stated as loudly as it can be.
Question 4 — Markov versus Chebyshev on the same problem

A biased coin has probability of heads occurring on 20% of trials. The coin is flipped 200 times. Find a bound that a head appears at least 120 times.

Given $n = 200$ · $p = 0.20$ · so $E(X) = np$ and $Var(X) = np(1-p)$

Hint: compute the binomial mean and variance first. Then do it twice — once with Markov, once with Chebyshev — and compare how tight the two bounds are.

  1. Set up. $E(X) = np = 200 \times 0.20 = 40$ heads. $Var(X) = np(1-p) = 200 \times 0.20 \times 0.80 = 32$.
  2. Markov bound. $X \ge 0$ and $k = 120$: $P(X \ge 120) \le \frac{E(X)}{120} = \frac{40}{120} = \frac{1}{3} \approx 0.3333$.
  3. Chebyshev bound. Getting 120 or more heads means being at least $120 - 40 = 80$ away from the mean, so $P(X \ge 120) \le P(|X - 40| \ge 80)$.
  4. Here $k\sigma = 80$, so $(k\sigma)^2 = 80^2 = 6400$.
  5. $P(|X-40| \ge 80) \le \frac{Var(X)}{(k\sigma)^2} = \frac{32}{6400} = \frac{1}{200} = 0.005$
Markov bound: 0.3333  ·  Chebyshev bound: 0.005
Why the enormous gap? Markov knows only the average (40) and says "at most a third of the time". Chebyshev also knows the variance is a mere 32, so it knows the count almost never strays far from 40 — and returns a bound nearly 70 times tighter. More information in, tighter bound out. If a question gives you a variance, it wants Chebyshev.
Question 5 — both Chebyshev forms

A random variable $X$ has a mean 8 and variance 9 and it is an unknown distribution. Find $P(-4 < X < 20)$ and $P(|X - 8| \ge 6)$.

Given $\mu = 8$ · $\sigma^2 = 9 \implies \sigma = 3$ · distribution shape unknown

Hint: for the first, re-centre the range on the mean by subtracting 8 from every part of the inequality. Then find k, and pick the form of Chebyshev that matches the direction.

  1. Part 1 — re-centre. $-4 < X < 20$. Subtract 8 throughout: $-12 < X - 8 < 12$, which is exactly $|X - 8| < 12$.
  2. Find k. $k\sigma = 12$ and $\sigma = 3$, so $k = 4$.
  3. This is a "close in" question, so use the lower-bound form: $P(|X-\mu| < k\sigma) \ge 1 - \frac{1}{k^2}$.
  4. $P(|X-8| < 12) \ge 1 - \frac{1}{16} = \frac{15}{16} = 0.9375$
  5. Part 2. $|X - 8| \ge 6$ gives $k\sigma = 6$, $\sigma = 3$, so $k = 2$.
  6. This is a "far away" question, so use the upper-bound form: $P(|X-8| \ge 6) \le \frac{1}{2^2} = 0.25$.
P(−4 < X < 20) ≥ 0.9375  ·  P(|X − 8| ≥ 6) ≤ 0.25
Write the inequality signs These answers are bounds, not values. Writing "= 0.9375" is wrong even though the number is right, because Chebyshev never claims to know the actual probability — only that it cannot be worse than this.
Question 6 — the mean and variance refresher

A random variable $X$ with probability distribution is given below. Find the mean and variance of this distribution.

X−2−1012
f(x)0.10.150.20.40.15

Hint: use $Var(X) = E(X^2) - [E(X)]^2$. Compute $E(X)$ and $E(X^2)$ as separate sums, and do not forget to square the mean at the end.

  1. Mean. $E(X) = \sum x f(x) = (-2)(0.1) + (-1)(0.15) + (0)(0.2) + (1)(0.4) + (2)(0.15)$
  2. $= -0.2 - 0.15 + 0 + 0.4 + 0.3 = 0.35$
  3. Second moment. $E(X^2) = \sum x^2 f(x) = 4(0.1) + 1(0.15) + 0(0.2) + 1(0.4) + 4(0.15)$
  4. $= 0.4 + 0.15 + 0 + 0.4 + 0.6 = 1.55$
  5. Variance. $Var(X) = E(X^2) - [E(X)]^2 = 1.55 - (0.35)^2 = 1.55 - 0.1225 = 1.4275$
Mean = 0.35 · Variance = 1.4275
Why this question is in this deck Chebyshev needs a mean and a variance before it can do anything. This question is the deck making sure you can produce both from a raw distribution table — because in an exam the inequality question may hand you the table rather than the finished numbers.

Chapter recap

  • Uniform: a rectangle of height $\frac{1}{b-a}$. Mean $\frac{a+b}{2}$, variance $\frac{(b-a)^2}{12}$.
  • Exponential: "still waiting" is $e^{-\lambda x}$, "already happened by now" is $1 - e^{-\lambda x}$. Mean $\frac{1}{\lambda}$, variance $\frac{1}{\lambda^2}$.
  • Always derive λ from the mean ($\lambda = 1/E(X)$) and fix the units before you do it.
  • Memorylessness: the words "given it has already…" mean subtract the two times and compute the plain probability of the difference.
  • Markov needs only a mean and gives a loose ceiling. Chebyshev also uses the variance and gives a much tighter one.
  • Find k by dividing the distance by σ, and re-centre the range on μ first if the question is written as a plain interval.
  • Answer bounds with ≤ or ≥, never with an equals sign.
Chapter 3

Estimation and Confidence Intervals

By the end of this chapter you can pick the right interval formula on sight, build a confidence interval for a mean, a proportion or a variance, and say what "95% confident" actually means without getting it wrong.

You have one sample. The population is out there, unknown, and you will never see all of it. Estimation is the business of making an honest statement about that population from your one sample — and, crucially, of admitting how much you might be off by. A single guessed number hides its own uncertainty. An interval wears it on the outside.

3.1 · What statistical inference is

Definition Inference is the process of generalising, or drawing conclusions about, the target population on the basis of results obtained from a sample.
Notes from the slides
  • Inference involves: estimation, and hypothesis testing.
  • Purpose: to make decisions about population characteristics.
  • Before beginning statistical analysis it is essential to examine the distribution of the variable for skewness (tails), kurtosis (peaked or flat distribution), spread (range of the values) and outliers (data values separated from the rest of the data).
  • Information about each of these characteristics determines the choice of statistical analysis, and lets it be accurately explained and interpreted.

The four words you must keep straight

TermWhat it meansExample
PopulationThe totality of the observations with which we are concernedevery student in India
SampleA subset of the populationthe 200 students you surveyed
StatisticA function of the sample random variables containing no unknown parameters$\bar{X}$, $S^2$
EstimatorA statistic $\hat{\theta}$ used to estimate an unknown parameter $\theta$ — it is a random variable, a recipe"take the sample mean"
EstimateA specific value of that estimator, obtained from one actual sample — a number$\bar{x} = 2.20$
An estimator is a function of the sample
$$ \hat{\theta} = U(X_1, X_2, \dots, X_n) $$
θ̂ the estimator of the unknown parameter · U the rule applied to the sample · X₁…Xn the sample random variables
Estimator vs estimate, in one line The estimator is the recipe ("add them up and divide by n"). The estimate is the cake you got this time (2.20). The recipe is what has statistical properties; the cake is just a number.
Two ways to draw inferences
  1. Estimation — we estimate one or more parameters using sample statistics. It comes in two types: (a) point estimation, (b) interval estimation. This chapter.
  2. Testing of hypotheses — we hypothesise that one or more parameters have some specific value or relationship, and make a decision based on sample statistics. Chapter 4.

Why any of this works: the sampling distribution

Everything in this chapter is borrowed from Chapter 1. Because the Central Limit Theorem tells us that

The engine underneath every formula in this chapter
$$ Z = \frac{\bar{X} - \mu}{\sigma/\sqrt{n}} \sim N(0,1) \quad \text{for large } n $$
x̄ your sample mean · μ the unknown population mean · σ/√n the standard error

we know exactly how far $\bar{x}$ is likely to stray from $\mu$. Turn that statement inside out — instead of "how far will $\bar{x}$ be from $\mu$", ask "how far might $\mu$ be from my $\bar{x}$" — and you have a confidence interval. That inversion is the whole idea.

3.2 · Point estimation and what makes an estimator good

A point estimate is a single number offered as the value of a parameter. Simple, but silent about its own reliability.

Population parameterPoint estimate (sample statistic)
Mean $\mu$$\bar{X}$
Proportion $P$$\hat{p}$
Variance $\sigma^2$$S^2$

Unbiasedness

Unbiased estimator
$$ E(\hat{\theta}) = \theta $$
E(θ̂) the mean of the estimator's sampling distribution · θ the true parameter — if these match, the estimator is unbiased
In plain English Unbiased does not mean "right". Any one sample will be off. It means the estimator is not systematically off — aim it a thousand times and the misses cancel out, landing on the truth on average. A biased estimator is a rifle with bent sights: it may be very precise and still consistently miss to the left.

From the slides: the sample mean $\bar{x}$ is an unbiased estimator of $\mu$; the sample variance $s^2$ is an unbiased estimator of $\sigma^2$; the sample proportion $\hat{p}$ is an unbiased estimator of $P$.

Bias
$$ \text{Bias}(\hat{\theta}) = E(\hat{\theta}) - \theta $$
Bias the gap between where the estimator lands on average and the truth
Note from the slides The bias of an unbiased estimator is 0.
Why $s^2$ divides by n − 1 This is the classic exam follow-up. Dividing by $n$ would make the sample variance too small on average, because the deviations are measured from $\bar{x}$ — which is itself pulled towards the data — rather than from the true $\mu$. Dividing by $n-1$ exactly corrects that shrinkage and makes $s^2$ unbiased. That "$-1$" is also where the degrees of freedom in the t-interval come from.

Efficiency

Unbiasedness alone is not enough — several estimators can all be unbiased. Among them we prefer the one that scatters least.

Relative efficiency
$$ \hat{\theta}_1 \text{ is more efficient than } \hat{\theta}_2 \iff Var(\hat{\theta}_1) < Var(\hat{\theta}_2) $$
both must be unbiased and based on the same number of observations · the most efficient estimator, the minimum variance unbiased estimator, is the unbiased one with the smallest variance
Both properties together Unbiased = centred on the bullseye. Efficient = tightly grouped. You want both, and if you must rank them, an estimator that is centred but scattered is usually preferred to one that is tight but wrong.

3.3 · Interval estimation, and what confidence really means

Notes from the slides
  • How much uncertainty is associated with a point estimate of a population parameter?
  • An interval estimate provides more information about a population characteristic than does a point estimate.
  • Such interval estimates are called confidence intervals.
  • An interval takes into consideration variation in sample statistics from sample to sample; is based on observation from one sample; gives information about closeness to unknown population parameters; and is stated in terms of a level of confidence — which can never be 100%.
Definition of a confidence interval
$$ P(a < \theta < b) = 1 - \alpha $$
a, b the lower and upper confidence limits · θ the unknown parameter · 1 − α the confidence level · then $(a,b)$ is called a $100(1-\alpha)\%$ confidence interval for θ
The single most misunderstood sentence in statistics

"There is a 95% probability that μ lies in (1.99, 2.41)" is wrong, and it is wrong in the exam too.

Look at the figure. The vertical line — the true μ — never moves. It is a fixed, if unknown, number. What moves is the intervals: each sample throws a different one. 95% of those thrown intervals land over the line; the red ones missed.

So once you have computed your particular interval, it either contains μ or it does not — there is no probability left in it. The 95% describes the method, not your one answer. The slides put it exactly this way: "A specific interval either will contain or will not contain the true parameter (no probability involved in a specific interval)."

Safe wording for the exam: "We are 95% confident that μ lies between a and b" — or, more fully, "95% of intervals constructed in this manner will contain the true mean."

Note from the slides — the relative frequency interpretation
  • In repeated samples of the population, the true value of the parameter $\theta$ would be contained in $100(1-\alpha)\%$ of intervals calculated this way.
  • From repeated samples, 95% of all the confidence intervals that can be constructed will contain the unknown true parameter.

Which interval do I use? — the decision table

Read this table before every question in this chapter. Choosing the wrong row is the most common way to lose all the marks on an otherwise correct calculation.

What you wantWhat you knowUseFormula
Mean $\mu$$\sigma$ known (and normal population, or $n \ge 30$) Z $\bar{x} \pm z_{\alpha/2}\dfrac{\sigma}{\sqrt{n}}$
Mean $\mu$$\sigma$ unknown, only $s$ available t, df $= n-1$ $\bar{x} \pm t_{n-1,\alpha/2}\dfrac{s}{\sqrt{n}}$
Proportion $P$$\hat{p}$ from a large sample Z $\hat{p} \pm z_{\alpha/2}\sqrt{\dfrac{\hat{p}(1-\hat{p})}{n}}$
Variance $\sigma^2$$\mu$ known χ², df $= n$ $\left(\dfrac{\sum(x_i-\mu)^2}{\chi^2_{n,\alpha/2}},\ \dfrac{\sum(x_i-\mu)^2}{\chi^2_{n,1-\alpha/2}}\right)$
Variance $\sigma^2$$\mu$ unknown, $s^2$ available χ², df $= n-1$ $\dfrac{(n-1)s^2}{\chi^2_{n-1,\alpha/2}} < \sigma^2 < \dfrac{(n-1)s^2}{\chi^2_{n-1,1-\alpha/2}}$

3.4 · Confidence interval for a mean, σ known

Start from what the CLT guarantees about the standard normal:

The probability statement we invert
$$ P\!\left(-z_{\alpha/2} < Z < z_{\alpha/2}\right) = 1 - \alpha $$
zα/2 the critical value leaving area α/2 in each tail · the middle area is the confidence level 1 − α
Assumptions
  • Population variance $\sigma^2$ is known.
  • Population is normally distributed.
  • If the population is not normal, use a large sample ($n \ge 30$).
Confidence interval for μ, σ known
$$ \bar{X} - z_{\alpha/2}\frac{\sigma}{\sqrt{n}} \;<\; \mu \;<\; \bar{X} + z_{\alpha/2}\frac{\sigma}{\sqrt{n}} $$
x̄ the sample mean, the centre of the interval · zα/2 the reliability factor from the Z-table · σ/√n the standard error · together the last two make the margin of error
Margin of error
$$ ME = z_{\alpha/2}\frac{\sigma}{\sqrt{n}} \qquad\text{so the interval is}\qquad \bar{x} \pm ME $$
ME the half-width of the interval — how far you are willing to be wrong
Notes from the slides
  • The interval width is equal to twice the margin of error.
  • If $\bar{x}$ is used as an estimate of $\mu$, we can be $100(1-\alpha)\%$ confident that the error will not exceed $z_{\alpha/2}\frac{\sigma}{\sqrt{n}}$.
  • The margin of error can be reduced if: the population standard deviation can be reduced ($\sigma \downarrow$); the sample size is increased ($n \uparrow$); or the confidence level is decreased ($(1-\alpha) \downarrow$).
The trade-off, stated honestly You can always make your interval narrower by demanding less confidence — a 50% interval is delightfully tight and nearly useless. The only way to get both high confidence and a narrow interval is to collect more data. And because $n$ sits under a square root, halving your margin of error costs you four times the sample size.

Finding the reliability factor $z_{\alpha/2}$

For a 95% interval: $1-\alpha = 0.95 \Rightarrow \alpha = 0.05 \Rightarrow \alpha/2 = 0.025$, and the table gives $z_{0.025} = 1.96$.

Always halve α A two-sided interval puts α/2 in each tail, not α. For 95% the value is 1.96, not 1.645. Using 1.645 by mistake is the same error as running a one-tailed test when you meant two-tailed.
Confidence levelConfidence coefficient, 1 − α$z_{\alpha/2}$
80%.801.28
90%.901.645
95%.951.96
98%.982.33
99%.992.58
99.8%.9983.08
99.9%.9993.27
Worked example 1 — CI for a mean with σ known

A sample of 11 circuits from a large normal population has a mean resistance of 2.20 ohms. We know from past testing that the population standard deviation is 0.35 ohms. Determine a 95% confidence interval for the true mean resistance of the population.

Given n = 11 · $\bar{x} = 2.20$ ohms · σ = 0.35 ohms (known, from past testing) · 95% confidence, so α = 0.05
  1. Pick the row. We want a mean, and σ is known from past testing, and the population is stated normal — so the Z-interval, even though n is only 11.
  2. Reliability factor: $\alpha/2 = 0.025$, table value $z_{0.025} = 1.96$.
  3. Substitute into $\bar{x} \pm z\frac{\sigma}{\sqrt{n}}$:   $2.20 \pm 1.96\left(\frac{0.35}{\sqrt{11}}\right)$
  4. Margin of error: $1.96 \times \frac{0.35}{3.31662} = 1.96 \times 0.10553 = 0.2068$
  5. Limits: $2.20 - 0.2068 = 1.9932$ and $2.20 + 0.2068 = 2.4068$.
1.9932 < μ < 2.4068 ohms

Interpretation, written the safe way: we are 95% confident that the true mean resistance is between 1.9932 and 2.4068 ohms. Although the true mean may or may not be in this interval, 95% of intervals formed in this manner will contain the true mean.

3.5 · Confidence interval for a mean, σ unknown — the t-distribution

In real work you almost never know $\sigma$. So you use $s$, the sample standard deviation, in its place. But that substitution costs something: $s$ is itself an estimate, and it wobbles from sample to sample. You have added a second source of uncertainty on top of the first, and the normal curve no longer tells the truth about how far $\bar{x}$ can stray.

The t statistic
$$ t = \frac{\bar{X} - \mu}{S/\sqrt{n}} $$
x̄ sample mean · μ population mean · S the sample standard deviation, standing in for the unknown σ · n sample size
Note from the slides This variable follows the Student's t distribution with $(n-1)$ degrees of freedom.
Degrees of freedom
$$ \text{d.f.} = n - 1 $$
the number of observations that are free to vary after the sample mean has been calculated
What "degrees of freedom" means Suppose five numbers must average 10, so they must total 50. You may choose the first four freely — anything you like. But once they are fixed, the fifth is forced; it has no freedom left. Four of the five could vary: $n - 1 = 4$ degrees of freedom. Using $\bar{x}$ in the calculation is what spends that one degree.
Notes from the slides — properties of the t
  • The t is a family of distributions; the t value depends on the degrees of freedom.
  • t-distributions are bell-shaped and symmetric, but have 'fatter' tails than the normal.
  • $t \longrightarrow Z$ as $n$ increases.
  • The body of the t table contains t values, not probabilities.
Assumptions Population standard deviation is unknown · population is normally distributed · if the population is not normal, use a large sample.
Confidence interval for μ, σ unknown
$$ \bar{X} - t_{n-1,\,\alpha/2}\frac{S}{\sqrt{n}} \;<\; \mu \;<\; \bar{X} + t_{n-1,\,\alpha/2}\frac{S}{\sqrt{n}} $$
tn−1, α/2 the critical t with n−1 df and area α/2 in each tail, defined by $P(t_{n-1} > t_{n-1,\alpha/2}) = \alpha/2$ · ME $= t_{n-1,\alpha/2}\frac{S}{\sqrt{n}}$
How to read the t-table Two things to get right. First, the row: it is df $= n-1$, not $n$. Second, the column: your slides' table is headed by the area in one tail, so for a 95% two-sided interval you want the $\alpha/2 = .025$ column, not the .05 column. Worked reading from the slides: for $n = 3$, df $= 2$, $\alpha = .10 \Rightarrow \alpha/2 = .05$, giving $t_{2,\,0.05} = 2.920$.

Notice in the comparison below how the t value falls towards the Z value as df grows — by 30 df they are nearly the same, which is exactly the "$n \ge 30$" rule of thumb showing up again.

Confidence levelt (10 d.f.)t (20 d.f.)t (30 d.f.)Z
.801.3721.3251.3101.282
.901.8121.7251.6971.645
.952.2282.0862.0421.960
.993.1692.8452.7502.576
Why the t is always wider — and why that is honest Every t value in that table is bigger than the Z beside it. A bigger multiplier means a wider interval. That extra width is the price of not knowing σ: you are less sure, so you must claim less precision. An interval built with Z when you should have used t is too narrow — it looks more confident than the data entitles you to be.
Worked example 2 — CI for a mean with σ unknown

A random sample of $n = 25$ has $\bar{x} = 50$ and $s = 8$. Form a 95% confidence interval for $\mu$.

Given n = 25 · $\bar{x} = 50$ · s = 8 (a sample standard deviation) · 95% confidence, α = 0.05
  1. Pick the row. The 8 is $s$, not σ — σ is unknown. So this is a t-interval.
  2. Degrees of freedom: d.f. $= n - 1 = 25 - 1 = 24$.
  3. Table value: $t_{24,\,0.025} = 2.0639$.
  4. Substitute: $50 - 2.0639\left(\frac{8}{\sqrt{25}}\right) < \mu < 50 + 2.0639\left(\frac{8}{\sqrt{25}}\right)$
  5. Margin of error: $2.0639 \times \frac{8}{5} = 2.0639 \times 1.6 = 3.302$
  6. Limits: $50 - 3.302 = 46.698$ and $50 + 3.302 = 53.302$.
46.698 < μ < 53.302

Had you wrongly used $z = 1.96$ here, you would have got $46.86 < \mu < 53.14$ — narrower, and overclaiming.

3.6 · Confidence interval for a proportion

Now the parameter is a percentage: the proportion $P$ of the population with some property. The sample proportion $\hat{p}$ is our point estimate, and for a large sample its distribution is approximately normal.

Standard error of a proportion
$$ \sigma_P = \sqrt{\frac{P(1-P)}{n}} \qquad\text{estimated by}\qquad \sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$
P the true population proportion, which we do not know · p̂ the sample proportion, used in its place · n the sample size
Confidence interval for a population proportion
$$ \hat{p} - z_{\alpha/2}\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} \;<\; P \;<\; \hat{p} + z_{\alpha/2}\sqrt{\frac{\hat{p}(1-\hat{p})}{n}} $$
p̂ = (number with the property) ÷ (sample size) · zα/2 the normal critical value · note there is no σ and no s anywhere — a proportion carries its own spread
Two habits that keep this clean
  • Compute $\hat{p}$ as a decimal first ($25/100 = 0.25$), then feed it in. Mixing percentages into the square root is a reliable way to be wrong by a factor of 10.
  • It is always $z$, never $t$ — there is no sample standard deviation being estimated here, so there are no degrees of freedom to lose.
Worked example 3 — CI for a proportion

A random sample of 100 people shows that 25 are left-handed. Form a 95% confidence interval for the true proportion of left-handers.

Given n = 100 · x = 25 left-handers · $\hat{p} = \frac{25}{100} = 0.25$ · 95% confidence
  1. Table value: $z_{0.025} = 1.96$.
  2. Standard error: $\sqrt{\frac{0.25(0.75)}{100}} = \sqrt{\frac{0.1875}{100}} = 0.043301$
  3. Margin of error: $1.96 \times 0.043301 = 0.08487$
  4. Limits: $0.25 - 0.08487 = 0.1651$ and $0.25 + 0.08487 = 0.3349$.
0.1651 < P < 0.3349

Interpretation: we are 95% confident that the true percentage of left-handers in the population is between 16.51% and 33.49%. Although the interval may or may not contain the true proportion, 95% of intervals formed from samples of size 100 in this manner will contain it.

3.7 · Confidence interval for a variance — the chi-square

Sometimes the consistency of a process matters more than its average. A machine that fills bottles to 500 ml on average is no good if half of them are at 480. To put an interval around $\sigma^2$ we need a new distribution.

The chi-square is NOT symmetric — this changes how you work

With Z and t you looked up one number and used it with a $\pm$. You cannot do that here. The chi-square is skewed to the right and lives only on positive values, so the left and right critical values are different numbers and must be looked up separately: $\chi^2_{1-\alpha/2}$ and $\chi^2_{\alpha/2}$.

Worse, they land in the formula the opposite way round from your intuition: the bigger chi-square value goes in the denominator of the lower limit. Dividing by a bigger number gives a smaller result — which is exactly right, but only if you resist the urge to "fix" it.

Case I — the population mean μ is known

If $X_1,\dots,X_n$ are normal with mean $\mu$ and variance $\sigma^2$, then standardising each observation as $Y_i = \frac{x_i-\mu}{\sigma}$ gives $Y_i \sim N(0,1)$, and the sum of their squares follows a chi-square distribution with $n$ degrees of freedom:

$$ \sum Y_i^2 = \sum\left(\frac{x_i-\mu}{\sigma}\right)^2 \sim \chi^2_{(n)} $$

Starting from $P\left(\chi^2_{n,1-\alpha/2} < \frac{\sum(x_i-\mu)^2}{\sigma^2} < \chi^2_{n,\alpha/2}\right) = 1-\alpha$ and rearranging to isolate $\sigma^2$ in the middle gives the interval:

CI for σ², μ known — degrees of freedom = n
$$ \left(\frac{\sum(x_i-\mu)^2}{\chi^2_{n,\,\alpha/2}},\ \frac{\sum(x_i-\mu)^2}{\chi^2_{n,\,1-\alpha/2}}\right) $$
Σ(xᵢ−μ)² the sum of squared deviations from the known mean · df = n, not n−1, because no degree of freedom was spent estimating the mean
Worked example 4 — CI for a variance, μ known

A machine fills bottles with a known mean volume of $\mu = 500$ ml. We want to estimate the variance of the filling process. A random sample of $n = 10$ bottles yields the following volumes (in ml): 502, 495, 500, 498, 499, 501, 503, 497, 500, 501. Find the 95% confidence interval for the population variance.

Given μ = 500 ml (known) · n = 10 · 95% confidence, α = 0.05
  1. Degrees of freedom. Since μ is known, d.f. $= n = 10$.
  2. Sum of squared deviations from 500: $2^2 + (-5)^2 + 0^2 + (-2)^2 + (-1)^2 + 1^2 + 3^2 + (-3)^2 + 0^2 + 1^2$
  3. $= 4 + 25 + 0 + 4 + 1 + 1 + 9 + 9 + 0 + 1 = 52$
  4. Table values at df = 10: upper $\chi^2_{10,\,0.025} = 20.483$, lower $\chi^2_{10,\,0.975} = 3.247$.
  5. Lower limit: $\frac{52}{20.483} = 2.539$  (divide by the bigger chi-square)
  6. Upper limit: $\frac{52}{3.247} = 16.015$
(2.539, 16.015) ml²

Case II — the population mean μ is unknown

The usual situation. We use the sample variance $s^2$, and pay one degree of freedom for it:

The chi-square statistic for a variance
$$ \chi^2_{n-1} = \frac{(n-1)s^2}{\sigma^2} $$
s² the sample variance · σ² the unknown population variance · this follows a chi-square distribution with n−1 df, where $\chi^2_{n-1,\alpha}$ is defined by $P(\chi^2_{n-1} > \chi^2_{n-1,\alpha}) = \alpha$
CI for σ², μ unknown — degrees of freedom = n − 1
$$ \frac{(n-1)s^2}{\chi^2_{n-1,\,\alpha/2}} \;<\; \sigma^2 \;<\; \frac{(n-1)s^2}{\chi^2_{n-1,\,1-\alpha/2}} $$
same numerator both sides · the two different chi-square values do all the work · take square roots of both limits if the question asks about σ rather than σ²
Worked example 5 — CI for a variance, μ unknown

You are testing the speed of a batch of computer processors. You collect the following data (in MHz): sample size $n = 17$, sample mean $\bar{x} = 3004$, sample standard deviation $s = 74$. Assume the population is normal. Determine the 95% confidence interval for $\sigma_x^2$.

Given n = 17 · $\bar{x} = 3004$ MHz · s = 74 MHz · 95% confidence, α = 0.05
  1. Degrees of freedom. μ is unknown, so d.f. $= n - 1 = 16$.
  2. Table values at df = 16: $\chi^2_{16,\,0.025} = 28.85$ and $\chi^2_{16,\,0.975} = 6.91$.
  3. Numerator: $(n-1)s^2 = 16 \times 74^2 = 16 \times 5476 = 87616$.
  4. Lower limit: $\frac{87616}{28.85} = 3036.95 \approx 3037$
  5. Upper limit: $\frac{87616}{6.91} = 12679.59 \approx 12680$
3037 < σ² < 12680

Notice how lopsided that interval is around $s^2 = 5476$ — it stretches much further up than down. That asymmetry is the skew of the chi-square distribution showing through, and it is correct, not a mistake.

3.8 · Practice questions

Before computing anything, say out loud which row of the decision table you are in and why. That single habit prevents most of the errors in this chapter.

Question 1

A random sample of 100 people shows that 25 are left-handed. Form a 95% confidence interval for the true proportion of left-handers.

Given n = 100 · 25 left-handed · 95% confidence

Hint: a proportion, so no σ and no t. Convert 25/100 to a decimal first.

  1. $\hat{p} = \frac{25}{100} = 0.25$, and $z_{0.025} = 1.96$.
  2. Standard error: $\sqrt{\frac{0.25 \times 0.75}{100}} = \sqrt{0.001875} = 0.043301$
  3. Margin of error: $1.96 \times 0.043301 = 0.08487$
  4. Limits: $0.25 \mp 0.08487$ gives $0.16513$ and $0.33487$.
0.1651 < P < 0.3349
Question 2 — a 99% interval

A random sample of 700 units from a large consignment showed that 200 were damaged. Find the 99% confidence interval for the proportion of damaged units in the consignment.

Given n = 700 · x = 200 damaged · 99% confidence

Hint: 99% is not 95% — go back to the table of common confidence levels and pick the right z. Everything else is the same as Question 1.

  1. $\hat{p} = \frac{200}{700} = \frac{2}{7} = 0.285714$.
  2. For 99% confidence, $\alpha = 0.01$ so $\alpha/2 = 0.005$, and the table gives $z_{0.005} = 2.58$.
  3. Standard error: $\sqrt{\frac{0.285714 \times 0.714286}{700}} = \sqrt{\frac{0.204082}{700}} = \sqrt{0.000291545} = 0.017075$
  4. Margin of error: $2.58 \times 0.017075 = 0.044053$
  5. Limits: $0.285714 - 0.044053 = 0.241661$ and $0.285714 + 0.044053 = 0.329767$.
0.2417 < P < 0.3298
Question 3 — variance with μ known

A machine fills bottles with a known mean volume of $\mu = 500$ ml. We want to estimate the variance of the filling process. A random sample of $n = 10$ bottles yields the following volumes (in ml): 502, 495, 500, 498, 499, 501, 503, 497, 500, 501. Find the 95% confidence interval for the population variance.

Given μ = 500 ml known · n = 10 · 95% confidence

Hint: μ is known, so the degrees of freedom are n, not n − 1, and you measure deviations from 500 rather than from the sample mean.

  1. d.f. $= n = 10$ because μ is known.
  2. $\sum(X_i - 500)^2 = 4 + 25 + 0 + 4 + 1 + 1 + 9 + 9 + 0 + 1 = 52$
  3. Table values, df = 10: $\chi^2_{10,\,0.025} = 20.483$, $\chi^2_{10,\,0.975} = 3.247$.
  4. Lower: $\frac{52}{20.483} = 2.539$  ·  Upper: $\frac{52}{3.247} = 16.015$
(2.539, 16.015)
Question 4 — variance with μ unknown

You are testing the speed of a batch of computer processors. Sample size 17, sample mean 3004 MHz, sample standard deviation 74 MHz. Assume the population is normal. Determine the 95% confidence interval for $\sigma_x^2$.

Given n = 17 · $\bar{x} = 3004$ · s = 74 · 95% confidence

Hint: here μ is unknown, so df = n − 1 = 16, and the numerator is $(n-1)s^2$. Remember the bigger chi-square goes under the lower limit.

  1. d.f. $= 17 - 1 = 16$.
  2. $(n-1)s^2 = 16 \times 74^2 = 16 \times 5476 = 87616$
  3. Table values, df = 16: $\chi^2_{16,\,0.025} = 28.85$, $\chi^2_{16,\,0.975} = 6.91$.
  4. Lower: $\frac{87616}{28.85} = 3036.95 \approx 3037$
  5. Upper: $\frac{87616}{6.91} = 12679.59 \approx 12680$
3037 < σ² < 12680

Chapter recap

  • Estimator is the recipe, estimate is the number it produced this time.
  • Unbiased = right on average ($E(\hat{\theta}) = \theta$). Efficient = smallest variance among the unbiased.
  • Every interval has the same shape: point estimate ± (reliability factor × standard error).
  • Pick the row before you compute: σ known → z; σ unknown → t with n−1 df; proportion → z with $\sqrt{\hat{p}(1-\hat{p})/n}$; variance → chi-square.
  • Halve α for a two-sided interval — 1.96 for 95%, 2.58 for 99%.
  • The chi-square is skewed: two different critical values, and the bigger one sits under the lower limit.
  • The confidence is in the method, not in your one interval. Say "we are 95% confident", never "there is a 95% probability that μ is in here".
  • To narrow an interval honestly, raise n — and remember it costs 4× the data to halve the margin of error.
Chapter 4

Hypothesis Testing

By the end of this chapter you can set up H₀ and Hₐ correctly, choose the right test statistic, find the rejection region, compute a p-value, and write the conclusion in the words an examiner wants.

Chapter 3 asked "what is the parameter, roughly?" This chapter asks a sharper question: "someone claims the parameter is 50 — does my sample give me the right to call that claim wrong?" It is a formal procedure for disagreeing with a number, and it has a fixed shape you can learn once and reuse for means, proportions and variances alike.

4.1 · What a hypothesis is

Definition A hypothesis is a claim or statement about a numerical property of a population — a population parameter such as the mean $\mu$, the proportion $P$, or the variance $\sigma^2$.
Notes from the slides — types of hypotheses
  • Research hypotheses: an assertion or conjecture about a population parameter arising from practical, scientific, or managerial questions.
  • Statistical hypotheses: formal statements about population parameters expressed in mathematical terms ($H_0$ and $H_1$).
  • Examples of research hypotheses: a new drug is more effective than the current market standard; the mean assembly time for a new process is less than 50 minutes; the proportion of defective items produced by a machine is less than 0.03.
  • Statistical hypotheses are stated in terms of population parameters, not sample statistics, and are evaluated using sample data to determine whether there is sufficient evidence to reject the initial assumption.

The two hypotheses

Notes from the slides
  • Null Hypothesis ($H_0$): a statement of no difference, no effect, or status quo. It states the belief or baseline assumption about a population parameter. It is assumed to be true until proven otherwise, and may be rejected or failed to be rejected based on sample evidence.
  • Alternative Hypothesis ($H_a$ or $H_1$): the opposite of the null. It represents what the researcher tries to support or gather evidence for — it carries the burden of proof.
  • Rule for the equality sign: the equality sign ($=$, $\le$, or $\ge$) ALWAYS belongs in the null hypothesis. The alternative hypothesis NEVER contains an equality sign — it uses $\neq$, $>$, or $<$.
  • $H_0$ refers to a specified parameter value, not a sample statistic. Example: $H_0: \mu = 100$ is correct; $H_0: \bar{X} = 100$ is incorrect.
The courtroom, which is the whole idea in one picture $H_0$ is "the defendant is innocent". We start by assuming it, not because we believe it, but because it is the position that must be disproved. The prosecution ($H_a$) carries the burden of proof. If the evidence is weak we do not declare the defendant innocent — we say "not guilty", meaning we failed to prove otherwise. That is exactly the difference between rejecting $H_0$ and failing to reject it.
Never write "accept H₀"

The two legal verdicts are guilty and not guilty — never innocent. Likewise your two statistical verdicts are reject $H_0$ and fail to reject $H_0$.

"Fail to reject" means the evidence was not strong enough, which is not at all the same as proving $H_0$ true. Writing "accept $H_0$" is one of the few phrases that reliably loses marks even when every number above it is right.

Setting up the hypotheses — a method that always works
  1. Find the claim being tested or challenged, and write it with an equals sign. That is your $H_0$.
  2. Ask what the question wants evidence for. That is your $H_a$.
  3. Check: does $H_a$ contain $\neq$, $>$ or $<$? Does $H_0$ carry the equality? If not, you have them the wrong way round.

Example from the slides — testing if the population mean equals 50:   $H_0: \mu = 50$   versus   $H_a: \mu \neq 50$.

4.2 · One-tailed and two-tailed tests

Notes from the slides
  • Two-tailed test: used when $H_a$ specifies a non-directional difference ($\neq$). The rejection region is divided into both tails of the sampling distribution.
  • One-tailed test: used when $H_a$ specifies a directional difference ($>$ or $<$). The rejection region is located entirely in one tail — right-tail for $>$, left-tail for $<$.
TypeHypothesesCritical regionp-value
Right / upper tail$H_0: \mu \le \mu_0$ vs $H_a: \mu > \mu_0$$Z > Z_\alpha$$P(Z > Z_{calc})$
Left / lower tail$H_0: \mu \ge \mu_0$ vs $H_a: \mu < \mu_0$$Z < -Z_\alpha$$P(Z < Z_{calc})$
Two tail$H_0: \mu = \mu_0$ vs $H_a: \mu \neq \mu_0$$Z < -Z_{\alpha/2}$ or $Z > Z_{\alpha/2}$$2 \times P(Z > |Z_{calc}|)$
The α/2 trap A two-tailed test splits α between the two ends, so each tail gets only α/2. At $\alpha = 0.05$ the two-tailed critical value is 1.96, but the one-tailed value is 1.645. Using 1.645 for a two-tailed test makes you reject far too easily. Decide which test you are running before you look up any value.

4.3 · The six steps

Steps in Testing Hypotheses — from the slides
  1. State the null hypothesis ($H_0$) and the alternative hypothesis ($H_a$).
  2. Select the level of significance ($\alpha$) and sample size ($n$).
  3. Determine the appropriate test statistic and sampling distribution.
  4. Determine the critical value(s) and define the decision rule (or rejection region).
  5. Collect sample data, compute the sample statistic and the test statistic value.
  6. Make the statistical decision (reject $H_0$ or fail to reject $H_0$) and state the conclusion in managerial terms.
Note — the hypothesis testing process Assume $H_0$ is true → take a random sample → compute the test statistic → compare the test statistic with the critical value (or the p-value with $\alpha$) → make the decision to reject or not reject $H_0$.
Write out all six steps in the exam Structured method marks are the easiest marks in this chapter. Even if your arithmetic slips, a visible $H_0$/$H_a$, a stated α, a named test statistic, a stated critical value and a written conclusion will collect most of the credit. Step 6 in words — about the actual pizzas or batteries, not about "the null hypothesis" — is the one students most often skip.

4.4 · Significance, the rejection region, and why we reject

Notes from the slides
  • Reason for rejecting $H_0$: if the sample statistic is unlikely to occur given that $H_0$ is true, we reject $H_0$. "Unlikely" means the test statistic falls in the critical/rejection region, where the probability of occurrence under $H_0$ is very small ($\le \alpha$).
  • Level of significance, $\alpha$: defines the probability of making a Type I error (rejecting $H_0$ when $H_0$ is true). Commonly chosen values are $\alpha = 0.05$, $0.01$ or $0.10$. It is set by the researcher prior to data collection.
  • Critical region (rejection region): the set of values of the test statistic for which the null hypothesis is rejected.
  • Non-rejection region: the set of values for which $H_0$ is not rejected.
  • Critical value(s): the boundary value(s) separating the rejection region from the non-rejection region.
The logic, in one sentence Assume the claim is true, then ask: if it really were true, how freakish would my sample be? If the answer is "so freakish it would happen less than 5% of the time", we stop believing the claim. It is proof by contradiction, run on probabilities instead of certainties.
α is chosen BEFORE you see the data Picking α after seeing your test statistic — nudging it from 0.05 to 0.10 so the result "works" — destroys the meaning of the whole procedure. The slides are explicit: α is set by the researcher prior to data collection.

4.5 · The two errors, and the power of a test

Notes from the slides
  • Type I error: occurs when a true null hypothesis is rejected. Probability $= \alpha$.
  • Type II error: occurs when a false null hypothesis is not rejected. Probability $= \beta$.
  • You cannot commit both errors simultaneously in a single decision.
  • Reducing $\alpha$ increases $\beta$ for a fixed sample size $n$.
  • Increasing sample size $n$ reduces both $\alpha$ and $\beta$ risks.

Outcomes and Probabilities

Decision$H_0$ is true$H_0$ is false ($H_a$ true)
Do not reject $H_0$Correct decision  ($1-\alpha$)Type II error  ($\beta$)
Reject $H_0$Type I error  ($\alpha$)Correct decision — Power  ($1-\beta$)
Two ways to be wrong, in plain words Type I is a false alarm: the fire alarm goes off with no fire. Type II is a miss: there is a fire and the alarm stays silent. Make the alarm more sensitive and you get fewer misses but more false alarms. Make it less sensitive and the reverse. The only way to improve both at once is a better detector — which in statistics means a bigger sample.
The courtroom example, from the slides

$H_0$: the defendant is innocent  vs  $H_a$: the defendant is guilty.

  • Type I error: convicting an innocent person (rejecting a true $H_0$).
  • Type II error: acquitting a guilty person (failing to reject a false $H_0$).
  • The judicial system prioritises minimising Type I error — protecting innocent people — by setting a very high standard of proof ("beyond a reasonable doubt"), and accepts a higher Type II error risk as the price.
  • In industrial quality control the same trade-off appears as producer's risk (Type I — rejecting a good batch) versus consumer's risk (Type II — accepting a bad batch).
Power of the test
$$ \text{Power} = 1 - \beta = P(\text{Reject } H_0 \mid H_0 \text{ is false}) $$
β the probability of a Type II error · Power the probability of correctly rejecting a false null — a test's ability to detect a real effect
Note from the slides Power increases as the sample size $n$ increases, as $\alpha$ increases, or as the true parameter moves further from the hypothesised value. There is an inverse relationship between $\alpha$ and $\beta$: as $\alpha$ decreases, $\beta$ increases and vice versa, assuming the sample size $n$ remains constant.

4.6 · The p-value approach

Notes from the slides
  • p-value: the probability of obtaining a test statistic as extreme as, or more extreme than, the observed value, assuming $H_0$ is true. Also known as the observed level of significance.
  • Decision rule: reject $H_0$ if p-value $< \alpha$; fail to reject $H_0$ if p-value $\ge \alpha$.
In plain English The p-value answers: "if the claim were true, how often would I see a sample at least this extreme?" A p-value of 0.002 means "twice in a thousand" — so either something very unusual happened, or the claim is wrong. A p-value of 0.40 means "four times in ten", which is nothing remarkable at all.
"If p is low, H₀ must go" Compare the p-value directly against α. Small p, reject. And note how the tail affects the computation: a two-tailed p-value is doubled, because "as extreme" includes both directions.
What a p-value is NOT It is not the probability that $H_0$ is true. It is a probability computed assuming $H_0$ is true — you cannot turn it around. Nor does a small p-value mean the effect is large; with a big enough sample, a trivially small difference can produce a tiny p-value.

The two methods below always give the same verdict. Drag α and the test statistic and watch both readouts move together — the marker crossing into the shaded zone happens at exactly the moment the p-value drops below α.

4.7 · Testing a mean when σ is known — the Z test

Assumptions Population standard deviation $\sigma$ is known · the population is normally distributed, OR the sample size $n \ge 30$ (by the Central Limit Theorem).
Z test for a mean, σ² known
$$ Z = \frac{\bar{X} - \mu_0}{\dfrac{\sigma}{\sqrt{n}}} $$
x̄ the sample mean · μ₀ the value claimed in H₀ · σ/√n the standard error · degrees of freedom: not applicable, $Z \sim N(0,1)$
Decision rule — critical value approach
  • Two-tailed ($H_a: \mu \neq \mu_0$): reject $H_0$ if $|Z_{calc}| > Z_{\alpha/2}$.
  • Right-tailed ($H_a: \mu > \mu_0$): reject $H_0$ if $Z_{calc} > Z_\alpha$.
  • Left-tailed ($H_a: \mu < \mu_0$): reject $H_0$ if $Z_{calc} < -Z_\alpha$.
Read the formula as a sentence "How far is my sample mean from the claim, measured in standard errors?" A Z of 3 means the sample landed three standard errors away from what the claim predicted — a long way, in a world where 95% of samples land within about two.

4.8 · Testing a mean when σ is unknown — the t test

Assumptions Population standard deviation $\sigma$ is unknown, so the sample standard deviation $S$ replaces it · the population is normally distributed (or $n \ge 30$).
t test for a mean, σ² unknown
$$ t = \frac{\bar{X} - \mu_0}{\dfrac{S}{\sqrt{n}}} \qquad \text{with } df = n-1 $$
identical in shape to the Z test — only S replaces σ, and the critical value now comes from the t table with n−1 degrees of freedom
Decision rule Compare the computed $t$ with the critical value at $df = n-1$:
  • Two-tailed: reject $H_0$ if $|t| > t_{\alpha/2,\,n-1}$.
  • Right-tailed: reject $H_0$ if $t > t_{\alpha,\,n-1}$.
  • Left-tailed: reject $H_0$ if $t < -t_{\alpha,\,n-1}$.
The one question that picks the test Was the standard deviation given as a population fact, or computed from the sample? "It is known from past records that σ = 5" → Z. "The sample had a standard deviation of 5" → t. Everything else about the two procedures is identical.

4.9 · Testing a proportion

Notes from the slides
  • Tests of the population proportion evaluate claims regarding a population proportion $P$, using the sample proportion $\hat{p} = \frac{X}{n}$, where $X$ is the number of successes in $n$ trials.
  • Conditions: the sampling distribution of $\hat{p}$ is approximately normal if $nP_0 \ge 5$ and $n(1-P_0) \ge 5$.
  • Hypotheses: $H_0: P = P_0$ versus $H_a: P \neq P_0$ (or $P > P_0$, or $P < P_0$).
Z test for a proportion
$$ Z = \frac{\hat{p} - P_0}{\sqrt{\dfrac{P_0(1-P_0)}{n}}} $$
p̂ the sample proportion · P₀ the proportion claimed in H₀ · degrees of freedom: not applicable, $Z \sim N(0,1)$
Use P₀ in the denominator, not p̂

This is the single most common slip in proportion tests, and it is the one place this chapter differs from Chapter 3.

  • Testing (this chapter): the standard error uses $P_0$ — the value from $H_0$ — because the whole calculation is done in the world where $H_0$ is true.
  • Confidence interval (Chapter 3): the standard error uses $\hat{p}$, because there is no claimed value to assume.

4.10 · Testing a variance

As in Chapter 3, questions about spread use the chi-square distribution — and again the two cases differ by whether the population mean is known.

Case I — population mean μ is known

Conditions The population is normally distributed and the population mean $\mu$ is known. Hypotheses: $H_0: \sigma^2 = \sigma_0^2$ versus $H_a: \sigma^2 \neq \sigma_0^2$ (or $>$, or $<$).
Chi-square test for a variance, μ known
$$ \chi^{2} = \frac{\sum_{i=1}^{n}(X_i - \mu)^{2}}{\sigma_0^{2}} \qquad \text{with } df = n $$
Σ(Xᵢ−μ)² squared deviations from the known mean · σ₀² the variance claimed in H₀ · df = n, since no degree of freedom is lost estimating the mean
Decision rules (df = n)
  • Right-tail ($H_a: \sigma^2 > \sigma_0^2$): reject $H_0$ if $\chi^2 > \chi^2_{n,\,\alpha}$.
  • Left-tail ($H_a: \sigma^2 < \sigma_0^2$): reject $H_0$ if $\chi^2 < \chi^2_{n,\,1-\alpha}$.
  • Two-tail ($H_a: \sigma^2 \neq \sigma_0^2$): reject $H_0$ if $\chi^2 > \chi^2_{n,\,\alpha/2}$ or $\chi^2 < \chi^2_{n,\,1-\alpha/2}$.

Case II — population mean μ is unknown

Conditions The population is normally distributed and $\mu$ is unknown, estimated by the sample mean $\bar{X}$.
Chi-square test for a variance, μ unknown
$$ \chi^{2} = \frac{(n-1)S^{2}}{\sigma_0^{2}} = \frac{\sum_{i=1}^{n}(X_i-\bar{X})^{2}}{\sigma_0^{2}} \qquad \text{with } df = n-1 $$
S² the sample variance · df = n − 1, because one degree of freedom is lost estimating μ with x̄
Decision rules (df = n − 1)
  • Right-tail: reject $H_0$ if $\chi^2_{n-1} > \chi^2_{n-1,\,\alpha}$.
  • Left-tail: reject $H_0$ if $\chi^2_{n-1} < \chi^2_{n-1,\,1-\alpha}$.
  • Two-tail: reject $H_0$ if $\chi^2_{n-1} > \chi^2_{n-1,\,\alpha/2}$ or $\chi^2_{n-1} < \chi^2_{n-1,\,1-\alpha/2}$.
Two separate lookups, again Because the chi-square curve is skewed, a two-tailed variance test needs two different critical values — you cannot use $\pm$ one number. Look up $\chi^2_{\alpha/2}$ for the right boundary and $\chi^2_{1-\alpha/2}$ for the left one, from the chi-square table supplied in your exam.

4.11 · Choosing the test — one table for the whole chapter

Testing a claim about…WhenStatisticFormuladf
Mean $\mu$σ known; normal or $n \ge 30$Z$\dfrac{\bar{X}-\mu_0}{\sigma/\sqrt{n}}$—
Mean $\mu$σ unknown, only $S$t$\dfrac{\bar{X}-\mu_0}{S/\sqrt{n}}$$n-1$
Proportion $P$$nP_0 \ge 5$ and $n(1-P_0) \ge 5$Z$\dfrac{\hat{p}-P_0}{\sqrt{P_0(1-P_0)/n}}$—
Variance $\sigma^2$μ knownχ²$\dfrac{\sum(X_i-\mu)^2}{\sigma_0^2}$$n$
Variance $\sigma^2$μ unknownχ²$\dfrac{(n-1)S^2}{\sigma_0^2}$$n-1$
A worked template you can copy for any question
  1. $H_0$ and $H_a$ — parameter, not statistic; equality goes in $H_0$.
  2. α and n — and decide one- or two-tailed now.
  3. Test statistic — pick the row from the table above; state why.
  4. Critical value — state the table value exactly, e.g. "$z_{0.025} = 1.96$".
  5. Compute — substitute, show the arithmetic, get a number.
  6. Decide and conclude — reject / fail to reject, then a sentence about the real-world thing.

4.12 · The deck's worked example — computing α and β directly

Sections 4.4 and 4.5 defined α and β as areas under curves. This example, taken straight from your slides, computes both of them exactly from a binomial distribution instead — which makes the two error probabilities much more concrete than any picture can.

Worked example 1 — the biased coin (Type I and Type II error)

To test whether a coin is unbiased, it is tossed 5 times. The null hypothesis of unbiasedness is rejected if and only if more than 4 heads are obtained. Find the (i) critical region, (ii) probability of Type I error, (iii) probability of Type II error, when the corresponding probability of getting a head is 0.2.

Given n = 5 tosses · reject H₀ only if more than 4 heads · under H₀ the coin is fair · under H₁ the probability of a head is 0.2
  1. State the hypothesis. The coin being unbiased means $H_0: p = \frac{1}{2}$.
  2. Model the count. Let $X$ be the number of heads in five tosses. Under $H_0$ it is binomial: $$P(X = x \mid H_0) = \binom{n}{x}p^{x}q^{n-x} = \binom{5}{x}\left(\tfrac{1}{2}\right)^{x}\left(\tfrac{1}{2}\right)^{5-x} = \binom{5}{x}\left(\tfrac{1}{2}\right)^{5} = \tfrac{1}{32}\binom{5}{x}$$ for $x = 0, 1, \dots, 5$.
  3. (i) The critical region. We reject $H_0$ if more than 4 heads are obtained, and the only value above 4 is 5. So the critical region is $X = 5$.
  4. (ii) Type I error. This is rejecting $H_0$ while $H_0$ is true, so compute the probability of landing in the critical region with a fair coin: $$\alpha = P(\text{Reject } H_0 \mid H_0) = P(X = 5 \mid p = \tfrac{1}{2}) = \tfrac{1}{32}\binom{5}{5} = \tfrac{1}{32} = 0.03125$$
  5. (iii) Type II error. This is failing to reject $H_0$ while $H_1$ is true, so now use $p = 0.2$ — and it is easier to compute the rejection probability and subtract: $$\beta = P(\text{Accept } H_0 \mid H_1) = 1 - P(\text{Reject } H_0 \mid H_1) = 1 - P(X = 5 \mid p = 0.2)$$ $$= 1 - \binom{5}{5}(0.2)^{5} = 1 - 0.00032 = 0.99968$$
(i) X = 5  ·  (ii) α = 0.03125  ·  (iii) β = 0.99968
Read those two numbers together — this is the lesson

α is a tiny 3.1%: this test almost never convicts a fair coin. But β is a catastrophic 99.97%: if the coin really only lands heads 20% of the time, this test will fail to notice essentially every single time.

Its power is $1 - \beta = 0.00032$. The rule "reject only on 5 heads out of 5" is so cautious that it is almost incapable of detecting anything — and note that a coin biased towards tails produces fewer heads, which this right-tailed rule can never flag at all. Driving α down to near zero pushed β to near one, exactly as section 4.5 warned.

4.13 · Practice questions

These come from the setup examples in your slide deck. Getting $H_0$ and $H_a$ right is worth doing slowly — every later step inherits the mistake.

Question 1 — stating the hypotheses

A manufacturer is filling 40 oz. packages with flour. The company wants the package contents to average 40 ounces. State the null and alternative hypotheses.

Given target fill = 40 ounces · the company cares about deviation in either direction

Hint: the equality always goes in $H_0$. Would over-filling also be a problem, or only under-filling? That decides whether $H_a$ uses $\neq$ or $<$.

  1. The claim being tested is that the process is on target, which carries the equality: $H_0: \mu = 40$ oz.
  2. The company wants to detect any departure from 40 — packages that are too full waste flour, packages that are too light short the customer. So the alternative is non-directional.
  3. $H_a: \mu \neq 40$ oz.
  4. Because $H_a$ uses $\neq$, this is a two-tailed test, and α is split between both tails.
H₀: μ = 40 oz  ·  Hₐ: μ ≠ 40 oz  (two-tailed)
Question 2 — parameter, not statistic

The average number of TV sets in U.S. homes is claimed to be equal to three.

a) State $H_0$ and $H_a$ for testing this claim.
b) Your classmate writes $H_0: \bar{X} = 3$. Explain why that is wrong.

Given the claimed average is 3 TV sets per home

Hint for (b): which of $\mu$ and $\bar{X}$ do you already know the value of once you have taken your sample?

  1. (a) The claim carries the equality, so $H_0: \mu = 3$, and its opposite is $H_1: \mu \neq 3$ — the average number of TV sets is not equal to three.
  2. (b) A hypothesis is always a statement about a population parameter, never about a sample statistic.
  3. $\bar{X}$ is computed directly from your own sample — you can simply look at it, so there is nothing to test and nothing uncertain about it. If your sample gave $\bar{X} = 2.8$, then $\bar{X} = 2.8$ is a fact, not a hypothesis.
  4. $\mu$ is the unknown quantity out in the population. That is the only thing a test can be about.
(a) H₀: μ = 3 · H₁: μ ≠ 3  ·  (b) hypotheses are about the unknown parameter μ, never the observed statistic X̄
Question 3 — one-tailed or two-tailed?

For each pair of hypotheses below, say whether the test is one-tailed or two-tailed, and if one-tailed, which tail holds the rejection region.

a)  $H_0: \mu \ge 40$  versus  $H_a: \mu < 40$
b)  $H_0: P \le 0.18$  versus  $H_a: P > 0.18$
c)  $H_0: \mu = 12$  versus  $H_a: \mu \neq 12$

Hint: look only at the sign in $H_a$. It points at the rejection region.

  1. (a) $H_a$ uses $<$, a direction, so it is one-tailed — specifically left-tailed. Reject $H_0$ if the test statistic falls below $-Z_\alpha$.
  2. (b) $H_a$ uses $>$, so it is one-tailed, right-tailed. Reject $H_0$ if the statistic exceeds $+Z_\alpha$. Note this one is about a proportion, so the statistic is $Z = \frac{\hat{p}-P_0}{\sqrt{P_0(1-P_0)/n}}$ with $P_0 = 0.18$.
  3. (c) $H_a$ uses $\neq$, no direction, so it is two-tailed. Reject if $|Z| > Z_{\alpha/2}$ — and remember α is split, so at 5% the critical value is 1.96, not 1.645.
  4. Notice in (a) and (b) that $H_0$ carries $\ge$ and $\le$: the equality is still on the null side, exactly as the rule requires.
(a) one-tailed, left  ·  (b) one-tailed, right  ·  (c) two-tailed
Question 4 — the logic of rejection

A claim states that the population mean age is 50, so $H_0: \mu = 50$. A random sample is selected and the sample mean age turns out to be $\bar{X} = 20$. Explain, in the language of sampling distributions, why this leads us to reject $H_0$.

Given $H_0: \mu = 50$ · observed $\bar{X} = 20$

Hint: assume H₀ is true, then ask where 20 sits on the sampling distribution of x̄ centred at 50.

  1. Assume $H_0$ is true. Then the sampling distribution of $\bar{X}$ is centred at $\mu = 50$, with spread $\sigma/\sqrt{n}$.
  2. Locate the observation. A sample mean of 20 sits far out in the left tail of that distribution.
  3. Ask the key question. If the population mean really were 50, how likely is it that a random sample would average only 20? Very unlikely — that value lies in the rejection region, where the probability of occurrence under $H_0$ is $\le \alpha$.
  4. Draw the conclusion. Since it is unlikely we would get a sample mean of this value if in fact 50 were the population mean, we reject the null hypothesis that $\mu = 50$.
  5. Note the form of the argument: we never proved $\mu \neq 50$ directly. We showed that assuming $\mu = 50$ makes our data absurd — proof by contradiction, run on probabilities.
Reject H₀: a sample mean of 20 is too improbable under a distribution centred at 50
Where to find more numerical practice Your module 6 deck is heavy on the framework and light on fully-worked numerical tests. Two complete hypothesis tests are worked end-to-end in your correlation deck, and both follow the six-step template exactly: Chapter 5, Question 1 (a t-test for a correlation coefficient) and Question 5 (a t-test plus confidence interval for a regression slope).

Chapter recap

  • $H_0$ holds the equality ($=, \le, \ge$); $H_a$ never does ($\neq, >, <$). Both are about parameters, never about $\bar{x}$.
  • Reject or fail to reject — never "accept $H_0$".
  • The direction of $H_a$ sets the tails, and a two-tailed test splits α in half (1.96, not 1.645, at 5%).
  • Type I (α) is a false alarm; Type II (β) is a miss. They trade off at fixed $n$; only a bigger sample improves both. Power $= 1-\beta$.
  • p-value: if p < α, reject. Double it for a two-tailed test. It is not the probability that $H_0$ is true.
  • Pick the statistic from one question: mean with σ known → Z; mean with σ unknown → t (df $= n-1$); proportion → Z with $P_0$ inside the standard error; variance → χ² (df $= n$ if μ known, $n-1$ if not).
  • Always finish in words about the real situation — step 6 is worth marks on its own.
Chapter 5

Correlation and Simple Linear Regression

By the end of this chapter you can measure how tightly two variables move together, rank-correlate data that has no numbers, fit a least-squares line by hand, read what its slope means, and test whether that slope is real.

Everything so far concerned one variable at a time. Now there are two, and two new questions. Correlation asks: do these move together, and how tightly? Regression goes further and asks: given one, what is my best guess for the other? The first gives you a number between −1 and 1. The second gives you a line.

5.1 · Scatter plots — always look first

Notes from the slides
  • Correlation analysis is used to measure the strength of the association (linear relationship) between two variables.
  • Correlation is only concerned with strength of the relationship.
  • No causal effect is implied with correlation.
  • A scatter plot (or scatter diagram or dot diagram) is used to show the relationship between two variables. Scattering of points around the line represents variation.
  • If a scatter plot shows some sort of linear relationship, we can use correlation analysis to measure the strength of the linear relationship between two variables.
  • We consider the two variables equally; as a result, no causal effect is implied.
Plot before you compute The correlation coefficient only measures straight-line association. A perfect U-shaped relationship — strong, obvious, completely real — can produce $r$ near zero, because the rising half and the falling half cancel. Computing $r$ without looking at the scatter plot will eventually tell you "no relationship" about data with an unmistakable pattern.

5.2 · The correlation coefficient

Notes from the slides
  • Correlation is used to quantify the degree to which two random variables are related, provided the relationship is linear.
  • The population correlation coefficient $\rho$ (rho) measures the strength of the association between the variables.
  • The sample correlation coefficient $r$ is an estimator of $\rho$ and is used to measure the strength of the linear relationship in the sample observations.
Features of ρ and r
  • Unit free
  • Range between −1 and 1
  • The closer to −1, the stronger the negative linear relationship
  • The closer to 1, the stronger the positive linear relationship
  • The closer to 0, the weaker the linear relationship
"Unit free" is the useful part Measure height in centimetres or in inches, weight in kilograms or in pounds — $r$ does not change. It is a pure number describing shape, not size. That is exactly why it can compare relationships from completely different fields.

Why r can never escape [−1, 1] — the slides' proof

Standardise both variables first:

$$ x_i' = \frac{x_i - \bar{x}}{s_x}, \qquad y_i' = \frac{y_i - \bar{y}}{s_y} $$

In these units the correlation is simply an average product, and each standardised variable has squares summing to $n$:

$$ r = \frac{1}{n}\sum_i x_i' y_i' \qquad\text{and}\qquad \sum_i x_i'^2 = n = \sum_i y_i'^2 $$
Proof

Lower bound. A sum of squares can never be negative:

$$ \frac{1}{n}\sum_i (x_i' + y_i')^2 \ge 0 \;\Rightarrow\; \frac{1}{n}\sum x_i'^2 + \frac{1}{n}\sum y_i'^2 + \frac{2}{n}\sum x_i'y_i' \ge 0 $$ $$ \Rightarrow\; 1 + 1 + 2r \ge 0 \;\Rightarrow\; 2(1+r) \ge 0 \;\Rightarrow\; r \ge -1 $$

Upper bound. Same trick with a minus sign:

$$ \frac{1}{n}\sum_i (x_i' - y_i')^2 \ge 0 \;\Rightarrow\; 2(1-r) \ge 0 \;\Rightarrow\; r \le 1 $$

Therefore $-1 \le r \le 1$. $\blacksquare$

If you ever compute r = 1.4 You have made an arithmetic error — usually a squared term entered as unsquared in the denominator. The proof above says no data on earth can produce it.

Three formulas for the same number

Pearson's r — deviational (product-moment) form
$$ r = \frac{\sum (x-\bar{x})(y-\bar{y})}{\sqrt{\left[\sum (x-\bar{x})^2\right]\left[\sum (y-\bar{y})^2\right]}} = \frac{SS_{xy}}{\sqrt{SS_{xx}\,SS_{yy}}} $$
SSxy sum of cross-products of deviations · SSxx, SSyy sums of squared deviations · best when the means are whole numbers
Pearson's r — computational form (use this one in exams)
$$ r = \frac{n\sum xy - \sum x \sum y}{\sqrt{\left[n\sum x^2 - \left(\sum x\right)^2\right]\left[n\sum y^2 - \left(\sum y\right)^2\right]}} $$
n number of pairs · everything else is a column total from a five-column table: x, y, xy, x², y²
Pearson's r — covariance form
$$ r = \frac{Cov(X,Y)}{S_x S_y} = \frac{E(XY) - E(X)E(Y)}{S_x S_y} $$
Cov(X,Y) the covariance, which carries the units · dividing by both standard deviations is what strips the units away
Exam method Build the five-column table — $x$, $y$, $xy$, $x^2$, $y^2$ — total every column, then substitute into the computational form. It needs no means, no decimals until the very end, and it is far harder to get wrong than the deviational version.
Worked example 1 — computing Pearson's r

Calculate Pearson's product-moment correlation coefficient $r$ for the child height ($x$, in cm) and child weight ($y$, in kg) data given below.

xyxyx²y²
358280122564
499441240181
27718972949
336198108936
60137803600169
21714744149
45114952025121
51126122601144
Σ = 32173314214111713
Given n = 8 pairs · Σx = 321 · Σy = 73 · Σxy = 3142 · Σx² = 14111 · Σy² = 713
  1. Numerator: $n\sum xy - \sum x\sum y = 8(3142) - (73)(321) = 25136 - 23433 = 1703$
  2. First bracket: $n\sum y^2 - (\sum y)^2 = 8(713) - 73^2 = 5704 - 5329 = 375$
  3. Second bracket: $n\sum x^2 - (\sum x)^2 = 8(14111) - 321^2 = 112888 - 103041 = 9847$
  4. Denominator: $\sqrt{375 \times 9847} = \sqrt{3692625} = 1921.62$
  5. $r = \dfrac{1703}{1921.62} = 0.886$
r = 0.886 — a relatively strong positive linear association between height and weight

Now build your own intuition. Drag the dots below and watch $r$ move. Try to make $r$ exactly 0 while the points still clearly form a pattern — then you will never trust a bare correlation number again.

5.3 · Is the correlation real? The significance test

A sample of 8 children gave $r = 0.886$. But even two unrelated variables will show some correlation by luck in a small sample. So we test it.

Hypotheses $H_0: \rho = 0$ (no correlation)  ·  $H_A: \rho \neq 0$ (correlation exists)
Test statistic for a correlation coefficient
$$ t = \frac{r}{\sqrt{\dfrac{1-r^2}{n-2}}} \qquad \text{with } df = n-2 $$
r the sample correlation · n the number of pairs · the denominator is the standard error of r
Note from the slides Here the degrees of freedom are taken to be $n-2$ because two points can be joined by a straight line surely.
Why n − 2 and not n − 1 Any two points lie perfectly on a line — with $n = 2$ you always get $r = \pm 1$ and it means nothing. You must "spend" two observations before the data can say anything about a line at all. Everything in this chapter that involves a fitted line uses $n-2$ degrees of freedom for exactly this reason.

5.4 · Spearman's rank correlation

Notes from the slides
  • Karl Pearson's coefficient of correlation cannot be used in cases where the direct quantitative measurement of the phenomenon under study is not possible. In such situations we can use Spearman's rank correlation coefficient.
  • Spearman's rank correlation coefficient, denoted by $r_s$, measures the correlation between two paired samples of ranked data. This correlation coefficient is applied to the ranks in two paired samples (not to the original scores).
When you need this Two judges rank six paintings. There is no number for "beauty" — only positions. Pearson has nothing to work with, but Spearman does: it throws away the values and keeps only the order, then asks whether the two orderings agree.
Spearman's rank correlation — no ties
$$ r_s = 1 - \frac{6\sum d_i^{2}}{n(n^{2}-1)} $$
di the difference between the two ranks of the same item · n the number of pairs · the 6 is a constant that makes the answer land in [−1, 1]
Computation steps, from the slides
  1. List the n pairs of ranks, X and Y.
  2. Find the differences ($d_i$) between the ranks.
  3. Square these differences and add the squares ($\sum d_i^2$).
  4. Compute $r_s$.
Worked example 2 — Spearman with no ties

Six paintings were ranked by two judges. Calculate the rank correlation coefficient.

PaintingFirst judge (X)Second judge (Y)dd²
A2200
B13−24
C4400
D56−11
E6511
F3124
Σd²10
Given n = 6 · Σd² = 10
  1. $r_s = 1 - \dfrac{6\sum d^2}{n(n^2-1)} = 1 - \dfrac{6 \times 10}{6(6^2-1)}$
  2. $= 1 - \dfrac{60}{6(35)} = 1 - \dfrac{60}{210} = 1 - 0.29$
  3. $= 0.71$
rs = 0.71 — the two judges broadly agree
Check yourself $\sum d$ (not squared) must always come to zero. If it does not, you have mis-assigned a rank somewhere. Do this check before squaring.

When ranks are tied

If two items are equal, they share the average of the ranks they would have occupied — and the formula needs a correction for each group of ties.

Correction factor and the corrected coefficient
$$ C.F. = \frac{m(m^{2}-1)}{12} $$ $$ r = 1 - \frac{6}{n(n^{2}-1)}\left[\sum d_i^{2} + \sum \frac{m(m^{2}-1)}{12}\right] $$
m how many times one particular value is repeated · one C.F. term per tied group, in either variable · they are all added inside the bracket alongside Σd²
Two rules for ties
  • Average the ranks. If the value 16 occupies positions 7, 8 and 9, all three get rank $\frac{7+8+9}{3} = 8$. The next item takes rank 10 — you do not renumber.
  • One C.F. per tied group, counted separately in x and in y. Three 16s in x gives $\frac{3(9-1)}{12} = 2$; two 13s in y gives $\frac{2(4-1)}{12} = 0.5$. Miss one and the answer is quietly wrong.

5.5 · Correlation and causation

From the slides

Correlation fails to show the cause and effect between the two variables. In a bivariate distribution, if the variables have a cause-and-effect relationship, there definitely exists a high degree of correlation between these variables. But the converse may not be true for the bivariate case — that means a high degree of correlation may not guarantee a cause-effect relationship between them.

The arrow only points one way Causation ⟹ correlation. If A really drives B, they will correlate. Correlation ⇏ causation. Ice-cream sales correlate with drowning deaths; neither causes the other, summer causes both. A high $r$ is evidence that something is going on — not evidence of what.

5.6 · The simple linear regression model

Notes from the slides
  • Regression analysis is used to: predict the value of a dependent variable based on the value of at least one independent variable; explain the impact of changes in an independent variable on the dependent variable; and controlling.
  • Regression can be a powerful tool for addressing three important practical questions: prediction, isolating the effect of a single predictor, and understanding multiple predictors.
  • Dependent / response variable: the variable we wish to explain. In simple linear regression it is always a continuous variable.
  • Independent / explanatory variable: the variable used to explain the dependent variable. In linear regression it could have any measurement scale.
  • Only one independent variable, x; the relationship between x and y is described by a linear function; changes in y are assumed to be caused by changes in x.
Population linear regression model
$$ y = \beta_0 + \beta_1 x + \epsilon $$
β₀ the population y-intercept · β₁ the population slope · x the independent variable · ε the random error term, everything about y that x cannot explain
Estimated (sample) regression line
$$ \hat{y}_i = b_0 + b_1 x \qquad\text{or, in the notation your slides also use,}\qquad y = a + bx $$
ŷ the predicted y · b₀ (or a) the estimated intercept · b₁ (or b) the estimated slope · the sample line estimates the population line
Greek versus Latin — worth two seconds every time $\beta_0, \beta_1$ are the true, unknown population values. $a, b$ (or $b_0, b_1$) are what you computed from your sample. The whole of section 5.11 exists to ask: is the $b_1$ I computed far enough from zero to believe $\beta_1$ isn't zero?
Assumptions — the "LINE" conditions
  • The relationship between the two variables x and y is Linear
  • Independent observations
  • Error values are Normally distributed for any given value of x
  • The probability distribution of the errors has Equal variance
  • Fixed independent variables (not random, non-stochastic, given values, deterministic) — the only randomness in the values of Y comes from the error term
  • No autocorrelation of the errors
  • No outlier distortion

5.7 · Least squares and the normal equations

Infinitely many lines could be drawn through a scatter of points. Least squares picks one rule: make the total squared vertical miss as small as possible.

The least squares criterion
$$ \Phi(a,b) = \sum e_i^{2} = \sum (y_i - \hat{y}_i)^{2} = \sum \left(y_i - (a + bx_i)\right)^{2} $$
ei the residual, observed minus predicted · we choose a and b to make this total as small as possible
Why square the errors? Squaring does two jobs at once. It makes every miss positive, so overshoots and undershoots cannot cancel into a fake "perfect" fit. And it punishes big misses far more than small ones — being off by 4 costs sixteen times as much as being off by 1 — so the line is pulled hard away from leaving any point badly stranded.

Setting both partial derivatives to zero, $\frac{\partial \Phi}{\partial a} = 0$ and $\frac{\partial \Phi}{\partial b} = 0$, gives

$$ \sum 2(y_i - a - bx_i)(-1) = 0, \qquad \sum 2(y_i - a - bx_i)(-x_i) = 0 $$

which tidy up into the two normal equations:

The normal equations
$$ \sum y_i = na + b\sum x_i $$ $$ \sum x_i y_i = a\sum x_i + b\sum x_i^{2} $$
two linear equations in the two unknowns a and b · solve them simultaneously and you have your line
Solved directly for the slope and intercept
$$ b = \frac{n\sum xy - \sum x\sum y}{n\sum x^{2} - \left(\sum x\right)^{2}} = \frac{Cov(x,y)}{Var(x)} \qquad\qquad a = \bar{y} - b\bar{x} $$
compute b first, always · then a follows from the means · note the numerator of b is the same numerator as in r
Two ways to be asked the same thing If the question gives you the raw pairs and $n$ is tiny, forming and solving the normal equations (as in Worked example 3) is quick and shows full method. If the question hands you $\sum x, \sum y, \sum xy, \sum x^2$ (as in Worked example 4), go straight to the direct formulas. Both give identical answers.
Worked example 3 — fitting a line via the normal equations

Assume $f(x) = a + bx$. Find the linear regression line for the following data:   $x$: 1, 2, 3  ·  $y$: 5.1, 5.9, 6.3

ixᵢyᵢxᵢ²xᵢyᵢ
115.115.1
225.9411.8
336.3918.9
Σ617.31435.8
Given n = 3 · Σx = 6 · Σy = 17.3 · Σx² = 14 · Σxy = 35.8
  1. Form the normal equations:   (1) $3a + 6b = 17.3$    (2) $6a + 14b = 35.8$
  2. Multiply (1) by 2: $6a + 12b = 34.6$
  3. Subtract from (2): $(6a+14b) - (6a+12b) = 35.8 - 34.6 \Rightarrow 2b = 1.2 \Rightarrow b = 0.60$
  4. Substitute into (1): $3a + 6(0.60) = 17.3 \Rightarrow 3a + 3.6 = 17.3 \Rightarrow 3a = 13.7$
  5. $a = 4.5667$
ŷ = 4.5667 + 0.60x

5.8 · Two regression lines, and r as their geometric mean

Regressing $y$ on $x$ minimises vertical misses. Regressing $x$ on $y$ minimises horizontal misses. These are different questions, so they give different lines.

The two regression equations
$$ \text{Y on X:}\quad y - \bar{y} = b_{yx}(x - \bar{x}), \qquad b_{yx} = \frac{Cov(x,y)}{Var(x)} = r\frac{S_y}{S_x} $$ $$ \text{X on Y:}\quad x - \bar{x} = b_{xy}(y - \bar{y}), \qquad b_{xy} = \frac{Cov(x,y)}{Var(y)} = r\frac{S_x}{S_y} $$
byx used when predicting y from x · bxy used when predicting x from y · both pass through the point of means
r is the geometric mean of the two regression coefficients
$$ b_{yx} \times b_{xy} = r\frac{S_y}{S_x} \times r\frac{S_x}{S_y} = r^{2} \qquad\Rightarrow\qquad r = \pm\sqrt{b_{yx}\,b_{xy}} $$
take the positive root if both regression coefficients are positive, the negative root if both are negative — they always share a sign
Note from the slides The intersection point of the two regression lines is $(\bar{x}, \bar{y})$ — that is, the mean. The point of intersection of the regression lines gives the mean, because both lines pass through this common point; therefore it is the solution of both equations.
Free marks If a question gives you both regression lines and asks for the means, do not hunt for data — just solve the two line equations simultaneously. The answer is $(\bar{x},\bar{y})$. And if it gives both lines and asks for $r$, take $\pm\sqrt{b_{yx}b_{xy}}$.

5.9 · Interpreting the slope and the intercept

Notes from the slides
  • $a$ is the estimated average value of $y$ when the value of $x$ is zero (provided that $x$ is inside the data range considered).
  • Otherwise, it shows the portion of the variability of the dependent variable left unexplained by the independent variable considered.
  • $b$ is the estimated change in the average value of $y$ as a result of a one-unit change in $x$.
Say "on average", and stay inside the data

The slope is an average change, not a promise about any individual. And an intercept at $x = 0$ is meaningless when no observation was anywhere near zero — you would be extrapolating far outside the data. That is exactly why the slides describe such an intercept as "the portion of the variability left unexplained" rather than as a real prediction.

Worked example 4 — estimating and interpreting a and b

A researcher wishes to examine the relationship between the amount of the daily average diet taken by a cohort of 20 sample children and the weight gained by them in one month (both measured in kg). The content of the food is the same for all of them.

Dependent variable ($y$) = weight gained in one month, in kg. Independent variable ($x$) = average weight of diet taken per day by a child, in kg.

Given n = 20 · Σx = 20.35 · Σy = 16.27 · Σxy = 17.58 · Σx² = 22.30
  1. Means: $\bar{x} = \frac{20.35}{20} = 1.0175$ and $\bar{y} = \frac{16.27}{20} = 0.8135$
  2. Slope numerator: $n\sum xy - \sum x \sum y = 20(17.58) - (20.35)(16.27) = 351.6 - 331.0945 = 20.5055$
  3. Slope denominator: $n\sum x^2 - (\sum x)^2 = 20(22.30) - (20.35)^2 = 446 - 414.1225 = 31.8775$
  4. $b = \dfrac{20.5055}{31.8775} = 0.643$
  5. $a = \bar{y} - b\bar{x} = 0.8135 - 0.643(1.0175) = 0.160$
Weight gained = 0.160 + 0.643 (food weight)

Interpretation, as the slides give it:

  • Intercept ($a = 0.160$): no child has had 0 kg of food per day, so for foods within the range of sizes observed, 0.160 kg is the portion of the weight gained not explained by food.
  • Slope ($b = 0.643$): the average weight of a child increases by 0.643 kg, on average, for each additional one kilogram of food taken each day.

5.10 · Explained and unexplained variation, and R²

How good is the line? Compare it against the dumbest possible predictor: ignoring $x$ entirely and always guessing $\bar{y}$.

The decomposition of variation
$$ SST = SSR + SSE $$ $$ SST = \sum (y-\bar{y})^{2} \qquad SSR = \sum (\hat{y}-\bar{y})^{2} \qquad SSE = \sum (y-\hat{y})^{2} $$
SST total variation of y about its own mean · SSR the part the line explains · SSE the part still left over, the residuals
In plain English SST is how wrong you are guessing $\bar{y}$ every time. SSE is how wrong you still are after using the line. SSR is the improvement — the amount of wrongness the line removed. They must add up, because the line either explained a bit of variation or it did not.
Notes from the slides
  • The coefficient of determination is the portion of the total variation in the dependent variable that is explained by variation in the independent variable.
  • The coefficient of determination is also called R-squared and is denoted as R².
  • The F-test tests the statistical significance of the regression of the dependent variable on the independent variable: $H_0: \beta = 0$.
  • The reliability of the regression equation is very commonly measured by the correlation coefficient R. Equivalently one can check the statistical significance of R or R² using the F-test and reach exactly the same F-value as the model coefficients' test.
Coefficient of determination
$$ R^{2} = \frac{SSR}{SST}, \qquad 0 \le R^{2} \le 1 \qquad\text{and for one independent variable}\qquad R^{2} = r^{2} $$
R² the fraction of y's variation explained by x · read it as a percentage
Reading R² out loud, and a sign warning

$R^2 = 0.785$ means "78.5% of the variation in weight is explained by variation in height". That is the sentence an examiner wants.

And note the direction of $R^2 = r^2$: going from $r$ to $R^2$ is safe, but going back is not — $R^2 = 0.64$ means $r = +0.8$ or $r = -0.8$. Squaring destroys the sign, so take it from the slope.

5.11 · Inference about the slope

Your fitted slope $b_1$ will essentially never be exactly zero, even for unrelated variables. So we test whether it is far enough from zero to be believed.

Hypotheses, from the slides Is there a linear relationship between x and y?   $H_0: \beta_1 = 0$ (no linear relationship)  ·  $H_1: \beta_1 \neq 0$ (a linear relationship does exist)
t-test for the population slope
$$ t = \frac{b_1 - \beta_1}{s_{b_1}} \qquad \text{with } df = n-2 $$
b₁ your sample slope · β₁ the hypothesised slope, almost always 0 · sb₁ the standard error of the slope, read off the software output
Confidence interval for the slope
$$ b_1 \pm t_{\alpha/2,\,n-2}\; s_{b_1} $$
same shape as every interval in Chapter 3: estimate ± (critical value × standard error)
The interval and the test always agree If the 95% confidence interval for $\beta_1$ excludes 0, then the two-tailed test at $\alpha = 0.05$ rejects $H_0$. They are two views of the same calculation, so if your interval excludes zero but your test fails to reject, you have made an arithmetic error somewhere.

5.12 · Practice questions

The rank-correlation questions are where the marks leak: assign ranks carefully, check $\sum d = 0$, and never forget a correction factor.

Question 1 — is the correlation significant?

Is there evidence of a linear relationship between child height and weight at the 0.05 level of significance?

Given α = 0.05 · n = 8 · r = 0.886 · $H_0: \rho = 0$ · $H_1: \rho \neq 0$

Hint: df = n − 2, and the test is two-tailed, so look up the α/2 = 0.025 column.

  1. Degrees of freedom: $df = n - 2 = 8 - 2 = 6$.
  2. Test statistic: $t = \dfrac{r}{\sqrt{\frac{1-r^2}{n-2}}} = \dfrac{0.886}{\sqrt{\frac{1-0.886^2}{6}}}$
  3. $= \dfrac{0.886}{\sqrt{\frac{1-0.7850}{6}}} = \dfrac{0.886}{\sqrt{\frac{0.2150}{6}}} = \dfrac{0.886}{0.1893} = 4.68$
  4. Critical value: two-tailed, α/2 = 0.025, df = 6, so $t_{0.025,\,6} = 2.447$.
  5. Decision: observed $4.68 > 2.447$, so reject $H_0$.
t = 4.68 > 2.447 → reject H₀: correlation exists between height and weight at the 5% level of significance
Question 2 — rank correlation with ties

Find the rank correlation coefficient for the following data:

x4833409161665241657
y1313246154209619
Given n = 10 pairs · ties in both x and y

Hint: 16 appears three times in x; 13 and 6 each appear twice in y. That is three correction factors, not one.

  1. Assign ranks, averaging ties. In x, 16 occupies positions 7, 8, 9 → all get rank 8. In y, 13 occupies 5, 6 → 5.5 each; 6 occupies 8, 9 → 8.5 each.
  2. $R_x$: 3, 5, 4, 10, 8, 8, 1, 6, 8, 2  ·  $R_y$: 5.5, 5.5, 1, 8.5, 4, 10, 2, 7, 8.5, 3
  3. $d$: −2.5, −0.5, 3, 1.5, 4, −2, −1, −1, −0.5, −1  (check: these sum to 0 ✓)
  4. $d^2$: 6.25, 0.25, 9, 2.25, 16, 4, 1, 1, 0.25, 1 → $\sum d^2 = 41$
  5. Correction factors. x-value 16 with m = 3: $\frac{3(9-1)}{12} = 2$. y-value 13 with m = 2: $\frac{2(4-1)}{12} = 0.5$. y-value 6 with m = 2: $0.5$. Total C.F. = 3.
  6. $r = 1 - \dfrac{6}{10(10^2-1)}\left[41 + 3\right] = 1 - \dfrac{6(44)}{990} = 1 - \dfrac{264}{990} = 1 - \dfrac{4}{15}$
  7. $= \dfrac{11}{15} = 0.7333$
r = 0.7333
Question 3 — ranking from marks

A group of eight students get the following percentage of marks in a test of statistics and mathematics. Find the rank correlation coefficient.

Roll No.% Marks in Statistics% Marks in Mathematics
15080
26071
36560
47075
57590
64082
77070
88050
Given n = 8 · statistics marks 70 appear twice

Hint: rank the marks (highest = rank 1), average the tied pair, and remember the single correction factor. The answer is negative — do not "fix" it.

  1. Ranks (highest mark = rank 1), averaging ties. Statistics: 70 appears twice, taking positions 3 and 4 → both get 3.5.
  2. $R_x$: 7, 6, 5, 3.5, 2, 8, 3.5, 1  ·  $R_y$: 3, 5, 7, 4, 1, 2, 6, 8
  3. $d = R_x - R_y$: 4, 1, −2, −0.5, 1, 6, −2.5, −7  (sum = 0 ✓)
  4. $d^2$: 16, 1, 4, 0.25, 1, 36, 6.25, 49 → $\sum d^2 = 113.5$
  5. Correction factor. Statistics value 70 with m = 2: $\frac{2(4-1)}{12} = 0.5$.
  6. $r_s = 1 - \dfrac{6\left[113.5 + 0.5\right]}{8(8^2-1)} = 1 - \dfrac{6(114)}{8(63)} = 1 - \dfrac{684}{504}$
  7. $= 1 - 1.35714 = -0.357$
rs = −0.357 — a moderate negative rank correlation: students who did well in statistics tended to do worse in mathematics
Question 4 — both regression lines and r

Find the regression equations of both $Y$ on $X$ and $X$ on $Y$ from the data given below. Hence find the correlation coefficient.

X1520253035
Y1214182531
Given n = 5

Hint: the means are whole numbers here, so the deviational method is fastest. Build columns for $(X-\bar{x})$, $(Y-\bar{y})$, their squares, and their product.

  1. Means: $\bar{x} = \frac{125}{5} = 25$, $\bar{y} = \frac{100}{5} = 20$.
  2. $\sum(X-\bar{x})^2 = 100+25+0+25+100 = 250$
  3. $\sum(Y-\bar{y})^2 = 64+36+4+25+121 = 250$
  4. $\sum(X-\bar{x})(Y-\bar{y}) = 80+30+0+25+110 = 245$
  5. Regression coefficients: $b_{yx} = \frac{245}{250} = 0.98$ and $b_{xy} = \frac{245}{250} = 0.98$.
  6. Y on X: $Y - 20 = 0.98(X - 25) \Rightarrow Y = 20 - 24.5 + 0.98X$, so $Y = -4.5 + 0.98X$.
  7. X on Y: $X - 25 = 0.98(Y - 20) \Rightarrow X = 25 - 19.6 + 0.98Y$, so $X = 5.4 + 0.98Y$.
  8. $r = \pm\sqrt{b_{yx}b_{xy}} = \sqrt{0.98 \times 0.98} = 0.98$, positive because both coefficients are positive.
Y = −4.5 + 0.98X  ·  X = 5.4 + 0.98Y  ·  r = 0.98
Question 5 — testing the slope, and its confidence interval

Using the child weight-gain model (Weight gained $= 0.160 + 0.643\,($food weight$)$, sample size $n = 20$), the MS-Excel output gives:

ModelCoefficient BStd. Errort StatSig. (P-value)
(Constant)0.1600.0772.065.054
Food weight0.6430.0738.7720.000

a) Test whether daily food weight affects children's weight ($H_0: \beta_1 = 0$ vs $H_1: \beta_1 \neq 0$) at $\alpha = 0.05$.
b) Construct a 95% confidence interval for the population slope $\beta_1$.

Given n = 20 · $b_1 = 0.643$ · $s_{b_1} = 0.073$ · $\beta_1 = 0$ under H₀ · α = 0.05

Hint: df = n − 2 = 18. For part (b), the interval is the estimate plus or minus the same critical t times the same standard error — and check whether it contains 0.

  1. (a) Test statistic. $t = \dfrac{b_1 - \beta_1}{s_{b_1}} = \dfrac{0.643 - 0}{0.073} = 8.772$
  2. Degrees of freedom: $df = n - 2 = 20 - 2 = 18$.
  3. Critical value: $t_{0.025,\,18} = 2.101$.
  4. Decision: $8.772 > 2.101$, so reject $H_0$. There is sufficient evidence that the food weight taken per day affects children's weight.
  5. (b) Confidence interval. $b_1 \pm t_{\alpha/2,\,n-2}\,s_{b_1} = 0.643 \pm (2.101)(0.073) = 0.643 \pm 0.153$
  6. Limits: $0.643 - 0.153 = 0.489$ and $0.643 + 0.153 = 0.796$.
t = 8.772 → reject H₀  ·  95% CI for β₁ = (0.489, 0.796)
The two answers agree, as they must The interval (0.489, 0.796) does not include 0 — which is the same verdict as the test rejecting $H_0: \beta_1 = 0$. Notice also the P-value column: 0.000 for food weight (reject) versus 0.054 for the constant (do not reject at 5%). Three routes, one conclusion.

Chapter recap

  • Always draw the scatter plot first — $r$ only sees straight lines and is blind to curves.
  • Pearson's r: use the computational form with the five-column table. It is unit free and trapped in [−1, 1].
  • Test a correlation with $t = r / \sqrt{(1-r^2)/(n-2)}$ on $n-2$ degrees of freedom.
  • Spearman for ranks: $r_s = 1 - \frac{6\sum d^2}{n(n^2-1)}$, check $\sum d = 0$, and add a $\frac{m(m^2-1)}{12}$ correction for every tied group in both variables.
  • Correlation ⇏ causation, though causation does imply correlation.
  • Least squares minimises the squared vertical misses; solve the normal equations, or use $b = \frac{n\sum xy - \sum x \sum y}{n\sum x^2 - (\sum x)^2}$ and $a = \bar{y} - b\bar{x}$.
  • Two lines, one crossing point: they always meet at $(\bar{x}, \bar{y})$, and $r = \pm\sqrt{b_{yx}b_{xy}}$.
  • SST = SSR + SSE and $R^2 = SSR/SST = r^2$ — the share of y's variation the line explains.
  • Slope inference uses $t = (b_1-\beta_1)/s_{b_1}$ with $n-2$ df; the CI excluding 0 and the test rejecting $H_0$ always agree.
Appendix

Statistical Tables

The tables you are allowed in the exam. The Z-table below is computed live, so it is exact to four decimals.

A1 · Standard Normal (Z) Table

Each cell is the area to the LEFT of $z$, i.e. $P(Z \le z) = \Phi(z)$. Find your $z$ to one decimal down the left column, then the second decimal across the top. Example: $z = 1.96 \Rightarrow$ row 1.9, column 0.06 $\Rightarrow 0.9750$.

How to use it backwards For a right-tail area, use $P(Z > z) = 1 - \Phi(z)$. For a middle area between $-z$ and $z$, use $2\Phi(z) - 1$. To find the $z$ for a given tail (e.g. 2.5% in the right tail), hunt inside the table for the area $0.9750$ and read off $z = 1.96$.

A1b · Standard Normal — "Area from 0 to z" Table

This is the version your lecture slides use. Each cell gives $P(0 \le Z \le z)$ — the area between the centre line and $z$. The largest value in this table is about $0.5$, never close to 1. Example: $z = 1.56 \Rightarrow$ row 1.5, column 0.06 $\Rightarrow 0.4406$.

Converting between the two tables For positive $z$:  $\Phi(z) = 0.5 + \text{(this table)}$  and  $\text{this table} = \Phi(z) - 0.5$. That single line is why the slide solutions keep adding and subtracting 0.5 — they are working from this table, not the cumulative one.

A2 · Student's t Critical Values

Row = degrees of freedom. Column = area in one tail. For a two-tailed test at $\alpha = 0.05$, use the $t_{0.025}$ column.

A3 · Every Formula on One Page