← back to statistics

Probability

OpenIntro Statistics · Ch. 3 · openintro.org/book/os

New to statistics? Start with Probability and Events, a short chapter you can experiment with.

Probability quantifies uncertainty. The rules are simple: probabilities are between 0 and 1, they add up for disjoint events, and conditional probability lets you update beliefs with new evidence. Bayes' theorem ties it all together.

Probability rules

For any event A: 0 ≤ P(A) ≤ 1. For disjoint events: P(A or B) = P(A) + P(B). For non-disjoint events: P(A or B) = P(A) + P(B) - P(A and B). The complement rule: P(not A) = 1 - P(A).

S A B A∩B P(A ∪ B) = P(A) + P(B) - P(A ∩ B)
Scheme

What does a warning tell you?

A fictional factory scanner flags 90% of defective items. It also flags 10% of good items. If an item gets flagged, is it probably defective? Predict first, then change how common defects are.

These are expected counts per 10,000 items, not a simulated batch. The scanner’s two conditional rates stay fixed.

ItemsFlaggedPassed
Defective9010
Good9908910

Defective among flagged: 90 ÷ 1080 = 8.3%.

“Given” changes the denominator. At a 1% defect rate, 90 defective and 990 good items are flagged. Only 90 of those 1,080 flagged items are defective, despite catching 90% of all defects.

The idea in one line

P(A | B) = P(A and B) / P(B), provided P(B) is positive. Keep only cases in B; among those, count the ones also in A. Reversing A and B usually changes the question and the answer.

A moment to think

A spam filter catches 90% of spam. Does that mean 90% of flagged messages are spam?

Conditional probability

P(A | B) = P(A and B) / P(B). The probability of A, given that B happened. This is how we update probabilities with evidence.

Scheme

Independence

Events A and B are independent if P(A | B) = P(A), equivalently P(A and B) = P(A) * P(B). Coin flips are independent. Test results from the same patient are not.

Scheme
Neighbors

Related chapters

Foundations (Wikipedia)

Translation notes

OpenIntro introduces probability with contingency tables and tree diagrams. We focus on the computational rules. The Bayes' theorem example (disease screening) is a standard illustration of base rate neglect. The original also covers probability trees and more complex multi-step scenarios. For rigorous probability axioms, see 🎰 Grinstead Ch. 1.

Want the full treatment? Read OpenIntro Statistics, Ch. 3.