Session 8.1.1 - Confidence Interval for the Mean \( \mu \) — σ known (z-interval)

Use when population SD \( \sigma \) is known (rare in practice). For real data with unknown \( \sigma \), use the t-interval page.

Why a confidence interval?

We rarely know the population mean \( \mu \). A small sample gives a point estimate \( \bar x \), but we need a range showing plausible values for \( \mu \). A \(100(1-\alpha)\%\) confidence interval (CI) is that range: if we repeated this process many times, about \(100(1-\alpha)\%\) of such intervals would capture the true \( \mu \).

Interpretation one-liner: “We are 95% confident that \( \mu \) lies between the two endpoints.” (It’s about the method’s long-run success rate, not a probability statement about this fixed \( \mu \).)

What is α (alpha)?

Alpha is the miss rate. For a two-sided \(100(1-\alpha)\%\) CI, the area outside totals \( \alpha \), split into \(\alpha/2\) in each tail. The critical value is \( z_{\alpha/2}=\Phi^{-1}(1-\alpha/2) \).

Pick 90% (α=0.10), 95% (α=0.05), or 99% (α=0.01).
Confidence
95%
\( \alpha \)
0.05
\( \alpha/2 \)
0.025
\( z_{\alpha/2} \)
1.960
Right-tail Excel
=NORM.S.INV(1-0.05/2)
Left-tail Excel
=NORM.S.INV(0.05/2)
Sketch: shaded tails total \( \alpha \); cutpoints at \( \pm z_{\alpha/2} \).

How it works (σ known)

\[ Z \;=\; \frac{\bar X - \mu}{\sigma/\sqrt{n}} \sim \mathcal{N}(0,1) \;\Rightarrow\; \bar x \pm z_{\alpha/2}\frac{\sigma}{\sqrt{n}}. \]

If \( \sigma \) is unknown (typical), use the t-interval page.

What to expect

  • Higher confidence ⇒ wider interval.
  • Larger \(n\) or smaller \( \sigma \) ⇒ narrower interval.
  • Width \(= 2\,z_{\alpha/2}\cdot \sigma/\sqrt{n}\).

How accurate?

Margin of error \( \text{ME}=z_{\alpha/2}\sigma/\sqrt{n} \). To hit a target ME*, use \( n=\big(\frac{z_{\alpha/2}\sigma}{\text{ME}^{*}}\big)^2 \).

Formula recap & how to use it

1) The confidence interval formula

\[ \text{CI for }\mu\ (\sigma\text{ known}):\quad \boxed{\ \bar x \pm z_{\alpha/2}\,\frac{\sigma}{\sqrt{n}}\ } \] \[ \text{Lower}=\bar x - z_{\alpha/2}\frac{\sigma}{\sqrt{n}},\quad \text{Upper}=\bar x + z_{\alpha/2}\frac{\sigma}{\sqrt{n}}. \]

2) Precision pieces

3) Quick workflow

  1. Choose confidence \(1-\alpha\) → get \(z_{\alpha/2}\) (see the alpha box above).
  2. Compute \( \mathrm{SE}=\sigma/\sqrt{n} \).
  3. Compute \( \mathrm{ME}=z_{\alpha/2}\cdot \mathrm{SE} \).
  4. Report CI: \( [\,\bar x-\mathrm{ME},\ \bar x+\mathrm{ME}\,] \).
  5. Interpret: “We are \(100(1-\alpha)\%\) confident that \( \mu \) lies in this interval.”

Worked example (calculator + mini graph)

Type your numbers or pick a preset.

Preset:



z-CI:
Margin of error
SE \(=\sigma/\sqrt{n}\)
z for confidence
Enter values and click Compute z-CI to see the step-by-step math here.
Graph: dot = \( \bar x \); line = CI; tick marks = endpoints.

Excel — quick steps

Cell map

  • B2 = \( \bar x \) (sample mean)
  • B3 = \( \sigma \) (known SD)
  • B4 = \( n \) (sample size)
  • B5 = confidence as decimal (e.g., 0.95)
  • B6 = \( z_{\alpha/2} \) → =NORM.S.INV(1-(1-$B$5)/2)
  • B7 = SE → =$B$3/SQRT($B$4)
  • B8 = ME → =$B$6*$B$7
  • B9 = Lower bound → =$B$2-$B$8
  • B10 = Upper bound → =$B$2+$B$8
  • B11 = Target ME* (you type this)
  • B12 = Required n=ROUNDUP(($B$6*$B$3/$B$11)^2,0)

