Model random events with distributions, and test claims using samples.
Make a probability table for a random variable and find its expected value, variance and standard deviation. Use the binomial distribution for counting successes and the normal distribution for measurements. See why sample means vary less than single values. Test a claim about a probability or a mean at the 5% level, name the two ways a test can be wrong, and find and read a correlation coefficient and a regression line.
You are ready for this book if
You can expand (p + q)³ and find a probability with a tree diagram.
This bookM5.7 Probability distributions and inference
Written and drawn by attnom. Free to read, print and share.
M5.7.1 Chapter 1
Random variables
If you throw two dice and add the scores, which total comes up most often, and what total should you expect?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Make a probability table for a discrete random variable
Find the expected value of a random variable
Say why an expected value is a balance point and not a likely value
Chance gives us a number in many places. It may be the total of two dice, the number of seeds out of ten that grow, or the number of buses that pass in an hour. Each of these is a random variable. We name it with a capital letter such as X. A small letter x stands for one of the values it may take.
A random variable is discrete when its values can be listed one by one, such as 0, 1, 2, 3. The number of heads in three tosses is discrete. A waiting time is not, because it can take any value along a stretch of the number line. Chapter 4 meets that kind. Until then every variable here is discrete.
The probability distribution of X lists every value x with its probability P(X = x). Two rules always hold. Each probability is from 0 to 1. And all the probabilities add up to 1, because X must take one of its values.
Draw it first
Draw the distribution of the total of two dice
1 Put each total, 2 to 12, under its own bar. Each bar is as high as its probability, from 1/36 for the total 2 up to 6/36 for the total 7.
2 The bar for 7 is the tallest. Six of the 36 equally likely pairs of scores make 7, so P(X = 7) = 6/36 = 1/6.
To make a table, list the values and find the probability of each. Let X be the number of heads in three tosses of a fair coin. The tree shows all 8 outcomes. They are equally likely, so each has probability 1/8. The hatched ends are the outcomes with X = 2.
Eight equally likely outcomes. Three of them have exactly two heads.
Worked example
X is the number of heads in three tosses of a fair coin. Make a probability table for X.
X can be 0, 1, 2 or 3.
The tree has 2 × 2 × 2 = 8 ends. Each end has probability 1/2 × 1/2 × 1/2 = 1/8.
Count the ends for each value. X = 0 only for TTT. X = 1 for HTT, THT and TTH. X = 2 for HHT, HTH and THH. X = 3 only for HHH.
So the probabilities are 1/8, 3/8, 3/8 and 1/8.
Check that they add to 1: 1/8 + 3/8 + 3/8 + 1/8 = 8/8 = 1.
Answer: For x = 0, 1, 2, 3 the probabilities are 1/8, 3/8, 3/8 and 1/8.
The probabilities of the table as bars. The two middle bars are three times as tall as the two outer bars.
The rule that the probabilities add to 1 lets you find one that is missing. Sometimes a rule gives the probabilities, with an unknown number in it. Add the probabilities, put the sum equal to 1, and solve for the unknown.
Worked example
The chance that X takes each of the values 1, 2, 3 and 4 is in proportion to the value. So P(X = x) = kx for some number k. Find k.
Now the expected value. Suppose you could repeat the chance a very large number of times and take the mean of all the values of X. That mean settles down to a fixed number, the expected value E(X), also called the mean of X and written μ. To find it, multiply each value by its probability and add: E(X) = Σ x P(X = x).
Worked example
X takes the values 1, 2, 3 and 4 with probabilities 0.1, 0.2, 0.3 and 0.4. Find E(X).
Multiply each value by its probability: 1 × 0.1 = 0.1, 2 × 0.2 = 0.4, 3 × 0.3 = 0.9 and 4 × 0.4 = 1.6.
Add the four products: 0.1 + 0.4 + 0.9 + 1.6 = 3.
So E(X) = 3.
Answer: E(X) = 3
The bars balance at the mean. The tall bar at 4 pulls the balance point to the right of the middle of 1 to 4, which is 2.5.
Think of each bar as a weight on a beam, with the beam resting on one point. The beam balances where the mean is. That is why E(X) is not always the middle value: a heavy bar far out pulls the balance point towards it.
Worked example
X is the score on one throw of a fair die. Find E(X). Can the die show this value?
No throw scores 3.5. The expected value is a mean over many throws. It does not have to be a score you can get.
Answer: E(X) = 3.5. The die cannot show this value.
Six equal bars balance at the middle, 3.5. There is no bar at 3.5.
See it three ways
With things
A bag holds 10 stones. One stone is marked 1, two are marked 2, three are marked 3 and four are marked 4. Pick one without looking. The mark on it is X.
As a picture
In words
A probability distribution lists every value of X with its chance. The chances add to 1.
In symbols
P(X = x) = x/10 for x = 1, 2, 3, 4, and 0.1 + 0.2 + 0.3 + 0.4 = 1. E(X) = Σ x P(X = x) = 3.
Try it
Add the scores of two bags
You need: 12 small slips of paper, two bags or two cups, a pencil.
Write the numbers 1 to 6 on six slips and put them in one bag. Do the same for the other bag.
Take one slip from each bag, add the two numbers, and put the slips back. Mark the total with a tally stroke.
Do this 36 times. Then look at which totals have the most strokes.
Compare your strokes with the table of pairs. The total 7 should be the tallest, and 2 and 12 the shortest.
What you will see: Your counts will not match the table exactly, because the draws are random. The more draws you make, the closer the strokes come to the shape of the table.
If you cannot try it, this is what happens.
A wrong idea many people have
The expected value is the value that X is most likely to take.
Why it feels right: In everyday speech, "expect" means "think will happen". So E(X) sounds like the best guess for the next result.
The test that breaks it: Take X as the number of heads in three tosses. E(X) = 0 × 1/8 + 1 × 3/8 + 2 × 3/8 + 3 × 1/8 = 12/8 = 1.5. But P(X = 1.5) = 0, because X can only be 0, 1, 2 or 3.
What is true: The expected value is the mean of many results, and the balance point of the bars. It can be a value that X can never take. The most likely value is a different thing, called the mode.
A wrong idea many people have
Any list of numbers between 0 and 1 is a probability distribution.
Why it feels right: A probability must be from 0 to 1, so a list of such numbers looks fine.
The test that breaks it: Take the probabilities 0.6, 0.7 and 0.5 for the values 1, 2 and 3. Each is from 0 to 1. But 0.6 + 0.7 + 0.5 = 1.8, so X would take one of its values with probability 1.8.
What is true: Each probability must be from 0 to 1 and the probabilities must add to exactly 1. Always add them as a check.
Key words
random variable
a number that depends on chance, such as the total of two dice. It is named with a capital letter, X.
discrete
a variable whose values can be listed one by one, such as 0, 1, 2, 3.
probability distribution
a list of every value of X with its probability. The probabilities add to 1.
expected value
the mean of X over very many repeats, E(X) = Σ x P(X = x). It is the balance point of the bars.
Back to your guess
The answer is C: The total 7 is the most likely, because more pairs of scores make it.
The total 7 comes up most often. Six of the 36 equally likely pairs of scores make it: 1 and 6, 2 and 5, 3 and 4, and the same three the other way round. The totals 2 and 12 are made by only one pair each. The expected total is also 7, because the bars are symmetric about 7. A list of every total with its chance is a probability distribution.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
X takes the values 1, 2, 3 and 4 with the probabilities in the table. One probability is hidden by c. Find c.
See the answer
0.3
The probabilities add to 1, so c = 1 − (0.1 + 0.35 + 0.25) = 1 − 0.7 = 0.3.
If you chose A: You added the three given probabilities, and 0.1 + 0.35 + 0.25 = 0.7. That is the total they already use. The hidden probability is what is left to reach 1. Read this page again.
If you chose B: That is the probability of the first value. The hidden one is 1 minus the sum of the others. Read this page again.
If you chose C: You added the given probabilities to 1. A probability cannot be above 1. Take them away from 1. Read this page again.
X takes the values 1, 2 and 3 with probabilities 0.5, 0.3 and 0.2. What is E(X)?
If you chose B: That is the mean of the three values, 1, 2 and 3, as if each were equally likely. The probabilities are not equal, so each value must be weighted by its probability. Read this page again.
If you chose C: You added the values. Multiply each value by its probability first, then add. Read this page again.
Which of these lists could be the probabilities of the four values of a random variable?
See the answer
0.4, 0.3, 0.2, 0.1
The probabilities must each be from 0 to 1 and add to 1. Only 0.4 + 0.3 + 0.2 + 0.1 = 1 does both.
If you chose A: Each is from 0 to 1, but the four add to 1.2. They must add to 1. Read this page again.
If you chose C: These add to 1, but a probability cannot be negative. Read this page again.
If you chose D: This list has only three numbers, and they add to 0.75. Four values need four probabilities that add to 1. Read this page again.
For one fair die, E(X) = 3.5. What does that tell us?
See the answer
The mean of very many throws will be close to 3.5.
The expected value is the long run mean. Single throws vary, but their mean over many throws settles near 3.5.
If you chose A: A die cannot show 3.5. Its scores are 1 to 6. Read this page again.
If you chose B: The expected value says nothing sure about one throw. Any score from 1 to 6 may come. Read this page again.
X is the number of heads in three tosses of a fair coin. What is P(X = 2)?
See the answer
3/8
Three of the 8 equally likely outcomes have exactly two heads: HHT, HTH and THH. Each has probability 1/8, so P(X = 2) = 3/8.
If you chose B: That is the chance of one outcome such as HHT. Two heads in three tosses can happen as HHT, HTH and THH. Go to M4.6.4.
If you chose C: You divided the number of heads by the number of tosses. That is not a probability of X = 2. Read this page again.
Which of these is a discrete random variable?
See the answer
The number of eggs in a nest.
A count takes separate values: 0, 1, 2, 3 and so on. Times and masses can take any value in a range, so they are not discrete.
If you chose A: A time can be any value along a stretch, such as 24.37 minutes. It is not a list of separate values. Read this page again.
If you chose C: A mass can be any value along a stretch. It is not a list of separate values. Read this page again.
X takes the values 10, 20, 30 and 40 with probabilities 0.1, 0.4, 0.3 and 0.2. Find E(X).
P(X = x) = 0.1x for x = 1, 2, 3 and 4. Find P(X ≥ 3).
See the answer
0.7
X ≥ 3 means X = 3 or X = 4. So P(X ≥ 3) = 0.3 + 0.4 = 0.7.
Keep it
Copy this into your exercise book.
Probabilities add to 1. E(X) = Σ x P(X = x). Multiply each value by its probability, then add. E(X) is the long run mean and the balance point. It need not be a possible value.
Draw: A bar chart of a distribution with a triangle under the balance point, named mean.
M5.7.2 Chapter 2
Variance and standard deviation
Two groups both have a mean of 7. How can I measure how spread out each group is?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Find the variance and standard deviation of a data set
Find the variance of a random variable
Say how adding to or multiplying every value changes the spread
The mean says where the middle of a data set is. It says nothing about how far the values are scattered round it. Group A and group B in the question have the same mean, yet they are very different. We need a number for spread.
Start with the distance of each value from the mean. We call x minus the mean the deviation of x. Some deviations are negative and some positive, and they always add to 0, so their sum says nothing. For group A they are −5, −3, 0, 2 and 6, and −5 − 3 + 0 + 2 + 6 = 0.
Squaring fixes this. A squared deviation is never negative, and a value far from the mean gives a much larger square than a value near it. The variance is the mean of the squared deviations: σ² = Σ(x − μ)² ÷ n. The standard deviation σ is the square root of the variance. It is in the same unit as the data, so it is a typical distance from the mean.
Draw it first
Draw a square on each deviation
1 Mark the data on a number line, and mark the mean, 7, with a dashed line.
2 On each value draw a square whose side runs from the value to the mean. A value 5 away from 7 gives a square of area 5 × 5 = 25.
The variance is the mean area of these squares, and the standard deviation is the side of a square with that mean area. Now do the sum in steps.
Worked example
Find the variance and the standard deviation of 2, 4, 7, 9 and 13.
The mean is (2 + 4 + 7 + 9 + 13) ÷ 5 = 35 ÷ 5 = 7.
The deviations are −5, −3, 0, 2 and 6. They add to 0, as they must.
Square them: 25, 9, 0, 4 and 36.
Add the squares: 25 + 9 + 0 + 4 + 36 = 74.
The variance is 74 ÷ 5 = 14.8.
The standard deviation is √14.8 = 3.85, to 3 significant figures.
Answer: The variance is 14.8 and the standard deviation is 3.85.
The squares for group A. Their areas add to 74. The mean area is 74 ÷ 5 = 14.8, which is the variance.
The same sum for group B, 6, 7, 7, 7, 8, gives squares 1, 0, 0, 0 and 1. They add to 2, so the variance is 2 ÷ 5 = 0.4 and the standard deviation is 0.63. Group B is much less spread out, and now a number says so.
Squaring every deviation by hand is slow. There is a shorter form. Expand (x − μ)² = x² − 2μx + μ². Add this over all n values: Σx² − 2μΣx + nμ². Since Σx = nμ, this is Σx² − 2nμ² + nμ² = Σx² − nμ². Divide by n and the result is σ² = Σx² ÷ n − μ². In words: the mean of the squares, minus the square of the mean.
Check with group A. The squares of the values are 4, 16, 49, 81 and 169, which add to 319. So σ² = 319 ÷ 5 − 7² = 63.8 − 49 = 14.8. It agrees. The short form works from a frequency table too: use Σfx² for Σx², and the total frequency for n.
The column fx² is each value squared, then times its frequency. The last row holds the totals the sum needs.
Worked example
The table gives the scores of 20 learners in a quiz. Find the mean, the variance and the standard deviation.
Add the columns. The total frequency is n = 20, Σfx = 57 and Σfx² = 183.
The mean is 57 ÷ 20 = 2.85.
The variance is Σfx² ÷ n − mean² = 183 ÷ 20 − 2.85² = 9.15 − 8.1225 = 1.0275.
To 3 significant figures the variance is 1.03.
The standard deviation is √1.0275 = 1.01, to 3 significant figures.
Answer: The mean is 2.85, the variance is 1.03 and the standard deviation is 1.01.
A random variable has a variance too. It is the mean of the squared deviations, with each weighted by its probability: Var(X) = E((X − μ)²). The same working as above turns this into Var(X) = E(X²) − [E(X)]², where E(X²) = Σ x² P(X = x). Find E(X) first.
P(x) is short for P(X = x). The totals of the last two columns are E(X) and E(X²).
Worked example
X takes the values 0, 1, 2 and 3 with probabilities 0.1, 0.3, 0.4 and 0.2. Find Var(X) and the standard deviation.
Answer: Var(X) = 0.81 and the standard deviation is 0.9.
Now change every value. Suppose Y = aX + b. Every value is multiplied by a and then moved by b. The mean follows: E(Y) = aE(X) + b. But moving every value by b does not change how far they are from each other, so b does not change the spread. Multiplying by a stretches each distance by a, so each squared deviation grows by a². Therefore Var(aX + b) = a² Var(X), and the standard deviation is |a| times as big.
Y = 3X + 2. The bars keep their heights. The values are three times as far apart and the mean moves from 1.7 to 7.1.
Worked example
In a quiz, X is the number of correct answers, with E(X) = 1.7 and Var(X) = 0.81. A learner scores Y = 3X + 2 points, with 3 points for each correct answer and 2 for taking part. Find E(Y), Var(Y) and the standard deviation of Y.
E(Y) = 3 × E(X) + 2 = 3 × 1.7 + 2 = 7.1.
The 2 does not change the spread. The 3 does: Var(Y) = 3² × Var(X) = 9 × 0.81 = 7.29.
The standard deviation of Y is √7.29 = 2.7.
Check: 3 × 0.9 = 2.7, where 0.9 is the standard deviation of X.
Answer: E(Y) = 7.1, Var(Y) = 7.29 and the standard deviation of Y is 2.7.
One note on the divisor. Some courses divide by n − 1 instead of n when the data is a sample taken from a larger group, to estimate the variance of the whole group. Many calculators have a key for each. This book divides by n, and a question says which to use.
See it three ways
With things
Five people stand on a line at the marks 2, 4, 7, 9 and 13 metres. Each marks a square on the ground, with one side along the line from where they stand to the mark 7.
As a picture
In words
The variance is the mean area of the squares. The standard deviation is the side of a square with that mean area.
In symbols
σ² = Σ(x − μ)² ÷ n = 74 m² ÷ 5 = 14.8 m², and σ = √14.8 m² = 3.85 m.
Try it
Measure the spread of hand spans
You need: a ruler in centimetres, five or six people, a pencil and paper.
Each person spreads a hand wide. Measure from the tip of the thumb to the tip of the little finger, in cm. Write the values down.
Find the mean. Then write each value minus the mean, and square it.
Add the squares and divide by the number of people. That is the variance. Its square root is the standard deviation.
Now write every span in mm, by multiplying by 10, and do the sum again.
What you will see: The standard deviation in mm is 10 times the one in cm. The variance in mm² is 100 times the one in cm². A spread of 2 cm and a spread of 20 mm are the same spread.
If you cannot try it, this is what happens.
A wrong idea many people have
The mean of the deviations measures the spread.
Why it feels right: A deviation is a distance from the mean, so the mean of the distances looks like the typical distance.
The test that breaks it: Take 2, 4, 7, 9 and 13. The deviations are −5, −3, 0, 2 and 6. They add to 0, so their mean is 0. But the values are clearly not all the same.
What is true: The deviations always add to 0, because the values above the mean balance the values below. Squaring each deviation first removes the signs, so the mean of the squares measures spread.
A wrong idea many people have
If I add 5 to every value, the standard deviation goes up by 5.
Why it feels right: Every value gets bigger, so the numbers seem to spread out more.
The test that breaks it: Add 5 to 2, 4, 7, 9 and 13 to get 7, 9, 12, 14 and 18. The new mean is 12. The deviations are −5, −3, 0, 2 and 6, the same as before, so the variance is still 14.8.
What is true: Adding the same number moves all the values and the mean together, so the distances between them do not change. Only multiplying changes the spread: the standard deviation is multiplied by the size of the multiplier.
Key words
spread
how far the values of a data set are scattered round their mean.
deviation
a value minus the mean. The deviations of a set always add to 0.
variance
the mean of the squared deviations, σ² = Σ(x − μ)² ÷ n = Σx² ÷ n − μ².
standard deviation
the square root of the variance. It has the same unit as the data.
Back to your guess
The answer is A: Group A, 2, 4, 7, 9, 13, is more spread out, because its values lie further from 7.
Group A is far more spread out. Its values lie 5, 3, 0, 2 and 6 away from the mean, while the values of group B lie only 1, 0, 0, 0 and 1 away. The mean cannot show this. This chapter makes a number that can: the standard deviation.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Two sets of four values both have mean 10. Set P is 9, 10, 10, 11. Set Q is 4, 8, 12, 16. Which statement is true?
See the answer
Q has the larger standard deviation, because its values lie further from the mean.
The variance of P is (1 + 0 + 0 + 1) ÷ 4 = 0.5. The variance of Q is (36 + 4 + 4 + 36) ÷ 4 = 20. So Q is far more spread out.
If you chose A: Repeating the mean makes a set tighter, not looser. The values of P lie at most 1 from the mean, and the values of Q lie up to 6 away. Read this page again.
If you chose C: The mean does not fix the spread. Sets with the same mean can be tight or wide, as groups A and B showed. Read this page again.
What is the variance of 1, 3, 5 and 7?
See the answer
5
The mean is 4. The deviations are −3, −1, 1 and 3, with squares 9, 1, 1 and 9. They add to 20, and 20 ÷ 4 = 5.
If you chose A: The squared deviations 9, 1, 1 and 9 add to 20. The variance is their mean, so divide by 4. Read this page again.
If you chose B: That is the standard deviation, √5. The variance is the number before the square root. Read this page again.
Lengths in a set have standard deviation 4 cm. Every length is changed to mm. What is the variance of the lengths in mm²?
See the answer
1600 mm²
The standard deviation in mm is 4 × 10 = 40 mm. The variance is the square of that: 40² = 1600 mm².
If you chose A: You multiplied the variance by 10. The standard deviation is multiplied by 10, but the variance is multiplied by 10², which is 100. Read this page again.
If you chose B: You squared the standard deviation but kept the unit cm. In mm every length and every deviation is 10 times bigger. Read this page again.
If you chose C: That is the standard deviation in mm, 4 × 10 = 40 mm. The variance is its square. Read this page again.
The standard deviation of a data set is 0. What must be true?
See the answer
Every value in the set is equal.
The variance is a mean of squares, so it is 0 only if every square is 0. Then every value equals the mean, so all the values are equal.
If you chose A: The values 5, 5, 5 have mean 5 and standard deviation 0. The mean can be any number. Read this page again.
If you chose C: The values 2 and −2 add to 0, but they lie 2 from the mean, so the standard deviation is 2. Read this page again.
For a random variable, E(X) = 3 and E(X²) = 11. What is Var(X)?
See the answer
2
Var(X) = E(X²) − [E(X)]² = 11 − 3² = 11 − 9 = 2.
If you chose B: You took E(X²) − E(X). The rule squares the mean: E(X²) − [E(X)]². Read this page again.
If you chose C: You added the two numbers. The variance is E(X²) minus the square of E(X). Read this page again.
X has variance 4. Y = 2X + 5. What is Var(Y)?
See the answer
16
Var(aX + b) = a² Var(X). Here a = 2 and b = 5, so Var(Y) = 2² × 4 = 16. The 5 plays no part.
If you chose A: You multiplied the variance by 2. The variance is multiplied by the square of the multiplier, 2² = 4. Read this page again.
If you chose B: You doubled the variance and then added 5. The 5 moves every value and does not change the spread. Read this page again.
From an earlier chapter
X takes the values 0, 1 and 2. The probabilities of 0 and 1 are 0.3 and 0.5. What is E(X)?
See the answer
0.9
The probability of 2 is 1 − 0.3 − 0.5 = 0.2. So E(X) = 0 × 0.3 + 1 × 0.5 + 2 × 0.2 = 0.5 + 0.4 = 0.9.
If you chose A: That is the mean of the values 0, 1 and 2, as if all were equally likely. Weight each value by its probability. Go to M5.7.1.
If you chose C: That is the probability of the value 1. Find the missing probability first, then multiply each value by its probability. Go to M5.7.1.
Find the variance of 3, 5, 6 and 10.
See the answer
6.5
The mean is 24 ÷ 4 = 6. The squared deviations are 9, 1, 0 and 16, which add to 26. The variance is 26 ÷ 4 = 6.5.
For 10 values, Σx = 120 and Σx² = 1500. Find the variance.
See the answer
6
The mean is 120 ÷ 10 = 12. The variance is Σx² ÷ n − mean² = 1500 ÷ 10 − 12² = 150 − 144 = 6.
X takes the values 1, 2, 3 and 4 with probabilities 0.1, 0.2, 0.4 and 0.3. Find Var(X).
Var(aX + b) = a² Var(X) = 4² × 2.5 = 16 × 2.5 = 40. The −1 does not change the spread.
Find the standard deviation of 6, 8, 8, 10 and 13, to 3 significant figures.
See the answer
2.37
The mean is 45 ÷ 5 = 9. The squared deviations are 9, 1, 1, 1 and 16, which add to 28. The variance is 28 ÷ 5 = 5.6, and √5.6 = 2.37.
Keep it
Copy this into your exercise book.
σ² = mean of (x − μ)² = Σx² ÷ n − μ². σ = √σ². Var(X) = E(X²) − [E(X)]². Var(aX + b) = a² Var(X). Adding b changes no spread.
Draw: A number line with five dots, a mean line and a square on each deviation.
M5.7.3 Chapter 3
The binomial distribution
A spinner is red on one third of its face. Joseph spins it 3 times. What is the chance of exactly one red?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Say when a binomial model fits a situation
Find P(X = 3) for a binomial distribution
Find the mean and variance of a binomial distribution
Many chance events are a count of successes in a number of tries. How many seeds out of ten grow? How many of the next 20 buses are on time? How many sixes come up in six throws? When the tries fit four conditions, the count has a standard distribution, the binomial distribution.
The four conditions. (1) There is a fixed number n of trials. (2) Each trial has two outcomes, called success and failure. (3) The chance of success is the same number p on every trial. (4) The trials are independent: one result does not change the chance of another. Then X, the number of successes, is written X ~ B(n, p). The chance of failure is q = 1 − p.
Take the spinner, with n = 3 and p = 1/3. Draw a tree for the three spins. R means red and N means not red. Every path has three branches, and its chance is found by multiplying along it.
Draw it first
Draw the tree for three spins of the spinner
1 Draw three stages. At each stage the branch R is marked 1/3 and the branch N is marked 2/3.
2 Write each end and multiply along its path. RRN is 1/3 × 1/3 × 2/3 = 2/27. The three paths with two reds all give 2/27.
Count the paths for each number of reds. There is 1 path with no red, 3 paths with one red, 3 paths with two reds and 1 path with three reds. The numbers of paths are the binomial coefficients 1, 3, 3, 1. Every path with the same number of reds has the same chance, because it has the same branches in another order.
The totals 8, 12, 6 and 1 add to 27, so the four chances add to 27/27 = 1.
This is the whole idea. For X ~ B(n, p), one path with r successes has chance p^r q^(n − r). The number of such paths is C(n, r), the number of ways to choose which r of the n trials are successes. On a calculator it is the key nCr. So P(X = r) = C(n, r) p^r q^(n − r).
Worked example
A spinner is red on 1/3 of its face. It is spun 3 times. Find the chance of exactly two reds.
X is the number of reds, so X ~ B(3, 1/3), with q = 2/3.
The number of paths with two reds is C(3, 2) = 3.
Each path has chance (1/3)² × (2/3) = 2/27.
So P(X = 2) = 3 × 2/27 = 6/27 = 2/9.
Answer: P(X = 2) = 2/9
With larger n, a tree is too big, but the formula still works. Here is a case with decimals. Use the calculator for the powers and write each part before you multiply.
Worked example
Amina plants 6 seeds. Each grows with probability 0.7, independently of the others. Find the probability that exactly 4 grow.
The number that grow is X ~ B(6, 0.7), with q = 0.3.
We want P(X = 4) = C(6, 4) × 0.7⁴ × 0.3². Here C(6, 4) = 15.
The powers are 0.7⁴ = 0.2401 and 0.3² = 0.09.
Multiply: 15 × 0.2401 × 0.09 = 0.324135.
So P(X = 4) = 0.3241, to 4 decimal places.
Answer: P(X = 4) = 0.3241
The distribution of the seeds that grow. The hatched bar is 0.3241 high. The most likely number is 4, a little under the mean of 4.2.
Often a question asks for a range of values. Add the bars it names. P(X ≤ 2) is P(X = 0) + P(X = 1) + P(X = 2). All the probabilities add to 1, so a "more than" question is often quicker by the complement: P(X ≥ 3) = 1 − P(X ≤ 2).
Worked example
Ravi's bus is on time with probability 0.8, each day independently. Over 10 days, find the probability that it is on time on at least 9 days.
X is the number of on-time days, so X ~ B(10, 0.8), with q = 0.2.
The hatched bars add to 0.3758. The tall bars are on the right, because success is likely each day.
The mean and variance have short forms. Count each trial as 1 for a success and 0 for a failure. One trial has mean p and variance p − p² = pq. X is the sum of n independent trials. Means add, and for independent trials variances add too. So E(X) = np and Var(X) = npq.
Worked example
Each of 40 trees bears fruit with probability 0.25, independently. Find the mean, the variance and the standard deviation of the number that bear fruit.
X ~ B(40, 0.25), with q = 0.75.
The mean is np = 40 × 0.25 = 10.
The variance is npq = 40 × 0.25 × 0.75 = 7.5.
The standard deviation is √7.5 = 2.74, to 3 significant figures.
Answer: The mean is 10, the variance is 7.5 and the standard deviation is 2.74.
See it three ways
With things
Throw a die 3 times. Call a six a success. List the 8 patterns of six and not six, such as 6, not 6, 6. Count how many have exactly one six.
As a picture
In words
The chance of r successes is the number of ways to place them, times the chance of one such way.
In symbols
P(X = r) = C(n, r) p^r q^(n − r), with mean np and variance npq.
Try it
Count the sixes in six throws
You need: a die, paper and a pencil.
Throw the die 6 times. Count the sixes. That is one value of X.
Repeat 20 times, so you have 20 values of X. Write how many times each value from 0 to 6 came up.
Compare with the table. In 100 repeats, about 33 runs give no six, 40 give one six and 20 give two sixes.
What you will see: Your 20 runs will not match the table exactly, but the shape should be alike. Runs with 0, 1 or 2 sixes are by far the most common, and 4 or more sixes almost never happen.
If you cannot try it, this is what happens.
A wrong idea many people have
Drawing counters from a bag without putting them back is a binomial situation.
Why it feels right: Each draw gives one of two colours, such as red or blue, so it looks like a success or a failure each time.
The test that breaks it: A bag has 3 red and 2 blue counters. The first draw is red with chance 3/5. If the first counter is red and kept out, the second draw is red with chance 2/4, not 3/5.
What is true: The chance changes after each draw, so the trials are not independent and p is not the same. A binomial model needs independent trials with a constant p. Putting each counter back before the next draw restores both.
A wrong idea many people have
P(X = r) = p^r q^(n − r), with no number of ways in front.
Why it feels right: It looks like the product of the branches, and a product of chances is how a tree works.
The test that breaks it: For the spinner, take p = 1/3, n = 3 and drop the number of ways. The four chances would be 8/27, 4/27, 2/27 and 1/27, which add to 15/27, not 1.
What is true: p^r q^(n − r) is the chance of one path. There are C(n, r) paths with r successes, so multiply by C(n, r). Then the chances add to 1, as they must.
Key words
binomial distribution
the distribution of the number of successes in n independent trials, each with the same chance p of success. Written B(n, p).
trial
one try with two outcomes, success or failure.
independent
one result does not change the chance of another.
Back to your guess
The answer is C: The chance is 4/9, because the one red can come on any of the three spins.
The chance is 4/9. One red and two others has chance 1/3 × 2/3 × 2/3 = 4/27 in one fixed order. The red can come first, second or third, so there are 3 orders, and 3 × 4/27 = 12/27 = 4/9. Counting the orders is what the binomial distribution does for us.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Which situation is a good fit for a binomial model?
See the answer
Twelve seeds are planted and each grows with probability 0.9, independently.
There is a fixed number of trials, 12, each with two outcomes, the same chance of success and independence. All four conditions hold.
If you chose B: Each card dealt changes what is left, so the chance of a heart changes. The trials are not independent. Read this page again.
If you chose C: The number of trials is not fixed. A binomial model counts successes in a fixed number of trials. Read this page again.
If you chose A: You gave the chance of one path, 0.4³ × 0.6² = 0.02304. There are 10 paths with three successes, so multiply by C(5, 3) = 10. Read this page again.
If you chose B: You swapped the powers, using 0.6³ × 0.4². The success chance 0.4 goes with the 3 successes: 0.4³ × 0.6². Read this page again.
X ~ B(20, 0.35). What is the mean of X?
See the answer
7
The mean is np = 20 × 0.35 = 7.
If you chose A: That is the variance, npq = 20 × 0.35 × 0.65. The mean is np, without the q. Read this page again.
If you chose C: That is nq = 20 × 0.65, the expected number of failures. The mean number of successes is np. Read this page again.
X ~ B(50, 0.2). What is the variance of X?
See the answer
8
Var(X) = npq = 50 × 0.2 × 0.8 = 8.
If you chose B: That is the mean, np = 50 × 0.2. The variance is npq, with the failure chance 0.8 as a last factor. Read this page again.
If you chose C: That is the standard deviation, √8. The variance is the number before the square root. Read this page again.
X ~ B(10, 0.3). Which expression gives P(X ≥ 3)?
See the answer
1 − P(X ≤ 2)
The values 0 to 10 cover everything, so P(X ≥ 3) = 1 − P(X ≤ 2). The part removed is X = 0, 1 and 2.
If you chose A: That leaves out X = 3. X ≥ 3 includes 3, so the part to take away is X = 0, 1, 2, which is P(X ≤ 2). Read this page again.
If you chose C: That is the chance of 3 or fewer, the other end of the bars. X ≥ 3 means 3 or more. Read this page again.
For X ~ B(10, 0.1), at which value is the bar tallest?
See the answer
X = 1
P(X = 0) = 0.9¹⁰ = 0.3487 and P(X = 1) = 10 × 0.1 × 0.9⁹ = 0.3874. The next bars are smaller, so the tallest bar is at 1.
If you chose A: The middle of the values 0 to 10 is 5, but the bars pile up near the mean np = 1, because success is unlikely. Read this page again.
If you chose B: Nine successes out of ten, when each has chance 0.1, is very unlikely. The bar at 9 is almost flat. Read this page again.
From an earlier chapter
For a random variable, E(X) = 4 and E(X²) = 19. What is Var(X)?
See the answer
3
Var(X) = E(X²) − [E(X)]² = 19 − 4² = 19 − 16 = 3.
If you chose A: You took E(X²) − E(X). The rule squares the mean: E(X²) − [E(X)]². Go to M5.7.2.
If you chose C: You added E(X²) and E(X). The variance is E(X²) minus the square of E(X). Go to M5.7.2.
X ~ B(8, 0.25). Find P(X = 2), to 4 decimal places.
X ~ B(10, 0.4). Find P(X ≤ 2), to 4 decimal places.
See the answer
0.1673
To 5 decimal places, P(X = 0) = 0.6¹⁰ = 0.00605, P(X = 1) = 10 × 0.4 × 0.6⁹ = 0.04031 and P(X = 2) = 45 × 0.16 × 0.6⁸ = 0.12093. The sum is 0.16729, which is 0.1673 to 4 decimal places.
X ~ B(30, 0.2). Find Var(X).
See the answer
4.8
Var(X) = npq = 30 × 0.2 × 0.8 = 4.8.
X ~ B(n, 0.6) has mean 12. Find n.
See the answer
20
The mean is np, so n × 0.6 = 12. Then n = 12 ÷ 0.6 = 20.
Keep it
Copy this into your exercise book.
X ~ B(n, p): fixed n, two outcomes, same p, independent. P(X = r) = C(n, r) p^r q^(n − r), q = 1 − p. Mean np, variance npq. P(X ≥ 3) = 1 − P(X ≤ 2).
Draw: A bar chart of B(6, 0.7) with the bar for 4 hatched.
M5.7.4 Chapter 4
The normal distribution
Masses of loaves, heights of plants and times of journeys all form a bell shape. How can a bell give a probability?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Describe the bell shape of a normal distribution
Find probabilities using a normal model
Use the rule that about 95% lies within 2 standard deviations
Masses, lengths and times can take any value along a line, so they are continuous. We cannot list their values or give each a probability. Instead, we draw a smooth curve over the values. Where the curve is high, values are common. The probability that X lies between two numbers is the area under the curve between them. The whole area is 1.
Because a single exact value has no width, P(X = 500) = 0. For a continuous variable P(X < a) and P(X ≤ a) are the same number, so we need not worry about which sign is used.
The most useful curve is the normal distribution. It is shaped like a bell, symmetric about its mean μ. Its width is set by the standard deviation σ. We write X ~ N(μ, σ²). Here the mass of a loaf is X ~ N(500, 8²) grams: the mean is 500 g and the standard deviation is 8 g.
Draw it first
Draw the bell and shade within one standard deviation
1 Draw the bell, with its peak above the mean, 500, and the two sides falling away equally.
2 Shade from 492 to 508, which is 500 − 8 to 500 + 8. The shaded area, 0.6827, is the probability that a loaf is within 8 g of the mean.
This 0.6827 is the same for every normal distribution: about 68% of values lie within 1 standard deviation of the mean. Within 2 standard deviations lies about 95%, and within 3 about 99.7%. More exactly, the areas are 0.6827, 0.9545 and 0.9973. Learn these three. They give a quick feel for any normal data.
Within 2 standard deviations of the mean, 484 g to 516 g, lies about 95% of the loaves.The mean sets where the bell stands. The standard deviation sets how wide it is. Both curves have area 1, so the narrow one must be taller.
To find other areas we use a table. A table cannot hold every normal distribution, so we use one trick. The z-score of x is z = (x − μ) ÷ σ. It counts how many standard deviations x is above the mean, and it is negative below the mean. If X ~ N(μ, σ²), then Z = (X − μ) ÷ σ has the standard normal distribution N(0, 1), with mean 0 and standard deviation 1. Every normal question becomes a question about Z.
The area under the standard normal curve to the left of z. Each value was worked out by a program from the curve, not copied. A calculator with a normal distribution function gives the same numbers.
Two facts finish the job. The curve is symmetric, so P(Z < −z) = 1 − P(Z < z). And the whole area is 1, so P(Z > z) = 1 − P(Z < z). With these, any area follows from the table.
Worked example
The mass of a loaf is X ~ N(500, 8²) g. Find the probability that a loaf is between 488 g and 508 g.
From the table, P(Z < 1) = 0.8413. By symmetry, P(Z < −1.5) = 1 − 0.9332 = 0.0668.
So the area is 0.8413 − 0.0668 = 0.7745.
Answer: The probability is 0.7745.
The shaded area from 488 g to 508 g is 0.7745. It is larger than the area within one standard deviation because it reaches 1.5 standard deviations on the left.
Worked example
The mass of a loaf is X ~ N(500, 8²) g. Find the probability that a loaf is heavier than 520 g.
Standardise: z = (520 − 500) ÷ 8 = 2.5.
We want P(Z > 2.5) = 1 − P(Z < 2.5).
From the table, P(Z < 2.5) = 0.9938, so the area is 1 − 0.9938 = 0.0062.
Answer: The probability is 0.0062.
Only about 6 loaves in 1000 are heavier than 520 g.
Sometimes the probability is given and we need the value. Then we read the table the other way. The values below give the z for a probability to the left. Find z first, then turn it back into x with x = μ + zσ.
The z that has the given area to its left. Each value was found by a program that searches the curve for the area.
Worked example
The mass of a loaf is X ~ N(500, 8²) g. The heaviest 2.5% of loaves are above what mass?
The area to the left of this mass is 1 − 0.025 = 0.975.
From the table of z values, P(Z < z) = 0.975 gives z = 1.96.
Turn z back into a mass: x = 500 + 1.96 × 8 = 500 + 15.68 = 515.68.
So the heaviest 2.5% of loaves are above 515.7 g, to 1 decimal place.
Answer: The mass is 515.7 g.
See it three ways
With things
Weigh more and more loaves and draw their masses as bars in narrower and narrower strips. The tops of the bars trace a bell, with the most loaves near the middle.
As a picture
In words
About 68% of values lie within 1 standard deviation of the mean, about 95% within 2 and about 99.7% within 3.
In symbols
X ~ N(μ, σ²). z = (x − μ) ÷ σ. P(Z < −z) = 1 − P(Z < z).
Try it
See a bell appear from dice
You need: four dice, paper and a pencil.
Draw a number line from 4 to 24 on paper. Roll four dice and add them. Put one cross above that total.
Do this 30 times. Each total from 4 to 24 has its own column of crosses.
Look at the pile. It is highest near 14 and thin near 4 and 24.
What you will see: Each die adds a small chance effect, and the sum of many such effects makes a bell. This is why so many measurements, which are the sum of many small causes, are close to normal. With only 30 rolls the pile is rough. The bars show what many rolls give.
If you cannot try it, this is what happens.
A wrong idea many people have
The height of the curve above 500 g is the probability that a loaf has mass 500 g.
Why it feels right: For the bars of a binomial distribution, the height of a bar is the probability. The curve looks like bars joined together.
The test that breaks it: The chance that a loaf is within half a gram of 500 g, between 499.5 g and 500.5 g, is only 0.0498. And the chance of exactly 500.000 g is 0, because a line has no area.
What is true: For a continuous variable, probability is area, not height. The height shows where values are crowded. To get a probability, take the area over an interval.
A wrong idea many people have
No value lies more than 3 standard deviations from the mean, because the curve ends there.
Why it feels right: Almost all of the area, 99.7%, lies within 3 standard deviations, and the curve looks flat on the axis beyond that.
The test that breaks it: The area outside 3 standard deviations is 1 − 0.9973 = 0.0027, about 1 value in 370. For 1000 loaves, expect about 3 outside the range 476 g to 524 g.
What is true: The curve gets very close to the axis but never touches it. Values beyond 3 standard deviations are rare, not impossible.
Key words
continuous
a variable that can take any value along a line, such as a mass or a time.
normal distribution
the bell shaped distribution N(μ, σ²), symmetric about its mean μ, with standard deviation σ.
z-score
z = (x − μ) ÷ σ, the number of standard deviations x lies from the mean. It is negative below the mean.
standard normal distribution
the normal distribution N(0, 1), with mean 0 and standard deviation 1.
Back to your guess
The answer is B: The area under the curve between two values is the probability of lying between them.
The area under the curve is the probability. The whole area is 1, and the area between two values is the chance of landing between them. The height of the curve is not a probability: a single exact value has no width, so it has no area and probability 0.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Which statement is true of every normal distribution?
See the answer
The curve is symmetric about its mean and has a total area of 1.
Every normal curve is a bell, symmetric about its mean, and probability is area, so the whole area is 1.
If you chose A: The curve gets close to the axis but never touches it. About 1 value in 370 lies beyond 3 standard deviations. Read this page again.
If you chose B: That describes only the standard normal distribution, N(0, 1). Other normal distributions have other means and widths. Read this page again.
Journey times are N(40, 6²) minutes. About what percentage of journeys take between 28 and 52 minutes?
See the answer
About 95%
The interval 28 to 52 is 40 − 2 × 6 to 40 + 2 × 6, within 2 standard deviations. The area is 0.9545, about 95%.
If you chose A: That is the area within 1 standard deviation, 34 to 46 minutes. The interval 28 to 52 is 2 standard deviations each side of 40. Read this page again.
If you chose C: That is the area within 3 standard deviations, 22 to 58 minutes. The interval 28 to 52 is 2 standard deviations each side. Read this page again.
X ~ N(60, 5²). What is the z-score of x = 70?
See the answer
2
z = (x − μ) ÷ σ = (70 − 60) ÷ 5 = 2. The value 70 is 2 standard deviations above the mean.
If you chose B: That is x − μ, the distance in the original units. Divide it by the standard deviation to count standard deviations. Read this page again.
If you chose C: You divided the standard deviation by the distance. The z-score is the distance divided by the standard deviation. Read this page again.
For Z ~ N(0, 1), P(Z < 1.5) = 0.9332. What is P(Z > 1.5)?
See the answer
0.0668
The whole area is 1, so P(Z > 1.5) = 1 − P(Z < 1.5) = 1 − 0.9332 = 0.0668.
If you chose A: That is the area to the left of 1.5. The question asks for the area to the right. Read this page again.
If you chose B: You took away 0.5, as if 0.9332 were measured from the middle. The table gives the whole area to the left, so take it from 1. Read this page again.
For Z ~ N(0, 1), P(Z < 1) = 0.8413. What is P(Z < −1)?
See the answer
0.1587
By symmetry the area left of −1 equals the area right of 1. That is 1 − 0.8413 = 0.1587.
If you chose B: That is P(Z < 1). The point −1 is on the other side of the mean, where the area to the left is small. Read this page again.
If you chose C: A probability can never be negative. Use symmetry: the area left of −1 equals the area right of 1. Read this page again.
Two normal curves have the same mean. Curve A has standard deviation 3 and curve B has standard deviation 6. Which curve is taller and narrower?
See the answer
Curve A, the one with the smaller standard deviation.
Both curves have total area 1. The curve with less spread packs its area into a narrower stretch, so it must be taller.
If you chose A: A larger standard deviation spreads the values out, so the bell is lower and wider. The area stays 1. Read this page again.
If you chose C: The mean only sets where the bell stands. The standard deviation sets its width and height. Read this page again.
From an earlier chapter
X ~ B(36, 0.5). What is the variance of X?
See the answer
9
The variance of B(n, p) is npq = 36 × 0.5 × 0.5 = 9.
If you chose A: That is the standard deviation, √9. The variance is npq, the number before the square root. Go to M5.7.3.
If you chose B: That is the mean, np. The variance is npq, with the failure chance 0.5 as a last factor. Go to M5.7.3.
Journey times are N(40, 6²) minutes. Find the probability that a journey takes between 37 and 52 minutes.
See the answer
0.6687
z = (37 − 40) ÷ 6 = −0.5 and z = (52 − 40) ÷ 6 = 2. The area is P(Z < 2) − P(Z < −0.5) = 0.9772 − (1 − 0.6915) = 0.9772 − 0.3085 = 0.6687.
Journey times are N(40, 6²) minutes. Find the probability that a journey takes more than 50.5 minutes.
See the answer
0.0401
z = (50.5 − 40) ÷ 6 = 1.75. The area is P(Z > 1.75) = 1 − 0.9599 = 0.0401.
Journey times are N(40, 6²) minutes. Only 5% of journeys take longer than t minutes. Find t, to 1 decimal place.
See the answer
49.9 minutes
The area to the left of t is 0.95, so z = 1.6449 from the table of z values. Then t = 40 + 1.6449 × 6 = 40 + 9.8694 = 49.8694, which is 49.9 minutes to 1 decimal place.
X ~ N(60, 5²). Find the z-score of x = 71.
See the answer
2.2
z = (x − μ) ÷ σ = (71 − 60) ÷ 5 = 11 ÷ 5 = 2.2.
Keep it
Copy this into your exercise book.
X ~ N(μ, σ²). Probability is area. About 68%, 95%, 99.7% within 1, 2, 3 standard deviations. z = (x − μ) ÷ σ. P(Z < −z) = 1 − P(Z < z).
Draw: A bell curve with the middle shaded and 95% written in it.
M5.7.5 Chapter 5
Samples and the sample mean
One loaf can be far from the usual mass. Why does the mean mass of four loaves stay so much closer?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Explain why sample means vary less than single values
Find the standard deviation of a sample mean
Find a probability for a sample mean using a normal model
In statistics we usually cannot measure everything. We take a sample of n values from a larger group and use it to say something about the group. The mean of the sample is the sample mean, written X̄. A different sample gives a different X̄, so X̄ is a random variable too. This chapter asks how X̄ behaves.
Take a fair die. One throw has mean 3.5. Now throw two dice and take their mean, which is the total divided by 2. The mean of two dice is also 3.5 on average, but it is far more often near 3.5 and far less often 1 or 6. A 1 needs two ones, which has chance 1/36.
Draw it first
Compare one die with the mean of two dice
1 Draw one die: six equal bars, balanced at 3.5.
2 Add the mean of two dice. It is balanced at the same place, 3.5, but the bars crowd in the middle and the ends are tiny.
Averaging pulls values towards the middle, because a high value in the sample is often paired with a low one. The more values we average, the stronger the effect. Now we make this exact.
Let X have mean μ and standard deviation σ. Take n independent values of X and find their mean X̄. The mean of X̄ is μ. The variance of X̄ is σ² ÷ n, and so its standard deviation is σ ÷ √n. The standard deviation of a sample mean has its own name, the standard error. Here is why. The sum of n independent values has variance nσ², because variances add. Dividing the sum by n divides its variance by n², and nσ² ÷ n² = σ² ÷ n.
Five samples of four throws. The throws range from 1 to 6, but the five sample means lie between 2.25 and 4.75.
Worked example
Sample 1 in the picture has the four throws 2, 5, 3 and 6. Find its sample mean.
Add the four throws: 2 + 5 + 3 + 6 = 16.
Divide by the number of throws: 16 ÷ 4 = 4.
So the first triangle stands at 4, and the number 4.00 is written beside the row.
Answer: The throws 2, 5, 3 and 6 add to 16, so the sample mean is 4.
Worked example
The mass of a loaf has mean 500 g and standard deviation 8 g. Find the standard deviation of the mean mass of 4 loaves, and of 16 loaves.
The standard deviation of a sample mean is σ ÷ √n.
For 4 loaves: 8 ÷ √4 = 8 ÷ 2 = 4 g.
For 16 loaves: 8 ÷ √16 = 8 ÷ 4 = 2 g.
The mean is 500 g in both cases. Only the spread shrinks.
Answer: The standard deviations are 4 g and 2 g.
If X itself is normal, X̄ is exactly normal as well. Write X ~ N(μ, σ²). Then X̄ ~ N(μ, σ² ÷ n). The curve for X̄ has the same centre and is narrower. We find its probabilities as in chapter 4, with the standard error in place of σ.
One loaf, and the mean of four loaves. Both curves have area 1, so the narrow one is twice as tall.
Worked example
The mass of a loaf is X ~ N(500, 8²) g. Compare the chance that one loaf is heavier than 504 g with the chance that the mean of 4 loaves is heavier than 504 g.
One loaf: z = (504 − 500) ÷ 8 = 0.5. P(X > 504) = 1 − 0.6915 = 0.3085.
Mean of 4 loaves: X̄ ~ N(500, 4²), since 8 ÷ √4 = 4.
Now z = (504 − 500) ÷ 4 = 1. P(X̄ > 504) = 1 − 0.8413 = 0.1587.
A heavy sample mean is about half as likely as a heavy single loaf.
Answer: The chance is 0.3085 for one loaf, and 0.1587 for the sample mean.
The areas beyond 504 g, drawn on one vertical scale. One loaf: 0.3085. The mean of 4 loaves: 0.1587, which is 0.51 times as much, about half.
It is also useful to ask how big a sample must be. Because the standard error is σ ÷ √n, a bigger sample gives a smaller error, but slowly. To halve the standard error you need four times as many values.
Worked example
The mass of a loaf has standard deviation 8 g. How many loaves must be in a sample so that the standard deviation of the mean is at most 1 g?
We need 8 ÷ √n ≤ 1.
So √n ≥ 8, and n ≥ 64.
The sample needs at least 64 loaves.
Check: 8 ÷ √64 = 8 ÷ 8 = 1.
Answer: The sample needs at least 64 loaves.
What if X is not normal? The die is not. The central limit theorem says that for a large sample, X̄ is close to normal whatever the shape of X. A common rule is that 30 values is enough for a normal model. The sum of four dice in chapter 4 already looked like a bell. For a small sample from a distribution that is not normal, a normal model for X̄ may be wrong.
See it three ways
With things
A baker weighs one loaf, then the mean of 4 loaves, then the mean of 16, then 64. The numbers settle closer and closer to the true mean, and each step of four times as many loaves halves the scatter.
As a picture
In words
The mean of a sample has the same centre as one value, but its spread is the single spread divided by the square root of the sample size.
In symbols
E(X̄) = μ, Var(X̄) = σ² ÷ n, standard error σ ÷ √n. If X ~ N(μ, σ²) then X̄ ~ N(μ, σ² ÷ n).
Try it
Throw pairs of dice
You need: two dice, paper and a pencil.
Throw one die 20 times and write the 20 scores. Find the smallest and the largest.
Now throw two dice 20 times. For each pair write the mean, the total divided by 2. Find the smallest and the largest.
Compare the two ranges. Count how many of your 20 values are 1, 1.5 or 6 in the second list.
What you will see: The single scores spread over all of 1 to 6, but the means of pairs rarely reach the ends. The table shows why: the mean 1 needs two ones, which is 1 pair in 36, while the mean 3.5 can be made in 6 ways.
If you cannot try it, this is what happens.
A wrong idea many people have
A bigger sample makes each value in it less variable.
Why it feels right: A bigger sample gives more reliable results, so it seems each value inside should be steadier.
The test that breaks it: Take a loaf with standard deviation 8 g. In a sample of 16 each loaf is still a single loaf, and each can still be 8 g or more from 500 g. It is the mean of the 16 that has standard deviation 2 g.
What is true: Single values keep their spread. A bigger sample makes the sample mean steadier, because highs and lows cancel in the average.
A wrong idea many people have
To halve the standard error, double the sample size.
Why it feels right: More values give a smaller error, and the numbers seem to scale in step.
The test that breaks it: Start with n = 4, where the standard error is 8 ÷ 2 = 4 g. Doubling to n = 8 gives 8 ÷ √8 = 2.83 g, which is not 2 g. Only n = 16 gives 8 ÷ 4 = 2 g.
What is true: The standard error is σ ÷ √n. To halve it, make √n twice as big, which needs n four times as big.
Key words
sample
a set of n values taken from a larger group, which we use to learn about the group.
sample mean
the mean X̄ of the values in a sample. It changes from sample to sample.
standard error
the standard deviation of the sample mean, σ ÷ √n.
central limit theorem
for a large sample, the sample mean is close to normal whatever the shape of the data.
Back to your guess
The answer is B: The mean of four loaves varies less, with a standard deviation of 4 g, half the size.
The standard deviation of the mean of four loaves is 4 g, half of 8 g. Heavy and light loaves in a sample partly cancel when we average them. The spread falls by the square root of the sample size: 8 ÷ √4 = 4. To cut it to a quarter we would need 16 loaves.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
A population has mean 50 and standard deviation 12. A sample of 9 values is taken. What is the standard deviation of the sample mean?
See the answer
4
The standard error is σ ÷ √n = 12 ÷ √9 = 12 ÷ 3 = 4.
If you chose A: That is the standard deviation of a single value. The mean of 9 values varies less. Read this page again.
If you chose B: You divided by n, 12 ÷ 9. The rule divides by the square root of n, which is 3. Read this page again.
A sample is made 4 times as big. What happens to the standard deviation of the sample mean?
See the answer
It becomes half of its old size.
The new standard error is σ ÷ √(4n) = σ ÷ (2√n), which is half the old one.
If you chose A: The standard error is σ ÷ √n. Four times the sample makes √n twice as big, so the error is halved, not quartered. Read this page again.
If you chose B: σ is fixed, but the standard error σ ÷ √n falls as n grows. Read this page again.
X has mean μ. What is the mean of the sample mean X̄ of n values?
See the answer
μ
Means add, so the total has mean nμ, and dividing by n gives μ. The sample mean has the same centre as one value.
If you chose B: The sample mean is not divided again. It is the total divided by n already, and it is centred on μ. Read this page again.
If you chose C: The square root of n belongs to the spread, not the centre. The centre of X̄ is μ. Read this page again.
Why do sample means vary less than single values?
See the answer
High values and low values in a sample partly cancel when averaged.
One extreme value is usually met by values on the other side, so the average is pulled back to the centre. The more values, the stronger the pull.
If you chose B: The values are chosen in the same random way. The smaller spread comes from averaging, not from care. Read this page again.
If you chose C: A sample mean can be off the middle. It is only that it is less often far off. Read this page again.
When can we use a normal model for X̄ even if X is not normal?
See the answer
When the sample is large, about 30 or more.
The central limit theorem says that for a large sample the sample mean is close to normal whatever the shape of X. A common rule of thumb is 30 or more values.
If you chose A: A small sample from a non normal distribution is not close to normal. The mean of two dice is a triangle. Read this page again.
If you chose B: The central limit theorem says a large sample gives a nearly normal X̄ whatever the shape of X. Read this page again.
The standard deviation of single values is 20. A sample of n values gives a sample mean with standard deviation 2. What is n?
See the answer
100
From 20 ÷ √n = 2 we get √n = 10, so n = 10² = 100.
If you chose A: You divided 20 by 2. The standard error is 20 ÷ √n, so √n = 10 and n is 10 squared. Read this page again.
If you chose C: You multiplied 20 by 2. Set 20 ÷ √n = 2, so √n = 10, and square both sides. Read this page again.
From an earlier chapter
For Z ~ N(0, 1), P(Z < 2) = 0.9772. What is P(Z < −2)?
See the answer
0.0228
By symmetry the area left of −2 equals the area right of 2. That is 1 − 0.9772 = 0.0228.
If you chose A: That is P(Z < 2). The point −2 is on the other side of the mean, where the area to the left is small. Go to M5.7.4.
If you chose C: You took away 0.5, as if 0.9772 were measured from the middle. By symmetry P(Z < −2) = 1 − P(Z < 2). Go to M5.7.4.
A population has standard deviation 15 g. A sample of 25 values is taken. Find the standard deviation of the sample mean, in g.
See the answer
3
The standard error is σ ÷ √n = 15 ÷ √25 = 15 ÷ 5 = 3 g.
Journey times are N(40, 6²) minutes. Find the probability that the mean of 9 journeys is less than 38 minutes.
See the answer
0.1587
The mean of 9 journeys is N(40, 2²), since 6 ÷ √9 = 2. Then z = (38 − 40) ÷ 2 = −1, and P(Z < −1) = 1 − 0.8413 = 0.1587.
The standard deviation of single values is 12. What is the smallest sample size that gives a standard deviation of the sample mean of at most 2?
See the answer
36
We need 12 ÷ √n ≤ 2, so √n ≥ 6 and n ≥ 36. The smallest sample size is 36.
The mass of a loaf is X ~ N(500, 8²) g. Find the probability that the mean of 16 loaves is less than 497 g.
See the answer
0.0668
The mean of 16 loaves is N(500, 2²), since 8 ÷ √16 = 2. Then z = (497 − 500) ÷ 2 = −1.5, and P(Z < −1.5) = 1 − 0.9332 = 0.0668.
Keep it
Copy this into your exercise book.
Sample mean X̄: mean μ, standard error σ ÷ √n. X ~ N(μ, σ²) gives X̄ ~ N(μ, σ² ÷ n). Four times the sample halves the error. Large n: X̄ is nearly normal.
Draw: Two bell curves with one centre: a wide one for single values and a narrow one for the sample mean.
M5.7.6 Chapter 6
Testing a claim
A seed packet says that 80% of its seeds grow. Amina plants 20 and only 12 grow. Should she doubt the claim?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Set up a null and an alternative hypothesis
Test a claim about a binomial probability at the 5% level
Write a conclusion in words that does not say more than the test shows
A hypothesis test weighs a claim against a sample. We cannot ask every seed, so we plant 20, and ask whether the result would be a surprise if the claim were true. A surprising result is evidence against the claim. A result that is not surprising is not evidence against it.
The claim we test is the null hypothesis, H₀. It gives p a value: H₀: p = 0.8. We act as if it is true, and look for evidence that it is not. The alternative hypothesis, H₁, says what we suspect instead. Amina suspects fewer seeds grow, so H₁: p < 0.8. This is a one tailed test, because it looks in one direction only. If the suspicion is "different, in either direction", H₁: p ≠ 0.8, the test is two tailed. Decide H₁ from the question, before you look at the data.
If H₀ is true, the number of seeds that grow is X ~ B(20, 0.8). This is the test statistic. The picture shows its distribution. Most of the weight is near 16. A result of 12 or fewer lies far out on the left.
Draw it first
Draw the distribution if the claim is true, and shade the tail
1 Draw the bars of B(20, 0.8), as if the claim were true. The tallest bar is at 16.
2 Shade the bars from 0 up to the result, 12. The shaded area is P(X ≤ 12), the chance of a result as low as Amina's or lower.
The significance level is the line for "too unlikely". It is usually 5%. If the chance of a result as extreme as ours, when H₀ is true, is 5% or less, we reject H₀. We say the result is significant at the 5% level. This way, if H₀ is true, we wrongly reject it in at most 5% of tests.
The steps. (1) Write H₀ and H₁ with p. (2) Say what X is and its distribution if H₀ is true. (3) Find the probability of a result as extreme as the one seen, in the direction of H₁. (4) Compare it with the level. (5) Reject or do not reject H₀, and say what it means in the words of the question.
Worked example
A seed packet claims that the probability that a seed grows is 0.8. Amina suspects it is lower. Write the hypotheses.
The claim is p = 0.8, so H₀: p = 0.8.
Amina suspects a lower probability, in one direction only, so H₁: p < 0.8.
This is a one tailed test.
Answer: H₀: p = 0.8 and H₁: p < 0.8
Worked example
Amina plants 20 seeds and 12 grow. Test the packet's claim at the 5% level.
H₀: p = 0.8 and H₁: p < 0.8.
If H₀ is true, X, the number of seeds that grow, is B(20, 0.8).
The result is 12, so we need P(X ≤ 12). Adding the bars gives P(X ≤ 12) = 0.0321.
Compare: 0.0321 is less than 0.05, so the result is in the critical region.
Reject H₀. There is evidence at the 5% level that fewer than 80% of the seeds grow.
Answer: Reject H₀, because P(X ≤ 12) = 0.0321 is less than 0.05.
Another way to decide is to find the critical region first. It is the set of values of X for which H₀ is rejected. For H₁: p < 0.8 the region is a lower tail, X ≤ c. Take c as large as possible with P(X ≤ c) at most 5%. If the result falls in the region, reject H₀.
Worked example
X ~ B(20, 0.8) if H₀ is true. Find the critical region for a one tailed test of H₁: p < 0.8 at the 5% level. Give the actual significance level.
Work up from the bottom: P(X ≤ 11) = 0.0100, P(X ≤ 12) = 0.0321 and P(X ≤ 13) = 0.0867.
0.0321 is at most 0.05, but 0.0867 is more. So c = 12.
The critical region is X ≤ 12.
The actual significance level is the chance of landing in the region when H₀ is true: 0.0321, about 3.2%.
Answer: The critical region is X ≤ 12 and the actual significance level is 0.0321.
The critical region X ≤ 12. Its bars are low, because these results are rare if the claim is true: together 0.0321, which is under 0.05. A result of 13 would not be in it.
The actual significance level is below 5% because X takes whole numbers only, and the tail cannot be cut at exactly 5%. It never goes above 5%.
In a two tailed test the 5% is shared. Put at most 2.5% in each tail. Take the tail in the direction of the result, and compare its probability with 0.025, not 0.05.
Worked example
A gardener says that half of the seeds from her plants give white flowers. Kofi plants 20 and gets 15 white flowers. Test at the 5% level whether the proportion is different from a half.
H₀: p = 0.5 and H₁: p ≠ 0.5. This is a two tailed test, so each tail may have at most 0.025.
If H₀ is true, X, the number of white flowers, is B(20, 0.5).
The result 15 is in the upper tail, so we need P(X ≥ 15) = 1 − P(X ≤ 14) = 0.0207.
Compare with the tail level: 0.0207 is less than 0.025.
Reject H₀. There is evidence at the 5% level that the proportion of seeds giving white flowers is not one half.
Answer: Reject H₀, because P(X ≥ 15) = 0.0207 is less than 0.025.
The critical region for the two tailed test is X ≤ 5 or X ≥ 15. Each tail is under 0.025, so the actual level is 0.0207 + 0.0207 = 0.0414.
Be careful with the words of the conclusion. When a result is not in the critical region, we say "do not reject H₀" and "there is not enough evidence at the 5% level to say that...". We never say that H₀ is proved. A sample that fails to show a difference does not show there is none.
See it three ways
With things
A packet of seeds has a claim printed on it. Until we have strong evidence against the claim, we go on trusting it. Only a result that is very unlikely if the claim is right makes us doubt it.
As a picture
In words
Find the chance, if the claim is true, of a result as extreme as the one seen. If it is 5% or less, reject the claim.
In symbols
H₀: p = 0.8, H₁: p < 0.8. X ~ B(20, 0.8). P(X ≤ 12) = 0.0321 < 0.05, so reject H₀.
Try it
Find out what a rare result looks like
You need: a die, paper and a pencil.
Throw a die 12 times and count the sixes. This is one run.
Make 10 runs. Write the count of sixes for each.
For a fair die, the number of sixes in a run is B(12, 1/6). Count how many runs gave 5 sixes or more.
What you will see: Most runs give 1, 2 or 3 sixes. For a fair die the chance of 5 or more in a run is 0.0364, about 1 run in 27. You will probably see none in 10 runs. If a die gave 5 sixes in 12 throws, we would have reason to test it.
If you cannot try it, this is what happens.
A wrong idea many people have
If the test does not reject H₀, then H₀ is proved true.
Why it feels right: We started by assuming H₀, and the data gave no reason to drop it, so it seems to be confirmed.
The test that breaks it: Suppose the seeds really grow with probability 0.7, and Amina plants 20. The expected number is 14. A result of 14 has P(X ≤ 14) = 0.1958 under the claim p = 0.8, so we would not reject H₀: p = 0.8, yet the packet is wrong.
What is true: A test can only reject H₀ or fail to reject it. "Do not reject" means the sample gave too little evidence against H₀. With a larger sample we might find a difference.
A wrong idea many people have
The probability 0.0321 is the probability that H₀ is true.
Why it feels right: It is a small chance attached to the claim, and it seems to say how likely the claim is.
The test that breaks it: The claim p = 0.8 is either true or false, so it has no probability of its own here. The number 0.0321 was found by assuming H₀ is true, and it is the chance of X ≤ 12 under that assumption.
What is true: The tail probability is the chance of a result as extreme as ours if H₀ is true. It is not the chance that H₀ is true.
Key words
null hypothesis
H₀, the claim being tested. It gives p a value, such as p = 0.8, and we act as if it is true.
alternative hypothesis
H₁, what we suspect instead: p lower, p higher, or p different.
significance level
the chance below which a result is called too unlikely if H₀ is true. Usually 5%.
critical region
the set of results for which H₀ is rejected.
test statistic
the quantity we measure, here the number of successes X.
Back to your guess
The answer is C: We can decide by asking how likely 12 or fewer would be if the claim were true.
Chance makes results differ from 16 even when the claim is true, so one number being below 16 settles nothing. What counts is how unlikely a result as low as 12 would be if the packet were right. Here that chance is 0.0321, about 3 in 100. That is small enough to doubt the claim.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
A spinner is claimed to land on red with probability 0.3. Joseph suspects it lands on red more often. Which hypotheses fit?
See the answer
H₀: p = 0.3 and H₁: p > 0.3
H₀ is the claim, p = 0.3. Joseph suspects a higher probability, so H₁: p > 0.3, a one tailed test.
If you chose B: The null hypothesis is the claim, and it gives p a value. The suspicion is the alternative hypothesis. Read this page again.
If you chose C: That is a two tailed test. Joseph suspects red comes up more often, in one direction, so H₁ is p > 0.3. Read this page again.
A test at the 5% level gives a tail probability of 0.08 in the direction of H₁. What is the conclusion?
See the answer
Do not reject H₀, because there is not enough evidence at the 5% level.
The tail probability 0.08 is above the level 0.05, so the result is not in the critical region. We do not reject H₀, and we do not claim it is proved.
If you chose A: A result is called significant only when its tail probability is 0.05 or less. Here 0.08 is more than 0.05. Read this page again.
If you chose C: Failing to reject H₀ does not prove it. The sample may be too small to show a difference. Read this page again.
What does a significance level of 5% mean?
See the answer
If H₀ is true, a wrong rejection has chance at most 5%.
The test rejects H₀ for results that have at most 5% chance if H₀ is true. So when H₀ is true, a wrong rejection happens in at most 5% of tests.
If you chose A: H₀ is either true or false. The level is a chance about test results, not about H₀. Read this page again.
If you chose C: The level has nothing to do with the sample size. It is the chance of rejecting H₀ by bad luck when H₀ is true. Read this page again.
H₁ says p is smaller than the claimed value. Where is the critical region for the number of successes X?
See the answer
In the lower tail, small values of X.
If p is smaller than claimed, we expect few successes. So few successes, the lower tail, is the evidence against H₀.
If you chose A: Large values of X would suggest a higher probability. H₁ says p is lower, so small values of X are the evidence. Read this page again.
If you chose B: Both tails belong to a two tailed test. When H₁ is p smaller, only the lower tail counts. Read this page again.
A two tailed test is done at the 5% level. Each tail may have a probability of at most what?
See the answer
2.5%
The two tails together must be at most 5%, so each is at most half of that, 2.5%.
If you chose B: Then the two tails together would be 10%. The 5% is shared between the tails. Read this page again.
If you chose C: That is more than the level. The two tails must together be at most 5%. Read this page again.
X ~ B(15, 0.5) if H₀ is true. A two tailed test at the 5% level has H₁: p ≠ 0.5. The result is 11, and P(X ≥ 11) = 0.0592. What is the conclusion?
See the answer
Do not reject H₀, because 0.0592 is above 0.025.
The test is two tailed, so the upper tail must have probability at most 0.025. It is 0.0592, which is more. The result is not significant.
If you chose A: The comparison is not with 0.1. A two tailed test at 5% compares each tail with 0.025. Read this page again.
If you chose C: Being above the expected value is not enough. The tail probability must be small enough. Read this page again.
From an earlier chapter
A population has standard deviation 10. A sample of 25 values is taken. What is the standard deviation of the sample mean?
See the answer
2
The standard error is σ ÷ √n = 10 ÷ √25 = 10 ÷ 5 = 2.
If you chose A: You divided 10 by 25. The rule divides by the square root of n, which is 5. Go to M5.7.5.
If you chose B: That is the standard deviation of a single value. The mean of 25 values varies less. Go to M5.7.5.
X ~ B(12, 0.3). Find P(X ≥ 7), to 4 decimal places.
See the answer
0.0386
P(X ≥ 7) = 1 − P(X ≤ 6) = 1 − 0.9614 = 0.0386.
X ~ B(15, 0.4) if H₀ is true. For a one tailed test of H₁: p < 0.4 at the 5% level, find the critical region X ≤ c. What is c?
See the answer
2
P(X ≤ 1) = 0.0052 and P(X ≤ 2) = 0.0271 are at most 0.05, but P(X ≤ 3) = 0.0905 is not. So c = 2.
The critical region for a test with X ~ B(15, 0.4) is X ≤ 2. What is the actual significance level, to 4 decimal places?
See the answer
0.0271
The actual level is the chance of the critical region if H₀ is true: P(X ≤ 2) = P(X = 0) + P(X = 1) + P(X = 2) = 0.0005 + 0.0047 + 0.0219 = 0.0271.
Keep it
Copy this into your exercise book.
H₀ is the claim. H₁ is the suspicion. If H₀ is true, X ~ B(n, p). Find the tail probability. At most 5% (2.5% each tail): reject H₀. Say it in words. Never "proved".
Draw: A bar chart of a binomial distribution with the left tail hatched and the result marked.
M5.7.7 Chapter 7
Testing a mean
A baker says that the mean mass of a loaf is 500 g. A sample of 16 loaves has a mean of 496 g. Is that too low to believe the claim?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Test a claim about a mean using a normal model
Explain the two ways a test can give the wrong answer
Find the critical value of the sample mean
Chapter 6 tested a claim about a probability, with X counting successes. Now the claim is about a mean, μ. The test has the same shape: assume H₀ is true, and ask how unlikely the sample would be. The difference is the distribution we use. It is the normal distribution of the sample mean from chapter 5.
Suppose the population is normal with a known standard deviation σ, and H₀: μ = μ₀. For a sample of n values, the sample mean is X̄ ~ N(μ₀, σ² ÷ n) if H₀ is true. Standardise it, and we have the test statistic z = (x̄ − μ₀) ÷ (σ ÷ √n), which is N(0, 1) if H₀ is true. If σ is not known, but n is large, the standard deviation of the sample is used in its place.
The baker claims μ = 500 g. We know σ = 8 g from earlier records. The sample has n = 16 loaves, so the standard error is 8 ÷ √16 = 2 g. If H₀ is true, X̄ ~ N(500, 2²). The baker's claim is wrong if loaves are lighter, so H₁: μ < 500. Draw the curve of X̄ and shade the lower tail.
Draw it first
Draw the distribution of the sample mean and mark the critical value
1 Draw the curve for X̄ if H₀ is true. It is centred at 500 and has standard deviation 2.
2 Mark the point with 5% of the area to its left. It is 1.645 standard errors below 500, which is 500 − 1.645 × 2 = 496.7. A sample mean below it is in the critical region.
The critical values. For a one tailed test at the 5% level the cut off for z is 1.645. A lower tail test rejects H₀ when z is below −1.645. An upper tail test rejects when z is above 1.645. For a two tailed test at the 5% level there is 2.5% in each tail, and the cut offs are z = −1.96 and z = 1.96. Both numbers come from the table of z values in chapter 4: they have 0.95 and 0.975 of the area to the left.
One tail: the lowest 5% of z. If z falls to the left of −1.645, reject H₀.
Worked example
The baker claims μ = 500 g. Take σ = 8 g. A sample of 16 loaves has mean 496 g. Test at the 5% level whether the mean mass is lower than the baker says.
H₀: μ = 500 and H₁: μ < 500. This is a one tailed test.
If H₀ is true, X̄ ~ N(500, 2²), because 8 ÷ √16 = 2.
The test statistic is z = (496 − 500) ÷ 2 = −2.
The critical value for a lower tail at 5% is −1.645. Since −2 is below −1.645, the result is in the critical region.
As a check, P(Z < −2) = 0.0228, which is less than 0.05.
Reject H₀. There is evidence at the 5% level that the mean mass of a loaf is less than 500 g.
Answer: The test statistic is z = −2, so reject H₀.
Two tails: 2.5% in each. If z falls outside −1.96 to 1.96, reject H₀.
Worked example
The baker claims μ = 500 g, with σ = 8 g. A sample of 64 loaves has mean 502.2 g. Test at the 5% level whether the mean mass is different from 500 g.
H₀: μ = 500 and H₁: μ ≠ 500. The test is two tailed.
If H₀ is true, X̄ ~ N(500, 1²), because 8 ÷ √64 = 1.
The test statistic is z = (502.2 − 500) ÷ 1 = 2.2.
The two tailed critical values are ±1.96. Since 2.2 is above 1.96, the result is in the critical region.
Reject H₀. There is evidence at the 5% level that the mean mass of a loaf is not 500 g. The sample mean is above 500 g, so the loaves seem to be heavier.
Answer: The test statistic is z = 2.2, so reject H₀.
We can also work in grams. A critical region for the sample mean itself comes from x̄ = μ₀ − 1.645 × σ ÷ √n, for a lower tail. A sample mean at or below this value rejects H₀.
Worked example
X̄ ~ N(500, 2²) if H₀ is true. Find the critical value of x̄ for a one tailed test of H₁: μ < 500 at the 5% level.
The cut off for z is −1.645.
Turn it back into grams: x̄ = 500 + (−1.645) × 2 = 500 − 3.29 = 496.71.
To 1 decimal place the critical value is 496.7.
The critical region is x̄ ≤ 496.7. A sample mean of 496 is in it, as we found.
Answer: The critical value is 496.7 g.
A test can give the wrong answer in two ways. A Type I error is rejecting H₀ when it is true. Its probability is the significance level, 5%, because that is how often a true H₀ gives a result in the critical region. A Type II error is not rejecting H₀ when it is false. Its probability depends on how far the true mean is from the claim.
The solid curve is X̄ if the claim is true. The hatched tail, 0.050, is the chance of a Type I error. The dashed curve is X̄ if the true mean is 497. The dotted part, 0.558, is the chance of a Type II error. It is a sample mean above the critical value, so H₀ is kept, even though it is false.
Worked example
The one tailed test above rejects H₀ when x̄ ≤ 496.71. Suppose the true mean mass is really 497 g, with the same standard error, 2 g. Find the probability of a Type II error.
A Type II error happens when H₀ is not rejected, so x̄ > 496.71.
If the true mean is 497, X̄ ~ N(497, 2²). We need P(X̄ > 496.71).
Then z = (496.71 − 497) ÷ 2 = −0.145.
P(Z > −0.145) = P(Z < 0.145) = 0.5576, using a calculator for z = 0.145.
To 3 decimal places the chance of a Type II error is 0.558.
Answer: The probability is 0.558.
So a mean that is 3 g under the claim goes undetected more than half of the time. The test is poor at finding small differences with only 16 loaves. The chance of catching a true difference is called the power, 1 − 0.558 = 0.442. Power rises when the true mean is further from the claim, when σ is smaller, and when the sample is larger.
See it three ways
With things
A smoke alarm can sound when there is no fire, which is a false alarm, or stay silent when there is a fire, which is a missed fire. A test of H₀ can err in the same two ways.
As a picture
In words
Type I: reject a true H₀, with chance equal to the significance level. Type II: keep a false H₀, with a chance that depends on the true mean.
In symbols
z = (x̄ − μ₀) ÷ (σ ÷ √n). One tail at 5%: z < −1.645 if H₁ is μ < μ₀, or z > 1.645 if H₁ is μ > μ₀. Two tails: |z| > 1.96.
Try it
See a Type I error happen
You need: a die, paper and a pencil.
Throw the die 12 times and add the scores. The mean is the total divided by 12. This is one run.
Make 10 runs. Write the mean of each.
The die is fair, so the mean should be 3.5. Count how many runs have a mean outside the limits in the table.
What you will see: The limits are the two tailed 5% limits for a fair die. Each run has a 1 in 20 chance of falling outside, so in 10 runs you will often see none, and sometimes one. Each such run would make a test reject a true H₀: a Type I error.
If you cannot try it, this is what happens.
A wrong idea many people have
The probability of a Type II error is also 5%.
Why it feels right: Type I has chance 5%, and the two errors seem to be a matched pair.
The test that breaks it: In the loaf test, if the true mean is 497 g the Type II error has probability 0.558. If the true mean is 494 g, it falls to 0.088. The probability changes with the true mean, but the Type I probability stays 0.05.
What is true: We choose the Type I probability by choosing the level. The Type II probability depends on the true value of μ, which we do not know, so it is not fixed by the test alone.
A wrong idea many people have
A smaller significance level always makes a better test.
Why it feels right: A smaller level means fewer wrong rejections, and fewer errors sounds better.
The test that breaks it: Move the level from 5% to 1%. The one tailed critical value for z moves from −1.645 to −2.326, so the critical value for x̄ becomes 500 − 4.65 = 495.35. Now a true mean of 497 g is even harder to detect.
What is true: Lowering the level lowers the Type I probability but raises the Type II probability. The two cannot both be cut without a bigger sample.
Key words
test statistic
for a mean, z = (x̄ − μ₀) ÷ (σ ÷ √n). It is N(0, 1) if H₀ is true.
critical value
the cut off between rejecting and not rejecting. For z at 5%: 1.645 for one tail, 1.96 for two tails.
Type I error
rejecting H₀ when it is true. Its probability is the significance level.
Type II error
not rejecting H₀ when it is false.
power
the chance of rejecting a false H₀, which is 1 minus the chance of a Type II error.
Back to your guess
The answer is C: It depends on the spread: we ask how many standard errors 496 g lies below 500 g.
The sample mean varies from sample to sample, so being below 500 settles nothing. We measure the gap in standard errors. With σ = 8 g and 16 loaves, the standard error is 2 g, so 496 g is 2 standard errors below the claim. That is unlikely enough to doubt it at the 5% level.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Which formula gives the test statistic for a sample mean x̄ of n values, when H₀ is μ = μ₀ and the standard deviation is σ?
See the answer
z = (x̄ − μ₀) ÷ (σ ÷ √n)
If H₀ is true, X̄ ~ N(μ₀, σ² ÷ n), so its standard deviation is σ ÷ √n. Subtract the mean and divide by that standard deviation.
If you chose B: That divides by the spread of one value. The sample mean has the smaller spread σ ÷ √n. Go to M5.7.5.
If you chose C: The standard error divides σ by the square root of n, not by n. Go to M5.7.5.
A two tailed test is done at the 5% level with a known standard deviation. For which values of z is H₀ rejected?
See the answer
When z is above 1.96 or below −1.96.
Each tail holds 2.5%, so the cut offs are the z values with 0.975 of the area to their left, which is 1.96, and its mirror image −1.96.
If you chose A: Those are the one tailed cut offs, with 5% in one tail. With two tails each has 2.5%, and the cut offs are further out. Read this page again.
If you chose C: The number 0.05 is the level, a probability. The cut offs are values of z. Read this page again.
What is a Type I error?
See the answer
Rejecting H₀ when H₀ is true.
A Type I error is a wrong rejection: H₀ is true, but the sample lands in the critical region by chance.
If you chose B: That is a Type II error. Type I is the other way round: a wrong rejection. Read this page again.
If you chose C: The size of the sample does not define the error. A Type I error is any rejection of a true H₀. Read this page again.
A test is done at the 5% level. What is the probability of a Type I error?
See the answer
0.05
If H₀ is true, the sample lands in the critical region with probability equal to the significance level, 5%, which is 0.05.
If you chose A: That is the chance of not rejecting a true H₀. A Type I error is rejecting it. Read this page again.
If you chose B: That describes a Type II error. A Type I error needs H₀ to be true, and then its chance is the level. Read this page again.
The true mean moves further away from the value in H₀. What happens to the probability of a Type II error?
See the answer
It gets smaller.
The curve for the true mean moves away from the region where H₀ is not rejected, so less of it lies there. The power rises.
If you chose A: A bigger difference is easier to detect, so a miss is less likely, not more. Read this page again.
If you chose B: It does change. The further the true mean, the less its curve overlaps the region where H₀ is kept. Read this page again.
A two tailed test at the 5% level gives z = 1.8. What is the conclusion?
See the answer
Do not reject H₀, because 1.8 is below 1.96.
The two tailed cut offs are ±1.96. Since 1.8 lies between −1.96 and 1.96, it is not in the critical region.
If you chose A: The value 1.645 belongs to a one tailed test. This test is two tailed, so the cut off is 1.96. Read this page again.
If you chose C: A result that is not significant does not prove H₀. It only fails to give enough evidence against it. Go to M5.7.6.
From an earlier chapter
X ~ B(25, 0.4) if H₀ is true. For a one tailed test of H₁: p < 0.4 at the 5% level, P(X ≤ 5) = 0.0294 and P(X ≤ 6) = 0.0736. What is the critical region?
See the answer
X ≤ 5
We want the largest c with P(X ≤ c) at most 0.05. P(X ≤ 5) = 0.0294 is allowed and P(X ≤ 6) = 0.0736 is not, so the critical region is X ≤ 5.
If you chose A: P(X ≤ 6) = 0.0736 is more than 0.05. The region must keep its probability at most 0.05. Go to M5.7.6.
If you chose C: That is a smaller region than allowed. Take c as large as possible with P(X ≤ c) at most 0.05, which is 5 here. Go to M5.7.6.
H₀: μ = 60. The standard deviation is 12 and the sample has 36 values with mean 63.4. Find the test statistic z.
See the answer
1.7
The standard error is 12 ÷ √36 = 2. Then z = (63.4 − 60) ÷ 2 = 3.4 ÷ 2 = 1.7.
H₀: μ = 120, with standard deviation 15 and a sample of 25. For a one tailed test of H₁: μ < 120 at the 5% level, find the critical value of x̄, to 1 decimal place.
See the answer
115.1
The standard error is 15 ÷ √25 = 3. The critical value is 120 − 1.645 × 3 = 120 − 4.935 = 115.065, which is 115.1 to 1 decimal place.
H₀: μ = 500, with standard deviation 8 and a sample of 64. For a two tailed test at the 5% level, the upper critical value of x̄ is 500 + 1.96 × the standard error. Find it, to 1 decimal place.
See the answer
502.0 g
The standard error is 8 ÷ √64 = 1. The upper critical value is 500 + 1.96 × 1 = 501.96, which is 502.0 g to 1 decimal place.
Z ~ N(0, 1). Find P(Z < −2.25), to 4 decimal places.
z = (x̄ − μ₀) ÷ (σ ÷ √n). 5% one tail: 1.645. Two tails: ±1.96. Type I: reject a true H₀, chance = level. Type II: keep a false H₀.
Draw: A bell curve with a dashed line at the critical value and the tail shaded.
M5.7.8 Chapter 8
Correlation and regression
A bean plant grows taller each day. How closely do the days and the height go together, and can I predict the height on a day I did not measure?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
Find and read a correlation coefficient
Find a regression line and use it with care
Say why correlation does not show cause
So far each chapter had one variable. Often we have two, measured on the same things. A bean plant has a number of days since it was planted and a height. A scatter diagram plots each pair as a point. If the points slope up, the variables are positively correlated. If they slope down, they are negatively correlated. If there is no pattern, there is no correlation.
Draw it first
Draw the scatter diagram and the line
1 Plot each pair, the day and the height of the plant, as a dot.
2 Draw one straight line through the middle of the dots. This is the line of best fit, and we will find it by a rule, not by eye.
We want a number for how closely the dots follow a straight line. It is the product moment correlation coefficient, r. It is built from three sums that measure spread. For n pairs: Sxx = Σx² − (Σx)² ÷ n, Syy = Σy² − (Σy)² ÷ n and Sxy = Σxy − (Σx)(Σy) ÷ n. Sxx and Syy are the sums of squared deviations from chapter 2, written another way. Sxy does the same with the pairs together: it is positive when high x goes with high y. Then r = Sxy ÷ √(Sxx × Syy).
Why divide like this? The division scales the result. Whatever units we use, r always falls from −1 to 1. The value r = 1 means all the points lie exactly on a rising line, and r = −1 means exactly on a falling line. The nearer r is to 0, the weaker the straight line pattern. Changing the unit, such as cm to mm, does not change r.
The days x are 1 to 8, and they add to 36. The squares of the days, x², add to 204. The columns of this table give the other sums.
Worked example
The table gives the height y in cm of a bean plant on day x. The sums are Σx = 36, Σy = 55.7, Σx² = 204, Σy² = 465.15 and Σxy = 306.8, with n = 8. Find the correlation coefficient.
So r = 0.985, to 3 decimal places. The relationship is strongly positive and very nearly a straight line.
Answer: r = 0.985
Some values to learn. A value of r near 1 or −1 shows a strong linear relationship. A value near 0 shows no linear relationship. But there is a warning: r measures only straight line patterns.
The seven points follow the exact rule y = x², yet r = 0. The left side falls and the right side rises, and these cancel.
The regression line. A line y = a + bx through the points is a good fit when the vertical gaps between the points and the line, the residuals, are small. The least squares line makes the sum of the squared residuals as small as possible. It is the line of y on x, with y the quantity we want to predict. Its slope and intercept are b = Sxy ÷ Sxx and a = ȳ − b x̄, where x̄ and ȳ are the means. The line always passes through the point (x̄, ȳ).
The short green lines are the residuals. The least squares line makes the sum of their squares as small as it can be. The residuals above the line and below it add to 0.
Worked example
For the bean plants, Sxx = 42 and Sxy = 56.15, the mean day is 4.5 and the mean height is 6.9625. Find the regression line of height on day.
To 3 decimal places, the slope is b = Sxy ÷ Sxx = 56.15 ÷ 42 = 1.337.
The intercept is a = ȳ − b x̄ = 6.9625 − 1.337 × 4.5 = 6.9625 − 6.0165 = 0.946.
So the line is y = 0.946 + 1.337x, with y in cm and x in days.
In words: on average the plant grows 1.337 cm each day.
Answer: a = 0.946 and b = 1.337
Use the line with care. A prediction from a value of x inside the range of the data, here 1 to 8 days, is an interpolation, and it is usually reliable. A prediction far outside the range is an extrapolation. It assumes the straight line pattern goes on, and it often does not. A plant does not grow 1.3 cm a day for ever.
Worked example
Use the line y = 0.946 + 1.337x to predict the height of the plant on day 5.5. Would you also use it for day 40?
Day 5.5 lies inside the data, which run from day 1 to day 8. This is an interpolation, so we can use the line.
So the predicted height is 8.30 cm, to 2 decimal places.
Day 40 is far outside the data. The line would give 54.4 cm, but there is no reason to think the plant keeps growing at this rate, so we would not trust it.
Answer: The height is about 8.30 cm.
One more warning, and the most important. Two variables can be strongly correlated without one causing the other. In hot weather more people swim, and more people also get sunburn. Swimming and sunburn have a high correlation, but the heat is a cause of both. A high r shows that two things go together. Only a careful experiment can show that one causes the other. Also, the line of y on x is for predicting y from x. Do not use it to predict x from y.
See it three ways
With things
Measure the hand span and the forearm length of eight people. Plot the pairs. People with larger spans tend to have longer forearms, and the points rise from left to right.
As a picture
In words
The correlation coefficient says how closely the points follow a straight line, from −1 to 1. The regression line is the best straight line for predicting y.
In symbols
r = Sxy ÷ √(Sxx Syy). b = Sxy ÷ Sxx. a = ȳ − b x̄. The line is y = a + bx.
Try it
Plot your own pairs
You need: a ruler in centimetres, eight people, graph paper or plain paper.
Measure the hand span of each person, tip of thumb to tip of little finger, in cm. Then measure their forearm, elbow to wrist, in cm.
Plot each pair as a dot. Put the hand span along the bottom and the forearm length up the side.
Hold a ruler on the page and slide it until it runs through the middle of the dots. Draw the line.
What you will see: Most people see the dots rise from left to right with some scatter. A calculator can give r and the regression line. You will usually find a clear positive r, but one unusual person can change the line a lot.
If you cannot try it, this is what happens.
A wrong idea many people have
A correlation coefficient close to 0 means the two variables are not related at all.
Why it feels right: A coefficient of 0 sounds like "nothing going on", and a related pair should show a pattern.
The test that breaks it: Take the seven points on the curve y = x² at x = −3, −2, −1, 0, 1, 2, 3. The relation is exact, yet r = 0, because the left side falls, the right side rises, and the two cancel.
What is true: The coefficient r measures only a straight line pattern. A value near 0 means there is no linear relationship. There may still be a curved one, so always look at the scatter diagram.
A wrong idea many people have
A high correlation shows that one variable causes the other.
Why it feels right: When two things move together, it feels natural to think that one pulls the other along.
The test that breaks it: On hot days more people swim, and more people get sunburn. The number of swimmers and the number of sunburn cases have r close to 1. Yet swimming does not cause sunburn here: the sun does, and the sun is also why people swim.
What is true: Correlation shows that two variables go together. It does not show why. A third variable may cause both, or the link may be chance.
Key words
correlation coefficient
r, from −1 to 1, which measures how closely points follow a straight line.
regression line
the least squares line y = a + bx, used to predict y from x.
residual
the vertical distance from a point to the line. The least squares line makes the sum of their squares smallest.
extrapolation
using the line for x far outside the data. It is unreliable. Using it inside the data is interpolation.
Back to your guess
The answer is A: The points lie close to a rising line, so a correlation coefficient of about 0.98 fits.
The coefficient is about 0.98. It is positive because the line rises, and it is close to 1 because the points lie close to the line. A correlation coefficient can never be below −1 or above 1, so 1.98 is impossible.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
Which of these values cannot be a correlation coefficient?
See the answer
1.3
The correlation coefficient always lies from −1 to 1. The value 1.3 is outside this range, so it cannot be r.
If you chose A: A value from −1 to 1 is possible, and 0.4 is a weak positive correlation. Read this page again.
If you chose C: A value from −1 to 1 is possible, and −0.8 is a strong negative correlation. Read this page again.
A correlation coefficient of −0.92 is found for two variables. What does it show?
See the answer
A strong negative linear relationship.
The size, 0.92, is close to 1, so the points lie close to a straight line. The minus sign means the line falls as x rises.
If you chose B: The sign is negative, so one variable falls as the other rises. And 0.92 is close to 1, so it is strong. Read this page again.
If you chose C: The size 0.92 is strong, but the minus sign means the line falls as x rises. Read this page again.
A set of points has r = 0. Which statement is true?
See the answer
There is no linear relationship, but there might be a curved one.
The coefficient r measures only straight line patterns. A curve such as y = x² can have r = 0.
If you chose B: The points on y = x² are exactly related, yet r = 0. A zero value only rules out a straight line pattern. Read this page again.
If you chose C: A flat line has no change in y, so r is not defined for it. A value of 0 is for a cloud or a curve with no linear pattern. Read this page again.
On hot days the number of swimmers and the number of sunburn cases have a high positive correlation. What can we conclude?
See the answer
Hot weather may cause both, so correlation alone does not show cause.
A third variable, the heat, can drive both counts. Correlation shows that the two go together, not that one causes the other.
If you chose A: The sun burns the skin, not the water. A high r alone cannot show what causes what. Read this page again.
If you chose B: No evidence points that way. Correlation does not say which variable acts on the other. Read this page again.
A line y = 2.1 + 0.9x was fitted to data with x from 1 to 8 days. Which prediction would you trust least?
See the answer
The value at x = 30 days.
The x value 30 is far outside the data, which run from 1 to 8. That is an extrapolation, and the straight line pattern may not continue.
If you chose A: Day 4 is inside the data from 1 to 8 days, so this is an interpolation and is usually reliable. Read this page again.
If you chose B: Day 7 is inside the data from 1 to 8 days, so this is an interpolation and is usually reliable. Read this page again.
In the line y = a + bx, the slope is b = 0.9, with y the height in cm and x the day. What does it mean?
See the answer
The plant grows 0.9 cm more for each extra day, on average.
The slope b is the change in y for a change of 1 in x. Here that is 0.9 cm of growth for each extra day.
If you chose A: That would be the intercept a, the value of y when x = 0. The slope is the change per day. Read this page again.
If you chose C: That is true only when a = 0. The slope is the change in height for one more day. Read this page again.
From an earlier chapter
H₀: μ = 50, the standard deviation is 10 and a sample of 25 values has mean 53. What is the test statistic z?
See the answer
1.5
The standard error is 10 ÷ √25 = 2. Then z = (53 − 50) ÷ 2 = 1.5.
If you chose A: You divided by the standard deviation of one value, 10. Divide by the standard error, 10 ÷ √25 = 2. Go to M5.7.7.
If you chose C: You divided by 10 ÷ 25. The standard error divides σ by the square root of n, which is 5. Go to M5.7.7.
For some data, Sxx = 25, Syy = 64 and Sxy = 36. Find the correlation coefficient r.
For the same 10 pairs, Σx = 50, Σy = 140, Σx² = 290 and Σxy = 760, the slope is b = 1.5. Find the intercept a.
See the answer
6.5
The mean of x is 50 ÷ 10 = 5 and the mean of y is 140 ÷ 10 = 14. Then a = ȳ − b x̄ = 14 − 1.5 × 5 = 14 − 7.5 = 6.5.
A regression line is y = 2.1 + 0.9x, with x in days and y the height in cm. Predict the height on day 6, in cm.
See the answer
7.5
y = 2.1 + 0.9 × 6 = 2.1 + 5.4 = 7.5 cm.
Keep it
Copy this into your exercise book.
r = Sxy ÷ √(Sxx Syy), from −1 to 1. Line y = a + bx: b = Sxy ÷ Sxx, a = ȳ − b x̄, through (x̄, ȳ). Predict inside the data. Correlation is not cause.
Draw: A scatter diagram with a line through the middle and a short residual line from each dot to it.
Key words, A to Z
Every key word in this book, what it means, and the chapter that teaches it.
alternative hypothesis
H₁, what we suspect instead: p lower, p higher, or p different. M5.7.6
binomial distribution
the distribution of the number of successes in n independent trials, each with the same chance p of success. Written B(n, p). M5.7.3
central limit theorem
for a large sample, the sample mean is close to normal whatever the shape of the data. M5.7.5
continuous
a variable that can take any value along a line, such as a mass or a time. M5.7.4
correlation coefficient
r, from −1 to 1, which measures how closely points follow a straight line. M5.7.8
critical region
the set of results for which H₀ is rejected. M5.7.6
critical value
the cut off between rejecting and not rejecting. For z at 5%: 1.645 for one tail, 1.96 for two tails. M5.7.7
deviation
a value minus the mean. The deviations of a set always add to 0. M5.7.2
discrete
a variable whose values can be listed one by one, such as 0, 1, 2, 3. M5.7.1
expected value
the mean of X over very many repeats, E(X) = Σ x P(X = x). It is the balance point of the bars. M5.7.1
extrapolation
using the line for x far outside the data. It is unreliable. Using it inside the data is interpolation. M5.7.8
independent
one result does not change the chance of another. M5.7.3
normal distribution
the bell shaped distribution N(μ, σ²), symmetric about its mean μ, with standard deviation σ. M5.7.4
null hypothesis
H₀, the claim being tested. It gives p a value, such as p = 0.8, and we act as if it is true. M5.7.6
power
the chance of rejecting a false H₀, which is 1 minus the chance of a Type II error. M5.7.7
probability distribution
a list of every value of X with its probability. The probabilities add to 1. M5.7.1
random variable
a number that depends on chance, such as the total of two dice. It is named with a capital letter, X. M5.7.1
regression line
the least squares line y = a + bx, used to predict y from x. M5.7.8
residual
the vertical distance from a point to the line. The least squares line makes the sum of their squares smallest. M5.7.8
sample
a set of n values taken from a larger group, which we use to learn about the group. M5.7.5
sample mean
the mean X̄ of the values in a sample. It changes from sample to sample. M5.7.5
significance level
the chance below which a result is called too unlikely if H₀ is true. Usually 5%. M5.7.6
spread
how far the values of a data set are scattered round their mean. M5.7.2
standard deviation
the square root of the variance. It has the same unit as the data. M5.7.2
standard error
the standard deviation of the sample mean, σ ÷ √n. M5.7.5
standard normal distribution
the normal distribution N(0, 1), with mean 0 and standard deviation 1. M5.7.4
test statistic
the quantity we measure, here the number of successes X. M5.7.6, M5.7.7
trial
one try with two outcomes, success or failure. M5.7.3
Type I error
rejecting H₀ when it is true. Its probability is the significance level. M5.7.7