Interactive statistics

56 free interactive lessons: from mean and median to A/B tests and Bayes. Drag the charts and build intuition. No sign-up.

Module 2: Probability

Probability basics: events, AND, OR, independence

Before computing anything fancy, let's master the basic language of chance. Just a few simple rules — how to combine probabilities of events: add them, multiply them, take the complement — underpin almost everything that follows, from A/B tests to spam filters. We'll work them out on a clear example: a roll of a die with six equally likely outcomes.

How to use. The 6 cells below are die-roll outcomes (1–6). Under each cell are two buttons: press A to include the outcome in event A, and B for event B. The Venn diagram above shows where each outcome lands.
event Aevent B132465neither A nor B
● only A● only B● A and B (intersection)● neither
Die outcomes — press the A / B buttons under each:
1
2
3
4
5
6
P(A) = 3/6 = 0.50P(B) = 3/6 = 0.50P(A∩B) = 2/6 = 0.33P(A∪B) = 4/6 = 0.67
P(A∪B) = P(A) + P(B) − P(A∩B) = 0.50 + 0.50 − 0.33 = 0.67

Click A/B under the outcomes to change the events — the diagram and numbers recompute live. On the Venn: the left crescent is only-A, the right only-B, the middle lens is the intersection (A and B), outside are outcomes in neither event.

Take a die roll: six equally likely outcomes. An event is a set of outcomes you care about: "even" = {2,4,6}, "greater than three" = {4,5,6}. Use the A and B buttons under the cells to define two events (by default A is the evens, B is above-three). The Venn diagram above lays out all six outcomes: the left circle is A, the right is B, the shared lens holds outcomes that fall into both. The probability P(A) is the share of the event's cells: 3 out of 6 = 0.5.

Why these rules matter

These rules are not school formalities — they are an analyst's daily arithmetic. "The chance that at least one of 1000 users hits a rare bug (p=0.1%)" is computed through the complement: 1 − 0.999¹⁰⁰⁰ ≈ 63%. Intuition fails here; the rule does not.

Multiplying independent probabilities also explains multiple comparisons (20 tests, each with a 5% chance of a false alarm, → the chance of at least one false alarm is 1 − 0.95²⁰ ≈ 64%) and why long coincidences are suspicious. Independence is the key — and often false — assumption, always worth a look.

Where it shows up

System reliability: failure probabilities of duplicated independent nodes multiply, which is why redundancy slashes risk — fault-tolerance engineering stands on this.

Games and lotteries: jackpot odds are a product of independent probabilities, hence their astronomical rarity. The same rules power risk pricing in insurance.

Definitions
Outcome and event
an outcome is a single result of an experiment; an event is a set of outcomes you care about.
ComplementP(Aˉ)=1P(A)P(\bar{A}) = 1 - P(A)
handy for "at least one" via "none".
Addition rule (OR)P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)
for mutually exclusive events the intersection is 0.
Multiplication rule (AND)P(AB)=P(A)P(B)P(A \cap B) = P(A)\cdot P(B)
for independent events, probabilities multiply.
Independence
one event does not change the probability of the other. If it does — the events are dependent.
Next →
Enjoying the materials?

This site is built by the DataSlice Telegram channel: data analytics in plain words — real cases, metrics, careers. The channel is in Russian.

Open the Telegram channel