Skip to content
🎯⭐ INTERACTIVE LESSON

Hypothesis Testing Framework

Learn step-by-step with interactive practice!

Hypothesis Testing Framework - Complete Interactive Lesson

Part 1: Null & Alternative Hypotheses

📐 Null & Alternative Hypotheses

Part 1 of 7 — Setting Up the Test


What Is Hypothesis Testing?

Hypothesis testing is a formal procedure for using sample data to decide between two competing claims about a population parameter.

ComponentSymbolDescription
Null hypothesisH0H_0No effect / no difference — the status quo
Alternative hypothesisHaH_aThere IS an effect / difference — the research claim

🔑 Key Idea: We assume H0H_0 is true and look for evidence against it. We NEVER prove H0H_0 true — we either reject it or fail to reject it.


Writing Hypotheses

Hypotheses are always about population parameters (μ\mu, pp), never about sample statistics (xˉ\bar{x}, p^\hat{p}).

For means:

TypeH0H_0HaH_aWhen to Use
Two-tailedH0:μ=μ0H_0: \mu = \mu_0Ha:μ≠μ0H_a: \mu \neq \mu_0"Is there a difference?"
Right-tailedH0:μ=μ0H_0: \mu = \mu_0Ha:μ>μ0H_a: \mu > \mu_0"Is it greater than?"
Left-tailedH0:μ=μ0H_0: \mu = \mu_0Ha:μ<μ0H_a: \mu < \mu_0"Is it less than?"

For proportions:

TypeH0H_0HaH_a
Two-tailedH0:p=p0H_0: p = p_0Ha:p≠p0H_a: p \neq p_0
Right-tailedH0:p=p0H_0: p = p_0Ha:p>p0H_a: p > p_0
Left-tailedH0:p=p0H_0: p = p_0Ha:p<p0H_a: p < p_0

⚠️ Important: H0H_0 always contains the equals sign (==). The alternative contains ≠\neq, >>, or <<.


Worked Example

Claim: "Students at this school score higher than the national average of 75."

  • Parameter: μ\mu = true mean score of students at this school
  • H0:μ=75H_0: \mu = 75 (no difference from national average)
  • Ha:μ>75H_a: \mu > 75 (school average is higher)

This is a right-tailed test because the claim is "higher than."


Significance Level (α\alpha)

Before testing, we choose a significance level α\alpha (usually 0.05):

α\alphaMeaning
0.05Reject H0H_0 if the evidence would occur less than 5% of the time under H0H_0
0.01More stringent — only reject with very strong evidence
0.10Less stringent — reject with moderate evidence

🔑 AP Tip: Unless told otherwise, assume α=0.05\alpha = 0.05 on the AP exam.

Hypothesis Setup 🎯

Hypothesis Identification 🧮

For each claim, identify the null value (μ0\mu_0):

1) Claim: μ>75\mu > 75. H0:μ=H_0: \mu = ?

2) Claim: μ<50\mu < 50. H0:μ=H_0: \mu = ?

3) Claim: μ≠100\mu \neq 100. H0:μ=H_0: \mu = ?

Test Direction 🔍

Exit Quiz — Null & Alternative Hypotheses ✅

Part 2: Test Statistics

📊 Test Statistics

Part 2 of 7 — Measuring the Evidence


What Is a Test Statistic?

A test statistic measures how far the sample result falls from the null hypothesis value, expressed in standard-error units.

t=xˉ−μ0s/nt = \frac{\bar{x} - \mu_0}{s / \sqrt{n}}

SymbolMeaning
xˉ\bar{x}Sample mean
μ0\mu_0Null hypothesis value
ssSample standard deviation
nnSample size
s/ns / \sqrt{n}Standard error of xˉ\bar{x}

🔑 Interpretation: tt tells you how many standard errors the sample mean is from the null value. Larger ∣t∣|t| → stronger evidence against H0H_0.


Standard Error (SE)

The standard error measures the typical distance between xˉ\bar{x} and μ\mu due to sampling variability:

SE=snSE = \frac{s}{\sqrt{n}}

FactorEffect on SE
Larger ss (more variability)SE increases
Larger nn (bigger sample)SE decreases

🔑 Key Insight: Quadrupling the sample size halves the standard error (because 4=2\sqrt{4} = 2).


Degrees of Freedom

For a one-sample tt-test: df=n−1df = n - 1

The degrees of freedom determine which tt-distribution to use for finding the P-value. More degrees of freedom → the tt-distribution looks more like a normal distribution.


Worked Example

