Advanced Mathematics

Confidence Intervals and Hypothesis Tests

Turning a sample into a statement about the whole population: a range of plausible values, or a test of a claim.

Needs a step first: 18

A 95%95\% confidence interval, such as xˉ±1.96 σ/n\bar x\pm1.96\,\sigma/\sqrt n, comes from a method that captures the true value in 95%95\% of samples. A hypothesis test asks how surprising the data would be if a claim H0H_0 were true: the p-value is the chance of a result at least as extreme, and a small one is evidence against H0H_0. Neither gives the probability that the hypothesis is true, which is the question Bayesian inference answers instead. These ideas sit behind every A/B test and every reported model accuracy.

Where it shows up: Comparing two models on a test set is a hypothesis test, and the error bars on a benchmark score are confidence intervals.

How to hold it: Give it to the machine, then check

Let software compute test statistics, p-values and intervals; check that an interval is roughly the estimate plus or minus two standard errors, and say correctly what the numbers do and do not mean.

What knowing it looks like

  • Construct a confidence interval for a mean and say correctly what it means.
  • Carry out a zz-test: state H0H_0 and H1H_1, compute the test statistic and p-value, and draw a conclusion.
  • Spot the common misreadings of a p-value.

Test yourself

A sample of 100100 measurements has mean 52.052.0, and the population standard deviation is known to be 1010. Give a 95%95\% confidence interval for the population mean, and test H0 ⁣:μ=50H_0\colon\mu=50 against H1 ⁣:μ≠50H_1\colon\mu\ne50 at the 5%5\% level.
Show the worked answer
Standard error 10/100=110/\sqrt{100}=1. Interval: 52.0±1.9652.0\pm1.96, that is (50.04, 53.96)(50.04,\,53.96). Test statistic z=52−501=2.0z=\frac{52-50}{1}=2.0; two-sided p-value 2(1−Φ(2))≈0.046<0.052\big(1-\Phi(2)\big)\approx0.046<0.05, so reject H0H_0. The two agree: 5050 lies just outside the interval. This does not mean there is a 95%95\% chance that μ\mu is in this particular interval; the 95%95\% belongs to the method.

Needs a step first: 18

Learn it with an AI

Copy this prompt into any AI assistant. It will take you through step by step at your level and finish with the test above.

Be my maths tutor. I'm learning "Confidence Intervals and Hypothesis Tests" (Undergraduate I tier): Turning a sample into a statement about the whole population: a range of plausible values, or a test of a claim.
I already know: The Central Limit Theorem.
Teach it Socratically: first ask what I already know; then explain the core idea with one concrete example and why it's true; then give me three problems, one at a time, easy to hard. Wait for my answer, check every step, and point out mistakes without giving the answer away.
Finish by testing me with this: A sample of $100$ measurements has mean $52.0$, and the population standard deviation is known to be $10$. Give a $95\%$ confidence interval for the population mean, and test $H_0\colon\mu=50$ against $H_1\colon\mu\ne50$ at the $5\%$ level.
Use LaTeX for formulas. When you say where it's used later (machine learning, quantum mechanics), be specific.

On the way to

Recommended