1.3.1Probability & Statistics

Sample spaces, events, and axioms of probability

2,438 words11 min readdifficulty · medium

What is a sample space?

Why do we need this? Without defining "all possibilities," we can't measure "how likely" something is. It's like asking "what fraction?" without saying "fraction of what?"

Examples of sample spaces

What is an event?

Why subsets? Because we often care about groups of outcomes. "Rolling an even number" is the event {2, 4, 6}, not a single outcome.

Types of events

  • Simple event: single outcome, e.g., {H} or {(3,5)}
  • Compound event: multiple outcomes, e.g., {sum≥ 10} = {(4,6), (5,5), (5,6), (6,4), (6,5), (6,6)}
  • Certain event: Ω itself (probability = 1)
  • Impossible event: ∅ (probability = 0)

Define event A = "sum is 7" A={(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)}A = \{(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)\} A=6|A| = 6

Define event B = "at least one die shows 6" B={(6,1),(6,2),..,(6,6),(1,6),(2,6),..,(5,6)}B = \{(6,1), (6,2), .., (6,6), (1,6), (2,6), .., (5,6)\} B=11|B| = 11 Why 11, not 12? (6,6) is counted once, not twice (inclusion-exclusion principle)

Event operations:

  • A ∪ B = "sum is 7 OR at least one 6" (union)
  • A ∩ B = {(1,6), (6,1)} = "sum is 7 AND at least one 6" (intersection)
  • A^c = "sum is NOT 7" (complement, all outcomes except A)

The three axioms of probability

Axiom 1 (Non-negativity): P(E)0EΩP(E) \geq 0 \quad \forall E \subseteq \Omega

Axiom 2 (Normalization): P(Ω)=1P(\Omega) = 1

Axiom 3 (Countable Additivity): For mutually exclusive events E1,E2,..E_1, E_2, ..: P(E1E2..)=P(E1)+P(E2)+...P(E_1 \cup E_2 \cup ..) = P(E_1) + P(E_2) + ... (if EiEj=E_i \cap E_j = \emptyset for iji \neq j)

Why these three?

Axiom 1 WHY: Probabilities are fractions of certainty. Negative probability has no physical meaning. You can't be "−20% sure."

Axiom 2 WHY: SOMETHING must happen. If you flip a coin, you get heads or tails (assuming it doesn't land on edge, which is outside our model). The total probability of all possible outcomes is certainty = 100% = 1.

Axiom 3 WHY: If events can't happen together (mutually exclusive), the probability of "A or B" is just "add them up." If you can't roll (1,1) AND (2,3) simultaneously, then P({(1,1)} ∪ {(2,3)}) = P({(1,1)}) + P({(2,3)}).

What about non-mutually-exclusive events? That's NOT Axiom 3. We derive it:

Derivation:

  1. Write AB=A(BAc)A \cup B = A \cup (B \cap A^c) (split B into "B-only" part)
  2. These are disjoint: AA and BAcB \cap A^c don't overlap
  3. By Axiom 3: P(AB)=P(A)+P(BAc)P(A \cup B) = P(A) + P(B \cap A^c)
  4. But B=(BA)(BAc)B = (B \cap A) \cup (B \cap A^c), disjoint again
  5. So P(B)=P(BA)+P(BAc)P(B) = P(B \cap A) + P(B \cap A^c)
  6. Rearrange: P(BAc)=P(B)P(AB)P(B \cap A^c) = P(B) - P(A \cap B)
  7. Substitute into step 3: P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)

Why this step? We had to avoid double-counting the overlap ABA \cap B.

Deriving useful properties from axioms

Proof:

  1. AA and AcA^c are mutually exclusive: AAc=A \cap A^c = \emptyset
  2. AAc=ΩA \cup A^c = \Omega (every outcome is either in A or not)
  3. By Axiom 2: P(Ω)=1P(\Omega) = 1
  4. By Axiom 3: P(AAc)=P(A)+P(Ac)P(A \cup A^c) = P(A) + P(A^c)
  5. Combine: 1=P(A)+P(Ac)1 = P(A) + P(A^c)
  6. Rearrange: P(Ac)=1P(A)P(A^c) = 1 - P(A)