A school claims its average SAT math score is 500. A random sample of 36 students gives xˉ=520\bar{x} = 520 and s=60s = 60.

Step 1 — Standard Error:

SE=sn=6036=606=10SE = \frac{s}{\sqrt{n}} = \frac{60}{\sqrt{36}} = \frac{60}{6} = 10

Step 2 — Test Statistic:

t=xˉ−μ0SE=520−50010=2010=2.0t = \frac{\bar{x} - \mu_0}{SE} = \frac{520 - 500}{10} = \frac{20}{10} = 2.0

Step 3 — Degrees of Freedom:

df=n−1=36−1=35df = n - 1 = 36 - 1 = 35

Interpretation: The sample mean is 2.0 standard errors above the null value. This is moderate-to-strong evidence against H0H_0.


How Large Is "Large Enough"?

∣t∣\vert t\vert ValueRough Guide
<1< 1Weak evidence against H0H_0
11 to 22Moderate evidence
>2> 2Strong evidence
>3> 3Very strong evidence

⚠️ Caution: These are rough guidelines. Always compute the P-value for a precise conclusion.

Test Statistic Concepts 🎯

Computing Test Statistics 🧮

1) s=14s = 14, n=49n = 49. What is the standard error?

2) xˉ=82\bar{x} = 82, μ0=75\mu_0 = 75, SE=2SE = 2. What is the tt-statistic?

3) n=26n = 26. What are the degrees of freedom?

Interpreting Test Statistics 🔍

Exit Quiz — Test Statistics ✅

Part 3: P-Values

🔢 P-Values

Part 3 of 7 — How Surprising Is the Evidence?


What Is a P-Value?

The P-value is the probability of obtaining a test statistic as extreme as (or more extreme than) the one observed, assuming H0H_0 is true.

🔑 Plain English: "If nothing special is happening (H0H_0 is true), how likely is it that we'd see data this extreme just by chance?"


Decision Rule

ComparisonDecisionConclusion
P<αP < \alphaReject H0H_0Result is statistically significant
P≥αP \geq \alphaFail to reject H0H_0Result is NOT statistically significant

⚠️ Never say "accept H0H_0." We either reject or fail to reject.


Interpreting P-Values

P-value RangeStrength of Evidence Against H0H_0
P>0.10P > 0.10Weak or no evidence
0.05<P≤0.100.05 < P \leq 0.10Moderate evidence
0.01<P≤0.050.01 < P \leq 0.05Strong evidence
P≤0.01P \leq 0.01Very strong evidence

One-Tailed vs Two-Tailed P-Values

Test TypeP-value Calculation
Right-tailed (Ha:μ>μ0H_a: \mu > \mu_0)P=P(t≥tobs)P = P(t \geq t_{obs})
Left-tailed (Ha:μ<μ0H_a: \mu < \mu_0)P=P(t≤tobs)P = P(t \leq t_{obs})
Two-tailed (Ha:μ≠μ0H_a: \mu \neq \mu_0)P=2⋅P(t≥∣tobs∣)P = 2 \cdot P(t \geq \vert t_{obs}\vert)

🔑 Two-tailed tests double the one-tail probability because evidence in either direction counts.


Worked Example

xˉ=520\bar{x} = 520, μ0=500\mu_0 = 500, SE=10SE = 10, α=0.05\alpha = 0.05, right-tailed test.

Step 1 — Test statistic: t=520−50010=2.0t = \frac{520 - 500}{10} = 2.0

Step 2 — P-value (using calculator): P=tcdf(2.0,1099,35)≈0.027P = \text{tcdf}(2.0, 10^{99}, 35) \approx 0.027

Step 3 — Decision: 0.027<0.05⇒Reject H00.027 < 0.05 \Rightarrow \text{Reject } H_0

Step 4 — Conclusion in context: "There is convincing evidence (t=2.0t = 2.0, P=0.027P = 0.027) that the true mean SAT math score at this school is greater than 500."


Writing AP Conclusions

Always include four elements:

  1. Decision — Reject or fail to reject H0H_0
  2. Evidence — Cite tt-statistic and P-value
  3. Context — Refer to the specific problem
  4. Direction — "Greater than," "less than," or "different from"

🔑 AP Tip: "Fail to reject" does NOT mean the null is proven true — only that we lack sufficient evidence.

P-Value Concepts 🎯

P-Value Decisions 🧮

1) The most common significance level α\alpha is:

2) P=0.03P = 0.03 vs P=0.08P = 0.08: which is more significant? (enter the P-value)

