Null vs Alternative Hypothesis: How to Write Them

By Jude Wallis · Published

The null hypothesis (H0) states no difference or effect about a population parameter and always uses an equals sign. The alternative hypothesis (Ha) is the claim you seek evidence for, written with <, >, or not-equal. Both describe parameters like p or mu, never sample statistics.

This is the "Setting Up a Test" step in the Fall 2026 AP Statistics course, covered in Unit 3 topic 3.5 for proportions and Unit 4 topic 4.4 for means.

Null vs alternative hypothesis at a glance

A significance test compares two claims about a population, never about your sample alone. The null hypothesis, written H0H_0 (read "H-naught"), is the no-effect claim: it sets a population parameter equal to one specific value. The alternative hypothesis, written HaH_a, is the claim you actually want evidence for.

You reject H0H_0 when the p-value is small enough, meaning below your significance level. The p-value is the probability of getting a result as extreme or more extreme than what you observed, assuming H0H_0 is true. Think of H0H_0 as the default position that stays in place until the evidence pushes hard enough to abandon it. Getting the two hypotheses right is the first step of every test, so it pays to slow down here, because a wrong parameter or a flipped inequality will send the rest of your work in the wrong direction.

What the null hypothesis (H0) says

The null hypothesis is a statement of no difference or no effect, and it is always about a population parameter. For a proportion that parameter is pp, the population proportion. For a mean it is μ\mu (the Greek letter mu), the population mean.

H0H_0 always contains equality, so it looks like H0:p=p0H_0: p = p_0 or H0:μ=μ0H_0: \mu = \mu_0, where p0p_0 and μ0\mu_0 are the specific hypothesized values. That hypothesized value usually comes from a claim, a target, or the status quo you are checking. If a label says a box holds 500 grams, then μ0=500\mu_0 = 500 is the number you place in H0H_0.

What the alternative hypothesis (Ha) says

The alternative hypothesis is the claim you are collecting data to support. It uses a strict inequality or the not-equal sign, never an equals sign, so it is written with <<, >>, or \neq (not equal to).

Use a one-sided alternative when the question points in a single direction. "Is the on-time rate lower than claimed?" gives Ha:p<p0H_a: p < p_0, while "did the mean increase?" gives Ha:μ>μ0H_a: \mu > \mu_0. Use a two-sided alternative, Ha:pp0H_a: p \neq p_0 or Ha:μμ0H_a: \mu \neq \mu_0, when you care whether the parameter differs from the hypothesized value in either direction.

Pick the direction from the question wording before you look at the data. Choosing the side after you see which way the sample came out inflates your error rate, a Type I error problem.

Why hypotheses use parameters, not statistics

Every hypothesis is a guess about a fixed but unknown number that describes the whole population, called a parameter. The sample proportion p^\hat{p} (read "p-hat") and the sample mean xˉ\bar{x} (read "x-bar") are statistics: numbers you compute from data that change from one sample to the next. Because a statistic is already known once you have the data, there is nothing left to test about it.

So a hypothesis like H0:p^=0.5H_0: \hat{p} = 0.5 has no meaning, since the value of p^\hat{p} is simply whatever your sample gave you. The unknown you are actually asking about is pp, the population proportion, which is why H0:p=0.5H_0: p = 0.5 is the correct form. Keep parameters (pp, μ\mu, and μd\mu_d, the population mean difference) inside the hypotheses and statistics (p^\hat{p}, xˉ\bar{x}) outside them.

Symbols and words for proportions and means

The table below lists the parameter, the null, and the common alternatives for the three setups you meet most in AP Statistics. Every row keeps the population parameter in the hypotheses and leaves the sample statistic out.

CaseParameterNull hypothesisAlternative hypothesis
One proportionpp (population proportion)H0:p=p0H_0: p = p_0Ha:p<p0H_a: p < p_0, p>p0p > p_0, or pp0p \neq p_0
One meanμ\mu (population mean)H0:μ=μ0H_0: \mu = \mu_0Ha:μ<μ0H_a: \mu < \mu_0, μ>μ0\mu > \mu_0, or μμ0\mu \neq \mu_0
Paired mean differenceμd\mu_d (population mean difference)H0:μd=0H_0: \mu_d = 0Ha:μd<0H_a: \mu_d < 0, μd>0\mu_d > 0, or μd0\mu_d \neq 0

For paired data you first compute a difference for each pair, then treat μd\mu_d, the population mean of those differences, like any other mean.

How to write H0 and Ha in four steps

  1. Name the population parameter in words and symbols, such as pp = the true proportion of voters who approve, or μ\mu = the mean battery life of all units.
  2. Find the hypothesized value from the claim or target, and write the null as parameter = value.
  3. Read the question to decide the direction, then write the alternative with <<, >>, or \neq.
  4. Check that both hypotheses use the parameter, that only H0H_0 has an equals sign, and that you fixed the direction before seeing the data.

