Probability
Foundations
8 min

Sample Spaces and Basic Rules

Model uncertainty with sample spaces and events, and use the complement and union rules to compute probabilities cleanly.

1. The idea

A sample space is the set of all possible outcomes of an experiment. An event is a subset of . Once you can describe an event precisely as a subset, computing its probability becomes a counting or measure problem rather than a guessing game.

Two rules do most of the work in interviews. The complement rule says , which is useful whenever "at least one" or "none" language appears. The union rule, , corrects for double-counting outcomes that belong to both events.

When outcomes are equally likely and the sample space is small, probability is just a ratio: favorable outcomes divided by total outcomes. The discipline is in enumerating the sample space correctly, not in the arithmetic.

2. Why it matters

Almost every interview probability question reduces to defining the right sample space. Sloppy setups — double counting, wrong denominators — are the most common source of wrong answers, even when the underlying idea was right.

3. Core mathematics

Complement rule

Union (inclusion-exclusion for two events)

Equally likely outcomes

Valid only when every outcome in has the same probability.

Independence (definition)

4. How to recognize it

Think of this when…

  • The problem describes rolling dice, drawing cards, or flipping coins with a small, enumerable outcome set.
  • Language like "at least one" or "none of" suggests using the complement.
  • The question asks for the probability of A or B, hinting at the union rule.
  • You are asked to justify why two events are or are not independent.

5. Worked example

Worked example

Roll two fair six-sided dice. What is the probability their sum equals 7?

  1. 1

    The sample space is all ordered pairs with , so , all equally likely.

  2. 2

    List pairs summing to 7: (1,6), (2,5), (3,4), (4,3), (5,2), (6,1).

  3. 3

    Apply the equally-likely-outcomes formula.

  4. Answer:

6. Common mistakes

  • Treating unordered outcomes (like "sum of dice") as equally likely instead of counting the underlying equally-likely ordered outcomes.
  • Forgetting to subtract when computing , causing double counting.
  • Assuming two events are independent without checking .
  • Confusing mutually exclusive events (cannot both occur) with independent events (occurrence of one gives no information about the other).

7. Quick check

Two fair dice are rolled. What is ?

If and and , what is ?

Mutually exclusive events with nonzero probability can be independent.

8. Practice

27 QuantSolve questions use this concept.

Practice this concept

9. Related methods