This note covers the normal distribution (finding probabilities, finding values from probabilities and standardising) and the chi-squared tests for independence and for goodness of fit. These tools let you model measurements such as heights or machine output and test whether data fit a claim or whether two categories are linked.
Key ideas
A normal random variable \(X\sim N(\mu,\sigma^2)\) has a bell-shaped, symmetrical curve centred on the mean \(\mu\). The standard deviation \(\sigma\) controls the spread. The total area under the curve is 1, so area means probability. About 68% of values lie within one standard deviation of the mean, about 95% within two and about 99.7% within three.
- Probability from values. Use the normal cumulative distribution function on your GDC with a lower bound, an upper bound, the mean and the standard deviation. For "greater than", use a very large upper bound such as \(10^{99}\), or use \(1-P(X\lt a)\).
- Values from probability. Use the inverse normal function on your GDC. It takes the area to the left, the mean and the standard deviation, and returns the value. If the area is to the right, subtract it from 1 first.
- Standardising. The \(z\)-score \(z=\frac{x-\mu}{\sigma}\) tells you how many standard deviations a value is from the mean. It lets you compare values from different distributions and find an unknown \(\mu\) or \(\sigma\) from the standard normal \(Z\sim N(0,1)\).
- Symmetry. \(P(Z\lt -a)=P(Z\gt a)\). A sketch with the shaded area always helps.
The chi-squared (\(\chi^2\)) tests compare observed counts with the counts you would expect if a stated hypothesis were true.
- Test for independence. Data sit in a contingency table. \(H_0\): the two variables are independent. \(H_1\): they are not independent (they are associated).
- Goodness-of-fit test. \(H_0\): the data follow a stated distribution (for example, equal proportions or a given set of probabilities). \(H_1\): they do not.
- The test statistic is large when observed and expected counts are far apart. The test is always one-tailed (upper tail).
- Each expected frequency should be at least 5. If one is smaller, combine neighbouring categories.
- Decision: if the \(p\)-value is less than the significance level (often 5%), reject \(H_0\). Equivalently, reject \(H_0\) if the statistic is greater than the critical value.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \(X\sim N(\mu,\sigma^2)\) | Normal distribution with mean \(\mu\) and variance \(\sigma^2\). Always check whether a question gives \(\sigma\) or \(\sigma^2\). |
| \(z=\dfrac{x-\mu}{\sigma}\) | Converts \(x\) to a standard score so that \(Z\sim N(0,1)\). |
| \(x=\mu+z\sigma\) | Converts a \(z\)-score back to a value. |
| \(E=\dfrac{\text{row total}\times\text{column total}}{\text{grand total}}\) | Expected frequency for a cell in an independence test. |
| \(\chi^2_{\text{calc}}=\sum\dfrac{(O-E)^2}{E}\) | Test statistic; \(O\) is observed and \(E\) is expected. |
| \(\nu=(r-1)(c-1)\) | Degrees of freedom for an independence test with \(r\) rows and \(c\) columns. |
| \(\nu=n-1\) | Degrees of freedom for a goodness-of-fit test with \(n\) categories, when no parameter is estimated from the data. |
| \(p\)-value | Probability of a statistic at least as large as the one found, assuming \(H_0\) is true. |
Worked examples
Example 1 The length of steel bolts from a machine is \(X\sim N(50.0,\,0.4^2)\) mm. (a) Find the probability that a bolt is between 49.5 mm and 50.6 mm long. (b) The longest 10% of bolts are sent for extra checking. Find the shortest length that is checked.
(a) Here \(\mu=50.0\) and \(\sigma=0.4\). Use the normal cumulative distribution function on the GDC with lower bound 49.5, upper bound 50.6, mean 50 and standard deviation 0.4.
As a check, \(z=\frac{49.5-50}{0.4}=-1.25\) and \(z=\frac{50.6-50}{0.4}=1.5\), so the area is \(P(-1.25\lt Z\lt 1.5)\approx 0.828\).
(b) The top 10% means the area to the left is 0.90. Use the inverse normal function with area 0.9, mean 50 and standard deviation 0.4. This gives \(x\approx 50.5126\).
Answer: (a) 0.828 (b) 50.5 mm
Example 2 A school surveys 200 students about how they usually travel to school (bus, bike or walk), splitting them into two year groups. The results are below. Test at the 5% significance level whether the way students travel is independent of year group.
Year 9: bus 30, bike 45, walk 25. Year 10: bus 20, bike 35, walk 45.
\(H_0\): travel method and year group are independent. \(H_1\): they are not independent.
Row totals are 100 and 100. Column totals are 50 (bus), 80 (bike) and 70 (walk). The grand total is 200.
Expected frequencies: bus \(\frac{100\times 50}{200}=25\), bike \(\frac{100\times 80}{200}=40\), walk \(\frac{100\times 70}{200}=35\). These are the same in both rows. All are at least 5, so the test is valid.
\(\chi^2=\frac{(30-25)^2}{25}+\frac{(45-40)^2}{40}+\frac{(25-35)^2}{35}+\frac{(20-25)^2}{25}+\frac{(35-40)^2}{40}+\frac{(45-35)^2}{35}\)
\(=1+0.625+2.857+1+0.625+2.857\approx 8.96\).
Degrees of freedom: \((2-1)(3-1)=2\). Using the \(\chi^2\) test feature on the GDC with the observed matrix gives \(p\approx 0.0113\).
Since \(0.0113\lt 0.05\), reject \(H_0\). (The critical value for 2 degrees of freedom at 5% is 5.99, and \(8.96\gt 5.99\).)
Answer: \(\chi^2\approx 8.96\), \(p\approx 0.0113\). There is evidence at the 5% level that travel method depends on year group.
Example 3 A café owner claims that 50% of customers choose tea, 30% choose coffee and 20% choose juice. In a sample of 100 customers, 48 chose tea, 35 coffee and 17 juice. Test the claim at the 5% level.
\(H_0\): the choices follow the proportions 50%, 30%, 20%. \(H_1\): they do not.
Expected counts: tea 50, coffee 30, juice 20. All are at least 5.
\(\chi^2=\frac{(48-50)^2}{50}+\frac{(35-30)^2}{30}+\frac{(17-20)^2}{20}=0.08+0.8333+0.45\approx 1.36\).
With 3 categories, \(\nu=3-1=2\). The GDC goodness-of-fit feature gives \(p\approx 0.506\).
Since \(0.506\gt 0.05\), do not reject \(H_0\).
Answer: \(\chi^2\approx 1.36\), \(p\approx 0.506\). There is no evidence against the owner's claim.
Common errors
- Using the variance as the standard deviation. For \(N(50,\,0.4^2)\) the standard deviation is 0.4, not 0.16.
- Entering a right-tail area into the inverse normal function. The GDC expects the area to the left.
- Writing the hypotheses as "there is a relationship" for \(H_0\). The null hypothesis for independence says there is no association.
- Using the wrong degrees of freedom, for example using the number of cells or the sample size instead of \((r-1)(c-1)\) or \(n-1\).
- Saying "accept \(H_0\)" or "prove". Say "do not reject \(H_0\)" or "there is insufficient evidence", and always link the conclusion to the context.
Exam tip: Draw a quick normal sketch and shade the required area before using the GDC. For a chi-squared test, state the hypotheses, the degrees of freedom, the statistic and the \(p\)-value, then compare the \(p\)-value with the significance level in words.
Check yourself
- \(X\sim N(70,\,8^2)\). Find \(P(X\gt 85)\).
Answer
\(z=\frac{85-70}{8}=1.875\). Using the normal cumulative distribution function with lower bound 85 gives \(P(X\gt 85)\approx 0.0304\). - For the same \(X\sim N(70,\,8^2)\), find \(k\) such that \(P(X\lt k)=0.3\).
Answer
The inverse normal function with area 0.3 gives \(z\approx -0.5244\), so \(k=70-0.5244\times 8\approx 65.8\). - A contingency table has 4 rows and 3 columns. How many degrees of freedom does the independence test have, and what is the 5% critical value?
Answer
\(\nu=(4-1)(3-1)=6\). The 5% critical value for 6 degrees of freedom is 12.6. - In a table with a grand total of 200, one row total is 60 and one column total is 40. Find the expected frequency of the cell where they meet.
Answer
\(E=\frac{60\times 40}{200}=12\).