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.
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:
We write this as $X \sim N(\mu, \sigma^2)$, read aloud as "X is normally distributed with mean mu and variance sigma squared".
- $-\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
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.
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:
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$.
- 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.
1.3 · Reading the Z-table (do this slowly, once)
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.
- Split your z at the decimal: $1.56 \rightarrow 1.5$ and $0.06$.
- Go down the left-hand column to the row labelled
1.5. - Go across the top to the column labelled
.06. - 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 want | Do this | Why |
|---|---|---|
| $P(0 \le Z \le a)$ | read the table directly | this 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 |
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:
1.5 · Sampling distributions
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.
- 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
$\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.
- 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.
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}$.
- 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.
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:
1.7 · Worked example from the slides
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?
Part (a) — one single pizza
- Name the tool. This is about one individual pizza, so we divide by $\sigma$ itself, not by the standard error.
- Standardise: $Z = \dfrac{15.5 - 16}{0.8} = \dfrac{-0.5}{0.8} = -0.625$
- Table lookup: $P(Z < -0.62) = 0.2676$ and $P(Z < -0.63) = 0.2643$. Interpolating at the midpoint $-0.625$ gives $0.2660$.
- So $P(X < 15.5) = 0.2660$.
Part (b) — the average of two pizzas
- Name the tool. Now it is an average, so the spread we need is the standard error, not σ.
- Standard error: $\sigma_{\bar{x}} = \dfrac{0.8}{\sqrt{2}} = 0.565685$
- Standardise: $Z = \dfrac{15.5 - 16}{0.565685} = -0.8839$
- Table lookup: $P(Z < -0.88) = 0.1894$, $P(Z < -0.89) = 0.1867$; interpolated at $-0.8839$ gives $0.1884$.
Part (c) — the average of four pizzas
- Standard error: $\sigma_{\bar{x}} = \dfrac{0.8}{\sqrt{4}} = \dfrac{0.8}{2} = 0.4$
- Standardise: $Z = \dfrac{15.5 - 16}{0.4} = -1.25$
- Table lookup: $P(Z < -1.25) = 0.1056$.
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.
Finding probabilities using the standard normal distribution: find $P(0 < Z < 1.56)$.
Hint: this is the plain Type A table lookup — no conversion needed at all.
- Identify the Z-score: $z = 1.56$.
- Split it: row $1.5$, column $.06$.
- Read the area straight off the table: $P(0 \le Z \le 1.56) = 0.4406$.
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$
Hint: for (c) and (d), remember the whole right half of the curve is 0.5. Sketch each one before computing.
- (a) Straight lookup: $P(0 < Z < 0.96) = 0.3315$.
- (b) By symmetry $P(-1.45 < Z < 0) = P(0 < Z < 1.45) = 0.4265$.
- (c) Split at the middle: $P(Z > -0.35) = P(-0.35 < Z < 0) + P(Z > 0) = 0.1368 + 0.5 = 0.6368$.
- (d) The complement of (c): $P(Z < -0.35) = 1 - 0.6368 = 0.3632$.
- (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$.
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)$
Hint: convert each X to a Z first, then decide which of the four table situations you are in.
- (i) At $X = 20$: $Z = \dfrac{20-12}{4} = 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$.
- (ii) At $X = 0$: $Z = \dfrac{0-12}{4} = -3$. At $X = 12$: $Z = \dfrac{12-12}{4} = 0$.
- $P(0 \le X \le 12) = P(-3 \le Z \le 0) = P(0 \le Z \le 3) = 0.4986$ by symmetry.
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$
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.
- (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$.
- (ii) $Z = \dfrac{45-30}{5} = 3$, so $P(X \ge 45) = 0.5 - 0.49865 = 0.0013$.
- (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)$.
- By symmetry that is $2 \times P(0 \le Z \le 1) = 2 \times 0.3413 = 0.6826$.
- Therefore $P(|X-30| > 5) = 1 - 0.6826 = 0.3174$.
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$
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$.
- (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$.
- (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$.
- (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$.
- So $z_3 = -1.36$ and $x_3 = 12 + 4(-1.36) = 6.56$.
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?
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%.
- (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$.
- (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$.
- (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$.
- $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$).
- $x_1 = 662 + 1.28(32) = 662 + 40.96 = 702.96$ kilos.
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?
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$.
- Stage 1 — find p. At $X = 70$: $Z = \dfrac{70-65}{5} = 1.0$.
- $p = P(X > 70) = 0.5 - P(0 \le Z \le 1.0) = 0.5 - 0.3413 = 0.1587$.
- 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}$.
- $P(Y=2) = \binom{3}{2}(0.1587)^2(0.8413)^{1} = 3 \times 0.025186 \times 0.8413$
- $= 0.06356 \approx 0.0635$.
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?
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.
- (i) $Z = \dfrac{15-20}{5} = -1.0$. $P(X<15) = 0.5 - 0.3413 = 0.1587$ → $100 \times 0.1587 = 15.87$ cells.
- (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.
- (iii) $P(X > 15) = 0.5 + 0.3413 = 0.8413$ → $84.13$ cells. Notice this is just $100 - 15.87$.
- (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.
- (v) $Z = \dfrac{30-20}{5} = 2.0$. $P(X>30) = 0.5 - 0.4772 = 0.0228 \approx 0.0227$ → $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.
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.
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.
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".
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.
The proof from your slides
Worth reading once, because it is short and it may be asked directly.
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$
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?
- Part (i) — name the tool. "Exceeds" means a tail probability, so we want $P(X > 2) = e^{-\lambda x}$.
- 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}$
- $e^{-1} = 0.3679$
- 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.
- By memorylessness, $P(X \ge 10 \mid X > 9) = P(X \ge 9+1 \mid X>9) = P(X \ge 1)$.
- $P(X \ge 1) = \int_1^\infty \frac{1}{2}e^{-x/2}dx = e^{-0.5} = 0.6065$
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
Chebyshev's inequality — uses the variance too
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.
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%.
- Name the tool. We know only the mean, and the variable is non-negative — that is exactly Markov's situation.
- $P(X \ge k) \le \frac{E(X)}{k}$
- Substitute: $P(X \ge 90) \le \frac{70}{90} = \frac{7}{9}$
- $= 0.7778$
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$.
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?
Hint: convert to minutes before you compute λ. Then notice "given he has already waited" — that is the memoryless cue.
- Convert units first. $E(X) = 45$ seconds $= \frac{45}{60} = 0.75$ minutes.
- Find λ. $\lambda = \frac{1}{E(X)} = \frac{1}{0.75} = \frac{4}{3}$ per minute.
- Apply memorylessness. We want $P(X > 5 \mid X > 2)$. The extra time is $5 - 2 = 3$ minutes, so this equals $P(X > 3)$.
- $P(X > 3) = e^{-\lambda x} = e^{-\frac{4}{3}(3)} = e^{-4}$
- $e^{-4} = 0.0183156 \approx 0.0183$
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?
Hint: "fail during its first 50,000" means it happens by 50,000 — that is the CDF, not the tail.
- Find λ. $E(X) = \frac{1}{\lambda} = 100000 \implies \lambda = \frac{1}{100000}$.
- Name the tool. "Fails during the first 50,000" is $P(X \le 50000)$, so use $F(x) = 1 - e^{-\lambda x}$.
- $P(X \le 50000) = \int_0^{50000}\frac{1}{100000}e^{-x/100000}dx = 1 - e^{-\frac{50000}{100000}} = 1 - e^{-0.5}$
- $= 1 - 0.60653 = 0.39347 \approx 0.3935$
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?
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.
- (i) "Already in operation for its mean life" means it has survived 10,000 hours. We want $P(X \le 15000 \mid X > 10000)$.
- Work with survival first: $P(X > 10000+5000 \mid X > 10000) = P(X > 5000)$ by memorylessness.
- $P(X > 5000) = e^{-5000/10000} = e^{-0.5} = 0.6065$
- Failing is the complement: $P(X \le 15000 \mid X>10000) = 1 - 0.6065 = 0.3935$.
- (ii) $P(X > 15000+5000 \mid X > 15000) = P(X > 5000) = e^{-0.5} = 0.6065$.
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.
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.
- Set up. $E(X) = np = 200 \times 0.20 = 40$ heads. $Var(X) = np(1-p) = 200 \times 0.20 \times 0.80 = 32$.
- 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$.
- 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)$.
- Here $k\sigma = 80$, so $(k\sigma)^2 = 80^2 = 6400$.
- $P(|X-40| \ge 80) \le \frac{Var(X)}{(k\sigma)^2} = \frac{32}{6400} = \frac{1}{200} = 0.005$
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)$.
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.
- Part 1 — re-centre. $-4 < X < 20$. Subtract 8 throughout: $-12 < X - 8 < 12$, which is exactly $|X - 8| < 12$.
- Find k. $k\sigma = 12$ and $\sigma = 3$, so $k = 4$.
- This is a "close in" question, so use the lower-bound form: $P(|X-\mu| < k\sigma) \ge 1 - \frac{1}{k^2}$.
- $P(|X-8| < 12) \ge 1 - \frac{1}{16} = \frac{15}{16} = 0.9375$
- Part 2. $|X - 8| \ge 6$ gives $k\sigma = 6$, $\sigma = 3$, so $k = 2$.
- This is a "far away" question, so use the upper-bound form: $P(|X-8| \ge 6) \le \frac{1}{2^2} = 0.25$.
A random variable $X$ with probability distribution is given below. Find the mean and variance of this distribution.
| X | −2 | −1 | 0 | 1 | 2 |
|---|---|---|---|---|---|
| f(x) | 0.1 | 0.15 | 0.2 | 0.4 | 0.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.
- Mean. $E(X) = \sum x f(x) = (-2)(0.1) + (-1)(0.15) + (0)(0.2) + (1)(0.4) + (2)(0.15)$
- $= -0.2 - 0.15 + 0 + 0.4 + 0.3 = 0.35$
- 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)$
- $= 0.4 + 0.15 + 0 + 0.4 + 0.6 = 1.55$
- Variance. $Var(X) = E(X^2) - [E(X)]^2 = 1.55 - (0.35)^2 = 1.55 - 0.1225 = 1.4275$
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.
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
- 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
| Term | What it means | Example |
|---|---|---|
| Population | The totality of the observations with which we are concerned | every student in India |
| Sample | A subset of the population | the 200 students you surveyed |
| Statistic | A function of the sample random variables containing no unknown parameters | $\bar{X}$, $S^2$ |
| Estimator | A statistic $\hat{\theta}$ used to estimate an unknown parameter $\theta$ — it is a random variable, a recipe | "take the sample mean" |
| Estimate | A specific value of that estimator, obtained from one actual sample — a number | $\bar{x} = 2.20$ |
- Estimation — we estimate one or more parameters using sample statistics. It comes in two types: (a) point estimation, (b) interval estimation. This chapter.
- 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
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 parameter | Point estimate (sample statistic) |
|---|---|
| Mean $\mu$ | $\bar{X}$ |
| Proportion $P$ | $\hat{p}$ |
| Variance $\sigma^2$ | $S^2$ |
Unbiasedness
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$.
Efficiency
Unbiasedness alone is not enough — several estimators can all be unbiased. Among them we prefer the one that scatters least.
3.3 · Interval estimation, and what confidence really means
- 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%.
"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."
- 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 want | What you know | Use | Formula |
|---|---|---|---|
| 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:
- Population variance $\sigma^2$ is known.
- Population is normally distributed.
- If the population is not normal, use a large sample ($n \ge 30$).
- 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$).
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$.
| Confidence level | Confidence coefficient, 1 − α | $z_{\alpha/2}$ |
|---|---|---|
| 80% | .80 | 1.28 |
| 90% | .90 | 1.645 |
| 95% | .95 | 1.96 |
| 98% | .98 | 2.33 |
| 99% | .99 | 2.58 |
| 99.8% | .998 | 3.08 |
| 99.9% | .999 | 3.27 |
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.
- 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.
- Reliability factor: $\alpha/2 = 0.025$, table value $z_{0.025} = 1.96$.
- Substitute into $\bar{x} \pm z\frac{\sigma}{\sqrt{n}}$: $2.20 \pm 1.96\left(\frac{0.35}{\sqrt{11}}\right)$
- Margin of error: $1.96 \times \frac{0.35}{3.31662} = 1.96 \times 0.10553 = 0.2068$
- Limits: $2.20 - 0.2068 = 1.9932$ and $2.20 + 0.2068 = 2.4068$.
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 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.
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 level | t (10 d.f.) | t (20 d.f.) | t (30 d.f.) | Z |
|---|---|---|---|---|
| .80 | 1.372 | 1.325 | 1.310 | 1.282 |
| .90 | 1.812 | 1.725 | 1.697 | 1.645 |
| .95 | 2.228 | 2.086 | 2.042 | 1.960 |
| .99 | 3.169 | 2.845 | 2.750 | 2.576 |
A random sample of $n = 25$ has $\bar{x} = 50$ and $s = 8$. Form a 95% confidence interval for $\mu$.
- Pick the row. The 8 is $s$, not σ — σ is unknown. So this is a t-interval.
- Degrees of freedom: d.f. $= n - 1 = 25 - 1 = 24$.
- Table value: $t_{24,\,0.025} = 2.0639$.
- Substitute: $50 - 2.0639\left(\frac{8}{\sqrt{25}}\right) < \mu < 50 + 2.0639\left(\frac{8}{\sqrt{25}}\right)$
- Margin of error: $2.0639 \times \frac{8}{5} = 2.0639 \times 1.6 = 3.302$
- Limits: $50 - 3.302 = 46.698$ and $50 + 3.302 = 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.
- 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.
A random sample of 100 people shows that 25 are left-handed. Form a 95% confidence interval for the true proportion of left-handers.
- Table value: $z_{0.025} = 1.96$.
- Standard error: $\sqrt{\frac{0.25(0.75)}{100}} = \sqrt{\frac{0.1875}{100}} = 0.043301$
- Margin of error: $1.96 \times 0.043301 = 0.08487$
- Limits: $0.25 - 0.08487 = 0.1651$ and $0.25 + 0.08487 = 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.
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:
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.
- Degrees of freedom. Since μ is known, d.f. $= n = 10$.
- 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$
- $= 4 + 25 + 0 + 4 + 1 + 1 + 9 + 9 + 0 + 1 = 52$
- Table values at df = 10: upper $\chi^2_{10,\,0.025} = 20.483$, lower $\chi^2_{10,\,0.975} = 3.247$.
- Lower limit: $\frac{52}{20.483} = 2.539$ (divide by the bigger chi-square)
- Upper limit: $\frac{52}{3.247} = 16.015$
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:
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$.
- Degrees of freedom. μ is unknown, so d.f. $= n - 1 = 16$.
- Table values at df = 16: $\chi^2_{16,\,0.025} = 28.85$ and $\chi^2_{16,\,0.975} = 6.91$.
- Numerator: $(n-1)s^2 = 16 \times 74^2 = 16 \times 5476 = 87616$.
- Lower limit: $\frac{87616}{28.85} = 3036.95 \approx 3037$
- Upper limit: $\frac{87616}{6.91} = 12679.59 \approx 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.
A random sample of 100 people shows that 25 are left-handed. Form a 95% confidence interval for the true proportion of left-handers.
Hint: a proportion, so no σ and no t. Convert 25/100 to a decimal first.
- $\hat{p} = \frac{25}{100} = 0.25$, and $z_{0.025} = 1.96$.
- Standard error: $\sqrt{\frac{0.25 \times 0.75}{100}} = \sqrt{0.001875} = 0.043301$
- Margin of error: $1.96 \times 0.043301 = 0.08487$
- Limits: $0.25 \mp 0.08487$ gives $0.16513$ and $0.33487$.
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.
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.
- $\hat{p} = \frac{200}{700} = \frac{2}{7} = 0.285714$.
- For 99% confidence, $\alpha = 0.01$ so $\alpha/2 = 0.005$, and the table gives $z_{0.005} = 2.58$.
- Standard error: $\sqrt{\frac{0.285714 \times 0.714286}{700}} = \sqrt{\frac{0.204082}{700}} = \sqrt{0.000291545} = 0.017075$
- Margin of error: $2.58 \times 0.017075 = 0.044053$
- Limits: $0.285714 - 0.044053 = 0.241661$ and $0.285714 + 0.044053 = 0.329767$.
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.
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.
- d.f. $= n = 10$ because μ is known.
- $\sum(X_i - 500)^2 = 4 + 25 + 0 + 4 + 1 + 1 + 9 + 9 + 0 + 1 = 52$
- Table values, df = 10: $\chi^2_{10,\,0.025} = 20.483$, $\chi^2_{10,\,0.975} = 3.247$.
- Lower: $\frac{52}{20.483} = 2.539$ · Upper: $\frac{52}{3.247} = 16.015$
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$.
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.
- d.f. $= 17 - 1 = 16$.
- $(n-1)s^2 = 16 \times 74^2 = 16 \times 5476 = 87616$
- Table values, df = 16: $\chi^2_{16,\,0.025} = 28.85$, $\chi^2_{16,\,0.975} = 6.91$.
- Lower: $\frac{87616}{28.85} = 3036.95 \approx 3037$
- Upper: $\frac{87616}{6.91} = 12679.59 \approx 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.
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
- 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
- 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 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.
- Find the claim being tested or challenged, and write it with an equals sign. That is your $H_0$.
- Ask what the question wants evidence for. That is your $H_a$.
- 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
- 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 $<$.
| Type | Hypotheses | Critical region | p-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}|)$ |
4.3 · The six steps
- State the null hypothesis ($H_0$) and the alternative hypothesis ($H_a$).
- Select the level of significance ($\alpha$) and sample size ($n$).
- Determine the appropriate test statistic and sampling distribution.
- Determine the critical value(s) and define the decision rule (or rejection region).
- Collect sample data, compute the sample statistic and the test statistic value.
- Make the statistical decision (reject $H_0$ or fail to reject $H_0$) and state the conclusion in managerial terms.
4.4 · Significance, the rejection region, and why we reject
- 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.
4.5 · The two errors, and the power of a test
- 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$) |
$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).
4.6 · The p-value approach
- 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$.
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
- 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$.
4.8 · Testing a mean when σ is unknown — the t test
- 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}$.
4.9 · Testing a proportion
- 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$).
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
- 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
- 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}$.
4.11 · Choosing the test — one table for the whole chapter
| Testing a claim about… | When | Statistic | Formula | df |
|---|---|---|---|---|
| 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$ |
- $H_0$ and $H_a$ — parameter, not statistic; equality goes in $H_0$.
- α and n — and decide one- or two-tailed now.
- Test statistic — pick the row from the table above; state why.
- Critical value — state the table value exactly, e.g. "$z_{0.025} = 1.96$".
- Compute — substitute, show the arithmetic, get a number.
- 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.
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.
- State the hypothesis. The coin being unbiased means $H_0: p = \frac{1}{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$.
- (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$.
- (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$$
- (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$$
α 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.
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.
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 $<$.
- The claim being tested is that the process is on target, which carries the equality: $H_0: \mu = 40$ oz.
- 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.
- $H_a: \mu \neq 40$ oz.
- Because $H_a$ uses $\neq$, this is a two-tailed test, and α is split between both tails.
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.
Hint for (b): which of $\mu$ and $\bar{X}$ do you already know the value of once you have taken your sample?
- (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.
- (b) A hypothesis is always a statement about a population parameter, never about a sample statistic.
- $\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.
- $\mu$ is the unknown quantity out in the population. That is the only thing a test can be about.
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.
- (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$.
- (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$.
- (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.
- 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 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$.
Hint: assume H₀ is true, then ask where 20 sits on the sampling distribution of x̄ centred at 50.
- Assume $H_0$ is true. Then the sampling distribution of $\bar{X}$ is centred at $\mu = 50$, with spread $\sigma/\sqrt{n}$.
- Locate the observation. A sample mean of 20 sits far out in the left tail of that distribution.
- 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$.
- 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$.
- 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.
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.
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
- 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.
5.2 · The correlation coefficient
- 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.
- 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
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 $$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$
Three formulas for the same number
Calculate Pearson's product-moment correlation coefficient $r$ for the child height ($x$, in cm) and child weight ($y$, in kg) data given below.
| x | y | xy | x² | y² |
|---|---|---|---|---|
| 35 | 8 | 280 | 1225 | 64 |
| 49 | 9 | 441 | 2401 | 81 |
| 27 | 7 | 189 | 729 | 49 |
| 33 | 6 | 198 | 1089 | 36 |
| 60 | 13 | 780 | 3600 | 169 |
| 21 | 7 | 147 | 441 | 49 |
| 45 | 11 | 495 | 2025 | 121 |
| 51 | 12 | 612 | 2601 | 144 |
| Σ = 321 | 73 | 3142 | 14111 | 713 |
- Numerator: $n\sum xy - \sum x\sum y = 8(3142) - (73)(321) = 25136 - 23433 = 1703$
- First bracket: $n\sum y^2 - (\sum y)^2 = 8(713) - 73^2 = 5704 - 5329 = 375$
- Second bracket: $n\sum x^2 - (\sum x)^2 = 8(14111) - 321^2 = 112888 - 103041 = 9847$
- Denominator: $\sqrt{375 \times 9847} = \sqrt{3692625} = 1921.62$
- $r = \dfrac{1703}{1921.62} = 0.886$
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.
5.4 · Spearman's rank correlation
- 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).
- List the n pairs of ranks, X and Y.
- Find the differences ($d_i$) between the ranks.
- Square these differences and add the squares ($\sum d_i^2$).
- Compute $r_s$.
Six paintings were ranked by two judges. Calculate the rank correlation coefficient.
| Painting | First judge (X) | Second judge (Y) | d | d² |
|---|---|---|---|---|
| A | 2 | 2 | 0 | 0 |
| B | 1 | 3 | −2 | 4 |
| C | 4 | 4 | 0 | 0 |
| D | 5 | 6 | −1 | 1 |
| E | 6 | 5 | 1 | 1 |
| F | 3 | 1 | 2 | 4 |
| Σd² | 10 | |||
- $r_s = 1 - \dfrac{6\sum d^2}{n(n^2-1)} = 1 - \dfrac{6 \times 10}{6(6^2-1)}$
- $= 1 - \dfrac{60}{6(35)} = 1 - \dfrac{60}{210} = 1 - 0.29$
- $= 0.71$
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.
- 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
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.
5.6 · The simple linear regression model
- 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.
- 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.
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:
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
| i | xᵢ | yᵢ | xᵢ² | xᵢyᵢ |
|---|---|---|---|---|
| 1 | 1 | 5.1 | 1 | 5.1 |
| 2 | 2 | 5.9 | 4 | 11.8 |
| 3 | 3 | 6.3 | 9 | 18.9 |
| Σ | 6 | 17.3 | 14 | 35.8 |
- Form the normal equations: (1) $3a + 6b = 17.3$ (2) $6a + 14b = 35.8$
- Multiply (1) by 2: $6a + 12b = 34.6$
- Subtract from (2): $(6a+14b) - (6a+12b) = 35.8 - 34.6 \Rightarrow 2b = 1.2 \Rightarrow b = 0.60$
- Substitute into (1): $3a + 6(0.60) = 17.3 \Rightarrow 3a + 3.6 = 17.3 \Rightarrow 3a = 13.7$
- $a = 4.5667$
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.
5.9 · Interpreting the slope and the intercept
- $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$.
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.
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.
- Means: $\bar{x} = \frac{20.35}{20} = 1.0175$ and $\bar{y} = \frac{16.27}{20} = 0.8135$
- Slope numerator: $n\sum xy - \sum x \sum y = 20(17.58) - (20.35)(16.27) = 351.6 - 331.0945 = 20.5055$
- Slope denominator: $n\sum x^2 - (\sum x)^2 = 20(22.30) - (20.35)^2 = 446 - 414.1225 = 31.8775$
- $b = \dfrac{20.5055}{31.8775} = 0.643$
- $a = \bar{y} - b\bar{x} = 0.8135 - 0.643(1.0175) = 0.160$
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 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.
$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.
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.
Is there evidence of a linear relationship between child height and weight at the 0.05 level of significance?
Hint: df = n − 2, and the test is two-tailed, so look up the α/2 = 0.025 column.
- Degrees of freedom: $df = n - 2 = 8 - 2 = 6$.
- Test statistic: $t = \dfrac{r}{\sqrt{\frac{1-r^2}{n-2}}} = \dfrac{0.886}{\sqrt{\frac{1-0.886^2}{6}}}$
- $= \dfrac{0.886}{\sqrt{\frac{1-0.7850}{6}}} = \dfrac{0.886}{\sqrt{\frac{0.2150}{6}}} = \dfrac{0.886}{0.1893} = 4.68$
- Critical value: two-tailed, α/2 = 0.025, df = 6, so $t_{0.025,\,6} = 2.447$.
- Decision: observed $4.68 > 2.447$, so reject $H_0$.
Find the rank correlation coefficient for the following data:
| x | 48 | 33 | 40 | 9 | 16 | 16 | 65 | 24 | 16 | 57 |
|---|---|---|---|---|---|---|---|---|---|---|
| y | 13 | 13 | 24 | 6 | 15 | 4 | 20 | 9 | 6 | 19 |
Hint: 16 appears three times in x; 13 and 6 each appear twice in y. That is three correction factors, not one.
- 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.
- $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
- $d$: −2.5, −0.5, 3, 1.5, 4, −2, −1, −1, −0.5, −1 (check: these sum to 0 ✓)
- $d^2$: 6.25, 0.25, 9, 2.25, 16, 4, 1, 1, 0.25, 1 → $\sum d^2 = 41$
- 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.
- $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}$
- $= \dfrac{11}{15} = 0.7333$
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 |
|---|---|---|
| 1 | 50 | 80 |
| 2 | 60 | 71 |
| 3 | 65 | 60 |
| 4 | 70 | 75 |
| 5 | 75 | 90 |
| 6 | 40 | 82 |
| 7 | 70 | 70 |
| 8 | 80 | 50 |
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.
- Ranks (highest mark = rank 1), averaging ties. Statistics: 70 appears twice, taking positions 3 and 4 → both get 3.5.
- $R_x$: 7, 6, 5, 3.5, 2, 8, 3.5, 1 · $R_y$: 3, 5, 7, 4, 1, 2, 6, 8
- $d = R_x - R_y$: 4, 1, −2, −0.5, 1, 6, −2.5, −7 (sum = 0 ✓)
- $d^2$: 16, 1, 4, 0.25, 1, 36, 6.25, 49 → $\sum d^2 = 113.5$
- Correction factor. Statistics value 70 with m = 2: $\frac{2(4-1)}{12} = 0.5$.
- $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}$
- $= 1 - 1.35714 = -0.357$
Find the regression equations of both $Y$ on $X$ and $X$ on $Y$ from the data given below. Hence find the correlation coefficient.
| X | 15 | 20 | 25 | 30 | 35 |
|---|---|---|---|---|---|
| Y | 12 | 14 | 18 | 25 | 31 |
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.
- Means: $\bar{x} = \frac{125}{5} = 25$, $\bar{y} = \frac{100}{5} = 20$.
- $\sum(X-\bar{x})^2 = 100+25+0+25+100 = 250$
- $\sum(Y-\bar{y})^2 = 64+36+4+25+121 = 250$
- $\sum(X-\bar{x})(Y-\bar{y}) = 80+30+0+25+110 = 245$
- Regression coefficients: $b_{yx} = \frac{245}{250} = 0.98$ and $b_{xy} = \frac{245}{250} = 0.98$.
- Y on X: $Y - 20 = 0.98(X - 25) \Rightarrow Y = 20 - 24.5 + 0.98X$, so $Y = -4.5 + 0.98X$.
- X on Y: $X - 25 = 0.98(Y - 20) \Rightarrow X = 25 - 19.6 + 0.98Y$, so $X = 5.4 + 0.98Y$.
- $r = \pm\sqrt{b_{yx}b_{xy}} = \sqrt{0.98 \times 0.98} = 0.98$, positive because both coefficients are positive.
Using the child weight-gain model (Weight gained $= 0.160 + 0.643\,($food weight$)$, sample size $n = 20$), the MS-Excel output gives:
| Model | Coefficient B | Std. Error | t Stat | Sig. (P-value) |
|---|---|---|---|---|
| (Constant) | 0.160 | 0.077 | 2.065 | .054 |
| Food weight | 0.643 | 0.073 | 8.772 | 0.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$.
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.
- (a) Test statistic. $t = \dfrac{b_1 - \beta_1}{s_{b_1}} = \dfrac{0.643 - 0}{0.073} = 8.772$
- Degrees of freedom: $df = n - 2 = 20 - 2 = 18$.
- Critical value: $t_{0.025,\,18} = 2.101$.
- Decision: $8.772 > 2.101$, so reject $H_0$. There is sufficient evidence that the food weight taken per day affects children's weight.
- (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$
- Limits: $0.643 - 0.153 = 0.489$ and $0.643 + 0.153 = 0.796$.
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.
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$.
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$.
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.