4.9.21 · D3Probability Theory & Statistics

Worked examples — z-test, t-test, chi-squared goodness of fit, F-test

4,079 words19 min readBack to topic

This page is a drill. The parent note built the machinery — here we walk through every case class the four tests can throw at you: known vs unknown spread, one-sided vs two-sided, tiny samples, degenerate/limiting inputs, and exam traps.

Before symbols show up, one reminder in plain words so line one is followable:


The scenario matrix

Each row is a case class you must be able to handle. The right column names the worked example that lands on it.

# Case class What makes it tricky Example
A Mean, known, two-sided denominator is a fixed constant Ex 1
B Mean, known, one-sided tail lives on one side only (sign of cutoff) Ex 2
C Mean, unknown, small must use → fatter-tailed Ex 3
D Limiting case: collapses into Ex 4
E GOF, uniform expected all equal, Ex 5
F GOF, estimated parameter lose an extra d.f., Ex 6
G Degenerate GOF: zero surprise, Ex 7
H F-test, two variances, two-sided larger on top, Ex 8
I Word problem end-to-end choosing the right test yourself Ex 9
J Exam twist: same data, wrong test how the verdict flips Ex 10

We lean on Central Limit Theorem, Student's t-distribution, Chi-squared Distribution, F-distribution, Degrees of Freedom and Bessel's Correction throughout — the parent note defined them; here we use them.

Figure — z-test, t-test, chi-squared goodness of fit, F-test

How to read the figure (four small panels):

  • Top-left overlays the standard Normal (blue, the curve) and a with (orange). The shaded orange slivers past are the extra tail area the carries — that shaded region is precisely why the critical value ( in Ex 3) sits farther out than the 's .
  • Top-right shows two curves (used in Ex 5–7); the red dashed line at is the upper-tail fence — note lives only on the positive axis, so there is no lower tail.
  • Bottom-left shows (Ex 8) with its upper critical value at .
  • Bottom-right stacks curves for then against the Normal, so you can watch the tails thin as grows — the visual meaning of "" in Ex 4.

Keep this figure in view: every example below points back to one of its four panels.


Cell A — Mean, known, two-sided


Cell B — Mean, known, one-sided (mind the sign of the cutoff)


Cell C — Mean, unknown, small


Cell D — Limiting case


Cell E — GOF, uniform expected counts


Cell F — GOF with an estimated parameter


Cell G — Degenerate GOF: perfect match


Cell H — F-test, two variances, two-sided

Figure — z-test, t-test, chi-squared goodness of fit, F-test

How to read this figure: the blue curve is the luck curve for the ratio of two sample variances. The red dashed line at is the upper-tail fence; the red-shaded region beyond it is the rejection zone. The orange line marks our observed — sitting left of the fence, inside the "could be luck" region.


Cell I — Word problem, choose the test yourself


Cell J — Exam twist: same data, wrong test flips the verdict


Recall Fast self-check

Which cell has exactly , and when? ::: Cell G — degenerate GOF, whenever every ; is a sum of squares so is its floor and its p-value is . In Ex 2 why is the fence not ? ::: The subscript names an upper tail area, but puts the rejection region in the lower tail, so we mirror to . In Ex 8 why is the larger variance on top? ::: So and we only ever read the single upper-tail critical value. In Ex 6 why is not ? ::: We estimated one parameter () from the data, costing an extra degree of freedom: . State both verdict rules. ::: Critical-value rule: reject if statistic beyond . p-value rule: reject if p-value . They always agree.