Every probability problem starts with a clear description of what can happen. A weather forecast, a quality check on a batch of chips and a game of cards all involve a process whose result is not certain in advance. The words experiment, sample space and event give this idea a precise form.

Random Experiment and Sample Space

A random experiment is a process that can be repeated under the same conditions, has more than one possible result, and whose result cannot be predicted in advance. Tossing a coin and throwing a die are examples. Each possible result is an outcome, and the set of all outcomes is the sample space, written S. For one die, S = {1, 2, 3, 4, 5, 6}. For two tosses of a coin, S = {HH, HT, TH, TT}, which has four outcomes.

Definition: Sample space. The set of all possible outcomes of a random experiment.

Events

An event is any subset of the sample space. Getting an even number on a die is the event E = {2, 4, 6}. An event with a single outcome is a simple event, and an event with more than one outcome is a compound event. The whole sample space is the sure event, and the empty set is the impossible event.

Operations on Events

Events can be combined like sets. The union A or B happens when at least one of A and B happens. The intersection A and B happens when both occur. The complement of A, written A', happens when A does not. Two events are mutually exclusive if they cannot occur together, so their intersection is empty. Events are exhaustive if together they make up the whole sample space.

Table 3.1: Operations on events

Operation Meaning Happens when
A union B A or B At least one occurs
A intersection B A and B Both occur
A' Not A A does not occur
Mutually exclusive A and B cannot coincide Intersection is empty

Example 3.1: Sample space and events for two dice

Problem: Two dice are thrown. How many outcomes are in the sample space, and how many give a sum of 7?

Solution:

  1. Each die has 6 faces, so there are 6 × 6 = 36 outcomes.
  2. The sum is 7 for (1, 6), (2, 5), (3, 4), (4, 3), (5, 2) and (6, 1).

Result: The sample space has 36 outcomes and the event "sum is 7" contains 6 of them.

from itertools import product
S = list(product(range(1, 7), repeat=2))
E = [s for s in S if sum(s) == 7]
print(len(S), len(E), E)

Output

36 6 [(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)]

Common mistakes

  • Listing HT and TH as one outcome when the coins are distinguishable.
  • Confusing mutually exclusive events with independent events.
  • Forgetting the complement as a quick way to count "at least one" cases.

Key takeaways

  • The sample space S lists all outcomes of an experiment.
  • An event is a subset of S.
  • Mutually exclusive events cannot occur together.
  • Union means "or", intersection means "and", complement means "not".

Practice questions

  1. Define sample space.
  2. What is the sample space of tossing two coins?
  3. When are two events mutually exclusive?

Answers to the practice questions

  1. The set of all possible outcomes of a random experiment.
  2. {HH, HT, TH, TT}.
  3. When they cannot occur together, so their intersection is empty.

Sources

  • Official BCA syllabus Probability and Statistics, course code 26BCA403DS01, Unit III