PROBABILITY AND STATISTICS/Student Engineering Notebook
Page 12·notes
CONFIDENCE INTERVALS & HYPOTHESIS TESTING—~30 MIN READ

t-Tests and Chi-Squared Tests: Which One, and Why

GATE 2027 DA core: z-test, t-test, chi-squared test, t and chi-squared distributions

“Pick the right test in ten seconds, get the degrees of freedom right, and stop losing marks on assumptions.”

1.Which test? Decide before you calculate

Prerequisites: the testing framework (H₀, H₁, α, p-value, rejection region) from [confidence intervals and the z, t and chi-square tests](/notes/probability-and-statistics/confidence-intervals-z-t-and-chisquare-tests), and the t and chi-squared distributions from [sampling distributions](/notes/probability-and-statistics/sampling-distributions-chisquare-t-and-f).

Most mistakes happen before any arithmetic, when the wrong test gets picked. Ask two questions. Is the data numeric measurements or counts in categories? Counts point to chi-squared. For measurements, do you know the population standard deviation σ? If yes (or n is large), use z. If you estimate it with the sample standard deviation s, use t.

The t distribution looks like the normal distribution but has heavier tails, because s itself varies from sample to sample. As df grows, t approaches the standard normal, which is why large samples can use z.

2. The decision table

Feature / AspectSituationTest and statisticDegrees of freedom
One mean, σ knownMean of a measurement vs a claimed μ₀z = (x̄ − μ₀)/(σ/√n)none (standard normal)
One mean, σ unknownSmall sample, roughly normal populationt = (x̄ − μ₀)/(s/√n)n − 1
Before vs after on the same unitsPaired measurementsone-sample t on differences dn − 1 (pairs)
Two independent groupsEqual variances assumedpooled two-sample tn₁ + n₂ − 2
Counts vs expected proportionsOne categorical variable, k categoriesχ² goodness of fitk − 1 − (parameters estimated)
Are two categories related?Contingency table, r rows × c columnsχ² test of independence(r − 1)(c − 1)

✎ Takeaway: Measurements and known σ: z. Measurements and estimated σ: t. Counts: χ².

WORKED NUMERICAL · STUDENT DERIVATION✎ Key Takeaway: Had σ = 3 been known, z = 2.0 > 1.96 would reject. The heavier t tail is exactly why the conclusion flips.

3. Worked example: one-sample t-test

Problem Statement:
A canteen claims its thali weighs 50 g of dal on average. You weigh 9 servings and get a mean of 52 g with sample standard deviation 3 g. At α = 0.05 (two-sided), is the claim contradicted?
n9x̄52 gs3 gμ₀50 g
Step 1: Pick the test

σ is unknown and n is small, so use a one-sample t-test.

↳ Result: H₀: μ = 50, H₁: μ ≠ 50
Step 2: Statistic

Standard error s/√n = 3/3 = 1.

t = (52 − 50) / 1
↳ Result: t = 2.0
Step 3: Critical value

df = n − 1 = 8. For a two-sided test at α = 0.05, use t(0.975, 8).

↳ Result: t_crit = 2.306
Step 4: Decide

|2.0| < 2.306, so the statistic is not in the rejection region.

↳ Result: Fail to reject H₀
Final Answer:t = 2.0 with 8 df is below 2.306, so at the 5% level the data does not contradict the 50 g claim.
WORKED NUMERICAL · STUDENT DERIVATION✎ Key Takeaway: Subtract one extra degree of freedom for every parameter you estimate from the same data (for example, a Poisson mean).

4. Worked example: chi-squared goodness of fit

Problem Statement:
A die is rolled 60 times with counts 8, 12, 9, 11, 6, 14 for faces 1 to 6. At α = 0.05, is the die fair?
Step 1: Expected counts

A fair die gives 60/6 = 10 for every face.

↳ Result: E = 10 for all six faces
Step 2: Statistic

Squared deviations are 4, 4, 1, 1, 16, 16.

χ² = (4 + 4 + 1 + 1 + 16 + 16) / 10
↳ Result: χ² = 4.2
Step 3: Degrees of freedom

