Bayes' Theorem and P-Values: Concepts and Common Pitfalls
Statistics & ExperimentsModel answerLast updated
Explain Bayes' theorem with a worked numeric example and define p-values precisely, including what they do and do not let you conclude.
Setting the Scene
A cross-functional team is reviewing the results of several product experiments. Someone on the business side asks you to walk the group through two statistical ideas that keep coming up: Bayesian updating and p-values. They want enough depth to reason about results correctly, without misreading what the numbers mean.
Your Task
Address both parts clearly and concisely.
Part 1 — Bayes' Theorem
Write out the formula and name each term. Then walk through a concrete numeric example that shows how the result can be counterintuitive, and explain why the calculation matters for real decisions.
Part 2 — P-Values
Give a plain-language definition. Use a simple example to show how to read a p-value correctly, then list the most important conclusions it does not support. Bonus: connect p-values back to Part 1 to show why a "statistically significant" result is not the same as a "probably true" result.
A strong answer names all formula components, completes the numbers, flags at least three common misinterpretations, and ties the two concepts together.
Hints
Hint 1
For Bayes' theorem, name all four terms (prior, likelihood, evidence, posterior) before plugging in numbers. The most surprising results come from low base rates — pick an example where the base rate is well under 50% so the counterintuitive outcome is obvious.
Hint 2
A p-value is a conditional probability of the form P(data | null is true), not P(null is true | data). Make sure your definition explicitly includes both 'assuming no effect' and 'at least as extreme as what we observed.'
Hint 3
To connect the two halves, think about what happens when you run many experiments and only a fraction of tested ideas actually work. Lay out the four cells (true positives, false positives, true negatives, false negatives) as counts and compute what fraction of 'significant' results are genuine — this is the false discovery rate, and it follows the same structure as Part 1.
Model answer
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Part 1: Bayes' Theorem
The Formula
Given a hypothesis H and some observed evidence E:
$$ P(H \mid E) = \frac{P(E \mid H),P(H)}{P(E)}, \qquad P(E) = P(E \mid H),P(H) + P(E \mid \neg H),P(\neg H) $$
What each term means:
- Prior, P(H): your belief in H before seeing any new evidence.
- Likelihood, P(E | H): how probable the evidence is, assuming H is true.
- Marginal evidence, P(E): the total probability of observing E across every possible scenario — a normalizing constant that ensures the posterior is a valid probability.
- Posterior, P(H | E): your updated belief after the evidence is in.
The one-line summary: posterior ∝ likelihood × prior. New data shifts your belief, but the starting point matters enormously.
Worked Example: Flagging Fraudulent Transactions
Suppose a fraud detection model has these characteristics:
- 1% of transactions are actually fraudulent: P(fraud) = 0.01
- The model catches 95% of real fraud: P(flag | fraud) = 0.95
- It falsely flags 5% of legitimate transactions: P(flag | legit) = 0.05
A transaction just got flagged. What is the probability it is genuinely fraudulent?
Step 1 — Total probability of a flag:
$$ P(\text{flag}) = 0.95 \times 0.01 + 0.05 \times 0.99 = 0.0095 + 0.0495 = 0.059 $$
Step 2 — Apply the theorem:
$$ P(\text{fraud} \mid \text{flag}) = \frac{0.0095}{0.059} \approx 0.16 $$
Only about 16% of flagged transactions are actually fraudulent, despite the model being "95% accurate."
Natural frequency reframe (easier for non-technical audiences): imagine 10,000 transactions. 100 are fraudulent — the model catches 95 of them. Of the 9,900 legitimate ones, 495 are flagged by mistake. That's 590 total flags, of which 95 are real: 95 / 590 ≈ 16%.
Why this matters for decisions: automatically blocking every flagged account punishes roughly five innocent users per fraudster stopped. Better options include a second-stage manual review or using the flag as a prior and updating with additional signals (chaining Bayes). Also note that the posterior is very sensitive to the base rate: if fraud climbed to 10%, the same model's precision would jump to about 68%.
Part 2: P-Values
Definition
Assume the null hypothesis is true (no real effect). The p-value is the probability of observing a result at least as extreme as the one you got, purely by chance.
It is a statement about the data given a hypothesis — P(data | H₀) — not a statement about how likely the hypothesis is.
Example: Testing a New Onboarding Flow
A team runs an A/B test on a signup screen. The treatment group converts 0.8 percentage points higher than control. The test returns p = 0.03.
Correct reading: if the new screen had zero real effect, a gap of 0.8 points or larger would appear by random variation only about 3% of the time. The result looks unusual under the assumption of no effect. With a pre-set threshold of α = 0.05, this crosses the bar for statistical significance.
What a P-Value Does Allow
- Quantifying how surprising the data are under the null.
- Controlling the long-run false-positive rate: if you use α = 0.05 consistently and the null is always true, you will wrongly reject it at most 5% of the time.
What a P-Value Does Not Allow
- It is not P(null is true). p = 0.03 does not mean "3% chance the feature does nothing."
- 1 − p is not the probability the feature works. There is no 97% confidence in the alternative baked into this number.
- It says nothing about effect size or business impact. With a large enough sample, a lift of 0.001% can reach p < 0.05 while being commercially meaningless.
- p > 0.05 does not prove the null. An underpowered test failing to detect an effect is not the same as confirming there is no effect.
- It assumes the analysis was pre-specified. Peeking at results repeatedly, testing many metrics, or slicing segments until something hits p < 0.05 inflates false positives severely. Fixes include pre-registration, Bonferroni or Benjamini–Hochberg corrections, and sequential testing frameworks.
Connecting the Two: Why "Significant" ≠ "Probably Real"
Bayes' theorem reveals a structural problem with naive p-value thresholds. Suppose:
- 10% of experiments test ideas that genuinely work (the base rate of true effects).
- Each test has 80% statistical power.
- α = 0.05.
Across 1,000 experiments:
| Count | Significant results | |
|---|---|---|
| Truly effective ideas | 100 | 80 (true positives) |
| Ineffective ideas | 900 | 45 (false positives at α = 0.05) |
| Total | 1,000 | 125 |
45 / 125 = 36% of significant results are false discoveries. The structure is identical to the fraud example: the significance threshold acts like the false-positive rate, and the share of good ideas is the base rate. When the base rate is low, false positives dominate the significant pile.
This is why confidence intervals (which show the plausible range of effect size), pre-registration, and replication matter alongside the p-value.
Common Mistakes to Avoid
- Swapping the conditional: treating P(E | H) as if it were P(H | E) — the core error in both parts.
- Ignoring base rates: quoting sensitivity or accuracy without accounting for how rare the positive condition is.
- Using 0.05 as a hard threshold rather than one input among several, including effect size, cost, and uncertainty.
- Not specifying the null and test direction (one-sided vs. two-sided) before interpreting any p-value.
- Conflating statistical significance with practical importance.