E = row total × column total / grand total, df = (r − 1)(c − 1)
Critical values (α = 0.05)
df 1: 3.841, 2: 5.991, 3: 7.815, 4: 9.488
Decision
reject H0 if χ² > χ²crit
2Practice problems
1.Normal distributionMedium
X is normal with mean 60 s and standard deviation 5 s; Y is independent and normal with mean 45 s and standard deviation 4 s. Find the probability P that X + Y is more than 111.4 s. Round z to two decimals.
μX = 60, σX = 5μY = 45, σY = 4X + Y > 111.4 s
P =
2.Normal distributionHard
Hole diameters D are normal with mean 25.03 mm and standard deviation 0.02 mm. Shaft diameters d are independent and normal with mean 25 mm and standard deviation 0.01 mm. A randomly chosen shaft fits when D − d > 0. Find the probability P that it fits. Round z to two decimals.
hole: μ = 25.03 mm, σ = 0.02 mmshaft: μ = 25 mm, σ = 0.01 mm
P =
3.Confidence intervalsMedium
The battery life of two phone models is compared. Model 1: 40 phones, mean 120 h, known standard deviation 13 h. Model 2: 80 phones, mean 123.5 h, known standard deviation 5 h. Find the upper limit of the 99% confidence interval for μ₁ − μ₂.
The diameters of 20 machined shafts have a sample standard deviation of 6 µm. Assuming the diameters are normally distributed, find the upper limit σ of the 95% confidence interval for the population standard deviation. With df = 19, 2.5% of the χ² distribution lies below 8.907 and 2.5% lies above 32.852.
n = 20s = 6 µmχ² = 8.907, 32.852
σ = µm
5.Hypothesis tests & confidence intervalsMedium
Two production lines make the same part. Line 1: a sample of 100 parts has mean length 49.5 mm, and the line's known standard deviation is 8 mm. Line 2: a sample of 80 parts has mean 53.7 mm, known standard deviation 12 mm. Find the test statistic z for H₀: μ₁ = μ₂, taking the difference as x̄₁ − x̄₂ (line 1 minus line 2).
A one-sided z test at α = 0.05 must detect a shift of the mean of 3 units with a power of 95%. The standard deviation is 25. Find the minimum sample size n.
The table gives 6 paired observations of x = car age in years and y = price in k€. Find the coefficient of determination r² of the least-squares line.
n = 6
r² =
8.Linear regression & correlationHard
The table gives 5 paired observations of x = hours studied and y = exam score. Use the least-squares line ŷ = a + b·x. Predict ŷ for x = 4.
n = 5x = 4
ŷ =
9.Chi-square testsMedium
The contingency table shows observed counts. Compute the chi-square statistic χ² for the test of independence between the row and column variables. Do not use a continuity correction.
N = 2002 × 3
χ² =
10.Chi-square testsHard
A chi-square goodness-of-fit test compares observed counts in 7 categories with fully specified expected proportions (no parameters are estimated from the data). How many degrees of freedom df does the test have?
k = 7
df =
3Solutions
1.Normal distribution
Answer: P = 0.1587
Sums and differences of normal variables: if X and Y are independent and normal, X + Y and X − Y are normal too. Means add or subtract: E(X ± Y) = μX ± μY. Variances always add, also for a difference: Var(X ± Y) = σX² + σY², so σ = √(σX² + σY²). Standard deviations never add directly. The total of n independent items with the same distribution has mean n·μ and standard deviation σ·√n. Then standardise as usual: z = (x − mean)/σ and read Φ(z).
Distribution of the sum
μ = 105 s, σ = √(5² + 4²) = 6.403 s
Standardise
z = (111.4 − 105)/6.403 = 1
Upper tail
P = 1 − Φ(1) = 1 − 0.8413 = 0.1587
Answer
P = 0.1587
2.Normal distribution
Answer: P = 0.9099
Sums and differences of normal variables: if X and Y are independent and normal, X + Y and X − Y are normal too. Means add or subtract: E(X ± Y) = μX ± μY. Variances always add, also for a difference: Var(X ± Y) = σX² + σY², so σ = √(σX² + σY²). Standard deviations never add directly. The total of n independent items with the same distribution has mean n·μ and standard deviation σ·√n. Then standardise as usual: z = (x − mean)/σ and read Φ(z).
Distribution of the difference
μ = 25.03 − 25 = 0.03 mm, σ = 0.02236 mm
Standardise
z = (0 − 0.03)/0.02236 = −1.34
Probability
P = 1 − Φ(−1.34) = 0.9099
Answer
P = 0.9099
3.Confidence intervals
Answer: upper limit = 1.987 h
Interval for a difference: estimate ± critical value × standard error. For two independent means with known σ: SE = √(σ₁²/n₁ + σ₂²/n₂) and z. With equal unknown variances: pooled s_p and t with n₁ + n₂ − 2 degrees of freedom. For paired data, work with the differences: d̄ ± t·s_d/√n.
Point estimate
x̄₁ − x̄₂ = 120 − 123.5 = −3.5
Standard error
SE = √(13²/40 + 5²/80) = 2.13
Margin of error
E = 2.576·2.13 = 5.487
Interval
−3.5 ± 5.487 → [−8.987, 1.987]
Answer
upper limit = 1.987 h
The interval contains 0, so the data do not show a significant difference.
4.Confidence intervals
Answer: σ = 8.763 µm
Interval for a variance: (n − 1)s²/σ² has a χ² distribution with n − 1 degrees of freedom. The 95% interval for σ² runs from (n − 1)s² divided by the upper χ² value (2.5% above it) to (n − 1)s² divided by the lower χ² value (2.5% below it); the interval for σ is the square root of both limits. It is not symmetric around s.
Sum of squares
(n − 1)s² = 19·6² = 684
Limits for σ²
684/32.852 = 20.82
684/8.907 = 76.79
Limit for σ
σ = √76.79 = 8.763 µm
Answer
σ = 8.763 µm
95% interval for σ: [4.563, 8.763] µm.
5.Hypothesis tests & confidence intervals
Answer: z = −2.689
Hypothesis test: the test statistic = (estimate − value under H₀)/(standard error under H₀). The p-value is the probability, assuming H₀ is true, of a statistic at least as extreme as the one observed: the area in one tail for a one-sided H₁, twice the tail area for a two-sided H₁. Reject H₀ when p ≤ α.
Standard error of the difference
SE = √(8²/100 + 12²/80) = √2.44 = 1.562
Test statistic
z = (49.5 − 53.7)/1.562 = −2.689
Answer
z = −2.689
|z| > 1.96, so H₀ is rejected at the 5% level (two-sided).
6.Hypothesis tests & confidence intervals
Answer: n = 752
Sample size for a test: to detect a true shift δ with power 1 − β in a one-sided z test at level α, the standard error must satisfy δ = (z_α + z_β)·σ/√n, so n = ((z_α + z_β)·σ/δ)², rounded up.
Solve for n
n = ((1.645 + 1.645)·25/3)² = 751.7
Round up
n = 752
Answer
n = 752
7.Linear regression & correlation
Answer: r² = 0.8887
Least-squares regression: with x̄ and ȳ the means, Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ), the line ŷ = a + b·x has slope b = Sxy/Sxx and intercept a = ȳ − b·x̄, so it always passes through (x̄, ȳ). Pearson's correlation coefficient r = Sxy/√(Sxx·Syy) lies between −1 and 1; r² is the fraction of the variation in y explained by the line.
Means
x̄ = 21/6 = 3.5
ȳ = 128/6 = 21.33
Sums of squares and products
Sxx = Σ(x − x̄)² = 17.5
Sxy = Σ(x − x̄)(y − ȳ) = −36
Syy = Σ(y − ȳ)² = 83.33
Coefficient of determination
r² = −36²/(17.5·83.33) = 0.8887
Answer
r² = 0.8887
About 88.87% of the variation in y is explained by the line.
8.Linear regression & correlation
Answer: ŷ = 55.4
Least-squares regression: with x̄ and ȳ the means, Sxx = Σ(x − x̄)², Syy = Σ(y − ȳ)² and Sxy = Σ(x − x̄)(y − ȳ), the line ŷ = a + b·x has slope b = Sxy/Sxx and intercept a = ȳ − b·x̄, so it always passes through (x̄, ȳ). Pearson's correlation coefficient r = Sxy/√(Sxx·Syy) lies between −1 and 1; r² is the fraction of the variation in y explained by the line.
Means
x̄ = 35/5 = 7
ȳ = 358/5 = 71.6
Sums of squares and products
Sxx = Σ(x − x̄)² = 40
Sxy = Σ(x − x̄)(y − ȳ) = 216
Regression line
b = 216/40 = 5.4
a = 71.6 − 5.4·7 = 33.8
ŷ = 33.8 + 5.4·x
Prediction
ŷ = 33.8 + 5.4·4 = 55.4
Answer
ŷ = 55.4
9.Chi-square tests
Answer: χ² = 24.33
Chi-square tests: compare observed counts O with the counts E expected under H₀ using χ² = Σ(O − E)²/E. Goodness of fit: E = n·p for each category, df = k − 1 (minus one more for each parameter estimated from the data). Independence in an r × c table: E = row total × column total / grand total, df = (r − 1)(c − 1). Reject H₀ when χ² exceeds the critical value for the chosen α.
df = 2. At α = 0.05 the critical value is 5.991, so H₀ (independence) is rejected.
10.Chi-square tests
Answer: df = 6
Chi-square tests: compare observed counts O with the counts E expected under H₀ using χ² = Σ(O − E)²/E. Goodness of fit: E = n·p for each category, df = k − 1 (minus one more for each parameter estimated from the data). Independence in an r × c table: E = row total × column total / grand total, df = (r − 1)(c − 1). Reject H₀ when χ² exceeds the critical value for the chosen α.