1.3.20 · D1Probability & Statistics

Foundations — Hypothesis testing and p-values

3,065 words14 min readBack to topic

Before you can trust a single line of the parent note, you must be able to read it. This page lists every symbol and idea the parent uses, in build-order, so that no notation ever appears before you own it. A smart 12-year-old should be able to walk from top to bottom without ever getting stuck.


0. The picture we keep coming back to

Almost everything in hypothesis testing lives on one bell-shaped curve. Get comfortable with this picture now and the rest is labelling.

Figure — Hypothesis testing and p-values

Everything below is a tool for drawing this curve and pointing at a spot on it.


1. Probability — the language of "how often"

The picture: think of a big jar of outcomes. is the fraction of the jar that is "heads". If half the jar is heads, .

Why the topic needs it: the whole p-value is a probability — "how often would I see data this weird?" You cannot read a p-value without first being fluent in .

The bar (given that): reads "the probability of , given that is already true." The vertical bar means "assuming...".


2. Random variable — a number that comes out of chance

The picture: a slot machine. You pull the lever (run the experiment) and a number pops out. is the name of that number-generator; the value it lands on this time is a plain number like .

Why the topic needs it: the test statistic (next few sections) is a random variable. To ask "how weird is 65 heads," you must imagine could have been many values, each with some probability. See 1.3.1-Random-variables-and-distributions.


3. Distribution — the full menu of possible values and their chances

Figure — Hypothesis testing and p-values

The picture: the bar chart above. Each bar is one possible number of heads; tall bars = likely, short bars = rare. The bars for a fair coin form the bell shape from Section 0.

Two named distributions the parent uses:

Why the topic needs it: the p-value is an area under the distribution. No distribution, nowhere to measure area.


4. Mean and standard deviation — center and spread

Figure — Hypothesis testing and p-values

The picture: is where the curve peaks (the middle). is the horizontal distance from the peak out to where the curve bends from "falling steeply" to "flattening out." A skinny bell has small ; a fat bell has large .

Why the topic needs it: to say a result is "far from expected," you need a center to measure from () and a ruler to measure with ().


5. Sample mean vs. true mean — measured vs. claimed

The picture: two dots on the number line. is the target the null hypothesis paints. is where your actual result landed. Hypothesis testing measures the gap between them.

Why the topic needs it: every test statistic is essentially , i.e. .


6. Test statistic — the single number we shade against the curve

The picture: all your messy data gets crushed down to one dot on the horizontal axis of the bell. That dot is the test statistic. The p-value is then just the tail area beyond that dot.

Why the topic needs it: you can't shade "your data" against a curve — data isn't a single point. The test statistic is the bridge that turns a whole dataset into one shadeable position.


7. The z-score — "how many rulers away?"

Worked reading: . You are 3 standard deviations to the right of the boring center — deep in a skinny tail.

All the cases (so you never get surprised):

  • : result sits exactly at expected. Totally boring.
  • : result is above expected (right side of the bell).
  • : result is below expected (left side of the bell).
  • large (like 3): far out in a tail → surprising.
  • small (like 0.4): near the fat middle → unsurprising.

The bars mean absolute value — throw away the sign, keep the size. . We use it because "3 steps left" and "3 steps right" are equally surprising; we care about distance, not direction.

This standardizing trick is the heart of 1.3.15-Central-limit-theorem and 1.3.18-Confidence-intervals.


8. Tails, and the p-value as an area

Figure — Hypothesis testing and p-values

The picture (above): your marks a spot. Shade everything further out than that spot. That shaded area is the p-value.


9. The Greek gatekeepers: , , and the hypotheses

The picture: is a fence painted on the bell's tails. If your p-value area is smaller than , you're outside the fence → reject .


10. The extras the parent leans on


How it all feeds the topic

Probability P and the bar given

Random variable X

Distribution binomial and normal

Mean mu and spread sigma

Test statistic one number

z-score standard normal N 0 1

Tails and shaded area

p-value

Compare to alpha then decide

Hypothesis testing conclusion


Equipment checklist

Test yourself — you should be able to say each answer out loud before reading the parent note.

What does mean, and what is its definition?
The probability of given is true; formally — shrink the world to outcomes where holds, then take the fraction that are also .
What is a random variable?
A number produced by a random process, named before its value is known (e.g. ).
What does describe?
The count of successes in independent tries, each succeeding with probability .
Why is and for a binomial?
Each flip has average and variance ; averages and variances of independent flips add, giving and .
In words, what are and ?
is the center (balance point / average); is the typical distance results stray from center (the spread).
Compute and for 100 fair coin flips.
, .
What is a test statistic?
One number computed from the data summarizing how far the result is from what predicts; it's shadeable against a distribution.
Why does standardizing give mean 0 and spread 1?
Subtracting centers the average at 0; dividing by rescales so one unit = one old standard deviation, making the spread .
What distribution does follow, and why does that let us read off a probability?
, the standard normal; its tail areas are fixed, so one universal table gives every time.
What does a z-score of 3 tell you?
Your result is 3 standard deviations above expected — far out in the right tail, surprising.
Geometrically, what IS the p-value?
The shaded tail area under the bell beyond your result.
Give the three tail formulas and when each is used.
Two-tailed for "different"; right for "greater"; left for "less".
What is ?
The pre-chosen threshold; reject if the p-value falls below it (often 0.05).
Why is a p-value NOT the probability is true?
It is , not ; the bar's sides are not interchangeable.