Sample Spaces and Events
What you'll learn: How to formally describe all possible outcomes of a random process and group them into meaningful events.
The Foundation of Probability
Before we can talk about how likely something is, we need to clearly define what can happen. This is where sample spaces and events come in—they're the building blocks of probability theory, which underlies uncertainty in machine learning.
Sample Space: All Possible Outcomes
The sample space (often denoted Ω or S) is the set of all possible outcomes of a random experiment or process.
Analogy: Think of flipping a coin. The sample space is {Heads, Tails}—literally every possible result.
For rolling a six-sided die, the sample space is {1, 2, 3, 4, 5, 6}.
In machine learning, imagine classifying an email. Your sample space might be {Spam, Not Spam}.
Outcomes vs. Events
An outcome is a single element from the sample space—one specific result.
An event is a set of outcomes—a collection of one or more results we're interested in.
Example: When rolling a die:
- Outcome: rolling a 4 (one specific result)
- Event: "rolling an even number" = {2, 4, 6} (a subset of the sample space)
- Event: "rolling less than 3" = {1, 2}
Events let us ask useful questions like "What's the probability of rolling an even number?" instead of only asking about individual outcomes.
Why This Matters for ML
In machine learning, we constantly deal with uncertain predictions. Defining sample spaces helps us formalize what our model can predict, and events help us calculate the probability of different outcomes (like "Will this customer buy?" or "Is this image a cat?").
Key Takeaway: The sample space contains all possible outcomes; an event is any subset of those outcomes we want to reason about probabilistically.