3) P=0.12P = 0.12, α=0.05\alpha = 0.05. Do we reject? (enter "yes" or "no")

P-Value Interpretation 🔍

Exit Quiz — P-Values ✅

Part 4: Type I & Type II Errors

📈 Type I & Type II Errors

Part 4 of 7 — Making the Wrong Decision


Decision Table

Every hypothesis test has four possible outcomes:

H0H_0 is actually trueH0H_0 is actually false
Reject H0H_0❌ Type I Error (α\alpha)✅ Correct Decision (Power)
Fail to reject H0H_0✅ Correct Decision❌ Type II Error (β\beta)

Type I Error (False Positive)

Definition: Rejecting H0H_0 when it is actually true.

  • Probability = α\alpha (the significance level)
  • You conclude there IS an effect when there really isn't one

Real-world example: A medical test says the patient has a disease, but they are actually healthy.

🔑 Key Connection: Choosing α=0.05\alpha = 0.05 means you accept a 5% chance of a Type I error.


Type II Error (False Negative)

Definition: Failing to reject H0H_0 when it is actually false.

  • Probability = β\beta
  • You conclude there is NO effect when there really IS one

Real-world example: A medical test says the patient is healthy, but they actually have the disease.


Power

Definition: The probability of correctly rejecting a false H0H_0.

Power=1−β\text{Power} = 1 - \beta

FactorEffect on Power
Increase nn (sample size)Power increases
Increase α\alphaPower increases (but more Type I risk)
Larger true effect sizePower increases
Decrease variability (ss)Power increases

🔑 AP Tip: Power is typically considered adequate when it is at least 0.80 (80%).


The α\alpha–β\beta Tradeoff

ActionType I Risk (α\alpha)Type II Risk (β\beta)Power (1−β1-\beta)
Lower α\alpha (e.g., 0.01)Decreases ✅Increases ❌Decreases ❌
Raise α\alpha (e.g., 0.10)Increases ❌Decreases ✅Increases ✅
Increase nnNo changeDecreases ✅Increases ✅

🔑 The only way to reduce BOTH errors is to increase the sample size.


Worked Example

A jury trial: H0H_0: The defendant is innocent.

OutcomeError TypeConsequence
Convict an innocent personType IWrongful conviction
Acquit a guilty personType IICriminal goes free

The justice system sets a very low α\alpha ("beyond reasonable doubt") because Type I errors have severe consequences.

Error Identification 🎯

Error Probabilities 🧮

1) Rejecting a true H0H_0 is a Type ___ error.

2) If α=0.05\alpha = 0.05, the probability of a Type I error is:

3) If β=0.20\beta = 0.20, the power is:

Error Concepts 🔍

Exit Quiz — Type I & Type II Errors ✅

Part 5: One-Sample t-Test

🧮 One-Sample t-Test

Part 5 of 7 — The Complete Procedure


When to Use a One-Sample t-Test

Use a one-sample tt-test when:

  • You have one quantitative variable
  • You want to test a claim about the population mean μ\mu
  • The population standard deviation σ\sigma is unknown (use ss instead)

Conditions (CHECK EVERY TIME)

ConditionWhat to CheckHow to Verify
RandomData from a random sample or randomized experimentStated in problem
Independencen<10%n < 10\% of the population (10% condition)N≥10nN \geq 10n
Normal/Large SamplePopulation is approximately normal, OR n≥30n \geq 30, OR (if n<30n < 30) the sample data are free from strong skewness and outliersCheck a dotplot/histogram of the sample; if n≥30n \geq 30, CLT applies

⚠️ AP Tip: You MUST state and verify all three conditions to earn full credit on the free response.


The Four-Step Process

Step 1 — STATE:

  • Define the parameter: "Let μ\mu = the true mean ..."
  • Write hypotheses: H0:μ=μ0H_0: \mu = \mu_0 vs HaH_a

Step 2 — PLAN:

  • Name the test: "One-sample tt-test"
  • Check all three conditions

Step 3 — DO:

t=xˉ−μ0s/n,df=n−1t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}, \quad df = n - 1

  • Find P-value using tt-distribution with df=n−1df = n-1

Step 4 — CONCLUDE:

  • Compare P-value to α\alpha
  • State conclusion in context

Worked Example

A manufacturer claims their batteries last 500 hours. A random sample of 25 batteries gives xˉ=490\bar{x} = 490, s=20s = 20. Test at α=0.05\alpha = 0.05.

STATE:

  • μ\mu = true mean battery life (hours)
  • H0:μ=500H_0: \mu = 500, Ha:μ<500H_a: \mu < 500 (left-tailed — suspect batteries last LESS)