This is the same setup work the AP course labels "Setting Up a Test." If you are unsure which parameter and test apply, see which statistical test to use.

Common mistakes when writing hypotheses

Writing hypotheses about a statistic. H0:xˉ=500H_0: \bar{x} = 500 is wrong because xˉ\bar{x}, the sample mean, is something you calculate, not an unknown you test. Hypotheses are always about the parameter, so write H0:μ=500H_0: \mu = 500 instead.

Putting the equality in Ha. The alternative never contains ==, \leq, or \geq; only H0H_0 carries the equals sign. If you find yourself writing Ha:p0.5H_a: p \geq 0.5, move the equality back to H0H_0 and leave a strict inequality in HaH_a.

Choosing the direction after seeing the data. Deciding on << versus >> once you notice which way p^\hat{p} landed makes your test look stronger than it really is. Set the sidedness from the research question first, then collect and analyze the data.

Setting up a one-proportion test (one-sided)

A delivery company advertises that 90% of its packages arrive on time. A consumer group takes a random sample of 200 packages and wants to test whether the true on-time rate is lower than 90%. Write the null and alternative hypotheses.

  1. Identify the parameter. Let pp = the true proportion of all packages from this company that arrive on time. This is a population proportion, not the sample proportion p^\hat{p}.

  2. Find the hypothesized value. The advertised rate is the value being checked, so p0=0.90p_0 = 0.90.

  3. Write the null as an equality. H0:p=0.90H_0: p = 0.90.

  4. Decide the direction from the question. The group suspects the rate is lower, so the alternative is one-sided in the less-than direction: Ha:p<0.90H_a: p < 0.90.

  5. Confirm the direction was set by the group's question before any data were collected, not after seeing the sample.

H0:p=0.90H_0: p = 0.90 versus Ha:p<0.90H_a: p < 0.90, where pp is the true proportion of all packages that arrive on time.

Setting up a one-mean test (two-sided)

A machine is supposed to fill bottles with a mean of 500 mL. An engineer wants to know whether the mean fill differs from 500 mL in either direction and measures a random sample of 30 bottles. Write the null and alternative hypotheses.

  1. Identify the parameter. Let μ\mu = the true mean fill volume of all bottles from this machine. This is a population mean.

  2. Find the hypothesized value. The target fill is the value being checked, so μ0=500\mu_0 = 500 mL.

  3. Write the null as an equality. H0:μ=500H_0: \mu = 500.

  4. Decide the direction from the question. The engineer cares about a difference either way (too full or too empty), so the alternative is two-sided: Ha:μ500H_a: \mu \neq 500.

  5. Note that the sample mean xˉ\bar{x} will be used later to compute the test statistic, but it never appears in the hypotheses.

H0:μ=500H_0: \mu = 500 versus Ha:μ500H_a: \mu \neq 500, where μ\mu is the true mean fill volume in mL.

Setting up a paired mean-difference test (one-sided)

A teacher records each of 25 students' reading speed before and after a 6-week program and wants evidence that the program increases reading speed. Define the difference for each student as (after - before). Write the null and alternative hypotheses.

  1. Recognize the design. Each student is measured twice, so this is paired data, and you work with the differences d=d = (after - before).

  2. Identify the parameter. Let μd\mu_d = the true mean difference (after - before) for the population of students. This is a population mean difference.

  3. Write the null as no change. No effect means the mean difference is 0, so H0:μd=0H_0: \mu_d = 0.

  4. Decide the direction from the question. "Increases" means after is larger than before, a positive difference, so Ha:μd>0H_a: \mu_d > 0.

  5. Keep the statistic out. The sample mean difference is a statistic, so it does not go in the hypotheses.

H0:μd=0H_0: \mu_d = 0 versus Ha:μd>0H_a: \mu_d > 0, where μd\mu_d is the true mean of the (after - before) differences.

Frequently asked questions

Which hypothesis gets the equals sign?

The null hypothesis always does. H0H_0 sets the parameter equal to a specific value, such as H0:p=0.5H_0: p = 0.5. The alternative HaH_a uses only a strict inequality or the not-equal sign (<<, >>, or \neq) and never contains an equals sign.

Can I use x-bar or p-hat in my hypotheses?

No. Hypotheses are statements about population parameters like μ\mu and pp. The sample statistics xˉ\bar{x} and p^\hat{p} are numbers you compute from data, so there is nothing to test about them and they stay out of H0H_0 and HaH_a.

How do I choose between a one-sided and a two-sided alternative?

Read the research question before you see the data. If it asks whether a value increased or decreased, use a one-sided alternative (>> or <<). If it asks only whether the value changed or differs, use a two-sided alternative (\neq).

Does the AP exam make me write hypotheses?

Yes. Setting up a test is a tested skill for proportions (topic 3.5) and means (topic 4.4), and Section II of the exam includes an inference free-response question that can be a full hypothesis test.