Skip to content
GATEiit

GATE DA · Probability and Statistics

Confidence intervals; z-test, t-test and chi-squared test

Building confidence intervals for a mean, and testing hypotheses with the z-test, t-test and chi-squared tests (goodness of fit, independence, variance): which test to use, the test statistic, and the decision.

Before you start

Concept notes

1. Sampling distribution and standard error

Take a random sample x1,…,xn from a population with mean μ and standard deviation σ. The sample mean xˉ is itself a random variable with mean μ and standard deviation σ/n, called the standard error (SE).

  • If the population is normal, xˉ is exactly normal. If not, it is approximately normal for large n (central limit theorem; n≥30 is the usual rule).
  • The sample standard deviation uses the divisor n−1: s=1n−1∑(xi−xˉ)2. This makes s2 an unbiased estimate of σ2.

Standardising gives the two key statistics:

Z=xˉ−μσ/n∼N(0,1),T=xˉ−μs/n∼tn−1

The second holds for a normal population with σ unknown. The t distribution is symmetric about 0 with heavier tails than N(0,1), and approaches N(0,1) as the degrees of freedom grow.

2. Confidence intervals

A confidence interval (CI) is a range computed from the sample that contains the true parameter in a stated fraction of repeated samples. A 95% CI means: if we repeated the sampling many times, about 95% of the intervals built this way would contain μ. It does not mean μ has a 95% probability of lying in this one fixed interval.

Case CI for μ
σ known (or n large) xˉ±zα/2 σ/n
σ unknown, normal population xˉ±tα/2, n−1 s/n

Common values: z0.05=1.645 (90%), z0.025=1.96 (95%), z0.005=2.576 (99%).

Width =2× critical value × SE. So:

  • higher confidence → wider interval;
  • larger n → narrower interval; width falls as 1/n, so quadrupling n halves the width;
  • the sample size for a margin of error E is n=(zα/2 σ/E)2, rounded up.

3. Hypothesis testing: the framework

  • Null hypothesis H0: the default claim, with an equality (e.g. μ=50).
  • Alternative H1: what we look for evidence of. μ≠50 is two-tailed; μ>50 or μ<50 is one-tailed.
  • Significance level α: the probability of a Type I error, rejecting H0 when it is true.
  • Type II error (β): failing to reject H0 when it is false. Power =1−β.
  • p-value: the probability, assuming H0, of a test statistic at least as extreme as the one observed. Reject H0 if p-value ≤α, equivalently if the statistic falls in the rejection region.

Steps: state H0,H1 → pick the test → compute the statistic → compare with the critical value (or p-value with α) → conclude.

A two-tailed test at level α rejects exactly when the (1−α) CI does not contain the hypothesised value. For a fixed sample size, lowering α raises β. We say "fail to reject" H0, never "accept it as proved".

01.96−1.96do not reject H0area 0.95rejectreject0.0250.025
Two-tailed z-test at α = 0.05: reject H0 when |z| > 1.96 (each shaded tail has area 0.025)

4. z-test and t-test for means

Situation Statistic Distribution under H0
One mean, σ known (or large n) z=xˉ−μ0σ/n N(0,1)
One mean, σ unknown, normal data t=xˉ−μ0s/n tn−1
Two means, σ1,σ2 known z=xˉ1−xˉ2σ12/n1+σ22/n2 N(0,1)
Two means, equal unknown variances t=xˉ1−xˉ2sp1/n1+1/n2 tn1+n2−2
Paired data (before/after) t=dˉsd/n on the differences tn−1

Here sp2=(n1−1)s12+(n2−1)s22n1+n2−2 is the pooled variance.

When to use which: known σ → z. Unknown σ with a small sample from a normal population → t. With a large sample, s is a good estimate of σ and the z-test is used.

Decision rule for a two-tailed test: reject if ∣z∣>zα/2 (or ∣t∣>tα/2,ν). For H1:μ>μ0, reject if z>zα (1.645 at 5%).

5. Chi-squared tests

The chi-squared statistic compares observed counts O with counts E expected under H0:

χ2=∑(O−E)2E

Large values mean poor agreement, so these tests are right-tailed: reject H0 if χ2>χα,ν2.

  • Goodness of fit (k categories): does the data follow a given distribution? ν=k−1−m, where m is the number of parameters estimated from the data (m=0 when the distribution is fully specified).
  • Test of independence (r×c contingency table): are two categorical variables independent? Eij=(row i total)(column j total)grand total and ν=(r−1)(c−1).
  • Test for a variance (normal population): χ2=(n−1)s2σ02 with ν=n−1. This one can be one- or two-tailed.

The chi-squared distribution with ν degrees of freedom has mean ν and variance 2ν. Counts tests need expected counts that are not too small (each E≥5 is the usual rule).

Formulas to remember

Standard error of the mean
SE=σn
CI for the mean, σ knownz0.025=1.96 for 95%
xˉ±zα/2 σn
CI for the mean, σ unknown
xˉ±tα/2, n−1 sn
Sample size for margin ERound up
n=(zα/2 σE)2
One-sample z statistic
z=xˉ−μ0σ/n
One-sample t statistic
t=xˉ−μ0s/n,ν=n−1
Pooled variance
sp2=(n1−1)s12+(n2−1)s22n1+n2−2
Chi-squared statistic for countsGoodness of fit: ν=k−1−m; independence: ν=(r−1)(c−1)
χ2=∑(O−E)2E
Expected count in a contingency table
Eij=Ri CjN
Chi-squared test for a variance
χ2=(n−1)s2σ02,ν=n−1

Common mistakes

  • Using s with divisor n instead of n−1 in the t statistic.
  • Using the z critical value 1.96 for a small-sample t-test; read tα/2,n−1 from the table.
  • Using zα for a two-tailed test or zα/2 for a one-tailed test.
  • Forgetting to subtract estimated parameters from the degrees of freedom in a goodness-of-fit test.
  • Dividing by O instead of E in the chi-squared statistic.
  • Reading a 95% CI as "the true mean lies here with probability 0.95".

Worked examples

Try each step yourself, then reveal the working.

Example 1: 95% confidence interval with known σ

numerical

A sample of 36 bulbs has mean life 50 hours. The population standard deviation is known to be 6 hours. Find the 95% confidence interval for the mean life.

  1. Step 1: Find the standard error.

    Try it on paper first.

Example 2: One-sample t-test

numerical

A machine is supposed to fill 50 g packets. A sample of 16 packets gives xˉ=52 g and s=8 g. Assume normal fill weights. Test H0:μ=50 against H1:μ≠50 at the 5% level. (t0.025,15=2.131.)

  1. Step 1: Which test, and why?

    Try it on paper first.

Example 3: Chi-squared goodness of fit: is the die fair?

numerical

A die is rolled 60 times. Faces 1 to 6 appear 8, 12, 9, 11, 6 and 14 times. Test at 5% whether the die is fair. (χ0.05,52=11.07.)

  1. Step 1: Find the expected counts under H0.

    Try it on paper first.

Example 4: Choosing the right test

conceptual

Name the test for each: (a) mean of 400 exam scores compared with 65, population SD unknown; (b) mean of 10 normal measurements compared with 5, SD unknown; (c) whether gender and choice of elective (3 options) are independent; (d) whether a normal population's variance exceeds 4.

  1. Step 1: Think about (a) and (b): what decides z versus t?

    Try it on paper first.

Previous year questions

No official GATE DA question is tagged with this topic yet. The topic test below uses practice questions.

Topic test

8 questions: original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.