Hypothesis Testing Examples in Statistics

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 Statistics.

Concept Recap

Hypothesis testing is a formal statistical procedure for using sample data to decide between two competing claims about a population parameter. You state a null hypothesis (no effect) and an alternative hypothesis, collect data, compute a test statistic, and determine whether the evidence is strong enough to reject the null.

Hypothesis testing is like a courtroom trial for data. You start by assuming innocence (null hypothesis: nothing special is happening). Then you look at the evidence (data). If the evidence is strong enough to be very unlikely under the assumption of innocence, you reject it and conclude something real is happening.

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 uses a sample result and a variation model to make a careful population statement.

Common stuck point: Students often know a procedure related to hypothesis testing but skip the recognition step: Am I using sample-to-sample variation to make a population claim with uncertainty stated clearly? That leads to a calculation or graph that looks reasonable but answers a different question.

Sense of Study hint: Ask: Am I using sample-to-sample variation to make a population claim with uncertainty stated clearly?

Worked Examples

Example 1

medium
A sample of n=36n=36 has mean xˉ=52\bar{x}=52 and known σ=6\sigma=6. Test H0:μ=50H_0: \mu = 50 vs. Ha:μ50H_a: \mu \ne 50. Compute the z-test statistic.

Answer

z=2z = 2

First step

1
Standard error: σ/n=6/36=1\sigma/\sqrt{n} = 6/\sqrt{36} = 1.

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

medium
Power of a test equals 1β1 - \beta. If β=0.20\beta = 0.20, what is the power?

Example 3

hard
A factory's mean weight is supposed to be μ0=100\mu_0 = 100 g. A sample of n=25n=25 has xˉ=98\bar{x}=98 and s=5s = 5. Compute the t-statistic for H0:μ=100H_0: \mu = 100.

Example 4

hard
An 80%80\% confidence interval for μ\mu is (48.5,51.5)(48.5, 51.5). Does a two-sided test of H0:μ=50H_0: \mu = 50 at α=0.20\alpha = 0.20 reject?

Example 5

medium
A coin is flipped 100100 times and lands heads 6060 times. Test H0:p=0.5H_0: p = 0.5 vs. Ha:p0.5H_a: p \ne 0.5. Compute z.

Example 6

challenge
Two researchers test the same hypothesis at α=0.05\alpha = 0.05. The chance both make a Type I error (when H0H_0 is true and tests are independent) is approximately what?

Example 7

medium
A coin is flipped 100 times and lands heads 60. Use H0:p=0.5H_0: p=0.5 vs Ha:p0.5H_a: p\ne 0.5 and SE =0.50.5/100=0.05= \sqrt{0.5\cdot 0.5/100}=0.05. Compute zz.

Example 8

medium
A sample has xˉ=52\bar{x}=52, s=8s=8, n=64n=64. Test H0:μ=50H_0:\mu=50 vs Ha:μ50H_a:\mu\ne 50. Compute tt.

Example 9

medium
We test H0:p=0.3H_0: p=0.3 vs Ha:p>0.3H_a: p>0.3 with p^=0.35\hat{p}=0.35, n=100n=100, SE under H0H_0 =0.30.7/1000.0458= \sqrt{0.3\cdot 0.7/100} \approx 0.0458. Compute zz.

Example 10

hard
Two independent samples have xˉ1=20,s1=4,n1=50\bar{x}_1=20, s_1=4, n_1=50 and xˉ2=18,s2=5,n2=50\bar{x}_2=18, s_2=5, n_2=50. Test H0:μ1=μ2H_0:\mu_1=\mu_2 vs Ha:μ1μ2H_a:\mu_1\ne\mu_2. Compute tt using SE=s12/n1+s22/n2\text{SE}=\sqrt{s_1^2/n_1+s_2^2/n_2}.

Example 11

