Sets, Functions, and Notation

Mathematical notation for sets, functions, and probability — the language of the course.

Before diving into probability theory, let's establish the mathematical notation and concepts you'll encounter throughout this course. This section provides a quick reference for the symbols, sets, and function notation used in rigorous mathematics.

If you're comfortable with undergraduate mathematics, you may skim this section as a refresher. Return here whenever you encounter unfamiliar notation.

Number Sets

Mathematics uses special symbols for commonly used sets of numbers. These appear constantly in probability theory.

SymbolNameDescription
Natural numbers (counting numbers)
Integers
RationalsFractions where
Real numbersAll points on the number line
Positive realsReal numbers greater than 0

These sets form a hierarchy: . Most random variables in this course take values in or .

Set Notation

Definition

Set

A set is an unordered collection of distinct objects (elements). Sets are typically denoted with capital letters like or special symbols like .

SymbolRead asMeaning
"x is in A"x is an element of set A
"x is not in A"x is not an element of set A
"A is a subset of B"Every element of A is also in B
"A union B"Elements in A or B (or both)
"A intersection B"Elements in both A and B
or "A complement"Elements not in A
"empty set"The set with no elements
Example

Set Builder Notation

Sets can be defined by listing elements or by specifying a rule:

  • — the set containing exactly 1, 2, and 3
  • — the set of all real numbers greater than 0 (read: "all x in R such that x is greater than 0")
  • — the set of all x whose square is less than 4 (i.e., the interval )

Explore: Set Operations

See how union, intersection, and complement work on concrete sets.

Interactive Venn diagram: select an operation to see which elements are included
Ω = {1, 2, ..., 10}AB1, 234, 56, 7

Operation:

A ∪ B

Elements in A or B (or both)

Result:

{1, 2, 3, 4, 5, 6, 7}

|A ∪ B| = 7

Set A

{1, 2, 3, 4, 5}

Set B

{4, 5, 6, 7}

Sets in Probability

In probability, sets represent events. The intersection A ∩ B means "both A and B occur". The union A ∪ B means "A or B (or both) occurs". The complement Aᶜ means "A does not occur".

Probability-Specific Sets

Definition

Sample Space

The sample space, denoted (capital omega), is the set of all possible outcomes of a random experiment.

Example

Sample Spaces

  • Coin flip:
  • Die roll:
  • Waiting time:
  • Stock price:

An event is a subset of the sample space — a collection of outcomes we might be interested in. For example, if rolling a die, the event "roll an even number" is the set .

Function Notation

Definition

Function

A function is a rule that assigns to each element of set (the domain) exactly one element of set (the codomain).

Common function notation:

  • — the output of when given input
  • — defines the rule: input , output
  • — alternative notation meaning the same thing
Key Insight

Random Variables as Functions

A random variable is actually a function from the sample space to the real numbers:

It assigns a numerical value to each possible outcome. For example, if you roll two dice, might be the sum of the faces — it converts each outcome (pair of faces) into a number.

Explore: Random Variable as a Mapping

Visualize how a random variable maps outcomes in Ω to real numbers.

A random variable X maps each outcome ω ∈ Ω to a real number X(ω)

Flip 3 coins, X = number of heads

Ω = {HHH, HHT, HTH, ...}

X(ω) = count of H

Sample Space Ωℝ (Real Numbers)TTTTTHTHTHTTTHHHTHHHTHHH0123

Hover over outcomes in Ω to see how they map to values in ℝ

The Randomness Comes From ω

A random variable X is a function — given any outcome ω, it produces a definite number X(ω). The "randomness" comes from not knowing which ω occurs, not from the function itself. Once ω is realized, X(ω) is completely determined.

Quantifiers

Mathematical statements often need to express "for all" or "there exists." These are called quantifiers.

SymbolRead asExample
"for all" exists
"there exists"
"there exists exactly one"

Common Abbreviations

Probability and statistics use many abbreviations. Here are the essential ones:

AbbreviationStands forMeaning
i.i.d.independent and identically distributedRandom variables that don't affect each other and follow the same distribution
a.s.almost surelyHappens with probability 1 (but may fail on a set of probability 0)
iffif and only ifBoth directions of implication hold
w.r.t.with respect toIndicates what variable we're differentiating/integrating
s.t.such thatIntroduces a condition
w.l.o.g.without loss of generalityMaking a simplifying assumption that doesn't affect the proof

Interval Notation

Intervals are subsets of real numbers between two endpoints. The bracket type indicates whether endpoints are included:

NotationNameIncludes
Closed intervalAll x with
Open intervalAll x with
Half-openAll x with
RayAll x with

Note: Square brackets include the endpoint; parentheses exclude it. Infinity always uses parentheses since it's not a real number.

Key Takeaways

  • is the set of real numbers — the home of most random variables
  • is the sample space — all possible outcomes of an experiment
  • means "is an element of"; means "is a subset of"
  • means is a function from set to set
  • i.i.d. means random variables are independent and identically distributed