Core answer: a 95% confidence interval = sample mean ± 1.96×σ/√n; a ±3% margin of error needs ~1067 respondents and barely depends on population size; Bayes’ theorem P(sick|+) = sensitivity×prevalence ÷ P(+) — at 1% prevalence even a 99%-accurate test leaves a positive only ~50% likely to be real.

Computing a confidence interval

Structure: point estimate ± Z × standard error.

ConfidenceZ
90%1.645
95%1.96
99%2.576

Example: 100 people, mean 170cm, σ=8 → 95% CI = 170±1.96×0.8 = 170±1.57cm. Correct reading: ~95 of 100 repeated samples would trap the true mean — not “95% chance the truth lies here”.

Margin vs sample size table

n=Z²·p(1−p)/ME², worst case at p=0.5:

Target marginn (95%)
±5%385
±3%1067
±2%2401
±1%9604

Halving the margin costs 4× the sample; a million-person city and a billion-person country both need just 1067 for ±3%.

Bayes and base-rate neglect

P(sick|+) = sens×prev ÷ [sens×prev + (1−spec)×(1−prev)]

PrevalenceP(sick+) at 99% sens / 95% spec
10%68.8%
1%16.7%
0.1%1.9%

Base rates dominate — screening low-prevalence groups floods true positives with false ones.

The Kelly criterion

Optimal stake fraction f*=(bp−q)/b: b=net odds, p=win prob, q=1−p. Even odds with 55% win rate: f*=(0.55−0.45)/1=10% of bankroll — betting 20% (2× Kelly) grows slower with ruin risk. Negative f* means do not bet.

Example: where poll ±3% comes from

A 1200-person poll shows 52% support: ME=1.96×√(0.52×0.48/1200)=±2.8% → 95% CI [49.2%, 54.8%]. When two candidates differ by less than twice the margin, the “lead” may be pure noise.

Example: how scary is a positive

Cancer screen, 90% sensitivity, 95% specificity, your group’s prevalence 0.5%: P=0.9×0.005÷(0.0045+0.05×0.995)=0.0045÷0.0543≈8.3% — 9 in 10 positives are false alarms. Screening still matters; it just means positives must be confirmed by follow-up diagnostics, not panic.

Common pitfalls

  • “95% confidence = 95% probability”: the truth is fixed, in or out — 95% describes the method’s long-run hit rate.
  • “Sample must be 5% of population”: one spoonful salts the soup — 1067 random respondents suffice for any city (randomness is the real requirement).
  • “99% accurate means 99% sick when positive”: ignoring base rates is the most common statistical misread — the Bayes calculator shows it in a 10,000-person grid.
  • “Kelly beats the casino”: f* only helps with positive edge; roulette at −5.3% expectation returns “don’t play”.