hard
A paired-sample test of n=25n=25 differences has dˉ=3\bar{d}=3, sd=10s_d=10. Test H0:μd=0H_0: \mu_d = 0. Compute tt.

Example 12

challenge
Test H0:p=0.5H_0: p=0.5 vs Ha:p>0.5H_a: p>0.5. Out of n=400n=400, 220 successes. Compute zz using SE under H0H_0.

Example 13

hard
A company claims its light bulbs last an average of 1000 hours. A sample of 50 bulbs has xˉ=985\bar{x} = 985 hours with σ=40\sigma = 40. Set up the null and alternative hypotheses for a two-tailed test.

Example 14

hard
Continuing the light bulb example (H0:μ=1000H_0: \mu = 1000, n=50n = 50, xˉ=985\bar{x} = 985, σ=40\sigma = 40), calculate the test statistic.

Practice Problems

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

Example 1

easy
In hypothesis testing, what does the null hypothesis H0H_0 typically state?

Example 2

easy
What is the alternative hypothesis HaH_a?

Example 3

easy
In a hypothesis test, which hypothesis do we assume true while computing evidence?

Example 4

easy
What do we do when the evidence against H0H_0 is strong enough?

Example 5

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

Example 6

easy
A test statistic measures how far the sample result is from H0H_0 in units of what?

Example 7

easy
Fill in: hypothesis testing decides between two competing claims about a population ____.

Example 8

easy
Order the steps: (a) compute test statistic, (b) state hypotheses, (c) decide. What is the correct sequence?

Example 9

medium
A sample mean is 105, the null claims μ0=100\mu_0=100, and SE =2.5=2.5. Compute the test statistic zz.

Example 10

medium
State H0H_0 and HaH_a for testing whether a coin is biased toward heads (pp = probability of heads).

Example 11

medium
A test gives z=2z=2 for a two-sided alternative. Roughly what is the p-value (use that beyond z=2|z|=2 is about 5%)?

Example 12

medium
A two-sided test gives z=2z=2 (p 0.05\approx 0.05). At α=0.05\alpha=0.05, what is the decision?

Example 13

medium
A new drug shows a tiny, clinically meaningless improvement, but the test rejects H0H_0 with n=100,000n=100{,}000. What does this illustrate?

Example 14

medium
Why must hypotheses be stated before collecting or examining the data?

Example 15

medium
A one-sided test of Ha:μ>50H_a: \mu>50 gives z=1.7z=1.7. The upper-tail area beyond z=1.7z=1.7 is about 0.045. At α=0.05\alpha=0.05, decide.

Example 16

medium
In the courtroom analogy, what plays the role of the null hypothesis?

Example 17

medium
A sample of n=49n=49 gives xˉ=53\bar{x}=53, the null claims μ0=50\mu_0=50, and σ=14\sigma=14. Compute the test statistic zz.

Example 18

challenge
A sample of n=64n=64 gives xˉ=52\bar{x}=52, σ=8\sigma=8, testing H0:μ=50H_0:\mu=50 vs Ha:μ>50H_a:\mu>50. Compute zz and decide at α=0.05\alpha=0.05 (one-sided z=1.645z^*=1.645).

Example 19

challenge
Explain the difference between a Type I and a Type II error in hypothesis testing.

Example 20

challenge
A study tests 20 independent hypotheses, each at α=0.05\alpha=0.05, with all nulls actually true. About how many false 'significant' results are expected?

Example 21

easy
A coffee company claims its bags contain 250250 g. State H0H_0 for testing whether the true mean weight differs from 250250 g.

Example 22

easy
A teacher believes a new method increases mean test scores above the historical mean of 7272. State HaH_a.

Example 23

easy
At significance level α=0.05\alpha = 0.05, a p-value of 0.030.03 leads to what decision about H0H_0?

Example 24

easy
At α=0.01\alpha = 0.01, a p-value of 0.040.04 leads to what decision about H0H_0?

Example 25

