Skip to content

Hypothesis Testing (Extended)

This document provides a rigorous treatment of hypothesis testing methodology, including null and Alternative hypotheses, significance levels, Type I and II errors, one-tailed and two-tailed tests, And critical regions.


The null hypothesis H0H_0 is the default assumption — a statement of “no effect” or “no difference.” It is assumed to be true unless the evidence is sufficiently compelling to reject It.

The alternative hypothesis H1H_1 specifies what we believe might be true instead. It is only Accepted if the evidence against H0H_0 is strong enough.

A test statistic is a function of the sample data whose distribution is known under H0H_0. Common test statistics include sample proportions, sample means, and sample correlation Coefficients.

The significance level α\alpha is the maximum probability of rejecting H0H_0 when it is Actually true. Common values are α=0.05\alpha = 0.05 (5%), α=0.01\alpha = 0.01 (1%), and α=0.10\alpha = 0.10 (10%).

  1. Assume H0H_0 is true.
  2. Calculate the probability of obtaining a test statistic at least as extreme as the observed value, assuming H0H_0.
  3. If this probability (the pp-value) is less than α\alphaReject H0H_0. Otherwise, do not reject H0H_0.

Alternatively, find the critical value cc such that P(test statisticcH0)=αP(\mathrm{test\ statistic} \geq c \mid H_0) = \alpha (for an upper-tailed test). If the observed test statistic exceeds ccReject H0H_0.

  • “Reject H0H_0”: there is sufficient evidence at the α\alpha significance level to support H1H_1.
  • “Do not reject H0H_0”: there is insufficient evidence to reject H0H_0. This does not mean H0H_0 is true.

DecisionH0H_0 trueH0H_0 false
Reject H0H_0Type I errorCorrect decision
Do not rejectCorrect decisionType II error

Type I error: Rejecting H0H_0 when it is true (false positive).

P(Type I)=αP(\mathrm{Type\ I}) = \alpha

Type II error: Failing to reject H0H_0 when it is false (false negative).

P(Type II)=βP(\mathrm{Type\ II}) = \beta

The power of a test is the probability of correctly rejecting H0H_0 when it is false:

Power=1β\mathrm{Power} = 1 - \beta

The power depends on:

  • The significance level α\alpha (increasing α\alpha increases power).
  • The sample size nn (increasing nn increases power).
  • The true value of the parameter (the further from H0H_0The greater the power).

Problem. A machine produces bolts with mean length 50  mm50\;\mathrm{mm}. The standard deviation is 0.5  mm0.5\;\mathrm{mm}. A sample of 16 bolts has mean 50.18  mm50.18\;\mathrm{mm}. Test at the 5% significance Level whether the mean length has changed.

H0:μ=50H_0: \mu = 50, H1:μ50H_1: \mu \neq 50 (two-tailed).

Under H0H_0: XˉN(50,0.52/16)=N(50,0.015625)\bar{X} \sim N(50, 0.5^2/16) = N(50, 0.015625).

Critical values: xˉ\bar{x} such that P(Xˉ50c)=0.05P(|\bar{X} - 50| \geq c) = 0.05.

z=±1.96z = \pm 1.96 for a two-tailed 5% test.

c=50±1.96×0.125=50±0.245c = 50 \pm 1.96 \times 0.125 = 50 \pm 0.245

Critical region: Xˉ<49.755\bar{X} \lt 49.755 or Xˉ>50.245\bar{X} \gt 50.245.

Test statistic: z=50.18500.125=1.44z = \dfrac{50.18 - 50}{0.125} = 1.44.

Since 1.44<1.961.44 \lt 1.96We do not reject H0H_0. There is insufficient evidence at the 5% level To conclude that the mean length has changed.

2.4 Finding the probability of Type II error

Section titled “2.4 Finding the probability of Type II error”

Continuing the example above, suppose the true mean is μ=50.2\mu = 50.2.

β=P(do not reject H0μ=50.2)\beta = P(\mathrm{do\ not\ reject}\ H_0 \mid \mu = 50.2)

