Calculator
Enter the data to get the confidence interval and its chart.
Explanation
When you know the population standard deviation \(\sigma\) (or can safely assume it is known), the confidence interval for the mean is built using the standard normal distribution. It is the simplest case and serves as a starting point for understanding the logic of confidence intervals.
In practice, \(\sigma\) is rarely known exactly. However, this interval is a good approximation when the sample size is large (n ≥ 30) and the population variance is stable and known from previous studies.
Formula
Let \(C\) denote the confidence level and \(\alpha=1-C\) the total area outside the interval. For 95% confidence, \(C=0.95\), \(\alpha=0.05\) and \(\alpha/2=0.025\) in each tail.
\( \bar{x} \pm z_{\alpha/2} \cdot \dfrac{\sigma}{\sqrt{n}} \)
- \(\bar{x}\): observed sample mean.
- \(z_{\alpha/2}\): critical value of the standard normal for the chosen confidence level.
- \(\sigma\): population standard deviation (known).
- \(n\): sample size.
The margin of error is \(E = z_{\alpha/2} \cdot \sigma/\sqrt{n}\), and the interval is \([\bar{x} - E,\; \bar{x} + E]\).
Common critical z values
- 90% confidence: \(z_{0.05} = 1.645\)
- 95% confidence: \(z_{0.025} = 1.960\)
- 99% confidence: \(z_{0.005} = 2.576\)
Worked example
A screw factory knows from technical specifications that \(\sigma = 0.08\) mm. A sample of 50 screws is measured, giving \(\bar{x} = 10.02\) mm. With 95% confidence (\(C=0.95\), \(\alpha=0.05\)), the interval is:
\( 10.02 \pm 1.960 \cdot \frac{0.08}{\sqrt{50}} \approx [9.998,\; 10.042] \text{ mm} \)
Assumptions of the z interval
- The sample must be random and the observations independent.
- The population standard deviation \(\sigma\) must be known, or fixed with sufficient certainty by information external to the study.
- The sample mean must be approximately normally distributed: this holds if the population is normal or if the sample size is large, by the central limit theorem.
- If \(\sigma\) is estimated from the sample and \(n\) is small, use the CI with Student's t instead of the z interval.
How to interpret the result
The interval \([L, U]\) defines the range of values of \(\mu\) compatible with the data and the chosen confidence level. The correct interpretation is frequentist: if you repeated the sampling many times and built the CI with the same procedure, a proportion \(C\) of those intervals would contain the true value of \(\mu\). For the specific interval in front of you, \(\mu\) is either inside or outside; the \(C\%\) probability refers to the method, not to the individual result.
In the chart, the green region under the standard normal curve represents the confidence zone and the red tails (each with area \(\alpha/2\)) mark the critical values \(\pm z_{\alpha/2}\). The observed z statistic, shown in yellow, indicates where the current sample falls on the standardized scale. If the z statistic falls inside the green region, the interval contains the reference value; if it falls in the red tails, it excludes it.
- Width and precision: the total width is \(2 \cdot z_{\alpha/2} \cdot \sigma/\sqrt{n}\). To cut it in half you need to quadruple the sample size; raising the confidence from 90% to 99% increases \(z\) from 1.645 to 2.576 and widens the interval by 57%.
- Connection with hypothesis testing: if a reference value \(\mu_0\) falls outside \([L, U]\), the data would reject \(H_0\!: \mu = \mu_0\) at significance level \(\alpha = 1 - C\) in the equivalent two-sided z test.
- When known \(\sigma\) matters: using the exact \(\sigma\) (instead of estimating it with \(s\)) introduces no extra uncertainty, so the CI is narrower than the t interval for the same sample. This makes it especially useful when the process variability is very stable and known in advance.
When to use this interval
Use the z CI when the sample size is large (n ≥ 30) or when \(\sigma\) is determined with certainty by the process (for example, calibrated measurement equipment). For small samples with unknown \(\sigma\), use the CI with Student's t.
Frequently asked questions
- Why use z instead of t? Because \(\sigma\) is known; the distribution of the statistic \((\bar{x}-\mu)/(\sigma/\sqrt{n})\) is exactly standard normal.
- What happens if the CI does not contain the reference value? At that confidence level you would reject the hypothesis that \(\mu\) equals that value.
- How do I cut the width in half? Quadruple the sample size (the margin of error varies with \(1/\sqrt{n}\)).