medium
For Ha:μ>50H_a: \mu > 50 with z=2z = 2, find the approximate p-value (use P(Z>2)0.0228P(Z>2) \approx 0.0228).

Example 26

medium
For Ha:μ50H_a: \mu \ne 50 with z=2z = 2, find the approximate two-sided p-value (use P(Z>2)0.0228P(Z>2) \approx 0.0228).

Example 27

medium
A drug company tests whether its pill lowers blood pressure (Ha:μ<130H_a: \mu < 130). State the direction of the rejection region for a z-test.

Example 28

medium
A two-proportion z-test compares p^1=0.40\hat{p}_1 = 0.40 and p^2=0.50\hat{p}_2 = 0.50 with SE of the difference =0.05=0.05. Compute the z-statistic.

Example 29

medium
A claim says 'at least 60%60\% approve.' A pollster wants to test against this claim. State HaH_a if she suspects approval is lower.

Example 30

hard
For a t-test with n=25n=25, how many degrees of freedom does the t-distribution have?

Example 31

hard
A test has α=0.05\alpha = 0.05 and observed p-value =0.051= 0.051. State and justify the decision.

Example 32

hard
Doubling the sample size (other things equal) changes the standard error by what factor?

Example 33

hard
A chi-square goodness-of-fit test has 44 categories with no estimated parameters. How many degrees of freedom?

Example 34

challenge
If 2020 independent tests are run at α=0.05\alpha = 0.05 when all nulls are true, what is the expected number of false rejections?

Example 35

easy
True or false: if p>αp > \alpha, we reject H0H_0.

Example 36

easy
Which hypothesis carries the burden of proof?

Example 37

easy
If a two-sided test gives z=2.5z = -2.5, is the result statistically significant at α=0.05\alpha=0.05?

Example 38

medium
A drug trial wants to detect whether the drug raises the cure rate above 50%. Write H0H_0 and HaH_a.

Example 39

medium
A test gives z=1.5z = 1.5 (two-sided). The two-tailed p-value is roughly 0.134. At α=0.05\alpha=0.05, what is the decision?

Example 40

medium
Which is the better description of α\alpha: (A) the probability H0H_0 is true; (B) the probability we wrongly reject a true H0H_0?

Example 41

medium
Which decision is consistent with a 95% CI for μμ0\mu - \mu_0 that contains 0?

Example 42

medium
If we shrink α\alpha from 0.05 to 0.01, what happens to (i) Type I error rate, (ii) Type II error rate?

Example 43

hard
An advertiser tests 20 independent claims at α=0.05\alpha=0.05 each. If every H0H_0 is true, about how many will be 'significant' by chance?

Example 44

hard
Why is 'fail to reject H0H_0' weaker than 'accept H0H_0'?

Example 45

hard
Why might a researcher use a one-sided test rather than two-sided?

Example 46

medium
True or false: a statistically significant result with p=0.04p=0.04 always means the practical effect is meaningful.

Example 47

medium
A class average is claimed to be 70. We test H0:μ=70H_0:\mu=70 vs Ha:μ<70H_a:\mu<70. A sample gives xˉ=69\bar{x}=69 with z=0.8z=-0.8. Are we 'getting evidence the average is lower'?

Example 48

hard
An experimenter runs the test, gets p=0.07p=0.07, then collects more data and stops when pp first drops below 0.05. Why is this wrong?

Example 49

hard
A school claims students sleep an average of 8 hours. A sample of 36 students has xˉ=7.5\bar{x} = 7.5 with σ=1.2\sigma = 1.2. State the hypotheses for a one-tailed test (testing if students sleep less) and compute the z-statistic.

Example 50

hard
In a two-tailed z-test at α=0.05\alpha = 0.05, the test statistic is z=2.10z = 2.10. Using critical values ±1.96\pm 1.96, should H0H_0 be rejected?

Background Knowledge

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

sampling distributionstandard errorprobability basic