Almost all researchers performing a hypothesis test think they are testing for evidence in support of something. They’re not. In fact, they are testing against something, and when this realization sinks in, everything from studies and A/B tests to “statistically significant” conclusions will have a new meaning for you.
Every hypothesis test is centered around a null hypothesis and an alternative hypothesis. If you mix them up, or write either one incorrectly, your whole process will be fundamentally flawed. That’s why this article aims to explain what the two hypotheses are, how to write them correctly, and what “rejecting” or “failing to reject” a hypothesis test means.
What Will I Learn?
What Is the Null Hypothesis (H0)?
The null hypothesis is the testable statement that no relationship exists between the independent and dependent variables under consideration.
It’s the default position, but not a matter of faith. It’s your starting point until evidence suggests otherwise.
Expressed algebraically, any good null will have an equal sign (=), greater than or equal to sign (≥), or less than or equal to sign (≤). That’s your cue. Any hypothesis with such a symbol is null.
Here’s how to set up your hypothesis.
H0: [Variable X] has no effect on [Variable Y].
A few worked examples:
| Research Question | Null Hypothesis (H0) |
| Does caffeine improve reaction time? | Caffeine has no effect on reaction time (µ₁ = µ₂) |
| Does ad variation B increase click-through rate vs A? | Ad variation B and A have equal click-through rates (p₁ = p₂) |
| Does study time predict exam scores? | There is no relationship between study time and exam scores (β₁ = 0) |
| Is the new drug batch within specification? | The batch mean meets the specification (µ = µ₀) |
| Does temperature affect product defect rate? | Temperature has no effect on defect rate (µ₁ = µ₂ = µ₃) |
One thing that often gets misunderstood in this regard: H0 (the null hypothesis) is not the hypothesis that you would like to hold true; rather, it is the hypothesis you test against using the information that you gather. Your task is to use the information to reject the null hypothesis.
What Is the Alternative Hypothesis (Ha)?
The alternative hypothesis is the claim that something is going on — that an effect exists, a difference is real, or a relationship is present.
It’s what you’re looking for evidence for, even though you can never directly test it. You only support Ha by showing that H0 is unlikely given your data.
Mathematically, Ha always contains an inequality: ≠, <, or >. If H0 uses =, then Ha uses ≠ (or a directional variant). They’re always opposites — which is the whole point.
Ha: [Variable X] has an effect on [Variable Y].
Same examples, now showing the Ha that pairs with each H0 above:
| Research Question | Alternative Hypothesis (Ha) |
| Does caffeine improve reaction time? | Caffeine affects reaction time (µ₁ ≠ µ₂) |
| Does ad variation B increase click-through rate vs A? | Ad variation B has a higher click-through rate than A (p₁ > p₂) |
| Does study time predict exam scores? | Study time is related to exam scores (β₁ ≠ 0) |
| Is the new drug batch within specification? | The batch mean does not meet the specification (µ ≠ µ₀) |
| Does temperature affect product defect rate? | At least one temperature group has a different defect rate |
Notice the second row. The Ha doesn’t say “B is different from A.” It says “B is higher than A.” That’s a specific directional claim — and it leads us directly into the next distinction you need to understand.
Null Hypothesis vs Alternative Hypothesis — Key Differences
Before you write either one, it helps to see exactly how they sit opposite each other across every dimension that matters.
| Feature | Null Hypothesis (H0) | Alternative Hypothesis (Ha) |
| Core claim | No effect or difference | Effect or difference exists |
| What it represents | Default assumption | Research claim |
| Mathematical symbol | = , ≥ , ≤ | ≠ , < , > |
| Notation | H0 | Ha or H1 |
| Who tests it directly | Statistical test runs against H0 | Ha is supported indirectly by rejecting H0 |
| When p-value > α | Not rejected — stays in place | Not supported |
| When p-value ≤ α | Rejected | Supported |
| What “accepted” means | Insufficient evidence to reject | Sufficient evidence found |
| Type I error risk | Rejecting a true H0 (false positive) | — |
| Type II error risk | — | Failing to support a true Ha (false negative) |
| Consequence of wrong decision | False alarm — claiming effect that doesn’t exist | Missed finding — real effect goes undetected |
That last row matters more than most textbooks acknowledge. A Type I error means you told someone a drug works when it doesn’t. A Type II error means you told them it doesn’t work when it does. Both are costly — just in different directions.
One-Tailed vs Two-Tailed Alternative Hypotheses
Here’s where things get genuinely tricky, and where most intro statistics courses skip over the decision logic entirely.
When you write Ha, you have to decide: are you looking for any difference, or a difference in a specific direction?
Two-tailed (non-directional): Ha states the parameter is simply not equal to the null value. Use this when you’re genuinely uncertain about which direction the effect might go — or when either direction matters.
H0: µ₁ = µ₂ Ha: µ₁ ≠ µ₂
One-tailed (directional): Ha states the parameter is specifically greater than or less than the null value. Use this only when you have a prior theoretical reason to expect a specific direction — and only that direction.
H0: µ₁ ≤ µ₂ Ha: µ₁ > µ₂
Two concrete examples side by side:
Two-tailed scenario: A school principal wants to know whether students at her school score differently from the national average of 72. She doesn’t know if they’ll score higher or lower — just whether there’s a difference. → Two-tailed, Ha: µ ≠ 72.
One-tailed scenario: A training company claims its program raises test scores above the national average. The researcher is specifically testing whether trained students score higher — not lower. → One-tailed, Ha: µ > 72.
The decision rule: If your research question contains the word “different,” use two-tailed. If it contains “higher,” “lower,” “greater,” or “less than” — and you have prior theoretical justification — use one-tailed.
One-tailed tests have more statistical power to detect an effect in the predicted direction. But they can’t detect an effect in the opposite direction. So if your drug actually harms patients and you ran a one-tailed test expecting improvement, you’d miss it entirely. That’s not a small risk.
How to Write Null and Alternative Hypotheses (Step-by-Step)
Most students jump straight to writing H0 and Ha without doing the work that makes them testable. Here’s the actual process.
Step 1: State your research question clearly.
Your research question is the plain-language version of what you want to find out. “Does drinking green tea daily lower blood pressure?” is a research question. “Blood pressure” is not.
Step 2: Identify your variables.
- Independent variable: the thing you’re manipulating or grouping by (daily green tea consumption — yes or no)
- Dependent variable: the thing you’re measuring for a change (blood pressure, in mmHg)
Step 3: Write H0.
State that the independent variable has no effect on the dependent variable. Use an equality symbol.
H0: Daily green tea consumption has no effect on blood pressure. (µ₁ = µ₂)
Step 4: Write Ha.
State the effect you’re testing for. Use an inequality symbol. Decide on directionality based on your research question.
Ha (two-tailed): Daily green tea consumption affects blood pressure. (µ₁ ≠ µ₂) Ha (one-tailed): Daily green tea consumption lowers blood pressure. (µ₁ < µ₂)
That’s it. Four steps. The trap is in Step 1 — researchers who aren’t clear about their research question write hypotheses that sound statistical but can’t actually be tested.
Template Sentences for Common Statistical Tests
Once you know your variables, plug them into the right template for your test. These work for every combination — just swap in your specific variable names.
| Statistical Test | Null Hypothesis (H0) | Alternative Hypothesis (Ha) |
| Two-sample t-test | The mean [DV] does not differ between [Group 1] and [Group 2]; µ₁ = µ₂ | The mean [DV] differs between [Group 1] and [Group 2]; µ₁ ≠ µ₂ |
| One-way ANOVA (2 groups) | The mean [DV] does not differ between [Group 1] and [Group 2]; µ₁ = µ₂ | The mean [DV] of at least one group differs; µ₁ ≠ µ₂ |
| One-way ANOVA (3+ groups) | The mean [DV] does not differ between any groups; µ₁ = µ₂ = µ₃ | The mean [DV] is not the same across all groups |
| Pearson correlation | No correlation between [X] and [Y] in the population; ρ = 0 | A correlation exists between [X] and [Y] in the population; ρ ≠ 0 |
| Simple linear regression | No relationship between [X] and [Y]; β₁ = 0 | A relationship exists between [X] and [Y]; β₁ ≠ 0 |
| Two-proportions z-test | The proportion [DV] does not differ between [Group 1] and [Group 2]; p₁ = p₂ | The proportion [DV] differs between [Group 1] and [Group 2]; p₁ ≠ p₂ |
| Chi-square test of independence | [Variable A] and [Variable B] are independent (no association) | [Variable A] and [Variable B] are not independent (an association exists) |
The chi-square row is one most template guides skip. If you’re testing whether two categorical variables are related — say, political affiliation and preferred news source — the chi-square test is your tool, and those are your hypotheses.
How to Decide Between H0 and Ha: The Role of the p-Value
Once you’ve run your statistical test, you get a number: the p-value. Here’s what it actually means.
The p-value is the probability of getting results at least as extreme as yours, assuming H0 is true.
A small p-value (say, p = 0.02) means: if H0 were true, there’s only a 2% chance you’d see data this far from the expected value. That’s suspicious. It suggests your data is inconsistent with H0.
You compare that p-value to a threshold called the significance level, written as α (alpha). The most common choice is α = 0.05, though 0.01 and 0.10 are also used depending on how much error risk the field tolerates.
The decision logic:
- If p ≤ α: Reject H0. The data is too unlikely under H0 to keep it. This means Ha is supported — not proven, supported.
- If p > α: Fail to reject H0. The data isn’t surprising enough to throw H0 out.
And here’s the part that matters most — the part that screws up more data interpretation than anything else:
Failing to reject H0 does not mean H0 is true.
It means your data didn’t give you enough evidence to discard it. That could be because H0 really is true. Or it could be because your sample was too small, your measurement was noisy, or the effect was real but too subtle for your test to catch. The absence of evidence is not evidence of absence.
Statisticians put it this way: you can reject H0, or you can fail to reject H0. You never “accept” H0. The wording isn’t pedantry — it reflects a genuine logical asymmetry built into the framework, one that Jerzy Neyman and Egon Pearson formalized when they introduced the concept of the alternative hypothesis in their 1933 paper.
Common Mistakes When Writing Hypotheses
I think this section is more useful than the definitions section. Knowing what H0 is won’t save you — knowing what you’re likely to get wrong will.
Mistake 1: Writing a hypothesis you can’t test with data.
“Students who believe in themselves perform better.” Believe in themselves how? Perform better on what? No data can test that as written. A testable version: “Students who score above 70 on the academic self-efficacy scale have higher semester GPAs than those who score below 70.”
Every hypothesis needs a measurable variable on each side.
Mistake 2: Choosing a direction without justification.
Running a one-tailed test because you hope the effect goes a certain way is not the same as having theoretical or prior empirical support for that direction. If you’re wrong about the direction, a one-tailed test will miss the real effect entirely. When in doubt, use two-tailed.
Mistake 3: Framing your expected finding as H0.
This is backwards — and it happens more than you’d think. A researcher who expects that a new teaching method improves test scores should not write that as H0. H0 is always the claim of no effect. The improvement claim goes in Ha. If you flip them, your “significant” result actually means the opposite of what you think.
Mistake 4: Confusing “fail to reject” with “accept the null.”
Weirdly enough, this one trips up experienced researchers too. A p-value of 0.23 doesn’t tell you H0 is true. It tells you your data wasn’t extreme enough to rule H0 out. These are genuinely different statements — and treating them as equivalent is how studies end up claiming “no effect” when they actually just had insufficient power to detect one.
Real-World Applications — Beyond Academia
Hypothesis testing isn’t just for lab coats. Two settings where H0 and Ha show up constantly, often without being labeled as such.
A/B Testing in Product Analytics
Every time a product team runs an A/B test, they’re running a two-proportions z-test — whether they know it or not.
Here’s how it maps:
H0: The conversion rate for variation B equals the conversion rate for control A. (p₁ = p₂)
Ha (two-tailed): The conversion rate for variation B differs from control A. (p₁ ≠ p₂)
Or, if the team has prior data suggesting the new design should increase conversions:
Ha (one-tailed): Variation B has a higher conversion rate than control A. (p₁ > p₂)
The significance level in most product contexts is α = 0.05. A p-value below that means the team has enough statistical reason to conclude the difference in conversion rates wasn’t just noise.
What goes wrong in practice: teams stop tests early when they see promising results, which inflates Type I error rates well above α = 0.05. The formal hypothesis framework exists precisely to prevent that.
Quality Control in Manufacturing
A batch of pharmaceutical tablets should each contain exactly 500mg of the active ingredient. The plant runs a sample and tests whether the batch mean has drifted.
H0: The batch mean equals 500mg. (µ = 500)
Ha: The batch mean does not equal 500mg. (µ ≠ 500)
A two-tailed test here makes sense — the batch fails specification if the mean is either too high or too low. Rejecting H0 triggers a hold and investigation. Failing to reject H0 means the batch passes — not that it’s definitively perfect, but that the sample data doesn’t give enough reason to flag it.
This is the Neyman-Pearson framework doing exactly what it was designed for: making a structured, defensible decision under uncertainty.
Frequently Asked Questions
Q1. Can the null hypothesis ever be proven true?
Ans. No. Statistical tests can only reject H0 or fail to reject it. Failing to reject H0 means your data didn’t give enough evidence to rule it out — not that H0 is confirmed. This is a hard boundary built into the logic of the framework, not a limitation of any particular test.
Q2. What is the difference between a research hypothesis and a statistical hypothesis?
Ans. A research hypothesis is your plain-language prediction: “The new drug will reduce symptoms faster than the placebo.” A statistical hypothesis translates that into testable mathematical form, split into H0 (no difference in symptom reduction speed) and Ha (the drug reduces symptoms faster). You need both; the research hypothesis gives you the direction, the statistical hypotheses give you the framework to test it.
Q3. What does “fail to reject the null hypothesis” mean?
Ans. It means your data wasn’t surprising enough — given the assumption that H0 is true — to justify throwing H0 out. It’s not a positive finding. It just means you didn’t find convincing evidence of an effect. Your sample may have been underpowered, the effect may be real but small, or H0 may genuinely be true. The test can’t tell you which.
Q4. How do you write a null hypothesis for a chi-square test?
Ans. The chi-square test of independence works on two categorical variables. Your H0 states that the variables are independent — no association between them. Example: “There is no association between gender and preference for remote versus in-office work.” Your Ha states an association exists: “Gender and work preference are not independent.”
Q5. What is the difference between H0 and Ha in machine learning?
Ans. In ML evaluation, hypothesis testing shows up most clearly in model comparison. H0 would state that two models have equal performance on the metric you care about (say, F1 score on a held-out test set). Ha would state that one model outperforms the other. Permutation tests and paired t-tests are the common tools for this, and the same “fail to reject vs. reject” logic applies. The statistical power of such comparisons depends heavily on test set size — something the field probably doesn’t take seriously enough.
Q6. Why can’t you just accept the null hypothesis when p > α?
Ans. Because p > α only tells you about the strength of evidence in your data — it says nothing about the truth of H0. A study with five participants that finds p = 0.30 says almost nothing about whether H0 is true; it mostly tells you the study was underpowered. Accepting H0 based on p > α conflates “I didn’t find convincing evidence” with “evidence of no effect.” Ronald Fisher himself was emphatic on this point, and it remains the most abused concept in applied statistics.