ML intuition: If your spam classifier says P(spam) = 0.7, then P(not-spam) = 0.3. They must sum to 1.

Proof:

  1. Write B=A(BAc)B = A \cup (B \cap A^c) (B is A plus extra stuff)
  2. These are disjoint
  3. By Axiom 3: P(B)=P(A)+P(BAc)P(B) = P(A) + P(B \cap A^c)
  4. By Axiom 1: P(BAc)0P(B \cap A^c) \geq 0
  5. Therefore: P(B)P(A)P(B) \geq P(A)

Intuition: "Bigger events can't have smaller probability." If B contains all of A plus more, B is at least as likely.

Computing probabilities in finite sample spaces

For finite Ω with equally likely outcomes (like fair dice, random draws):

Why this works:

  1. Each outcome ω has the same probability: P({ω})=1ΩP(\{\omega\}) = \frac{1}{|\Omega|}
  2. Event E is a union of disjoint outcomes: E={ω1}{ω2}...E = \{\omega_1\} \cup \{\omega_2\} \cup ...
  3. By Axiom 3: P(E)=ωEP({ω})=E1ΩP(E) = \sum_{\omega \in E} P(\{\omega\}) = |E| \cdot \frac{1}{|\Omega|}

Why this step? Each of the 36 outcomes is equally likely (fair dice). The event "sum=7" contains 6 of them.

Estimated: P(spam)3001000=0.3P(\text{spam}) \approx \frac{300}{1000} = 0.3 P(not-spam)7001000=0.7P(\text{not-spam}) \approx \frac{700}{1000} = 0.7

Check: 0.3+0.7=10.3 + 0.7 = 1 ✓ (Axiom 2)

ML connection: This is maximum likelihood estimation for a Bernoulli distribution.

Common mistakes

Why it feels right: For disjoint events, this IS true (Axiom 3). Beginers overgeneralize.

The fix: Check if events overlap. If ABA \cap B \neq \emptyset, use inclusion-exclusion: P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)

Example: Two dice, A = "first die is 6", B = "sum is 10"

  • P(A)=6/36=1/6P(A) = 6/36 = 1/6
  • P(B)=3/36=1/12P(B) = 3/36 = 1/12 (pairs: (4,6), (5,5), (6,4))
  • AB={(6,4)}A \cap B = \{(6,4)\}, so P(AB)=1/36P(A \cap B) = 1/36
  • P(AB)=1/6+1/121/36=6/36+3/361/36=8/36=2/9P(A \cup B) = 1/6 + 1/12 - 1/36 = 6/36 + 3/36 - 1/36 = 8/36 = 2/9

If we'd just added: 1/6+1/12=1/42/91/6 + 1/12 = 1/4 \neq 2/9

Why it feels right: Mathematically, |Ω| = 2. Classical probability gives 1/2.

The fix: Equally likely outcomes require symmetry (fair coin, fair die random draw). Weather is NOT symmetric. The axioms allow non-uniform probabilities. We need data or a model.

The fix: Axiom 1 and 2 bound P(E) ∈ [0, 1]. If you compute something outside this range, you made an algebra error or your model is incoherent.

Connections to ML/AI

Recall Explain to a 12-year-old

Imagine you have a bag of marbles: 3 red, 2 blue, 5 green. You close your eyes and pick one.

The sample space is "all the marbles in the bag" — every possible one you could pick. That's 10 marbles total.

An event is something you care about, like "I picked a red marble" or "I picked red or blue." Events are just groups of marbles.

The three rules of probability (axioms) are:

  1. Chances can't be negative. You can't have "minus 30% chance" of picking red — that's nonsense.
  2. SOME marble will be picked (assuming you do pick). So the chance of "any marble at all" is 100%, which we write as 1.
  3. If two events can't happen at the same time (like picking one marble that's both red AND blue — impossible), then the chance of "red OR blue" is just: chance of red + chance of blue.