All-in-one formulas

  • ME in one cell: =NORM.S.INV(1-(1-$B$5)/2)*$B$3/SQRT($B$4)
  • n for target ME*: =ROUNDUP((NORM.S.INV(1-(1-$B$5)/2)*$B$3/$B$11)^2,0)
Tip: To plan sample size, enter your target ME* in B11 and read the result in B12. Then set B4 = B12 to compute the CI. If \( \sigma \) is unknown, use the t-interval page.

Common Student Q&A — quick explanations + tiny math

1) Does higher confidence mean more accuracy?

No—higher confidence → wider interval (less precise).

Example (commute): \( \sigma=4,\ n=25\Rightarrow \mathrm{SE}=4/\sqrt{25}=0.8\).
95%: \(z_{\alpha/2}=1.96\Rightarrow \mathrm{ME}=1.96\times0.8=1.568\).
99%: \(z_{\alpha/2}=2.576\Rightarrow \mathrm{ME}=2.576\times0.8=2.0608\).
99% is “safer” but less precise.
2) If I collect more data, how much narrower does the CI get?

Width shrinks like \(1/\sqrt{n}\). Quadrupling \(n\) halves the ME.

With 95%, \( \sigma=4 \).
\(n=25\Rightarrow \mathrm{SE}=0.8,\ \mathrm{ME}=1.96\times0.8=1.568\).
\(n=100\Rightarrow \mathrm{SE}=0.4,\ \mathrm{ME}=1.96\times0.4=0.784\) (half as wide).
3) Is the CI centered at \( \mu \) or at \( \bar x \)?

Always centered at the sample mean \( \bar x \). That’s why your line is symmetric around the dot ( \( \bar x \) ).

Example: \( \bar x=11.7,\ \mathrm{ME}=2.48 \Rightarrow [\,9.22,\ 14.18\,] \) is symmetric around 11.7.
4) What is “width” vs “margin of error”?

Width = Upper − Lower = \(2\times \mathrm{ME}\).

If \( \mathrm{ME}=1.568 \Rightarrow \text{Width}=2\times1.568=3.136\).
5) How many students do I need to be within ±1 minute at 95%?

Use \( n=\left(\dfrac{z_{\alpha/2}\sigma}{\mathrm{ME}^{*}}\right)^2 \) and round up.

With \( \sigma\approx4,\ \mathrm{ME}^{*}=1 \):
\( n=(1.96\times4/1)^2=(7.84)^2\approx 61.47 \Rightarrow \boxed{62}\).
6) σ is unknown—can I still use this page?

For real data, use the t-interval page. z is mainly for when \( \sigma \) is known or planning.

Tiny math: if \(n=10\) and you estimate \(s=4\):
\( \mathrm{SE}=4/\sqrt{10}=1.265.\) 95%:
z: \(1.96\times1.265=2.48\) vs t\(_{9,0.025}=2.262\): \(2.262\times1.265=2.86\).
t makes ME a bit larger at small n.
7) One-sided bound example?

For a 95% lower bound (only want a minimum), use \( \bar x - z_{\alpha}\dfrac{\sigma}{\sqrt{n}} \) with \(z_{\alpha}=1.645\).

Example: \( \bar x=11.7,\ \sigma=4,\ n=10.\ \mathrm{SE}=1.265\).
Lower 95% bound: \(11.7-1.645\times1.265\approx \boxed{9.62}\).
8) Student-life example: “average study hours within ±0.5 hr at 95%”

Suppose prior \( \sigma\approx 2 \) hours.

\( n=(1.96\times2/0.5)^2=(3.92/0.5)^2=(7.84)^2\approx 61.47 \Rightarrow \boxed{62}\).
9) Engineering example: “mean shaft diameter within ±0.02 mm at 95%”

Assume historical \( \sigma\approx 0.08 \) mm.

\( n=(1.96\times0.08/0.02)^2=(0.1568/0.02)^2=(7.84)^2\approx 61.47 \Rightarrow \boxed{62}\).
10) Does a mean CI say 95% of individual items are inside?

No. That’s a CI for the mean, not for individual observations.

For coverage of individuals (e.g., protein bar weights), use a tolerance interval or a prediction interval.
11) Is a hypothesized mean plausible?

If \( \mu_0 \) falls inside your CI, it’s consistent with the data at that confidence.

Example: CI \([9.22,14.18]\). Is \( \mu_0=11 \) plausible? Yes (inside).
12) Units & rounding?

Keep units consistent (minutes with minutes, mm with mm). Report ME and endpoints to a sensible number of decimals (usually 2–3).

Quick Excel map: B6 = \(z_{\alpha/2}\), B7 = SE, B8 = ME, B9/B10 = lower/upper; B11 = target ME*, B12 = required \(n\).