PLAN:

  • One-sample tt-test
  • ✅ Random: stated "random sample"
  • ✅ Independent: 25 < 10% of all batteries produced
  • ✅ Normal: n=25<30n = 25 < 30, so the sample data must be free from strong skewness and outliers (a dotplot of the 25 lifetimes shows no strong skew or outliers)

DO: SE=sn=2025=205=4SE = \frac{s}{\sqrt{n}} = \frac{20}{\sqrt{25}} = \frac{20}{5} = 4 t=490−5004=−104=−2.5t = \frac{490 - 500}{4} = \frac{-10}{4} = -2.5 df=25−1=24df = 25 - 1 = 24 P=tcdf(−1099,−2.5,24)≈0.0098P = \text{tcdf}(-10^{99}, -2.5, 24) \approx 0.0098

CONCLUDE: Since P=0.0098<α=0.05P = 0.0098 < \alpha = 0.05, we reject H0H_0. There is convincing evidence that the true mean battery life is less than 500 hours.


z Procedures vs. t Procedures on the AP Exam

ParameterProcedureWhy
Proportion ppzzThe SE comes from p0p_0 (test) or p^\hat{p} (interval)
Mean μ\mutt with df=n−1df = n-1σ\sigma is unknown, so we use ss

t-Test Concepts 🎯

Computing a t-Test 🧮

n=36n = 36, xˉ=52\bar{x} = 52, s=6s = 6, μ0=50\mu_0 = 50:

1) SE=s/n=SE = s/\sqrt{n} = ?

2) t=(xˉ−μ0)/SE=t = (\bar{x} - \mu_0)/SE = ?

3) df=df = ?

t-Test Procedure 🔍

Exit Quiz — One-Sample t-Test ✅

Part 6: Problem-Solving Workshop

🛠️ Problem-Solving Workshop

Part 6 of 7 — Putting It All Together


Worked Example 1: Cereal Box Weights

A cereal company advertises 16 oz boxes. A consumer group suspects the boxes are underfilled. They weigh a random sample of 40 boxes and find xˉ=15.7\bar{x} = 15.7 oz, s=0.8s = 0.8 oz. Test at α=0.05\alpha = 0.05.

STATE:

  • μ\mu = true mean weight of cereal boxes (oz)
  • H0:μ=16H_0: \mu = 16 vs Ha:μ<16H_a: \mu < 16 (left-tailed — suspect underfilling)

PLAN:

  • One-sample tt-test
  • ✅ Random: "random sample" stated
  • ✅ Independent: 40 boxes <10%< 10\% of all boxes produced
  • ✅ Normal/Large: n=40≥30n = 40 \geq 30 → CLT applies

DO: SE=0.840=0.86.325≈0.1265SE = \frac{0.8}{\sqrt{40}} = \frac{0.8}{6.325} \approx 0.1265

t=15.7−160.1265=−0.30.1265≈−2.372t = \frac{15.7 - 16}{0.1265} = \frac{-0.3}{0.1265} \approx -2.372

df=40−1=39df = 40 - 1 = 39

P=tcdf(−1099,−2.372,39)≈0.0114P = \text{tcdf}(-10^{99}, -2.372, 39) \approx 0.0114

CONCLUDE: Since P=0.0114<α=0.05P = 0.0114 < \alpha = 0.05, we reject H0H_0. There is convincing evidence that the true mean weight of cereal boxes is less than 16 oz. The consumer group's suspicion is supported.


Worked Example 2: Study Hours

A college claims students study an average of 15 hours per week. A professor surveys a random sample of 50 students and finds xˉ=13.2\bar{x} = 13.2 hours, s=5.1s = 5.1 hours. Test at α=0.05\alpha = 0.05 whether the true mean differs from 15.

STATE:

  • μ\mu = true mean weekly study hours for students at this college
  • H0:μ=15H_0: \mu = 15 vs Ha:μ≠15H_a: \mu \neq 15 (two-tailed — "differs from")

PLAN:

  • One-sample tt-test
  • ✅ Random: "random sample" stated
  • ✅ Independent: 50<10%50 < 10\% of all college students
  • ✅ Normal/Large: n=50≥30n = 50 \geq 30 → CLT applies

DO: SE=5.150=5.17.071≈0.7212SE = \frac{5.1}{\sqrt{50}} = \frac{5.1}{7.071} \approx 0.7212

