Relations as Sets of Ordered Pairs
What you'll learn: How to define relationships between elements of two sets using ordered pairs.
The Core Idea
In the last lesson, you learned about Cartesian products, which create all possible ordered pairs between two sets. A binary relation is simply a subset of that Cartesian product—you pick only the pairs that satisfy some relationship you care about.
Think of it like a guest list for a party: if you have a set of people and a set of food items, the Cartesian product is every possible person-food pairing. A relation might be "Person X likes Food Y"—so you'd only include pairs like (Alice, Pizza) and (Bob, Tacos) where the relationship actually holds.
Formal Definition
Given two sets A and B, a binary relation R from A to B is any subset of A × B.
We write (a, b) ∈ R or a R b to say "a is related to b."
Key Components
- Domain: The set of all first elements that actually appear in the relation's pairs
- Codomain: The entire target set B (what the relation could map to)
- Range: The set of all second elements that actually appear in the relation's pairs (subset of codomain)
Example
Let A = {1, 2, 3} and B = {4, 5}.
A × B = {(1,4), (1,5), (2,4), (2,5), (3,4), (3,5)}
A relation R = {(1,4), (2,4), (3,5)} is a subset of A × B.
- Domain of R: {1, 2, 3}
- Codomain: {4, 5}
- Range of R: {4, 5}
Key Takeaway: A binary relation is a subset of a Cartesian product that captures which pairs are actually related; its domain is the set of "input" elements used, and its range is the set of "output" elements reached.