In probability, what is a sample space and what counts as an event?
answer
- everything that could possibly happen
- outcomes: exactly one occurs
- an event is a subset
- 36 ordered pairs, not 11 sums
- counting works only if equally likely
basics
~20 sA sample space is the set of all possible outcomes of a random experiment, listed so exactly one occurs. An event is any subset of it. Two dice give 36 outcomes; "the sum is 7" is a 6-outcome event.
solid answer
~50 sThe sample space, usually written `S`, is the complete list of possible outcomes of a random experiment, chosen so the outcomes are mutually exclusive and cover everything: exactly one occurs on each trial. An event is any subset of `S`, so "or" becomes union, "and" becomes intersection, and "not" becomes complement. For two distinguishable fair dice, `S` is the 36 ordered pairs `(i, j)`. The event "sum is 7" is `{(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)}`, six outcomes, so `6/36 = 1/6`. The event "both dice show the same value" is the six doubles, also `1/6`. The two never happen together, since 7 is odd. The counting shortcut `P(A) = |A| / |S|` is only valid when every outcome in `S` is equally likely, which is exactly why the 36 ordered pairs are the right list and the 11 possible sums are not.
go deeper
Be ready to write the sample space out explicitly for a small experiment and count the outcomes in an event, then divide. Say the words mutually exclusive and exhaustive when you describe your list.
Explain why the counting shortcut needs an equally likely model, and show that the same experiment admits several valid sample spaces of which only some are symmetric. The 36 versus 21 versus 11 dice framing is the cleanest demonstration.
Show that you fix the sample space before the formula when a business question is fuzzy: define what one trial is, what a single outcome is, and whether outcomes can co-occur, then justify the probability model rather than assuming it.
Own the framing decision: which experiment is actually being modelled, whether the granularity of the sample space matches the decision at stake, and what breaks downstream when the team quietly redefines what one observation means.
## The vocabulary A **random experiment** is any procedure whose result is not determined in advance: rolling dice, drawing a card, sampling a user from a database, measuring the latency of the next request. An **outcome** is one indivisible result of that experiment. The **sample space**, written `S` (or the Greek letter Omega), is the set of all outcomes. Two conditions make a list of outcomes a legitimate sample space: - **Mutually exclusive** — no two listed outcomes can occur on the same trial. - **Collectively exhaustive** — at least one of them must occur. Together these say that on every trial *exactly one* outcome happens. If your list can fail both ways at once, you do not have a sample space; you have a set of tags. An **event** is any subset of `S`. That is the whole definition, and it is deliberately generous: - A single-outcome subset is an **elementary** (or simple) event. - The whole set `S` is the **certain** event, probability 1. - The empty set is the **impossible** event, probability 0. Because events are sets, ordinary English maps onto set operations with no slippage: | English | Set notation | |---|---| | A or B (inclusive) | union, `A ∪ B` | | A and B | intersection, `A ∩ B` | | not A | complement, `A^c` | | A implies B | `A` is a subset of `B` | ## The worked example: two dice Roll two fair dice you can tell apart. The sample space is every ordered pair: `S = {(1,1), (1,2), ..., (6,5), (6,6)}`, so `|S| = 6 × 6 = 36`. Define two events: - `A` = "the sum is 7" = `{(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)}`, `|A| = 6`. - `B` = "both dice show the same value" = `{(1,1), (2,2), (3,3), (4,4), (5,5), (6,6)}`, `|B| = 6`. Each outcome in `S` is equally likely with probability `1/36`, so `P(A) = 6/36 = 1/6` and `P(B) = 6/36 = 1/6`. Notice `A ∩ B` is empty: a double always gives an even sum, and 7 is odd. So the events cannot both occur, and `P(A ∪ B) = 6/36 + 6/36 = 12/36 = 1/3`. ## Why the choice of sample space matters The counting formula `P(A) = (number of outcomes in A) / (number of outcomes in S)` is **not** the definition of probability. It is a shortcut that holds only under an **equally likely outcome model** — when the physical symmetry of the experiment makes every element of `S` equally probable. You can describe the same two-dice experiment with different sample spaces, and only some of them are equally likely: - **36 ordered pairs** — equally likely. Counting works. - **21 unordered pairs** (treating `(1,2)` and `(2,1)` as one outcome) — a perfectly valid sample space, but *not* equally likely. An unordered mixed pair has probability `2/36`, a double only `1/36`. Dividing counts by 21 gives wrong answers. - **11 possible sums**, 2 through 12 — also valid, also not equally likely. The sum 7 has probability `6/36`; the sum 2 has probability `1/36`. This is the single most common way beginners produce confidently wrong probabilities: they pick a coarse sample space, then apply a formula that silently assumed symmetry. ## Discrete and continuous sample spaces A sample space can be finite (36 dice outcomes), countably infinite (the number of retries before a request succeeds: 0, 1, 2, ...), or uncountable (the latency of the next request, any non-negative real number). In the uncountable case, individual outcomes carry probability zero and you assign probability to events such as intervals rather than to points. The definitions of sample space and event do not change; only the machinery for assigning numbers does. ## Why interviewers open here A miscounted or badly chosen sample space corrupts everything computed afterwards, and it does so silently — the arithmetic still runs and produces a plausible number. Interviewers use this question to check that you write down `S` explicitly before reaching for a formula, and that you can say out loud whether its outcomes are equally likely. ## Traps to avoid - Calling a single outcome "an event" and a set of outcomes something else. Every outcome corresponds to a one-element event; events are the general object. - Listing categories that a trial can satisfy twice, or none of. - Assuming symmetry. A biased coin has sample space `{H, T}`, but `P(H)` is not automatically `1/2`.
- What is the difference between an outcome and an event?An outcome is one indivisible result of the experiment and an element of the sample space. An event is a set of outcomes: possibly empty, possibly a single outcome, possibly the entire sample space. Every outcome has a matching one-element event, but most interesting events, like "the sum is 7", bundle several outcomes together.
- Why is the 36-ordered-pair sample space for two dice better than the 11 possible sums?Both are valid sample spaces, but only the 36 ordered pairs are equally likely, so `P(A) = |A| / 36` is legitimate. The 11 sums are wildly unequal: 7 arises six ways and 2 only one way. Dividing counts by 11 would say `P(sum = 7) = 1/11` instead of the correct `1/6`.
- How does the idea of a sample space work for a continuous quantity like request latency?The sample space becomes an interval of real numbers rather than a finite list, for example all values from zero upward. Any single value then has probability zero, so you assign probability to events like "latency exceeds 200 ms" instead of to individual points. Sample space and event keep their definitions; only the counting shortcut disappears.
The sample space is the full menu; an event is any way you circle part of it, from one dish to the whole page.
saying these in an interview costs you the question
- Treating a sample space as a list of interesting cases rather than all outcomes
- Assuming outcomes are equally likely without checking the experiment's symmetry
- Using the 21 unordered dice pairs as if each had probability 1/21
- Saying an event must be a single outcome
- Listing overlapping categories and calling them a sample space