=P(49.755<Xˉ<50.245XˉN(50.2,0.015625))= P(49.755 \lt \bar{X} \lt 50.245 \mid \bar{X} \sim N(50.2, 0.015625))

=P ⁣(49.75550.20.125<Z<50.24550.20.125)=P(3.56<Z<0.36)= P\!\left(\dfrac{49.755 - 50.2}{0.125} \lt Z \lt \dfrac{50.245 - 50.2}{0.125}\right) = P(-3.56 \lt Z \lt 0.36)

=Φ(0.36)Φ(3.56)0.64060.0002=0.6404= \Phi(0.36) - \Phi(-3.56) \approx 0.6406 - 0.0002 = 0.6404

Power =10.6404=0.3596= 1 - 0.6404 = 0.3596.


A one-tailed test is used when H1H_1 specifies a direction:

  • H1:μ>μ0H_1: \mu \gt \mu_0 (upper-tailed): critical region in the upper tail.
  • H1:μ<μ0H_1: \mu \lt \mu_0 (lower-tailed): critical region in the lower tail.

The entire significance level α\alpha is in one tail, making it easier to detect an effect in the Specified direction.

A two-tailed test is used when H1H_1 does not specify a direction:

  • H1:μμ0H_1: \mu \neq \mu_0: critical region split between both tails, with α/2\alpha/2 in each.
  • Use a two-tailed test unless there is a strong prior reason to expect a specific direction.
  • A one-tailed test has greater power in the specified direction but cannot detect effects in the opposite direction.
  • The choice must be made before examining the data.

For a standard normal test at significance level α\alpha:

Test typeα=0.10\alpha = 0.10α=0.05\alpha = 0.05α=0.01\alpha = 0.01
Two-tailed±1.645\pm 1.645±1.960\pm 1.960±2.576\pm 2.576
Upper-tailed1.2821.2821.6451.6452.3262.326
Lower-tailed1.282-1.2821.645-1.6452.326-2.326

4. Hypothesis Tests for the Binomial Proportion

Section titled “4. Hypothesis Tests for the Binomial Proportion”

To test whether a population proportion pp equals a specified value p0p_0:

H0:p=p0,H1:pp0 (or p>p0 or p<p0)H_0: p = p_0, \qquad H_1: p \neq p_0\ (\mathrm{or}\ p \gt p_0\ \mathrm{or}\ p \lt p_0)

Under H0H_0If XX is the number of successes in nn trials, then XB(n,p0)X \sim B(n, p_0).

Problem. A coin is tossed 20 times and lands heads 15 times. Test at the 5% significance level Whether the coin is biased.

H0:p=0.5H_0: p = 0.5, H1:p0.5H_1: p \neq 0.5 (two-tailed).

Under H0H_0: XB(20,0.5)X \sim B(20, 0.5).

For a two-tailed test at 5%, we need the critical region in each tail to have probability 0.025\leq 0.025.

Lower tail: P(Xk)0.025P(X \leq k) \leq 0.025.

P(X5)=0.02070.025P(X \leq 5) = 0.0207 \leq 0.025. So k=5k = 5 (critical region: X5X \leq 5).

Upper tail: P(Xk)0.025P(X \geq k) \leq 0.025.

P(X15)=P(X5)=0.02070.025P(X \geq 15) = P(X \leq 5) = 0.0207 \leq 0.025. So k=15k = 15 (critical region: X15X \geq 15).

Since X=15X = 15 falls in the critical region, we reject H0H_0. There is sufficient evidence at The 5% level to conclude the coin is biased.

The actual significance level is the probability of being in the critical region under H0H_0:

αactual=P(X5)+P(X15)=2(0.0207)=0.0414\alpha_{\mathrm{actual}} = P(X \leq 5) + P(X \geq 15) = 2(0.0207) = 0.0414

This is approximately 4.14%, which is the closest we can get to 5% with a discrete distribution.

Mathematics is the study of structure, quantity, and change. Algebra provides symbols for unknown quantities, geometry describes spatial relationships, and calculus captures motion and growth. Together, these branches form a powerful toolkit for solving problems that range from calculating areas to predicting population dynamics. Mathematical literacy is essential for science, technology, and informed citizenship.