Hypothesis Testing Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Hypothesis Testing.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

A systematic method to decide whether sample data provides enough evidence to reject a claim (null hypothesis) about a population parameter.

Think of a courtroom trial: the null hypothesis (H0H_0) is 'innocent until proven guilty.' You look at the evidence (data) and ask: 'Is this evidence so strong that it would be very unlikely if the defendant were truly innocent?' If yes, you reject the null hypothesis. If not, you don't have enough evidence to convict—but that doesn't prove innocence.

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Hypothesis testing checks whether sample data is surprising enough to reject a default claim about a population.

Common stuck point: The procedure for hypothesis testing is the easy part; the trap is treating 'fail to reject H0H_0' as 'prove H0H_0 true'. Asking "Am I deciding whether sample data is surprising enough to reject a specific stated claim about a population?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Am I deciding whether sample data is surprising enough to reject a specific stated claim about a population?

Worked Examples

Example 1

medium
A school claims its students average 75 on standardized tests. A sample of n=36n=36 gives xˉ=78\bar{x}=78 with σ=12\sigma=12. Test H0:μ=75H_0: \mu=75 vs Ha:μ>75H_a: \mu>75 at α=0.05\alpha=0.05.

Answer

z=1.5z=1.5, p=0.067>0.05p=0.067 > 0.05. Fail to reject H0H_0. Evidence is inconclusive.

First step

1
Calculate test statistic: z=xˉμ0σ/n=787512/36=32=1.5z = \frac{\bar{x} - \mu_0}{\sigma/\sqrt{n}} = \frac{78 - 75}{12/\sqrt{36}} = \frac{3}{2} = 1.5

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

hard
A medication is claimed to reduce blood pressure by 10 mmHg on average. A clinical trial with n=49n=49 patients shows xˉ=8.2\bar{x}=8.2 mmHg reduction, s=7s=7 mmHg. Test H0:μ=10H_0: \mu=10 vs Ha:μ10H_a: \mu \neq 10 at α=0.05\alpha=0.05.

Example 3

medium
A factory claims defect rate 5%5\%. From n=400n = 400, p^=0.08\hat p = 0.08. Test H0:p=0.05H_0: p = 0.05 vs Ha:p>0.05H_a: p > 0.05 at α=0.05\alpha = 0.05.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
State null and alternative hypotheses for each scenario: (a) testing if a coin is fair, (b) testing if a new drug reduces fever faster than the standard drug.

Example 2

hard
A teacher claims students average 80 points. A skeptic samples n=25n=25 students: xˉ=76\bar{x}=76, s=10s=10. Using z=xˉμ0s/nz = \frac{\bar{x}-\mu_0}{s/\sqrt{n}}, test H0:μ=80H_0: \mu=80 vs Ha:μ<80H_a: \mu < 80 at α=0.01\alpha=0.01.

Example 3

easy
In a hypothesis test, what is the null hypothesis H0H_0 usually a statement of?

Example 4

easy
A test gives p=0.02p = 0.02 with α=0.05\alpha = 0.05. Do you reject or fail to reject H0H_0?

Example 5

easy
A test gives p=0.08p = 0.08 with α=0.05\alpha = 0.05. State the conclusion.

Example 6

easy
True or false: failing to reject H0H_0 proves H0H_0 is true.

Example 7

easy
When must the significance level α\alpha be chosen?

Example 8

easy
A claim is 'the mean equals 100100.' Write the null hypothesis symbolically.

Example 9

easy
A researcher wants to show the mean is greater than 5050. What is the alternative hypothesis HaH_a?

Example 10

easy
Does a statistically significant result automatically mean the effect is large and important?

Example 11

medium
A test of H0:μ=100H_0: \mu = 100 vs Ha:μ100H_a: \mu \ne 100 has xˉ=104\bar{x} = 104, σ=10\sigma = 10, n=25n = 25. Compute the z test statistic.

Example 12

medium
A two-sided test has test statistic z=2z = 2. Using P(Z>2)0.0228P(Z > 2) \approx 0.0228, find the p-value.

Example 13

medium
With test statistic z=2z = 2, two-sided p-value 0.04560.0456, and α=0.05\alpha = 0.05, state the conclusion.

Example 14

medium
A one-sided test Ha:μ>50H_a: \mu > 50 has xˉ=53\bar{x} = 53, σ=12\sigma = 12, n=36n = 36. Find zz.

Example 15

medium
For a right-tailed test, z=1.5z = 1.5 and P(Z>1.5)0.0668P(Z > 1.5) \approx 0.0668. With α=0.05\alpha = 0.05, conclude.

Example 16

medium
A test rejects H0H_0 at α=0.05\alpha = 0.05 but a 95%95\% CI for μ\mu is (48,52)(48, 52) and H0:μ=50H_0: \mu = 50. Is this consistent?

Example 17

medium
A test of H0:μ=200H_0: \mu = 200 vs Ha:μ200H_a: \mu \ne 200 has xˉ=195\bar{x} = 195, σ=20\sigma = 20, n=16n = 16. Find zz.