That's it! These three simple rules let us calculate probabilities for everything in AI and ML.


Summary

  • Sample space Ω: all possible outcomes, exhaustive and mutually exclusive
  • Event E: a subset of Ω we assign probability to
  • Three axioms: Non-negativity, normalization, additivity (for disjoint events)
  • Derived properties: complement rule, inclusion-exclusion, monotonicity
  • Classical probability: P(E) = |E|/|Ω| when outcomes are equally likely
  • ML foundation: all probabilistic models (Bayes, logistic regression, generative models) rest on these axioms

#flashcards/ai-ml

What is a sample space (Ω)?
The set of all possible outcomes of a random experiment, which must be exhaustive (contains every possible outcome) and mutually exclusive (outcomes don't overlap).
What is an event in probability theory?
A subset of the sample space (E ⊆ Ω) representing a collection of outcomes we're interested in.
State Axiom 1 of probability (non-negativity).
P(E) ≥ 0 for all events E. Probabilities cannot be negative.
State Axiom 2 of probability (normalization).
P(Ω) = 1. The probability of the entire sample space (something must happen) is 1.
State Axiom 3 of probability (countable additivity).
For mutually exclusive events E₁, E₂, ...: P(E₁ ∪ E₂ ∪ ...) = P(E₁) + P(E₂) + ... The probability of a union of disjoint events is the sum of their individual probabilities.
Derive the complement rule P(A^c) = 1 - P(A) from the axioms.
(1) A and A^c are mutually exclusive: A ∩ A^c = ∅. (2) They partition Ω: A ∪ A^c = Ω. (3) By Axiom 2: P(Ω) = 1. (4) By Axiom 3: P(A ∪ A^c) = P(A) + P(A^c). (5) Therefore: 1 = P(A) + P(A^c), so P(A^c) = 1 - P(A).
What is the inclusion-exclusion principle for two events?
P(A ∪ B) = P(A) + P(B) - P(A ∩ B). We subtract the intersection to avoid double-counting outcomes that are in both A and B.
When can we use the formula P(E) = |E|/|Ω|?
Only when the sample space is finite AND all outcomes are equally likely (uniform distribution), such as fair dice or random draws from a uniform population.
Why can't we say P(rain) = 1/2 just because there are two outcomes (rain/no rain)?
The formula P(E) = |E|/|Ω| only works for equally likely outcomes. Rain and no-rain are not symmetric; we need data or a weather model to assign probabilities.
For two dice, what is P(sum ≥ 10)?
The favorable outcomes are {(4,6), (5,5), (5,6), (6,4), (6,5), (6,6)}, so |E| = 6. Total outcomes |Ω| = 36. Therefore P(E) = 6/36 = 1/6.
If A ⊆ B, what is the relationship between P(A) and P(B)?
P(A) ≤ P(B). This is the monotonicity property: larger events (more outcomes) cannot have smaller probability.
Figure — Sample spaces, events, and axioms of probability

Concept Map

defines

must be

subset of

single outcome

many outcomes

combined via

union intersection complement

whole set

is

measured by

assigns

used in ML

Random Experiment

Sample Space Omega

Exhaustive and Mutually Exclusive

Event E

Simple Event

Compound Event

Set Operations

Certain Event Omega

Empty Set

Impossible Event

Kolmogorov Axioms

Probability P of E

Spam Classifier and Distributions

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Probability theory ka foundation teen basic concepts pe tikta hai: sample space, events, aur teen axioms. Sample space (Ω) basically wo set hai jisme experiment ke sare possible outcomes hote hain. Jaise do dice roll karo toh 36 outcomes possible hain (1,1) se (6,6) tak. Yeh zaroori hai ki yeh set complete ho (exha

Go deeper — visual, from zero

Test yourself — Probability & Statistics

Connections