k = 6 categories and no parameters estimated from the data.

↳ Result: df = 5
Step 4: Decide

The critical value χ²(0.05, 5) is 11.070. 4.2 < 11.070.

↳ Result: Fail to reject H₀
Final Answer:χ² = 4.2 with 5 df is well below 11.070, so there is no evidence the die is unfair.
WORKED NUMERICAL · STUDENT DERIVATION✎ Key Takeaway: Association is not causation: this test cannot say that making notes caused the passing.

5. Worked example: chi-squared test of independence

Problem Statement:
80 students: of 40 who made their own notes, 30 passed and 10 failed; of 40 who did not, 20 passed and 20 failed. At α = 0.05, is passing independent of making notes?
Step 1: Totals

Passed 50, failed 30, N = 80; each row has 40.

↳ Result: Row totals 40, 40; column totals 50, 30
Step 2: Expected counts

E = row total × column total / N.

40·50/80 = 25, 40·30/80 = 15
↳ Result: E = [[25, 15], [25, 15]]
Step 3: Statistic

Every cell is 5 away from its expected count.

χ² = 25/25 + 25/15 + 25/25 + 25/15
↳ Result: χ² ≈ 5.33
Step 4: Decide

df = (2 − 1)(2 − 1) = 1, and χ²(0.05, 1) = 3.841. 5.33 > 3.841.

↳ Result: Reject H₀
Final Answer:χ² ≈ 5.33 with 1 df exceeds 3.841, so passing and note-making are associated at the 5% level.

6.Common mix-ups

MythBefore-and-after scores are two samples, so use a two-sample t-test.
RealityThey are paired. Test the differences with a one-sample t.

Pairing removes the variation between individuals, so the two-sample test wastes power and uses the wrong df.

MythYou can run a chi-squared test on percentages.
RealityChi-squared needs raw counts.

The statistic depends on sample size. 30% of 10 and 30% of 1000 carry very different evidence.

MythNot rejecting H₀ means H₀ is true.
RealityIt means the data did not provide enough evidence against it.

Small samples often fail to reject even when an effect exists.

STUDENT PRACTICE · CONCEPT DRILL

Practice

Problem 1 · FOUNDATION

A 3 × 4 contingency table is tested for independence. How many degrees of freedom does the chi-squared statistic have?

Problem 2 · GATE-LEVEL

12 students take a test before and after a revision session. Which test compares the means correctly?

Problem 3 · TRICKY

Counts in 5 categories are tested against a Poisson model whose mean was estimated from the same data. What is the df?

Problem 4 · FOUNDATION

Why does a t-test need a larger statistic than a z-test to reject at the same α with a small sample?

RAPID REVIEW · NOTEBOOK SUMMARY

One-minute revision

core principle:

“Counts → χ². Measurements with known σ → z. Measurements with estimated σ → t.”

must-remember principles:
  • •t = (x̄ − μ₀)/(s/√n), df = n − 1
  • •Pooled t: df = n₁ + n₂ − 2
  • •χ² = Σ(O − E)²/E
  • •Independence: df = (r−1)(c−1); fit: df = k − 1 − estimated params
critical exam pitfalls:
  • •Paired ≠ two-sample
  • •Counts, not percentages
  • •Expected counts ≥ ~5
  • •Fail to reject ≠ accept
SOURCE TRANSPARENCY & CITATIONS

Primary Academic References & Exam Sources

Every concept in Notes From a B.Tech Brain is synthesized from authoritative academic texts, seminal peer-reviewed research, verified exam archives, and renowned university lectures.

Primary Academic Texts
NIST/SEMATECH e-Handbook of Statistical Methods↗by NIST · t-tests, chi-square goodness of fit, contingency tables, critical value tables.
ACADEMIC STANDARD
Applied Statistics and Probability for Engineersby · Hypothesis tests on means, paired comparisons, goodness of fit and contingency tables.
ACADEMIC STANDARD
Official Examination Archives
GATE 2027 DA syllabus↗IIT Madras · Probability and Statistics: t-distribution, chi-squared distribution, z-test, t-test, chi-squared test.
GATE CS OFFICIAL