Example 18

challenge
Explain why we say 'fail to reject H0H_0' rather than 'accept H0H_0', using the courtroom analogy.

Example 19

challenge
With nn very large, a trivial effect (mean differs from 100100 by 0.10.1) becomes statistically significant. Explain the mechanism and the lesson.

Example 20

challenge
A researcher runs 2020 independent tests at α=0.05\alpha = 0.05 on data where every H0H_0 is true. What is the expected number of false rejections, and what is this problem called?

Example 21

medium
A two-sided z-test has z=1.8z = -1.8. Using P(Z<1.8)0.0359P(Z < -1.8) \approx 0.0359, find the p-value and conclude at α=0.05\alpha = 0.05.

Example 22

medium
A test of H0:μ=25H_0: \mu = 25 vs Ha:μ>25H_a: \mu > 25 has xˉ=28\bar{x} = 28, σ=6\sigma = 6, n=9n = 9. Find zz.

Example 23

easy
A test has p=0.03p = 0.03 and α=0.05\alpha = 0.05. State the decision and what it means.

Example 24

easy
State the null and alternative hypotheses for testing if a coin's heads probability differs from 0.50.5.

Example 25

easy
A z-test gives test statistic z=0.5z = 0.5 and P(Z>0.5)0.3085P(Z > 0.5) \approx 0.3085. Find the two-sided p-value.

Example 26

easy
For H0:μ=50H_0: \mu = 50 vs Ha:μ<50H_a: \mu < 50 with z=2.5z = -2.5 and P(Z<2.5)0.0062P(Z < -2.5) \approx 0.0062, state the conclusion at α=0.01\alpha = 0.01.

Example 27

medium
For H0:μ=100H_0: \mu = 100 vs Ha:μ100H_a: \mu \ne 100 with xˉ=106\bar x = 106, σ=10\sigma = 10, n=25n = 25, compute the z statistic.

Example 28

medium
Continuing: with z=3z = 3 in a two-sided test, P(Z>3)0.00135P(Z > 3) \approx 0.00135. Find the p-value.

Example 29

medium
For H0:p=0.5H_0: p = 0.5 vs Ha:p>0.5H_a: p > 0.5, p^=0.60\hat p = 0.60, n=100n = 100, compute the z statistic.

Example 30

medium
With z=2z = 2 in a right-tailed proportion test and P(Z>2)0.0228P(Z > 2) \approx 0.0228, conclude at α=0.05\alpha = 0.05.

Example 31

medium
Compute the z statistic for H0:μ=70H_0: \mu = 70, xˉ=67\bar x = 67, σ=8\sigma = 8, n=64n = 64.

Example 32

medium
With z=3z = -3 in a two-sided test, P(Z<3)0.00135P(Z < -3) \approx 0.00135. Find p-value and conclude at α=0.01\alpha = 0.01.

Example 33

medium
State which error type is committed: a court convicts an innocent defendant.

Example 34

medium
State which error type is committed: a court fails to convict a guilty defendant.

Example 35

medium
A two-sided test produces p=0.04p = 0.04. What is the smallest significance level at which we reject H0H_0?

Example 36

medium
Match: α=0.05\alpha = 0.05. The 95% confidence interval for μ\mu is (48,52)(48, 52) and we test H0:μ=50H_0: \mu = 50. Decision?

Example 37

hard
A researcher runs 5050 independent hypothesis tests at α=0.05\alpha = 0.05 under all true nulls. What is the expected number of false rejections and the probability of at least one?

Example 38

hard
With n=100n = 100, xˉ=102\bar x = 102, σ=10\sigma = 10, test H0:μ=100H_0: \mu = 100 vs Ha:μ100H_a: \mu \ne 100. Compute z and the p-value (use P(Z>2)0.0228P(Z > 2) \approx 0.0228).

Example 39

hard
Why does increasing nn (with fixed σ\sigma and effect size) tend to make any nonzero deviation statistically significant?

Example 40

hard
For H0:μ=0H_0: \mu = 0 vs Ha:μ>0H_a: \mu > 0, σ=2\sigma = 2, the rejection region is xˉ>1.0\bar x > 1.0. With true μ=1.5\mu = 1.5 and n=16n = 16, find the power.

Example 41

hard
Explain why p-hacking inflates the Type I error rate.

Example 42

challenge
For a one-sided test Ha:μ>μ0H_a: \mu > \mu_0 with σ\sigma known, derive the sample size nn needed to achieve power 1β1 - \beta at significance α\alpha for a specified effect δ=μ1μ0\delta = \mu_1 - \mu_0.

Example 43

challenge
Using the Bonferroni correction for mm independent tests, what individual α\alpha should each test use to maintain family-wise error rate 0.05\le 0.05 with m=10m = 10?

Background Knowledge

These ideas may be useful before you work through the harder examples.

sampling distributionnormal distributionprobability