Sample Space
A lot of probability becomes easier once you’re clear about what could possibly happen. The sample space is simply the “menu” of all outcomes you’re allowing your random process to produce.
What it is
In probability theory, the sample space (often written as Ω) is the set of all possible outcomes of a random experiment. An individual outcome is a single element of that set. An event is any subset of the sample space (for example, “the coin lands heads” is a subset of {H, T}). Probabilities are assigned to events, and those assignments only make sense relative to a clearly defined sample space.
Concrete examples
- Coin flip: Ω = {H, T}.
- Die roll: Ω = {1, 2, 3, 4, 5, 6}.
- Exam score (0–100 points): Ω could be {0, 1, 2, …, 100} if integer scores, or an interval [0, 100] if fractional scoring is possible.
- House price: Ω is often modeled as a range of positive real numbers, e.g., (0, ∞), even though in practice you’ll only observe a finite sample.
Why it matters in AI/ML
In machine learning, you constantly define “what outcomes are possible” before you can model uncertainty:
- Classification: the sample space is the set of class labels (e.g., {spam, not spam}). Predicted probabilities must sum to 1 over this space.
- Regression: the sample space is typically continuous (real-valued targets), which affects how you use probability density rather than discrete probabilities.
- Generative models (e.g., language models): the sample space is all valid token sequences under the chosen vocabulary and rules.
If the sample space is misspecified (missing outcomes, wrong granularity, impossible values), probability calculations, likelihoods, and model evaluation can quietly become inconsistent.
Sample Space is the set of all possible outcomes of a random experiment or process, forming the domain on which probabilities are defined. It is essential in statistics and ML because it clarifies what events and distributions mean, enabling correct likelihoods, expectations, and inference. Example: for a binary classifier’s label, the sample space is {0, 1}; for a die roll, it is {1,2,3,4,5,6}.
Imagine you’re about to roll a die. Before you roll, you can list every possible result: 1, 2, 3, 4, 5, or 6. That complete list of all possible outcomes is the sample space.
In statistics and AI, the sample space means “everything that could happen” in a situation with uncertainty. For example, if an email filter is deciding whether a message is spam or not, the sample space might be {spam, not spam}. Defining the sample space is a first step because probabilities can only be assigned to outcomes that are actually in that set.