t=13.2−150.7212=−1.80.7212≈−2.495t = \frac{13.2 - 15}{0.7212} = \frac{-1.8}{0.7212} \approx -2.495

df=49df = 49

P=2×tcdf(−1099,−2.495,49)≈2×0.0080=0.0160P = 2 \times \text{tcdf}(-10^{99}, -2.495, 49) \approx 2 \times 0.0080 = 0.0160

CONCLUDE: Since P=0.016<α=0.05P = 0.016 < \alpha = 0.05, we reject H0H_0. There is convincing evidence that the true mean weekly study hours for students at this college differs from 15 hours.


Common AP Mistakes to Avoid

MistakeCorrection
Not stating hypotheses in terms of μ\muAlways use population parameters
Skipping conditionsMust check all three explicitly
Saying "accept H0H_0"Say "fail to reject H0H_0"
Conclusion without context"There is (not) convincing evidence that [real-world statement]"
Using xˉ\bar{x} or p^\hat{p} in hypothesesAlways use μ\mu or pp
Forgetting to double P for two-tailedTwo-tailed: P=2×one-tail areaP = 2 \times \text{one-tail area}

Workshop Practice 🎯

Workshop Calculations 🧮

n=25n = 25, xˉ=84\bar{x} = 84, s=10s = 10, μ0=80\mu_0 = 80:

1) SE=s/n=SE = s/\sqrt{n} = ?

2) t=(xˉ−μ0)/SE=t = (\bar{x} - \mu_0)/SE = ?

3) df=df = ?

AP Process Steps 🔍

Exit Quiz — Problem-Solving Workshop ✅

Part 7: Review & Applications

🏆 Review & Applications

Part 7 of 7 — Complete Reference Guide


Formula Reference

FormulaExpressionPurpose
Standard ErrorSE=snSE = \dfrac{s}{\sqrt{n}}Measures variability of xˉ\bar{x}
Test Statistict=xˉ−μ0s/nt = \dfrac{\bar{x} - \mu_0}{s/\sqrt{n}}Standardizes the distance from null
Degrees of Freedomdf=n−1df = n - 1Determines the tt-distribution shape

Hypothesis Test Decision Guide

QuestionAnswer
"Is it greater than?"Right-tailed: Ha:μ>μ0H_a: \mu > \mu_0
"Is it less than?"Left-tailed: Ha:μ<μ0H_a: \mu < \mu_0
"Is it different from?"Two-tailed: Ha:μ≠μ0H_a: \mu \neq \mu_0

Decision Rule

If P<α⇒Reject H0If P≥α⇒Fail to reject H0\text{If } P < \alpha \Rightarrow \text{Reject } H_0 \qquad \text{If } P \geq \alpha \Rightarrow \text{Fail to reject } H_0


Error Summary

H0H_0 TrueH0H_0 False
Reject H0H_0Type I (α\alpha)✅ Correct (Power = 1−β1-\beta)
Fail to reject H0H_0✅ CorrectType II (β\beta)

Conditions Checklist

ConditionCheck
RandomSRS or randomized experiment
Independentn<10%n < 10\% of population
Normal/Largen≥30n \geq 30 (CLT) or data approximately normal

AP Four-Step Process

  1. STATE — Define parameter; write H0H_0 and HaH_a
  2. PLAN — Name the test; check all three conditions
  3. DO — Compute SE, tt, dfdf, P-value
  4. CONCLUDE — Decision + evidence + context

Power Factors

To Increase PowerDo This
Increase nnMore data → smaller SE → easier to detect effects
Increase α\alphaMore willing to reject (but more Type I risk)
Larger effect sizeBigger ∣μ−μ0∣\vert\mu - \mu_0\vert → easier to detect
Decrease ssLess variability → more precise estimates

Common Mistakes on the AP Exam

MistakeWhy It's Wrong
"Accept H0H_0"We can only "fail to reject" — never prove H0H_0
Using xˉ\bar{x} in hypothesesHypotheses use μ\mu (parameter), not xˉ\bar{x} (statistic)
No context in conclusionMust relate conclusion to the specific problem
Forgetting to check conditionsAll three required for full credit
Confusing statistical and practical significanceSmall P doesn't mean the effect matters in practice

Comprehensive Review 🎯

Quick Calculations 🧮

1) n=30n = 30. df=df = ?

2) s=12s = 12, n=36n = 36. SE=SE = ?

3) xˉ=48\bar{x} = 48, μ0=50\mu_0 = 50, SE=2SE = 2. t=t = ?

Key Concepts 🔍

Exit Quiz — Hypothesis Testing Review ✅